Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp2570755pxb; Tue, 24 Aug 2021 02:14:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzHuC7XcBIAcKgqeXoTcdRYWFvn/ZEWVGNOUFmo/NRSp7hF6h86GT7DR+HGzWYintbmozWw X-Received: by 2002:a05:6402:4253:: with SMTP id g19mr42072688edb.31.1629796473608; Tue, 24 Aug 2021 02:14:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629796473; cv=none; d=google.com; s=arc-20160816; b=WL5mYZIygF9fPw7sv5dlu+5ETobLYjwVSvR2cSNKwUqGewBbS5Nj1EiVLo2MK6YJkk eCNjQh20Xjro548FFKK5rCa1T506oUMQZzrcbemYjA8cx9Lb2AxFp+JwZC09wjnvFlbp zqZKvg6SSNLqZlUgJXvScq3ROAndQTJ58QJ1r1xNbPhBNAgUj5t7W1XVziG9pot+0MXL xBLBGNdem5E0AtzEEstqBd1QstjLVY0e+EkcU42MU6/uzThMhwkIKDPqwr8DhBC47Cib 1B0J/GJ84/lI5ogfouE0MbGFQUPQJuUVyLpnqeUqTaVjlSvAsLYgEjOqOlsDu8gFRY4q bHdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=UO2zBbBs1G6uT3R3xch5pdAd9JzMFmQCenqYTZnnAws=; b=xrlxt0Hqd2X1jEJxU59ZIAnymg8Dfq3ZdexRUmleZ5Sj8F4Ej8Pk+OgHeza55tTkFU hQNL9h5sDhAw+6cakCIPsa68iS3LcyowRdb/rFN1v61Icr9XKxF+tvMIfatbRYKkygdr 9uqwsh9af4nEnUHzuxeR7qmQ2Qpb2KnEl4UI1zzIqILtSdLnK9DqazGK5LJf2TsYNBY1 ygT9NswmXst34q83YsB79KcoRpPDgwow2yoJ+smvbl0ZLRmad4VewOYre6VAG7s0cPrF faMUJW/+c7Y6VPpJ9b1LCuba5VGWKnPMhNSlhs0T8Q3kGiKINbNiI1X1UTwhLcNjndEn UAoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ciI55oT+; 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 q1si16363715ejn.480.2021.08.24.02.14.10; Tue, 24 Aug 2021 02:14:33 -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=ciI55oT+; 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 S235642AbhHXJM6 (ORCPT + 99 others); Tue, 24 Aug 2021 05:12:58 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:33241 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235666AbhHXJM5 (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-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-300-TzVKMdJhOKSERT_vbgnxTw-1; Tue, 24 Aug 2021 05:12:11 -0400 X-MC-Unique: TzVKMdJhOKSERT_vbgnxTw-1 Received: by mail-ej1-f70.google.com with SMTP id q15-20020a17090622cf00b005c42d287e6aso2790057eja.18 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=kyvL/pOwrj/V521xy7ZWi/rJfgwYEdN04AJZmjYeoiA4iAPVmSHKuxSZAhEdnpD2+q 3vaLxyEBShHJnCD0UTHygHxDh9Yniox9OHQwD9r0NN8l2Gk8DC2MPfT2mALk874hLXfT IWoB8JF7j07mOdPj1FeFi9FolTglXlevCaomjfpnp1eAlz08y86mPJ5+60iw+vWwTPKx S+EiUfoA6Ao9DHNIrycYfWDhcpp5zUQIG4b/FsR53kF1M5Gug+P9oPYaFigZXwLQu85T ums/Vz2LxFxfJ4SkydfxW0Df4PTixwTuLiruDf+tr5du/czDx52pF6TRHVbzLmhjB2vZ qyiQ== X-Gm-Message-State: AOAM531mG1JrBvx9zWRSKHpxBG55nBHt+MeWTbfYaVdtSa5QTCNkaDPS HETk6VZg7CNLOIVuODq0dGfJWMhJeVB+1ccLKnSxo7uut082h+JyuGe9DLVfwI8xrQJqS5Gc/Ps 7rD5MPdDGfTZCjmy5oCNkcu4t X-Received: by 2002:a17:906:544f:: with SMTP id d15mr39905060ejp.520.1629796330481; Tue, 24 Aug 2021 02:12:10 -0700 (PDT) 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-kernel@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