Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp243165pxt; Wed, 4 Aug 2021 21:31:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJznD048V33ff5/azfH2GDlfycZPB7hi9Avta4IiMfVEPwEkzhIl9coFwGdsOAf2fruXJE6A X-Received: by 2002:aa7:d30e:: with SMTP id p14mr3903688edq.204.1628137883423; Wed, 04 Aug 2021 21:31:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628137883; cv=none; d=google.com; s=arc-20160816; b=x5Psxamw77e/H7yQNNdJZkegJhSMVvXMyc6cZX96NEB3Mr4pUxkA6F7m/hPX0e4Bfv bMiYS9JMziHPt3ScHSgodiG0qLtPf9i0DWD/T8tGzGh5EITi3VhIILIh5RMFlIcSMYUj UE9TfoLFiVnlEN3oChYlCmaUJDcfBc3/iEv5Fz3PqOQgj0Pp/yLNouEaN9WsezJONiij t9OEwggU6QhrhtN9CAqMvTYsDjnXA24CVu1uVkhjXiWdxhnCoFqp0DXdCMCI3u50kzVZ 1cW2tRPvJfnQJHYrxHRDA5bQl7J+HewVwvvdgtFSah2g0oDuNpzcevjpET8/wrz1map1 vIIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=0SfoaXZxJdcvxq9K8bDT35iiWKfn4PrvoqV9XwnQE6s=; b=JtQQZz3/CeYVIxd+C3bjHFMu9B4GdjQlSJ6Uep4bRU3FhmzxPLB+9EasqRjJ1XtFG3 sr7JboHPc+tQMCO1soU80fcoDdOdzlsEbV4w3fIkm1sqZ2kdIr+W7oetp0Sz87Xy2nbX 0gyznKXK3LgDyzUgqBq9s8X767FlctG/l97WReg5fsNr+3R+yNTqTJc+bbzJSabCcxRt hBgHjoDogVfxLX9iMG6QSHoerZtwZbAYcqSeMHVnR3c/HMu5tDYN20xCpPXpN51FL9Dh g6y+uoez9EGjOUQW/JvZC29UdcnZYq/bE7dpoWVPdHslJEHWebT7bLVoWn3EKz7xhXS9 jzVQ== ARC-Authentication-Results: i=1; mx.google.com; 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 a9si4494480edn.29.2021.08.04.21.30.50; Wed, 04 Aug 2021 21:31:23 -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; 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 S237275AbhHEAzF (ORCPT + 99 others); Wed, 4 Aug 2021 20:55:05 -0400 Received: from mga09.intel.com ([134.134.136.24]:27472 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237196AbhHEAyT (ORCPT ); Wed, 4 Aug 2021 20:54:19 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10066"; a="214027490" X-IronPort-AV: E=Sophos;i="5.84,296,1620716400"; d="scan'208";a="214027490" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Aug 2021 17:53:49 -0700 X-IronPort-AV: E=Sophos;i="5.84,296,1620716400"; d="scan'208";a="437617289" Received: from mjkendri-mobl.amr.corp.intel.com (HELO skuppusw-desk1.amr.corp.intel.com) ([10.254.17.117]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Aug 2021 17:53:47 -0700 From: Kuppuswamy Sathyanarayanan To: 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 , "Michael S . Tsirkin" Cc: 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: [PATCH v4 13/15] virtio: Use shared mappings for virtio PCI devices Date: Wed, 4 Aug 2021 17:52:16 -0700 Message-Id: <20210805005218.2912076-14-sathyanarayanan.kuppuswamy@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210805005218.2912076-1-sathyanarayanan.kuppuswamy@linux.intel.com> References: <20210805005218.2912076-1-sathyanarayanan.kuppuswamy@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andi Kleen In a TDX guest the pci device mappings of virtio must be shared with the host, so use explicit shared mappings. Signed-off-by: Andi Kleen Signed-off-by: Kuppuswamy Sathyanarayanan --- drivers/virtio/virtio_pci_modern_dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/virtio/virtio_pci_modern_dev.c b/drivers/virtio/virtio_pci_modern_dev.c index e11ed748e661..6ec4c52258ce 100644 --- a/drivers/virtio/virtio_pci_modern_dev.c +++ b/drivers/virtio/virtio_pci_modern_dev.c @@ -83,7 +83,7 @@ vp_modern_map_capability(struct virtio_pci_modern_device *mdev, int off, return NULL; } - p = pci_iomap_range(dev, bar, offset, length); + p = pci_iomap_shared_range(dev, bar, offset, length); if (!p) dev_err(&dev->dev, "virtio_pci: unable to map virtio %u@%u on bar %i\n", -- 2.25.1