Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp2504921pxb; Tue, 24 Aug 2021 00:15:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKVGr8nLAzhrTDblsMWVGCWs12g9ZEo+pL6H8mrjWlN2GcdRjg4optgW/Mr8jWH2i4eCGD X-Received: by 2002:a05:6402:34d6:: with SMTP id w22mr41944746edc.244.1629789303843; Tue, 24 Aug 2021 00:15:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629789303; cv=none; d=google.com; s=arc-20160816; b=f2zsBcJCNdEl3WA5zCXI+fySVZb2HuykUOuVR2gikHC/Dw3gpedtVXk9z4FeW6KLvX DARjAMf4vSdy3xs5oU7HjWhP9JRzvdTARqZzmyHJLv2Uq/pFndAna6yVu3u8FypXMK9m N2A8B+cC5BuyOcDRSH/r8f4X+A19b6kNvhzcjFG6ZqcueKg7D4Is+DjwOrLAhHE6RN7/ /MsrBJ6RK5NrGEJRQf/nxY5ELSv9qIJlKRxoOwQ5CHG5wb0gy3IVxeWb3jg03FKlrPBu W6xCQLc2f9TD4veOl30kvLfjoRYyp+Xz+exoiFmAaPueruzNTw9at/8sG3snatlGOfEx Ix1w== 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=yyOWKyVgFnzXQH7hUCU2sLB3yDJPcTOpVipPjz3CdkE=; b=e5c6y7Iphd+4mxUli87aVOIdI32IRdB/h71sJDpoN71qb/wG/rCUYP/Sq67fwCMHJ0 jxlBuJrTEys5yE+SszcJ3NgvkWKfTIyziva+bkqBrDRAqdQRMsArDfqP5QEzp6VA9CAg BQuWi83V8DOe+dPM4R1DwTqeNSSLzDyu0wL19Eoqv3Q3japERU35+BoJMYabhXPSvW4j D1NNJWrrXKZ2hRKtg0bGqz8ludK63AEFQCK8IdzNqSo8UWBikegneMnsvxl3NPyNol5e 8dnLARbotQ/z2GqJM0cRRscAbg8IS9pMks/rEkgXTOrPUXI3lgdhwsqPVvjleyGEdS35 yH/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=vhbSFZGC; 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 h9si1478151edw.388.2021.08.24.00.14.41; Tue, 24 Aug 2021 00:15:03 -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=@infradead.org header.s=casper.20170209 header.b=vhbSFZGC; 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 S234584AbhHXHMb (ORCPT + 99 others); Tue, 24 Aug 2021 03:12:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229823AbhHXHMa (ORCPT ); Tue, 24 Aug 2021 03:12:30 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BC81C061575; Tue, 24 Aug 2021 00:11:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=yyOWKyVgFnzXQH7hUCU2sLB3yDJPcTOpVipPjz3CdkE=; b=vhbSFZGCSzrdVnS1l48yczaF9K SvGLI6rQMV0CT4xfqBFA1Ef8Ep6dM6q2xMdXaRx9S+pjQv+qRWNTnYsJWFL8YUyXFnmmGXijIOv/u PmjJy+0bZz71DBJ/UkUMV+6BfLJLvi+0cQKLjAPOl4yUvzdEyDBluDRFXDs9PGsu260PN6t8h9BWS H1PEQ3FThNCcxhmfejfOihqbEbqvN5Tz9D5EG6yz3rmvyIp8Jq/WE/Lfa1HosWUPEttO8bNdoTMb3 MEPPz3NaNDAKI3Hj8hsdNgFtMUO4QPPaCM8IM8adV5zMNm5tB0B7013DPglF0teZ/nW4MFAZoW9MB bODkw5sg==; Received: from hch by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mIQXL-00Ah6e-Fc; Tue, 24 Aug 2021 07:08:07 +0000 Date: Tue, 24 Aug 2021 08:07:55 +0100 From: Christoph Hellwig To: "Kuppuswamy, Sathyanarayanan" Cc: "Michael S. Tsirkin" , 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: 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> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html 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. Well, assuming the host can do any damage when mapped shared that also means not mapping it shared will completely break the drivers.