From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F25D0C433E0 for ; Tue, 26 May 2020 06:48:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C113720870 for ; Tue, 26 May 2020 06:48:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590475703; bh=KB2ZEvmVzYY93muPmZUfwEbvx2qqohH1HVtTZyR6awQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=hqmVg4l+kdtyRlH0A3EDazbHy7n0JyjPI+t5kJR8cMloqk2Dv8UcVbpiBcdLgOoaP DKDXY8HgWJMbLOK+PxR3JvjiYF9SN9X7HAhw73msY3QHSOrTEsuMMDLYDwInNHnFRt nlVv5zlx3IYRi9bI/npe5pUQowEE54q0MZdIT2bk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729984AbgEZGsX (ORCPT ); Tue, 26 May 2020 02:48:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:37622 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726921AbgEZGsW (ORCPT ); Tue, 26 May 2020 02:48:22 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 651BA207D8; Tue, 26 May 2020 06:48:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590475701; bh=KB2ZEvmVzYY93muPmZUfwEbvx2qqohH1HVtTZyR6awQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LO3HdrUXEDbWzDjjfHIa/ja3MnPXUxBXLDUL/htS/xtBbpMoBurXScP6wjQBDWXwX WQV4nWS6m0POKAA277sCm1D3HcV1EkaF2cSqu47Q1YtQureNkFS8g/ZKQ4HhqXnnA6 4FlaFJZz/M/W2AgKpwbRUZRVogqtw1stXAzATJG0= Date: Tue, 26 May 2020 08:48:19 +0200 From: Greg KH To: Andra Paraschiv Cc: linux-kernel@vger.kernel.org, Anthony Liguori , Benjamin Herrenschmidt , Colm MacCarthaigh , Bjoern Doebel , David Woodhouse , Frank van der Linden , Alexander Graf , Martin Pohlack , Matt Wilson , Paolo Bonzini , Balbir Singh , Stefano Garzarella , Stefan Hajnoczi , Stewart Smith , Uwe Dannowski , kvm@vger.kernel.org, ne-devel-upstream@amazon.com Subject: Re: [PATCH v3 04/18] nitro_enclaves: Init PCI device driver Message-ID: <20200526064819.GC2580530@kroah.com> References: <20200525221334.62966-1-andraprs@amazon.com> <20200525221334.62966-5-andraprs@amazon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200525221334.62966-5-andraprs@amazon.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > Signed-off-by: Alexandru Ciobotaru > Signed-off-by: Andra Paraschiv > --- > 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 > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#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