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 631D7C433DF for ; Tue, 26 May 2020 22:19:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4001820870 for ; Tue, 26 May 2020 22:19:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590531589; bh=bKlQNn/LWFxPJxkiyOz5A0mBP6CdTyek73u34XgevK4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=k9obayQNNXv34v/Jq6aRhC/Mr1oao97Fm86RMoC6OJu9hvVLX2CtGh+xY43UA3cY3 S0pi/X0j4ypzhTyB0lofTRi2TatdEgU8cq1CvZxao59d+hUMormgqLL1PDfozXE3LV gfQvgTaeVgs8McHMlWBTok5AlX+TYNCb+xbinGs8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403949AbgEZWTs (ORCPT ); Tue, 26 May 2020 18:19:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:51094 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389382AbgEZWTs (ORCPT ); Tue, 26 May 2020 18:19:48 -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 09D3A20870; Tue, 26 May 2020 22:19:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590531586; bh=bKlQNn/LWFxPJxkiyOz5A0mBP6CdTyek73u34XgevK4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ycac6ILJkUlU5lQePEd0NMtfiaDAgplP8FmvtCueKBQehobAxnDFJNmQ3IumlwfYd 8pobB2Mi8QFjUoGszYO1oVESJMtrI2rt9scyaYdBN6M+q5pB/0EPJphts1Z/4JMycd U2nU3/loBc5tCa/KKXjTzlJBpbsxC8m4qt0yRb9Q= Date: Wed, 27 May 2020 00:19:44 +0200 From: Greg KH To: "Paraschiv, Andra-Irina" 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: <20200526221944.GA179549@kroah.com> References: <20200525221334.62966-1-andraprs@amazon.com> <20200525221334.62966-5-andraprs@amazon.com> <20200526064819.GC2580530@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 09:35:33PM +0300, Paraschiv, Andra-Irina wrote: > > > On 26/05/2020 09:48, Greg KH wrote: > > 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. > > This was needed to have an identifier for the overall NE logic - PCI dev, > ioctl and misc dev. Why? They are all different "devices", and refer to different interfaces. Stick to what the dev_* gives you for them. You probably want to stick with the pci dev for almost all of those anyway. > The ioctl and misc dev logic has pr_* logs, but I can update them to dev_* > with misc dev, then remove this prefix. That would be good, thanks. greg k-h