Received: by 2002:a25:2c96:0:0:0:0:0 with SMTP id s144csp89821ybs; Tue, 26 May 2020 04:31:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwn3UpbYGfvp/LjCaKDFAZjar35K1utnLK0Js0SGbZQNAF9nB3YSIqVY2glrtI+JELp6wtA X-Received: by 2002:a05:6402:17ba:: with SMTP id j26mr6660191edy.324.1590492715394; Tue, 26 May 2020 04:31:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590492715; cv=none; d=google.com; s=arc-20160816; b=Klgx0o6mgtPKOqZ70glNhYSC87cAymEgdo70oqfm4db49D07rmJ6GDb9RQ6HwEFuom a/rDdN2SY7GL+XPwO5Dn4gQd/k0sLxkLOHdTlG4lZUItDDaWJzVbVoXiK3TOfqTxKoTL wXvg9VQRUWbmfp1o5nwdHHobArLFWtjpR1xGL/PXl4ES/W+WxlBGAdSHunrvteT1S8XO Ulo7ZW0PVbffSRUOMY8VjJ8OAHDb4bGUX7VaVnb1gSpPHYHyVPJhsh0LLe8zZPDNw4yc PJZRIeELwoKalxlnpCmBQCmO6C7+jlbcupH0u3Y3WNuviv9DKvkovedABt/Cwyn0Gb0w cpew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=nzsXvMniikB2voZq8L+kiamcqNopNcLnCU88QIJtbDM=; b=qj2MEiA5VY4FjJ0lj6TU7ELLyYXebtVFpcE/+//OKVegOlGUGWvP3KVOogyBkkY84Z YPTA6iAwyXGm5jzM018YkBM5qcJ7weC5ZnP2PrnJU5F8GIZDorie3p9Yu4X3s3q6XF2p FbeElv37Gcu1PHk6ISqhxw7mwbkoNkAUIg5gOZPj0t5iAJCDasRZXqoe0zsf0XHYJrsb OYCVylG//mfY7JpMojGVQMfkZ0qwUcdWxWg3sT79Rnc5+tQB1oRySIXWAgdouUZe50Im 7PLmkmZQz//c4qQB25o9O/5FT56EfySotJMz8fA7vjYQmP1SkHcF5CORjVEfMprVyld0 iVcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=LO3HdrUX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b9si11549734edu.30.2020.05.26.04.31.31; Tue, 26 May 2020 04:31:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=LO3HdrUX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729016AbgEZGsX (ORCPT + 99 others); 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