Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp3087309pxb; Tue, 24 Aug 2021 15:01:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyL/fKTZuZC8gao7cZNT77O9WMp9HzfeA/csrZXxHni4XId96oWYzrytsQk6Ew4EulPQKd4 X-Received: by 2002:a17:906:c346:: with SMTP id ci6mr10121665ejb.479.1629842512174; Tue, 24 Aug 2021 15:01:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629842512; cv=none; d=google.com; s=arc-20160816; b=oLtb1Uwlmyats4cycsGCyKG/R45qTHkuZ6MJ9qoIu4X2m47CNWrjl4WlFipG6jAns+ R0hmjF24L1LcPCgGbooyR/BkWpS3y87L8AODyNN0j1N/8puX7t+zRe7TkzBtjHLoUM2F YpjMndVZjBq0JnQkkTf7k7hJJUAQwxZxbxszI9QD0fSrGU0ciKgUHfcIilnfSP0WeKvw nKIgs6cFnRj3yFosNVY/tGsFqbuZxs+cMgT5vAbBQLUguK/gTJ3R0dEwLwaPE/ZYGyXI yqN2AlJioN09/SNqsbvQMQMukMKSxBwuEDpiTHCv6BgeZ6TG6xKuNu0A5kvxvrtUlyc9 CPIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=jcFx0PZcA3f5x3kcuOE3FShtVPGcFTUcoRfnJMf2+WA=; b=nOqgtZ9OlMofyyLu2BIiEFv/CuqrSJY0bPTNGHj9uflDozjeL3K2A+w1l6ntDaAn9W zC+1opBL7kS99JJ0FPGSCcZDj70dgtgxGVpxRyYi0XG2R+ZZ7pecUhIA4jsk75kL+IZk A3UZqLija/trKgn7yWu/4diYix48Ynf/b1vzYAzr4GmxGv608UQOP92eDcfU15MuJ1jg heotM4kGp4FIa4N3vufLjpm9M9Dt4G1kIDRlZx6Tu/eddMeC+v4kGktJuPYDbyGDMwC+ xgyrtmNYEJBq01GJgmQ3pgVshyS0DpnRSsIYk1QApl6mr0ScHYiFyemWJHjsvfK8qCuy xapw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=kSoxnifX; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q6si1264584eds.568.2021.08.24.15.01.27; Tue, 24 Aug 2021 15:01:52 -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=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=kSoxnifX; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238735AbhHXWAj (ORCPT + 99 others); Tue, 24 Aug 2021 18:00:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238742AbhHXWAh (ORCPT ); Tue, 24 Aug 2021 18:00:37 -0400 Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0FCFC06179A for ; Tue, 24 Aug 2021 14:59:52 -0700 (PDT) Received: by mail-pf1-x434.google.com with SMTP id r9so3494344pfh.6 for ; Tue, 24 Aug 2021 14:59:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=jcFx0PZcA3f5x3kcuOE3FShtVPGcFTUcoRfnJMf2+WA=; b=kSoxnifXykQ6StIPlHX99aPNWQu+Di5Pk4x5o0CyBgJd9Hi73+uUta5pC3l9MPuDvg fBBpumEasAZeQZ2lG3NadMhBf/b9wuvINIZK2gj66HQh13cdNeZ+ZXIwck5oL9wu4os+ US/+tqwCN2mSD+JCYRel2n+VEvcXsl1OGVQLjDfi4InNQ0bwty5/GVhAIxR6hITtGdLg B2dsfbm0W5uvRuyca+8kETN9jz+XRkeYZnbViXu4AvIglxlwUOQjCHGEfA65Iz68RZya QItoB3l4XDQYmoL1ZwgpumDwEUbCDGUDrdkJu1fa/f2rehIPRlYuMHbS58voDQNxtFcC VbJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=jcFx0PZcA3f5x3kcuOE3FShtVPGcFTUcoRfnJMf2+WA=; b=IyMueTwP6np1c5KP/d+H976+73Jc6FwKKFaUdHC1Tz7bTcrgNjE3gaSCR6SpDbTCyI Z7ZUW94KwmruWEheER0shqIQiAikjY1CB7rg9At5VQz1rxYdNLPvdZgetG2ZGQCFFsd1 VB2X7pMIZ2OM8+m/mp4evAQs/9la5b8grzbBRT2EQk6fFt4bFof3mNTY1JLc6VrSqzkU SIhqIbqXpAIhE6GlUlVPyue0NNbVN5m2gdYqUqsg0xEo2iWCIv6IeQN3C7IxpftqVkvE eJ+q/zZH7TGNq6DhV6V3K7Hh/EyEr9Nxfwa4CqGqisEjbTr3MzLmm2FqDq1Hqi7s6nvh Ysog== X-Gm-Message-State: AOAM532uqtEUvOjDHYxwz6pFHD8onE38VMXVT+wXQUd+Vv/uKwNVursn 84aFFPWFVj0kaARgT5jaYPI0902krQiygro+pPIh3g== X-Received: by 2002:a65:6642:: with SMTP id z2mr26520993pgv.240.1629842392235; Tue, 24 Aug 2021 14:59:52 -0700 (PDT) MIME-Version: 1.0 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> In-Reply-To: From: Dan Williams Date: Tue, 24 Aug 2021 14:59:41 -0700 Message-ID: Subject: Re: [PATCH v4 11/15] pci: Add pci_iomap_shared{,_range} To: Rajat Jain Cc: "Kuppuswamy, Sathyanarayanan" , "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 , Andi Kleen , Kirill Shutemov , Sean Christopherson , Kuppuswamy Sathyanarayanan , X86 ML , Linux Kernel Mailing List , Linux PCI , linux-alpha@vger.kernel.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, sparclinux@vger.kernel.org, linux-arch , Linux Doc Mailing List , virtualization@lists.linux-foundation.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 24, 2021 at 2:57 PM Rajat Jain wrote: > > On Mon, Aug 23, 2021 at 6:06 PM Dan Williams wrote: > > > > On Mon, Aug 23, 2021 at 5:31 PM 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. > > > > That's confusing, isn't device authorization what keeps unaudited > > drivers from loading against untrusted devices? I'm feeling like > > Michael that this should be a detail that drivers need not care about > > explicitly, in which case it does not need to be exported because the > > detail can be buried in lower levels. > > > > Note, I specifically said "unaudited", not "hardened" because as Greg > > mentioned the kernel must trust drivers, its devices that may not be > > trusted. > > Can you please point me to the thread where this discussion with Greg > is ongoing? It slowed down to implement the "move to the 'authorized' device model" recommendation. LWN has a good writeup (as usual) and a link to the thread: https://lwn.net/Articles/865918/