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=-11.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 9366CC19F31 for ; Tue, 24 Aug 2021 09:12:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7B63861374 for ; Tue, 24 Aug 2021 09:12:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235653AbhHXJM7 (ORCPT ); Tue, 24 Aug 2021 05:12:59 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:46709 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235686AbhHXJM5 (ORCPT ); Tue, 24 Aug 2021 05:12:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629796332; 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: in-reply-to:in-reply-to:references:references; bh=UO2zBbBs1G6uT3R3xch5pdAd9JzMFmQCenqYTZnnAws=; b=ciI55oT+4ry/YlJLlDbugRTfprdq8vmV8TxkKb01viiPuKkCGhO804W14LS76wuqUuE+pJ KfuZCRH8vytOEwSgN/ZVJOTN8ffYpvEEqlTWk9AnsTrzYcdsb0W9dwj/0mW756MhXE+X9y cur4x82RiyCts6/Ze32mfLqL6/9yMes= Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-220-SCOc_mGdPHWPeeTyPzuDvQ-1; Tue, 24 Aug 2021 05:12:11 -0400 X-MC-Unique: SCOc_mGdPHWPeeTyPzuDvQ-1 Received: by mail-ej1-f71.google.com with SMTP id s11-20020a170906060b00b005be824f15daso6794191ejb.2 for ; Tue, 24 Aug 2021 02:12:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=UO2zBbBs1G6uT3R3xch5pdAd9JzMFmQCenqYTZnnAws=; b=oKhE+3phAOGO9M3mSCtMsFDp36cqUftvwfi6KI9epSDylY8S0h2DLm+lJVUheOx2Su 9RBmn3OsDlFVF20hEMNCeLGmU+yunO01vuAj0Z1QGgB3i2ePX3XW0jjfdtnlvtPxtHKG Hzc+k+Ih8G7tBzsYL9e9TtRU3PAJySWGZ+cMVmffaJvYe5EbQaUWRPaefBg7WZ04RAEW bNNhd/2PEQZQIHVt3s0PECzaJxuKBg1sXbyhdJkWzEd3dpeCle9xi3MIaxBbWtQk5CMX UPurEoCMCkemIi2DqCGLeGLG+0PBxnC4yEQX1XAFDVU0l3BcC7xpDUP6LE13jI9XmMJY 0g2Q== X-Gm-Message-State: AOAM530qoxXqpFL4aHiR0671eKf6+33Jhr8i1ZIYqKIdMU2PeXpgGjvu GdoV4h3K1AAUmIvB1Tml87z+3yKlvPqYTkzFdrs9TKDkxXn3lotfNBBJDQFlWQnFR0PZLcVkFXL nzqR6+0+ifSAVC+o5rljnLA== X-Received: by 2002:a17:906:544f:: with SMTP id d15mr39905066ejp.520.1629796330482; Tue, 24 Aug 2021 02:12:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3bMICaqu3WLm0C02mi3EAPqHyfBIAeSrxUN0aqhXmoBEhQ7Pz6k5PO9S6BLCHr/N7T4Bnvg== X-Received: by 2002:a17:906:544f:: with SMTP id d15mr39905053ejp.520.1629796330344; Tue, 24 Aug 2021 02:12:10 -0700 (PDT) Received: from redhat.com ([2.55.137.225]) by smtp.gmail.com with ESMTPSA id b18sm2737239ejl.90.2021.08.24.02.12.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Aug 2021 02:12:09 -0700 (PDT) Date: Tue, 24 Aug 2021 05:12:03 -0400 From: "Michael S. Tsirkin" To: "Kuppuswamy, Sathyanarayanan" Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Peter Zijlstra , Andy Lutomirski , Bjorn Helgaas , Richard Henderson , Thomas Bogendoerfer , James E J Bottomley , Helge Deller , "David S . Miller" , Arnd Bergmann , Jonathan Corbet , Peter H Anvin , Dave Hansen , Tony Luck , Dan Williams , Andi Kleen , Kirill Shutemov , Sean Christopherson , Kuppuswamy Sathyanarayanan , x86@kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-alpha@vger.kernel.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, sparclinux@vger.kernel.org, linux-arch@vger.kernel.org, linux-doc@vger.kernel.org, virtualization@lists.linux-foundation.org Subject: Re: [PATCH v4 11/15] pci: Add pci_iomap_shared{,_range} Message-ID: <20210824050842-mutt-send-email-mst@kernel.org> References: <20210805005218.2912076-1-sathyanarayanan.kuppuswamy@linux.intel.com> <20210805005218.2912076-12-sathyanarayanan.kuppuswamy@linux.intel.com> <20210823195409-mutt-send-email-mst@kernel.org> <26a3cce5-ddf7-cbe6-a41e-58a2aea48f78@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <26a3cce5-ddf7-cbe6-a41e-58a2aea48f78@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org On Mon, Aug 23, 2021 at 05:30:54PM -0700, Kuppuswamy, Sathyanarayanan wrote: > > > On 8/23/21 4:56 PM, Michael S. Tsirkin wrote: > > > Add a new variant of pci_iomap for mapping all PCI resources > > > of a devices as shared memory with a hypervisor in a confidential > > > guest. > > > > > > Signed-off-by: Andi Kleen > > > Signed-off-by: Kuppuswamy Sathyanarayanan > > I'm a bit puzzled by this part. So why should the guest*not* map > > pci memory as shared? And if the answer is never (as it seems to be) > > then why not just make regular pci_iomap DTRT? > > It is in the context of confidential guest (where VMM is un-trusted). So > we don't want to make all PCI resource as shared. It should be allowed > only for hardened drivers/devices. I can't say this answers the question at all. PCI devices are part of the VMM and so un-trusted. In particular PCI devices do not have the key to decrypt memory. Therefore as far as I can see PCI resources should not be encrypted. I conclude they all should be marked shared. If I'm wrong can you please give an example of a PCI resource that is encrypted? -- MST