[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH kernel 03/17] tsm/core: Store range_id in pci_tsm_mmio_entry
- To: <x86@xxxxxxxxxx>
- From: Alexey Kardashevskiy <aik@xxxxxxx>
- Date: Wed, 16 Sep 2026 21:51:43 +1000
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=OKUdPqVU6vcP8IIVfw9k2l6nR9BJplx9o3NZa4hjOck=; b=EDrGQU+zjyMIoBNBObg/r6jTe0H5NY8XWxArKdQBcDcekZYrh0UbRIh0tmCOcCfHp+dP6Wztd+oV40oofWIb4PFbFrxaTyiu/fxvMKTsdJyfUDuQBzh63awmNCIlzw2kxvb5izGceKhpYEkaujCzyL/utidKOJh+2vZjiyRqmTUXA9/cQePrUksl8uf6C0grj3ZJTzNp5u8EZzpUEviQPAjjmdTPZeGYvt8v8f/WO3Xzv8VITj5VSvEuFuOEads2rBd6M5Dm/XYx0+tsXPMX9v/5O/KZVSEJUGfxZpb+NPctjB7Uw3AuYXTo9rForv4T9S6RWtJhg4NX8Ej5WJRPrQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Urn84h68Kv1NiW1kUjFhGSLpejB7pKDouEqo54M/qmMxqqUURd6ehj7mM9xpJoyNrMOyUCwditYWutF0X2+l0E9N6rbyp7n7T93fYm75aTFSiMm3PWzBQ+EzDba/ohbFoxZMLDEtYQ1KMmI8f5qJucPcqUgzNSHQSRCwKOJghCsJdwF34jAnX0AJGV7mjpTDuVJ835sAoA+8mt2dLoBHWmWxVbsPI9P5Pn6LMSuK6og9lrcTYvcgozQynqSEb07n+m9GO1XMQ/tOeOWdpd9q73+IScNGeTdee02ynit+Phwjbohxr+Vsj9onyxl/yw6v5FMtv8Fn2PQ7QgGYuWBOaA==
- Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
- Cc: <linux-kernel@xxxxxxxxxxxxxxx>, <kvm@xxxxxxxxxxxxxxx>, <linux-crypto@xxxxxxxxxxxxxxx>, <linux-pci@xxxxxxxxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>, Borislav Petkov <bp@xxxxxxxxx>, Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>, "H. Peter Anvin" <hpa@xxxxxxxxx>, Sean Christopherson <seanjc@xxxxxxxxxx>, Paolo Bonzini <pbonzini@xxxxxxxxxx>, Andy Lutomirski <luto@xxxxxxxxxx>, Peter Zijlstra <peterz@xxxxxxxxxxxxx>, Ashish Kalra <ashish.kalra@xxxxxxx>, Tom Lendacky <thomas.lendacky@xxxxxxx>, Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>, "David S. Miller" <davem@xxxxxxxxxxxxx>, Bjorn Helgaas <bhelgaas@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>, Marek Szyprowski <m.szyprowski@xxxxxxxxxxx>, Robin Murphy <robin.murphy@xxxxxxx>, "Andrew Morton" <akpm@xxxxxxxxxxxxxxxxxxxx>, David Hildenbrand <david@xxxxxxxxxx>, Lorenzo Stoakes <ljs@xxxxxxxxxx>, "Liam R. Howlett" <liam@xxxxxxxxxxxxx>, Vlastimil Babka <vbabka@xxxxxxxxxx>, Mike Rapoport <rppt@xxxxxxxxxx>, "Suren Baghdasaryan" <surenb@xxxxxxxxxx>, Michal Hocko <mhocko@xxxxxxxx>, "Catalin Marinas" <catalin.marinas@xxxxxxx>, Jini Susan George <jinisusan.george@xxxxxxx>, Kees Cook <kees@xxxxxxxxxx>, Michael Ellerman <mpe@xxxxxxxxxxxxxx>, Nikunj A Dadhania <nikunj@xxxxxxx>, Ard Biesheuvel <ardb@xxxxxxxxxx>, Eric Biggers <ebiggers@xxxxxxxxxx>, Kim Phillips <kim.phillips@xxxxxxx>, Joerg Roedel <jroedel@xxxxxxx>, Ethan Nelson-Moore <enelsonmoore@xxxxxxxxx>, "Tycho Andersen (AMD)" <tycho@xxxxxxxxxx>, "Liam Merwick" <liam.merwick@xxxxxxxxxx>, Michael Kerrisk <mtk.manpages@xxxxxxxxx>, Suresh Siddha <suresh.b.siddha@xxxxxxxxx>, Xiaotian Feng <dfeng@xxxxxxxxxx>, Venkatesh Pallipadi <venkatesh.pallipadi@xxxxxxxxx>, Andi Kleen <ak@xxxxxxxxxxxxxxx>, Kiryl Shutsemau <kas@xxxxxxxxxx>, Tony Luck <tony.luck@xxxxxxxxx>, Jason Gunthorpe <jgg@xxxxxxxx>, Lu Baolu <baolu.lu@xxxxxxxxxxxxxxx>, Xu Yilun <yilun.xu@xxxxxxxxxxxxxxx>, Carlos López <clopez@xxxxxxx>, Jonathan Cameron <jic23@xxxxxxxxxx>, Jori Koolstra <jkoolstra@xxxxxxxxx>, Thomas Weißschuh <thomas.weissschuh@xxxxxxxxxxxxx>, "Aneesh Kumar K.V (Arm)" <aneesh.kumar@xxxxxxxxxx>, Ian Campbell <ian.campbell@xxxxxxxxxx>, Jeremy Fitzhardinge <jeremy.fitzhardinge@xxxxxxxxxx>, Petr Tesarik <ptesarik@xxxxxxxx>, "David Howells" <dhowells@xxxxxxxxxx>, Haavard Skinnemoen <hskinnemoen@xxxxxxxxx>, Kenji Kaneshige <kaneshige.kenji@xxxxxxxxxxxxxx>, Ilpo Järvinen <ilpo.jarvinen@xxxxxxxxxxxxxxx>, "Christian Marangi" <ansuelsmth@xxxxxxxxx>, Dave Jiang <dave.jiang@xxxxxxxxx>, "Michael Kelley" <mhklinux@xxxxxxxxxxx>, Ilias Stamatis <ilstam@xxxxxxxxxx>, "Sumanth Korikkar" <sumanthk@xxxxxxxxxxxxx>, Simona Vetter <simona.vetter@xxxxxxxx>, Toshi Kani <toshi.kani@xxxxxx>, Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>, Vinod Koul <vkoul@xxxxxxxxxx>, Jiang Liu <jiang.liu@xxxxxxxxxxxxxxx>, Arnd Bergmann <arnd@xxxxxxxx>, Anshuman Khandual <anshuman.khandual@xxxxxxx>, Kefeng Wang <wangkefeng.wang@xxxxxxxxxx>, "Palmer Dabbelt" <palmerdabbelt@xxxxxxxxxx>, <linux-coco@xxxxxxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>, <iommu@xxxxxxxxxxxxxxx>, <linux-mm@xxxxxxxxx>, Alexey Kardashevskiy <aik@xxxxxxx>, <aik@xxxxxxxxx>, Santosh Shukla <santosh.shukla@xxxxxxx>, "Pratik R . Sampat" <prsampat@xxxxxxx>, Scott Soule Cheloha <scott.cheloha@xxxxxxx>, Ackerley Tng <ackerleytng@xxxxxxxxxx>, Fuad Tabba <tabba@xxxxxxxxxx>
- Delivery-date: Wed, 16 Sep 2026 11:54:41 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
The pci_tsm_mmio struct represent a parsed TDI report which platform
TSM driver will apply at the TDI accept step.
On top of what the existing structure stores already, the AMD TSM driver
is going to need a range ID for the PSP communication.
Instead of calculating it in the platform TSM driver, just pass it along.
While at this, set the flag as resource_contains() checks for the type
when pci_tsm_mmio_setup() inserts the range.
Signed-off-by: Alexey Kardashevskiy <aik@xxxxxxx>
---
Not quite sure if IORESOURCE_MEM deserves a separate fix;
also if it is just me who hit this.
---
include/linux/pci-tsm.h | 2 ++
drivers/pci/tsm/core.c | 2 ++
2 files changed, 4 insertions(+)
diff --git a/include/linux/pci-tsm.h b/include/linux/pci-tsm.h
index 6d5fadd79360..9b34304d9a1f 100644
--- a/include/linux/pci-tsm.h
+++ b/include/linux/pci-tsm.h
@@ -161,10 +161,12 @@ struct pci_tsm_pf0 {
* @res: MMIO address range (typically Guest Physical Address, GPA)
* @tsm_offset: Host Physical Address, HPA obfuscation offset added by the TSM.
* Translates report addresses to GPA.
+ * @range_id: PCI BAR index for this range
*/
struct pci_tsm_mmio_entry {
struct resource res;
u64 tsm_offset;
+ unsigned char range_id;
};
struct pci_tsm_mmio {
diff --git a/drivers/pci/tsm/core.c b/drivers/pci/tsm/core.c
index 2a18be5be56e..a197d56edbfb 100644
--- a/drivers/pci/tsm/core.c
+++ b/drivers/pci/tsm/core.c
@@ -746,6 +746,8 @@ struct pci_tsm_mmio *pci_tsm_mmio_alloc(struct pci_dev
*pdev)
entry->res.start = range.start;
entry->res.end = range.end;
+ entry->res.flags = IORESOURCE_MEM;
+ entry->range_id = bar;
entry->tsm_offset = tsm_offset;
mmio->nr++;
}
--
2.55.0
|