/linux/drivers/pci/endpoint/ |
H A D | pci-epc-core.c | 3 * PCI Endpoint *Controller* (EPC) library 13 #include <linux/pci-epc.h> 23 struct pci_epc *epc = *(struct pci_epc **)res; in devm_pci_epc_release() local 25 pci_epc_destroy(epc); in devm_pci_epc_release() 30 * @epc: epc returned by pci_epc_get() 34 void pci_epc_put(struct pci_epc *epc) in pci_epc_put() argument 36 if (IS_ERR_OR_NULL(epc)) in pci_epc_put() 39 module_put(epc->ops->owner); in pci_epc_put() 40 put_device(&epc->dev); in pci_epc_put() 54 struct pci_epc *epc; in pci_epc_get() local [all …]
|
H A D | pci-ep-cfs.c | 13 #include <linux/pci-epc.h> 33 struct pci_epc *epc; member 53 struct pci_epc *epc = epc_group->epc; in pci_secondary_epc_epf_link() local 56 ret = pci_epc_add_epf(epc, epf, SECONDARY_INTERFACE); in pci_secondary_epc_epf_link() 62 pci_epc_remove_epf(epc, epf, SECONDARY_INTERFACE); in pci_secondary_epc_epf_link() 66 /* Send any pending EPC initialization complete to the EPF driver */ in pci_secondary_epc_epf_link() 67 pci_epc_notify_pending_init(epc, epf); in pci_secondary_epc_epf_link() 77 struct pci_epc *epc; in pci_secondary_epc_epf_unlink() local 82 epc = epc_group->epc; in pci_secondary_epc_epf_unlink() 85 pci_epc_remove_epf(epc, epf, SECONDARY_INTERFACE); in pci_secondary_epc_epf_unlink() [all …]
|
H A D | pci-ep-msi.c | 3 * PCI Endpoint *Controller* (EPC) MSI library 15 #include <linux/pci-epc.h> 23 struct pci_epc *epc; in pci_epf_write_msi_msg() local 26 epc = pci_epc_get(dev_name(msi_desc_to_dev(desc))); in pci_epf_write_msi_msg() 27 if (!epc) in pci_epf_write_msi_msg() 30 epf = list_first_entry_or_null(&epc->pci_epf, struct pci_epf, list); in pci_epf_write_msi_msg() 35 pci_epc_put(epc); in pci_epf_write_msi_msg() 40 struct pci_epc *epc = epf->epc; in pci_epf_alloc_doorbell() local 48 if (list_first_entry_or_null(&epc->pci_epf, struct pci_epf, list) != epf) { in pci_epf_alloc_doorbell() 53 domain = of_msi_map_get_device_domain(epc->dev.parent, 0, in pci_epf_alloc_doorbell() [all …]
|
H A D | pci-epf-core.c | 14 #include <linux/pci-epc.h> 25 * EPF device and EPC device has been lost 26 * @epf: the EPF device which has lost the binding with the EPC device 29 * and EPC device has been lost. 54 * bound to a EPC device 55 * @epf: the EPF device which has been bound to the EPC device 57 * Invoke to notify the function driver that it has been bound to a EPC device 64 struct pci_epc *epc; in pci_epf_bind() local 85 epc = epf->epc; in pci_epf_bind() 87 if (!IS_ERR_OR_NULL(epc)) { in pci_epf_bind() [all …]
|
/linux/include/linux/ |
H A D | pci-epc.h | 3 * PCI Endpoint *Controller* (EPC) header file 36 * struct pci_epc_map - information about EPC memory for mapping a RC PCI 44 * @phys_base: base physical address of the allocated EPC memory for mapping the 47 * @virt_base: base virtual address of the allocated EPC memory for mapping the 65 * struct pci_epc_ops - set of function pointers for performing EPC operations 86 * @get_features: ops to get the features supported by the EPC 90 int (*write_header)(struct pci_epc *epc, u8 func_no, u8 vfunc_no, 92 int (*set_bar)(struct pci_epc *epc, u8 func_no, u8 vfunc_no, 94 void (*clear_bar)(struct pci_epc *epc, u8 func_no, u8 vfunc_no, 96 u64 (*align_addr)(struct pci_epc *epc, u64 pci_addr, size_t *size, [all …]
|
H A D | pci-epf.h | 60 * @bind: ops to perform when a EPC device has been bound to EPF device 61 * @unbind: ops to perform when a binding has been lost between a EPC device 73 * struct pci_epc_event_ops - Callbacks for capturing the EPC events 74 * @epc_init: Callback for the EPC initialization complete event 75 * @epc_deinit: Callback for the EPC deinitialization event 76 * @link_up: Callback for the EPC link up event 77 * @link_down: Callback for the EPC link down event 78 * @bus_master_enable: Callback for the EPC Bus Master Enable event 152 * @epc: the EPC device to which this EPF device is bound 158 * @sec_epc: the secondary EPC device to which this EPF device is bound [all …]
|
/linux/arch/mips/kernel/ |
H A D | branch.c | 32 long epc = regs->cp0_epc; in __isa_exception_epc() local 35 if (__get_user(inst, (u16 __user *) msk_isa16_mode(epc))) { in __isa_exception_epc() 38 return epc; in __isa_exception_epc() 45 epc += 4; in __isa_exception_epc() 47 epc += 2; in __isa_exception_epc() 49 epc += 2; in __isa_exception_epc() 51 epc += 4; in __isa_exception_epc() 53 return epc; in __isa_exception_epc() 326 long epc; in __MIPS16e_compute_return_epc() local 328 epc = regs->cp0_epc; in __MIPS16e_compute_return_epc() [all …]
|
/linux/drivers/pci/controller/cadence/ |
H A D | pcie-cadence-ep.c | 11 #include <linux/pci-epc.h> 37 static int cdns_pcie_ep_write_header(struct pci_epc *epc, u8 fn, u8 vfn, in cdns_pcie_ep_write_header() argument 40 struct cdns_pcie_ep *ep = epc_get_drvdata(epc); in cdns_pcie_ep_write_header() 46 dev_err(&epc->dev, "Only Virtual Function #1 has deviceID\n"); in cdns_pcie_ep_write_header() 79 static int cdns_pcie_ep_set_bar(struct pci_epc *epc, u8 fn, u8 vfn, in cdns_pcie_ep_set_bar() argument 82 struct cdns_pcie_ep *ep = epc_get_drvdata(epc); in cdns_pcie_ep_set_bar() 150 static void cdns_pcie_ep_clear_bar(struct pci_epc *epc, u8 fn, u8 vfn, in cdns_pcie_ep_clear_bar() argument 153 struct cdns_pcie_ep *ep = epc_get_drvdata(epc); in cdns_pcie_ep_clear_bar() 183 static int cdns_pcie_ep_map_addr(struct pci_epc *epc, u8 fn, u8 vfn, in cdns_pcie_ep_map_addr() argument 186 struct cdns_pcie_ep *ep = epc_get_drvdata(epc); in cdns_pcie_ep_map_addr() [all …]
|
/linux/drivers/pci/controller/dwc/ |
H A D | pcie-designware-ep.c | 15 #include <linux/pci-epc.h> 65 funcs = pci->ep.epc->max_functions; in dw_pcie_ep_reset_bar() 144 static int dw_pcie_ep_write_header(struct pci_epc *epc, u8 func_no, u8 vfunc_no, in dw_pcie_ep_write_header() argument 147 struct dw_pcie_ep *ep = epc_get_drvdata(epc); in dw_pcie_ep_write_header() 228 static void dw_pcie_ep_clear_bar(struct pci_epc *epc, u8 func_no, u8 vfunc_no, in dw_pcie_ep_clear_bar() argument 231 struct dw_pcie_ep *ep = epc_get_drvdata(epc); in dw_pcie_ep_clear_bar() 366 static int dw_pcie_ep_set_bar(struct pci_epc *epc, u8 func_no, u8 vfunc_no, in dw_pcie_ep_set_bar() argument 369 struct dw_pcie_ep *ep = epc_get_drvdata(epc); in dw_pcie_ep_set_bar() 464 static u64 dw_pcie_ep_align_addr(struct pci_epc *epc, u64 pci_addr, in dw_pcie_ep_align_addr() argument 467 struct dw_pcie_ep *ep = epc_get_drvdata(epc); in dw_pcie_ep_align_addr() [all …]
|
/linux/drivers/pci/controller/ |
H A D | pcie-rockchip-ep.c | 18 #include <linux/pci-epc.h> 29 * @epc: PCI EPC device 50 struct pci_epc *epc; member 114 static int rockchip_pcie_ep_write_header(struct pci_epc *epc, u8 fn, u8 vfn, in rockchip_pcie_ep_write_header() argument 118 struct rockchip_pcie_ep *ep = epc_get_drvdata(epc); in rockchip_pcie_ep_write_header() 151 static int rockchip_pcie_ep_set_bar(struct pci_epc *epc, u8 fn, u8 vfn, in rockchip_pcie_ep_set_bar() argument 154 struct rockchip_pcie_ep *ep = epc_get_drvdata(epc); in rockchip_pcie_ep_set_bar() 219 static void rockchip_pcie_ep_clear_bar(struct pci_epc *epc, u8 fn, u8 vfn, in rockchip_pcie_ep_clear_bar() argument 222 struct rockchip_pcie_ep *ep = epc_get_drvdata(epc); in rockchip_pcie_ep_clear_bar() 253 static u64 rockchip_pcie_ep_align_addr(struct pci_epc *epc, u64 pci_addr, in rockchip_pcie_ep_align_addr() argument [all …]
|
H A D | pcie-rcar-ep.c | 13 #include <linux/pci-epc.h> 159 static int rcar_pcie_ep_write_header(struct pci_epc *epc, u8 fn, u8 vfn, in rcar_pcie_ep_write_header() argument 162 struct rcar_pcie_endpoint *ep = epc_get_drvdata(epc); in rcar_pcie_ep_write_header() 195 static int rcar_pcie_ep_set_bar(struct pci_epc *epc, u8 func_no, u8 vfunc_no, in rcar_pcie_ep_set_bar() argument 199 struct rcar_pcie_endpoint *ep = epc_get_drvdata(epc); in rcar_pcie_ep_set_bar() 246 static void rcar_pcie_ep_clear_bar(struct pci_epc *epc, u8 fn, u8 vfn, in rcar_pcie_ep_clear_bar() argument 249 struct rcar_pcie_endpoint *ep = epc_get_drvdata(epc); in rcar_pcie_ep_clear_bar() 259 static int rcar_pcie_ep_set_msi(struct pci_epc *epc, u8 fn, u8 vfn, u8 nr_irqs) in rcar_pcie_ep_set_msi() argument 261 struct rcar_pcie_endpoint *ep = epc_get_drvdata(epc); in rcar_pcie_ep_set_msi() 273 static int rcar_pcie_ep_get_msi(struct pci_epc *epc, u8 fn, u8 vfn) in rcar_pcie_ep_get_msi() argument [all …]
|
/linux/drivers/pci/endpoint/functions/ |
H A D | pci-epf-ntb.c | 42 #include <linux/pci-epc.h> 83 struct epf_ntb_epc *epc[2]; member 95 struct pci_epc *epc; member 146 struct pci_epc *epc; in epf_ntb_link_up() local 152 ntb_epc = ntb->epc[type]; in epf_ntb_link_up() 153 epc = ntb_epc->epc; in epf_ntb_link_up() 163 ret = pci_epc_raise_irq(epc, func_no, vfunc_no, irq_type, 1); in epf_ntb_link_up() 165 dev_err(&epc->dev, in epf_ntb_link_up() 244 struct pci_epc *epc; in epf_ntb_configure_mw() local 248 ntb_epc = ntb->epc[type]; in epf_ntb_configure_mw() [all …]
|
H A D | pci-epf-test.c | 19 #include <linux/pci-epc.h> 243 filter.dev = epf->epc->dev.parent; in pci_epf_test_init_dma_chan() 340 struct pci_epc *epc = epf->epc; in pci_epf_test_copy() local 369 ret = pci_epc_mem_map(epc, epf->func_no, epf->vfunc_no, in pci_epf_test_copy() 377 ret = pci_epc_mem_map(epf->epc, epf->func_no, epf->vfunc_no, in pci_epf_test_copy() 382 pci_epc_mem_unmap(epc, epf->func_no, epf->vfunc_no, in pci_epf_test_copy() 409 pci_epc_mem_unmap(epc, epf->func_no, epf->vfunc_no, &dst_map); in pci_epf_test_copy() 410 pci_epc_mem_unmap(epc, epf->func_no, epf->vfunc_no, &src_map); in pci_epf_test_copy() 419 pci_epc_mem_unmap(epc, epf->func_no, epf->vfunc_no, &dst_map); in pci_epf_test_copy() 420 pci_epc_mem_unmap(epc, epf->func_no, epf->vfunc_no, &src_map); in pci_epf_test_copy() [all …]
|
H A D | pci-epf-vntb.c | 44 #include <linux/pci-epc.h> 218 ret = pci_epc_map_addr(ntb->epf->epc, func_no, vfunc_no, phys_addr, addr, size); in epf_ntb_configure_mw() 220 dev_err(&ntb->epf->epc->dev, in epf_ntb_configure_mw() 235 pci_epc_unmap_addr(ntb->epf->epc, in epf_ntb_teardown_mw() 327 * @ntb: EPC associated with one of the HOST which holds peer's outbound 350 pci_epc_clear_bar(ntb->epf->epc, ntb->epf->func_no, ntb->epf->vfunc_no, epf_bar); in epf_ntb_config_sspad_bar_clear() 379 ret = pci_epc_set_bar(ntb->epf->epc, func_no, vfunc_no, epf_bar); in epf_ntb_config_sspad_bar_set() 421 const struct pci_epc_features *epc_features = pci_epc_get_features(epf->epc, in epf_ntb_config_spad_bar_alloc() 474 epc_features = pci_epc_get_features(ntb->epf->epc, ntb->epf->func_no, ntb->epf->vfunc_no); in epf_ntb_configure_interrupt() 490 ret = pci_epc_set_msi(ntb->epf->epc, in epf_ntb_configure_interrupt() [all …]
|
/linux/Documentation/arch/x86/ |
H A D | sgx.rst | 37 SGX utilizes an *Enclave Page Cache (EPC)* to store pages that are associated 56 Regular EPC pages contain the code and data of an enclave. 64 number for a page evicted from the EPC. 69 The processor tracks EPC pages in a hardware metadata structure called the 70 *Enclave Page Cache Map (EPCM)*. The EPCM contains an entry for each EPC page 146 EPC sanitization 155 The sanitization is done by going through EPC address space and applying the 231 EPC leaks 234 When EPC page leaks happen, a WARNING like this is shown in dmesg: 236 "EREMOVE returned ... and an EPC page was leaked. SGX may become unusable..." [all …]
|
/linux/Documentation/PCI/endpoint/ |
H A D | pci-endpoint-cfs.rst | 26 functions. Every EPC device present in the system will have an entry in 74 ... <Symlink EPC Device1>/ 76 ... <Symlink EPC Device2>/ 89 it's linked to another EPF device, cannot be linked to a EPC device. 91 EPC Device 94 Every registered EPC device will be listed in controllers directory. The 95 entries corresponding to EPC device will be created by the EPC core. 99 .. <EPC Device1>/ 103 .. <EPC Device2>/ 108 The <EPC Device> directory will have a list of symbolic links to [all …]
|
/linux/arch/riscv/kernel/ |
H A D | traps_misaligned.c | 288 static inline int get_insn(struct pt_regs *regs, ulong epc, ulong *r_insn) in get_insn() argument 292 if (epc & 0x2) { in get_insn() 295 if (__read_insn(regs, insn, epc, u16)) in get_insn() 306 epc += sizeof(u16); in get_insn() 307 if (__read_insn(regs, tmp, epc, u16)) in get_insn() 313 if (__read_insn(regs, insn, epc, u32)) in get_insn() 338 unsigned long epc = regs->epc; in handle_vector_misaligned_load() local 341 if (get_insn(regs, epc, &insn)) in handle_vector_misaligned_load() 347 regs->epc = epc + INSN_LEN(insn); in handle_vector_misaligned_load() 352 regs->epc = epc; in handle_vector_misaligned_load() [all …]
|
H A D | cfi.c | 11 * Returns the target address and the expected type when regs->epc points 31 * ebreak ; <- regs->epc in decode_cfi_insn() 38 if (get_kernel_nofault(insn, (void *)regs->epc - 4)) in decode_cfi_insn() 45 if (get_kernel_nofault(insn, (void *)regs->epc) || in decode_cfi_insn() 46 get_kernel_nofault(insn, (void *)regs->epc + GET_INSN_LENGTH(insn))) in decode_cfi_insn() 70 if (!is_cfi_trap(regs->epc)) in handle_cfi_failure() 74 return report_cfi_failure_noaddr(regs, regs->epc); in handle_cfi_failure() 76 return report_cfi_failure(regs, regs->epc, &target, type); in handle_cfi_failure()
|
H A D | traps.c | 156 do_trap_error(regs, signo, code, regs->epc, "Oops - " str); \ 161 do_trap_error(regs, signo, code, regs->epc, "Oops - " str); \ 183 do_trap_error(regs, SIGILL, ILL_ILLOPC, regs->epc, in do_trap_insn_illegal() 191 do_trap_error(regs, SIGILL, ILL_ILLOPC, regs->epc, in do_trap_insn_illegal() 231 do_trap_error(regs, SIGBUS, BUS_ADRALN, regs->epc, in do_trap_misaligned() 294 force_sig_fault(SIGTRAP, TRAP_BRKPT, (void __user *)regs->epc); in handle_break() 300 else if (report_bug(regs->epc, regs) == BUG_TRAP_TYPE_WARN || in handle_break() 302 regs->epc += get_break_insn_length(regs->epc); in handle_break() 332 regs->epc += 4; in do_trap_ecall_u() 361 do_trap_error(regs, SIGILL, ILL_ILLTRP, regs->epc, in do_trap_ecall_u()
|
/linux/arch/x86/kernel/cpu/sgx/ |
H A D | encls.h | 139 /* Initialize an EPC page into an SGX Enclave Control Structure (SECS) page. */ 152 * Associate an EPC page to an enclave either as a REG or TCS page 166 /* Disassociate EPC page from its enclave and mark it as unused. */ 172 /* Copy data to an EPC page belonging to a debug enclave. */ 178 /* Copy data from an EPC page belonging to a debug enclave. */ 190 /* Load, verify, and unblock an EPC page. */ 197 /* Make EPC page inaccessible to enclave, ready to be written to memory. */ 203 /* Initialize an EPC page into a Version Array (VA) page. */ 211 /* Invalidate an EPC page and write it out to main memory. */ 218 /* Restrict the EPCM permissions of an EPC page. */ [all …]
|
H A D | main.c | 38 /* Nodes with one or more EPC sections. */ 51 * Reset post-kexec EPC pages to the uninitialized state. The pages are removed 466 * __sgx_alloc_epc_page() - Allocate an EPC page 468 * Iterate through NUMA nodes and reserve ia free EPC page to the caller. Start 472 * - an EPC page: A borrowed EPC pages were available. 473 * - NULL: Out of EPC pages. 482 * Try local node first. If it doesn't have an EPC section, in __sgx_alloc_epc_page() 504 * @page: EPC page 519 * @page: EPC page 546 * sgx_alloc_epc_page() - Allocate an EPC page [all …]
|
H A D | sgx.h | 17 "EREMOVE returned %d (0x%x) and an EPC page was leaked. SGX may become unusable. " \ 41 * Contains the tracking data for NUMA nodes having EPC pages. Most importantly, 52 * The firmware can define multiple chunks of EPC to the different areas of the 54 * used to store EPC pages for one EPC section and virtual memory area where
|
/linux/arch/mips/kvm/ |
H A D | emulate.c | 46 long epc = instpc; in kvm_compute_return_epc() local 50 if (epc & 3) { in kvm_compute_return_epc() 51 kvm_err("%s: unaligned epc\n", __func__); in kvm_compute_return_epc() 56 err = kvm_get_badinstrp((u32 *)epc, vcpu, &insn.word); in kvm_compute_return_epc() 65 arch->gprs[insn.r_format.rd] = epc + 8; in kvm_compute_return_epc() 85 epc = epc + 4 + (insn.i_format.simmediate << 2); in kvm_compute_return_epc() 87 epc += 8; in kvm_compute_return_epc() 88 nextpc = epc; in kvm_compute_return_epc() 94 epc = epc + 4 + (insn.i_format.simmediate << 2); in kvm_compute_return_epc() 96 epc += 8; in kvm_compute_return_epc() [all …]
|
/linux/arch/x86/include/asm/ |
H A D | sgx.h | 21 /* EPC enumeration. */ 23 /* An invalid EPC section, i.e. the end marker. */ 25 /* A valid EPC section. */ 27 /* The bitmask for the EPC section type. */ 71 * %SGX_CHILD_PRESENT SECS has child pages present in the EPC. 74 * %SGX_PAGE_NOT_MODIFIABLE: The EPC page cannot be modified because it 166 * range and other global attributes for the enclave and it is the first EPC 167 * page created for any enclave. It is moved from a temporary buffer to an EPC 304 * struct sgx_secinfo - describes attributes of an EPC page 307 * Used together with ENCLS leaves that add or modify an EPC page to an
|
/linux/arch/riscv/include/asm/ |
H A D | ftrace.h | 128 unsigned long epc; member 161 return arch_ftrace_regs(fregs)->epc; in ftrace_regs_get_instruction_pointer() 167 arch_ftrace_regs(fregs)->epc = pc; in ftrace_regs_set_instruction_pointer() 206 arch_ftrace_regs(fregs)->epc = arch_ftrace_regs(fregs)->ra; in ftrace_override_function_with_return() 215 regs->epc = afregs->epc; in ftrace_partial_regs()
|