Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp2864053pxb; Fri, 8 Oct 2021 17:40:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzAMPy4/Ty/SlvJk9ffv47em16V/A1PLI/8mgaoiRnwNW+4+/FeOer30D1nP7WKuEdq9aYA X-Received: by 2002:a17:907:9889:: with SMTP id ja9mr8505937ejc.361.1633740037336; Fri, 08 Oct 2021 17:40:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633740037; cv=none; d=google.com; s=arc-20160816; b=zesxkllBTL4MQNlpw0lnz65HigcvWtfuxWbbhNtG437LZGdeWtzgzUYf5CbgOu5dsX HYNRURywzb1r4yGNd8EB+zgB45ZtRtxgIb+MRkRg4/CrlpUZD/40jn/EcFdOAX1FKyiF TcQGeFxMCCm+RxqyEuw/IisWQhkz2haVr6RYnHvxa5kV8f8TM6onlCstFqJE9MVIsXgn lx+9zhUxQzTGP6HMJsWp8isa1FCQisSc5eRQGS4xPMeIzOD7XBo49Nn2CCcATkaib3md TTvzZOvQsXXphr6uDn3tWlxKVeqXE7uuMrTxkJWbAw++8oaWG52PgQysBHiA6eWleT/A tTTQ== 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=5iTKfajl6sdZV0EzVHUU8llAb/s7JxR/sgoM4hRx4oY=; b=jzbLG78OlK0Tr4UbXf/mHv4FzDB+x/WK4GcuJuniTIIz7gIRq1RMGoP+/G6qYG26lJ Oq/0Dq5UI8gmAb1gh3QwPN3EuX3GJW9ujhFpHg5+P0dAQyeubll7MLAELaPhZ3m3IWfn zgkeKxhrVjvn39wftY/tCsAwqdfHCccuQQigr9xwqK0afDqURopNAcMu/PcqT1FX400N 3Onnvt2H41HqBa19Nhihv8RPQJqWsDeUN2zfdINLhLUww7LsVedx97WtlY0k6HkYHe7g 2grS/sf8rBsZDkw0iUzZ9HskDhnJe975Gc48M29cit5v7fJ+fgrutcp1qqOKjZfJoUhd v7ZA== 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 y11si1236757edi.152.2021.10.08.17.40.14; Fri, 08 Oct 2021 17:40:37 -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 S244282AbhJIAky (ORCPT + 99 others); Fri, 8 Oct 2021 20:40:54 -0400 Received: from mga02.intel.com ([134.134.136.20]:5261 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244120AbhJIAk3 (ORCPT ); Fri, 8 Oct 2021 20:40:29 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10131"; a="213756564" X-IronPort-AV: E=Sophos;i="5.85,358,1624345200"; d="scan'208";a="213756564" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Oct 2021 17:37:53 -0700 X-IronPort-AV: E=Sophos;i="5.85,358,1624345200"; d="scan'208";a="624905427" Received: from dmsojoza-mobl3.amr.corp.intel.com (HELO skuppusw-desk1.amr.corp.intel.com) ([10.251.135.62]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Oct 2021 17:37:51 -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" , Paolo Bonzini , David Hildenbrand , Andrea Arcangeli , Josh Poimboeuf Cc: Peter H Anvin , Dave Hansen , Tony Luck , Dan Williams , Andi Kleen , Kirill Shutemov , Sean Christopherson , Kuppuswamy Sathyanarayanan , 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 v5 14/16] virtio: Use shared mappings for virtio PCI devices Date: Fri, 8 Oct 2021 17:37:09 -0700 Message-Id: <20211009003711.1390019-15-sathyanarayanan.kuppuswamy@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211009003711.1390019-1-sathyanarayanan.kuppuswamy@linux.intel.com> References: <20211009003711.1390019-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 --- Changes since v4: * Replaced pci_iomap_shared_range() with pci_iomap_host_shared_range(). 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..f29bf45a4642 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_host_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