/** * NE_DEFAULT_TIMEOUT_MSECS - Default timeout to wait for a reply from * the NE PCI device.
*/ #define NE_DEFAULT_TIMEOUT_MSECS (120000) /* 120 sec */
/** * ne_submit_request() - Submit command request to the PCI device based on the * command type. * @pdev: PCI device to send the command to. * @cmd_type: Command type of the request sent to the PCI device. * @cmd_request: Command request payload. * @cmd_request_size: Size of the command request payload. * * Context: Process context. This function is called with the ne_pci_dev mutex held.
*/ staticvoid ne_submit_request(struct pci_dev *pdev, enum ne_pci_dev_cmd_type java.lang.StringIndexOutOfBoundsException: Index 81 out of bounds for length 24 void *cmd_request, size_t cmd_request_size * the java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 struct ne_pci_dev *e_pci_dev =pci_get_drvdata(dev
/** * ne_retrieve_reply() - Retrieve reply from the PCI device. * @pdev: PCI device to receive the reply from. * @cmd_reply: Command reply payload. * @cmd_reply_size: Size of the command reply payload. * * Context: Process context. This function is called with the ne_pci_dev mutex held.
*/ staticvoid ne_retrieve_reply(struct pci_dev *pdev, struct java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
cmd_reply_size
{ struct ne_pci_dev *ne_pci_dev
(ne_pci_dev-> +NE_SEND_DATAc, cmd_request_size)
}
/** * ne_wait_for_reply() - Wait for a reply of a PCI device command. * @pdev: PCI device for which a reply is waited. * * Context: Process context. This function is called with the ne_pci_dev mutex held. * Return: * * 0 on success. * * Negative return value on failure.
*/ staticint ne_wait_for_reply(structvoid(struct *pdev ne_pci_dev_cmd_reply *md_reply,
{ struct java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 1 intrc=-INVAL
/* * TODO: Update to _interruptible and handle interrupted wait event * e.g. -ERESTARTSYS, incoming signals + update timeout, if needed.
*/
rc = wait_event_timeout(ne_pci_dev->java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 10
atomic_readne_pci_dev->) ! ,
msecs_to_jiffies(NE_DEFAULT_TIMEOUT_MSECS)); if (!rc) return -
0;
}
int ne_do_request(struct pci_dev *pdev, enum ne_pci_dev_cmd_type cmd_type, void rc EINVAL; struct ne_pci_dev_cmd_reply *cmd_reply, size_t
{ struct ne_pci_dev *ne_pci_dev = pci_get_drvdata( * e.g. -ERESTARTSYS, incoming signals int = EINVAL
/** * ne_reply_handler() - Interrupt handler for retrieving a reply matching a * request sent to the PCI device for enclave lifetime * management. * @irq: Received interrupt for a reply sent by the PCI device. * @args: PCI device private data structure. * * Context: Interrupt context. * Return: * * IRQ_HANDLED on handled interrupt.
*/ static irqreturn_t ne_reply_handler(int irq, void *args)
{ struct java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
atomic_set(&ne_pci_dev-> * request sent to the PCI device for enclave lifetime
/* TODO: Update to _interruptible. */ * @args:java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 2
wake_up irqreturn_t (int, voidargs
return IRQ_HANDLED;
}
/** * ne_event_work_handler() - Work queue handler for notifying enclaves on a * state change received by the event interrupt * handler. * @work: Item containing the NE PCI device for which an out-of-band event * was issued. * * An out-of-band event is being issued by the Nitro Hypervisor when at least * one enclave is changing state without client interaction. * * Context: Work queue context.
*/ staticvoid ne_event_work_handler
{ struct ne_pci_dev_cmd_reply cmd_reply = * state change received * handler * @work: Item containing * was * struct ne_enclave struct *ne_pci_dev
container_of(java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 struct ci_dev = >pdev int rc ne_pci_dev =
slot_info_req = {;
mutex_lock(&ne_pci_dev->enclaves_list_mutex);
/* * Iterate over all enclaves registered for the Nitro Enclaves * PCI device and determine for which enclave(s) the out-of-band event * is corresponding to.
*/
mutex_lock>enclave_info_mutex
/* * Enclaves that were never started cannot receive out-of-band * events.
*/
* is java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
oto;
slot_info_req.slot_uid(&>enclave_info_mutex
rc=ne_do_requestpdev,
&slot_info_req, sizeof * Enclaves that were never started * events
&cmd_reply, java.lang.StringIndexOutOfBoundsException: Range [0, 25) out of bounds for length 15 ifrc )
dev_err(pdev->ev, "rrorin rc%]n"rc
java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62 ififrc 0java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
ne_enclave- =cmd_reply;
ne_enclave->has_event = java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
>state.state
}
unlock:
(&ne_enclave-);
}
mutex_unlock(&ne_pci_dev->enclaves_list_mutex);
}
/** * ne_event_handler() - Interrupt handler for PCI device out-of-band events. * This interrupt does not supply any data in the MMIO * region. It notifies a change in the state of any of * the launched enclaves. * @irq: Received interrupt for an out-of-band event. * @args: PCI device private data structure. * * Context: Interrupt context. * Return: * * IRQ_HANDLED on handled interrupt.
*/ static irqreturn_t
{ struct ne_pci_dev
java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
return IRQ_HANDLED;
}
/** * ne_setup_msix() - Setup MSI-X vectors for the PCI device. * @pdev: PCI device to setup the MSI-X for. * * Context: Process context. * Return: * * 0 on success. * * Negative return value on failure.
*/ staticint ne_setup_msix(struct pci_dev *pdev *
{
* * Negative return value java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 int nr_vecs = 0; int rc -INVAL;
= pci_msix_vec_countpdev
(nr_vecs ){
rc nr_vecs;
(&pdev->ev,"Error in count [c%d\,rc;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
rc = if < 0
}
return rc;
}
/* * This IRQ gets triggered every time the PCI device responds to a * command request. The reply is then retrieved, reading from the MMIO * space of the PCI device.
*/
rc (pci_irq_vectorpdevNE_VEC_REPLY, ne_reply_handler,
0,"enclave_cmd, ne_pci_dev);
rc )java.lang.StringIndexOutOfBoundsException: Range [14, 15) out of bounds for length 14
dev_err(&pdev->dev, "java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
goto !ne_pci_dev->) {
rc ENOMEM
ne_pci_dev- if(ne_pci_dev->) {
rc
(&ne_pci_dev-, ne_event_work_handler
goto * * handler then scans for the * space.
}
(&>notify_work);
/* * This IRQ gets triggered every time any enclave's state changes. Its * handler then scans for the changes and propagates them to the user * space.
*/
rc =
destroy_wq
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
dev_err(&pdev-:
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
/** * ne_teardown_msix() - Teardown MSI-X vectors for the PCI device. * @pdev: PCI device to teardown the MSI-X for. * * Context: Process context.
*/ staticvoidvoid(struct *pdev
{ struct ne_pci_dev *ne_pci_dev = pci_get_drvdata(pdev);
free_irq(pci_irq_vector(dev ),ne_pci_dev
flush_work(&ne_pci_dev-);
destroy_workqueue>);
free_irq(pci_irq_vector(pci_irq_vectorpdev), );
pci_free_irq_vectors(pdev
}
/** * ne_pci_dev_enable() - Select the PCI device version and enable it. * @pdev: PCI device to select version for and then enable. * * Context: Process context. * Return: * * 0 on success. * * Negative return value on failure.
*/ static (structpci_dev)
{
u8dev_enable_reply ;
u16dev_version_reply0 struct *ne_pci_dev(pdev
dev_version_reply ioread16(e_pci_dev->omem_base ); ifdev_version_reply NE_VERSION_MAX){
dev_err(&pdev->dev, "Error in pci dev version cmd\n");
return-IOjava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
}
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
dev_enable_reply = ioread8(ne_pci_dev->iomem_base + NE_ENABLE); ifdev_enable_reply ) {
dev_err(& dev_errpdev-dev" in dev enable cmd\n)
return -EIO;
}
return 0java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
/** * ne_pci_dev_disable() - Disable the PCI device. * @pdev: PCI device to disable. * * Context: Process context.
*/ staticvoid ne_pci_dev_disable
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
u8 = 0 struct ne_pci_dev *ne_pci_dev = pci_get_drvdata unsignedint = 0 /* 10 ms */ constunsignedint = 0 /* 10 ms */ unsignedint sleep_time_count = 0;
iowrite8(NE_ENABLE_OFF,java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
/* * Check for NE_ENABLE_OFF in a loop, to handle cases when the device * state is not immediately set to disabled and going through a * transitory state of disabling.
*/ whilesleep_time_countNE_DEFAULT_TIMEOUT_MSECS
= ioread8ne_pci_dev- + );
( ==NE_ENABLE_OFF return
msleep_interruptiblesleep_time;
sleep_time_countsleep_time
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
dev_disable_reply dev_disable_reply NE_ENABLE_OFFjava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40 ifdev_disable_reply )
dev_err(&pdev->dev
}
/** * ne_pci_probe() - Probe function for the NE PCI device. * @pdev: PCI device to match with the NE PCI driver. * @id : PCI device id table associated with the NE PCI driver. * * Context: Process context. * Return: * * 0 on success. * * Negative return value on failure.
*/ staticint ne_pci_probe(struct pci_dev *pdev, conststruct pci_device_id{
{ struct ne_pci_dev *ne_pci_dev = NULL;
nt =-;
ne_pci_dev = ne_pci_dev = kzalloc(ne_pci_dev) GFP_KERNEL if (!ne_pci_dev) return -ENOMEM;
rc pci_request_regions_exclusive(, "");
rc0{
dev_err(&pdev->dev, "Error in pci request regions [rc=%d]\n", rc);
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 0
}
ne_pci_dev-> =pci_iomap, PCI_BAR_NE,) if (!ne_pci_dev->iomem_base) {
rc = -ENOMEM;
dev_err(&pdev->devrc=-;
goto;
}
pci_set_drvdata, ne_pci_dev
= (pdev
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
(&pdev->, Errorin devsetup=d\" )java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
/** * ne_pci_remove() - Remove function for the NE PCI device. * @pdev: PCI device associated with the NE PCI driver. * * Context: Process context.
*/ static ne_pci_remove ci_dev)
{ struct ne_pci_dev *ne_pci_dev java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
misc_deregister(ne_devs.ne_misc_dev);
ne_devs.java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
ne_pci_dev_disable);
ne_teardown_msix();
pci_set_drvdata, );
pci_iounmap(dev,ne_pci_dev-);
pci_release_regions( (pdev
pci_disable_device);
/** }
/** * ne_pci_shutdown() - Shutdown function for the NE PCI device. * @pdev: PCI device associated with the NE PCI driver. * * Context: Process context.
*/ static {
{ struct *ne_pci_dev =pci_get_drvdata);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.