Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp26304ybz; Tue, 21 Apr 2020 14:26:24 -0700 (PDT) X-Google-Smtp-Source: APiQypIWV0gNRYBeq6AYzcOSlGsHRksCzsT5yTWXd/ADEqzhb15J33nIUA2HOYyLJev3+5pc8mvQ X-Received: by 2002:a17:906:6b1b:: with SMTP id q27mr22622481ejr.158.1587504384365; Tue, 21 Apr 2020 14:26:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587504384; cv=none; d=google.com; s=arc-20160816; b=E1U/db28NCG4kcbUamHctqA4DQxgH8OjWa8LERbZaVlgfqOby0oGvLZ0xTyWm9bjnW TzW9nwdsS/ohHiiTtoe6/+Iv7aaJiw5FmST+vv2IHdzHG+8x7FQXnuLQlcqLE27n4EkM GDFjqnwLGpAlZAE1pBgXn3ICRROYFJi50dGelapVFlgOHn2nFKUQFXfgmzPmFItJ9FBW MmZ7oFqE6bQIByEnCv+dYh4Q6dU3Xm8fIJS2kYDPuBt2h8LrNnekyF/BYehxdAg1DQmK NT8wx+B6yCwQCc5ha55GxZRO3VLR5uZGQco5t9O/IlkY9e//OrT6H3tCuU40EzOGb4p3 3Kxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=j0OOdK3DXtQCBZ/bSdHvigSbjQLSkz9kPwFTn49a0go=; b=U3nqCI2bHbK2Zt0E2Hbc5IdQhQK5AZIu5kDq0q9TtaHK91++w8oD2Htoy498RVLioO cu1xhyGHKYTUW61QULOHzdmfLNY/UL2g1+bjjUNyZZ7MHxAPf5AQIbjQh0KwrHvVHD8Q TOYXdN9JX7eer5W6fhVy6P3gyHFHzk7vfMGe5U2Nej+hRXIgJ7JQNSNLqWC11jUpyxfn DYFNWJxDnPlB+jThbdhGQr0BYha1sj33n+VeX7eRex4ojgNPYLZ7yM7jtvLt0Gmx++2C uzkj+F4htIThHnn0cGr6Aok3yZsAmyTKTgzt8dolnLDP4cXW9x2D+OaPkcraSljOsnAY P4aA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=esvL0VK4; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u19si990199edd.364.2020.04.21.14.25.58; Tue, 21 Apr 2020 14:26:24 -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=@redhat.com header.s=mimecast20190719 header.b=esvL0VK4; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726296AbgDUVWq (ORCPT + 99 others); Tue, 21 Apr 2020 17:22:46 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:60822 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726112AbgDUVWq (ORCPT ); Tue, 21 Apr 2020 17:22:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587504164; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=j0OOdK3DXtQCBZ/bSdHvigSbjQLSkz9kPwFTn49a0go=; b=esvL0VK4p6EZsuZbv1Bs8TwcAmCjOuCtYQarhOZJCs2cTaSLT4Q4qkdD8cYUJ9RJntumNb ZcRBoEfZ7VWyY2Hqnu9ZOR9fsRvXRvpMn9Y+dlHM6/m+2R6IIZZIeQWfd1e1Ye3pEXgST+ O2U+6v+btJed+OO959b5TH7wc6wS4/4= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-223-JhyzH39HN8GtDs7U0kzDig-1; Tue, 21 Apr 2020 17:22:43 -0400 X-MC-Unique: JhyzH39HN8GtDs7U0kzDig-1 Received: by mail-wm1-f69.google.com with SMTP id n127so1965815wme.4 for ; Tue, 21 Apr 2020 14:22:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=j0OOdK3DXtQCBZ/bSdHvigSbjQLSkz9kPwFTn49a0go=; b=A2xNUqEOl/+677THR5gY1CoVctcPP8/Yp4sNngr40MG8cGy12RlBsIwxBBgaSk4INg idll3ivvtDzjyyv/0ECZiFEOBRgkY9KQJ0HHUYisrGnF9r1SyeMrk04waod4DIYTkvlc 135Y7TCvwcOCeFemXbay6swHAyFfQC5J7bI7cit7MId8dMqZ/nHs3xnoIenvzYEFvGau Rj3I+b7DzH9Qw9jE81+NpcLciTVxXT5sEvHRLEZbEEGDCfXQMZew4A3pEqbFygCX2oOI dbl3DVp54cQ6ZCNzkd8Z0aAphaeOA2xGkbhZ8Xq8ZkEkk4tmBvNwAmhvOUwLUU/KD1bn LeYw== X-Gm-Message-State: AGi0PuatOyDX1bD+8aTJtpXTwofD6CEIuTmVUuxeT1XMovbPMkOBf8l7 EcRw7ELT6YaqiSIuvA+sy0dyTDZHYtIo0gEBUJB6B96siVwqzhCD5X3kGS8F7X7qaqWOmKCyh6P UwndGRTJoig1wlFDbgzhlIL3D X-Received: by 2002:a5d:640a:: with SMTP id z10mr20415579wru.280.1587504161806; Tue, 21 Apr 2020 14:22:41 -0700 (PDT) X-Received: by 2002:a5d:640a:: with SMTP id z10mr20415539wru.280.1587504161481; Tue, 21 Apr 2020 14:22:41 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:f43b:97b2:4c89:7446? ([2001:b07:6468:f312:f43b:97b2:4c89:7446]) by smtp.gmail.com with ESMTPSA id p7sm5559855wrf.31.2020.04.21.14.22.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 21 Apr 2020 14:22:40 -0700 (PDT) Subject: Re: [PATCH v1 02/15] nitro_enclaves: Define the PCI device interface To: Andra Paraschiv , linux-kernel@vger.kernel.org Cc: Anthony Liguori , Benjamin Herrenschmidt , Colm MacCarthaigh , Bjoern Doebel , David Woodhouse , Frank van der Linden , Alexander Graf , Martin Pohlack , Matt Wilson , Balbir Singh , Stewart Smith , Uwe Dannowski , kvm@vger.kernel.org, ne-devel-upstream@amazon.com References: <20200421184150.68011-1-andraprs@amazon.com> <20200421184150.68011-3-andraprs@amazon.com> From: Paolo Bonzini Message-ID: Date: Tue, 21 Apr 2020 23:22:39 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <20200421184150.68011-3-andraprs@amazon.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21/04/20 20:41, Andra Paraschiv wrote: > The Nitro Enclaves (NE) driver communicates with a new PCI device, that > is exposed to a virtual machine (VM) and handles commands meant for > handling enclaves lifetime e.g. creation, termination, setting memory > regions. The communication with the PCI device is handled using a MMIO > space and MSI-X interrupts. > > This device communicates with the hypervisor on the host, where the VM > that spawned the enclave itself run, e.g. to launch a VM that is used > for the enclave. > > Define the MMIO space of the PCI device, the commands that are > provided by this device. Add an internal data structure used as private > data for the PCI device driver and the functions for the PCI device init > / uninit and command requests handling. > > Signed-off-by: Alexandru-Catalin Vasile > Signed-off-by: Alexandru Ciobotaru > Signed-off-by: Andra Paraschiv > --- > .../virt/amazon/nitro_enclaves/ne_pci_dev.h | 266 ++++++++++++++++++ > 1 file changed, 266 insertions(+) > create mode 100644 drivers/virt/amazon/nitro_enclaves/ne_pci_dev.h Can this be placed just in drivers/virt/nitro_enclaves, or drivers/virt/enclave/nitro? It's not unlikely that this device be implemented outside EC2 sooner or later, and there's nothing Amazon-specific as far as I can see from the UAPI. Paolo