On Tue, May 26, 2020 at 01:13:20AM +0300, Andra Paraschiv wrote: > The Nitro Enclaves PCI device is used by the kernel driver as a means of > communication with the hypervisor on the host where the primary VM and > the enclaves run. It handles requests with regard to enclave lifetime. > > Setup the PCI device driver and add support for MSI-X interrupts. > > Signed-off-by: Alexandru-Catalin Vasile <lexnv@xxxxxxxxxx> > Signed-off-by: Alexandru Ciobotaru <alcioa@xxxxxxxxxx> > Signed-off-by: Andra Paraschiv <andraprs@xxxxxxxxxx> > --- > Changelog > > v2 -> v3 > > * Remove the GPL additional wording as SPDX-License-Identifier is already in > place. > * Remove the WARN_ON calls. > * Remove linux/bug include that is not needed. > * Update static calls sanity checks. > * Remove "ratelimited" from the logs that are not in the ioctl call paths. > * Update kzfree() calls to kfree(). > > v1 -> v2 > > * Add log pattern for NE. > * Update PCI device setup functions to receive PCI device data structure and > then get private data from it inside the functions logic. > * Remove the BUG_ON calls. > * Add teardown function for MSI-X setup. > * Update goto labels to match their purpose. > * Implement TODO for NE PCI device disable state check. > * Update function name for NE PCI device probe / remove. > --- > drivers/virt/nitro_enclaves/ne_pci_dev.c | 252 +++++++++++++++++++++++ > 1 file changed, 252 insertions(+) > create mode 100644 drivers/virt/nitro_enclaves/ne_pci_dev.c > > diff --git a/drivers/virt/nitro_enclaves/ne_pci_dev.c b/drivers/virt/nitro_enclaves/ne_pci_dev.c > new file mode 100644 > index 000000000000..0b66166787b6 > --- /dev/null > +++ b/drivers/virt/nitro_enclaves/ne_pci_dev.c > @@ -0,0 +1,252 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. > + */ > + > +/* Nitro Enclaves (NE) PCI device driver. */ > + > +#include <linux/delay.h> > +#include <linux/device.h> > +#include <linux/list.h> > +#include <linux/mutex.h> > +#include <linux/module.h> > +#include <linux/nitro_enclaves.h> > +#include <linux/pci.h> > +#include <linux/types.h> > +#include <linux/wait.h> > + > +#include "ne_misc_dev.h" > +#include "ne_pci_dev.h" > + > +#define DEFAULT_TIMEOUT_MSECS (120000) /* 120 sec */ > + > +#define NE "nitro_enclaves: " Why is this needed? The dev_* functions should give you all the information that you need to properly describe the driver and device in question. No extra "prefixes" should be needed at all. thanks, greg k-h