* [PATCH 0/6] x86/platform: Move AMD specific headers to <asm/amd/*.h>
@ 2025-04-13 8:41 Ingo Molnar
2025-04-13 8:41 ` [PATCH 1/6] x86/platform/amd: Move the <asm/amd-ibs.h> header to <asm/amd/ibs.h> Ingo Molnar
` (6 more replies)
0 siblings, 7 replies; 15+ messages in thread
From: Ingo Molnar @ 2025-04-13 8:41 UTC (permalink / raw)
To: linux-kernel
Cc: Mario Limonciello, Borislav Petkov, H . Peter Anvin,
Linus Torvalds, Peter Zijlstra, Thomas Gleixner, Ingo Molnar
Also clean up some details while at it.
The Git tree of these patches can also be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/mingo/tip.git WIP.x86/platform
Thanks,
Ingo
===============>
Ingo Molnar (6):
x86/platform/amd: Move the <asm/amd-ibs.h> header to <asm/amd/ibs.h>
x86/platform/amd: Add standard header guards to <asm/amd/ibs.h>
x86/platform/amd: Move the <asm/amd_nb.h> header to <asm/amd/nb.h>
x86/platform/amd: Move the <asm/amd_hsmp.h> header to <asm/amd/hsmp.h>
x86/platform/amd: Clean up the <asm/amd/hsmp.h> header guards a bit
x86/platform/amd: Move the <asm/amd_node.h> header to <asm/amd/node.h>
Documentation/userspace-api/ioctl/ioctl-number.rst | 2 +-
MAINTAINERS | 6 +++---
arch/x86/events/amd/ibs.c | 2 +-
arch/x86/include/asm/{amd_hsmp.h => amd/hsmp.h} | 4 ++--
arch/x86/include/asm/{amd-ibs.h => amd/ibs.h} | 5 +++++
arch/x86/include/asm/{amd_nb.h => amd/nb.h} | 2 +-
arch/x86/include/asm/{amd_node.h => amd/node.h} | 0
arch/x86/kernel/amd_gart_64.c | 2 +-
arch/x86/kernel/amd_nb.c | 2 +-
arch/x86/kernel/amd_node.c | 2 +-
arch/x86/kernel/aperture_64.c | 2 +-
arch/x86/kernel/cpu/cacheinfo.c | 2 +-
arch/x86/kernel/cpu/mce/inject.c | 2 +-
arch/x86/mm/amdtopology.c | 2 +-
arch/x86/mm/numa.c | 2 +-
arch/x86/pci/amd_bus.c | 2 +-
arch/x86/pci/fixup.c | 2 +-
drivers/char/agp/amd64-agp.c | 2 +-
drivers/edac/amd64_edac.c | 4 ++--
drivers/hwmon/k10temp.c | 2 +-
drivers/platform/x86/amd/hsmp/acpi.c | 4 ++--
drivers/platform/x86/amd/hsmp/hsmp.c | 2 +-
drivers/platform/x86/amd/hsmp/plat.c | 4 ++--
drivers/platform/x86/amd/pmc/mp1_stb.c | 2 +-
drivers/platform/x86/amd/pmc/pmc.c | 2 +-
drivers/platform/x86/amd/pmf/core.c | 2 +-
drivers/pnp/quirks.c | 2 +-
drivers/ras/amd/atl/internal.h | 4 ++--
sound/soc/amd/acp/acp-rembrandt.c | 2 +-
sound/soc/amd/acp/acp63.c | 2 +-
sound/soc/amd/acp/acp70.c | 2 +-
sound/soc/sof/amd/acp.c | 2 +-
tools/perf/check-headers.sh | 2 +-
tools/perf/util/amd-sample-raw.c | 2 +-
34 files changed, 44 insertions(+), 39 deletions(-)
rename arch/x86/include/asm/{amd_hsmp.h => amd/hsmp.h} (91%)
rename arch/x86/include/asm/{amd-ibs.h => amd/ibs.h} (98%)
rename arch/x86/include/asm/{amd_nb.h => amd/nb.h} (98%)
rename arch/x86/include/asm/{amd_node.h => amd/node.h} (100%)
--
2.45.2
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 1/6] x86/platform/amd: Move the <asm/amd-ibs.h> header to <asm/amd/ibs.h>
2025-04-13 8:41 [PATCH 0/6] x86/platform: Move AMD specific headers to <asm/amd/*.h> Ingo Molnar
@ 2025-04-13 8:41 ` Ingo Molnar
2025-04-14 8:15 ` [tip: x86/merge] " tip-bot2 for Ingo Molnar
2025-04-13 8:41 ` [PATCH 2/6] x86/platform/amd: Add standard header guards " Ingo Molnar
` (5 subsequent siblings)
6 siblings, 1 reply; 15+ messages in thread
From: Ingo Molnar @ 2025-04-13 8:41 UTC (permalink / raw)
To: linux-kernel
Cc: Mario Limonciello, Borislav Petkov, H . Peter Anvin,
Linus Torvalds, Peter Zijlstra, Thomas Gleixner, Ingo Molnar
Collect AMD specific platform header files in <asm/amd/*.h>.
Cc: Borislav Petkov <bp@alien8.de>
Cc: Mario Limonciello <superm1@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
arch/x86/events/amd/ibs.c | 2 +-
arch/x86/include/asm/{amd-ibs.h => amd/ibs.h} | 0
| 2 +-
tools/perf/util/amd-sample-raw.c | 2 +-
4 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/x86/events/amd/ibs.c b/arch/x86/events/amd/ibs.c
index 0252b7ea8bca..172619932fe3 100644
--- a/arch/x86/events/amd/ibs.c
+++ b/arch/x86/events/amd/ibs.c
@@ -26,7 +26,7 @@ static u32 ibs_caps;
#include <linux/hardirq.h>
#include <asm/nmi.h>
-#include <asm/amd-ibs.h>
+#include <asm/amd/ibs.h>
/* attr.config2 */
#define IBS_SW_FILTER_MASK 1
--git a/arch/x86/include/asm/amd-ibs.h b/arch/x86/include/asm/amd/ibs.h
similarity index 100%
rename from arch/x86/include/asm/amd-ibs.h
rename to arch/x86/include/asm/amd/ibs.h
diff --git a/tools/perf/check-headers.sh b/tools/perf/check-headers.sh
index a4499e5a6f9c..493a13830419 100755
--- a/tools/perf/check-headers.sh
+++ b/tools/perf/check-headers.sh
@@ -185,7 +185,7 @@ done
# diff with extra ignore lines
check arch/x86/lib/memcpy_64.S '-I "^EXPORT_SYMBOL" -I "^#include <asm/export.h>" -I"^SYM_FUNC_START\(_LOCAL\)*(memcpy_\(erms\|orig\))" -I"^#include <linux/cfi_types.h>"'
check arch/x86/lib/memset_64.S '-I "^EXPORT_SYMBOL" -I "^#include <asm/export.h>" -I"^SYM_FUNC_START\(_LOCAL\)*(memset_\(erms\|orig\))"'
-check arch/x86/include/asm/amd-ibs.h '-I "^#include [<\"]\(asm/\)*msr-index.h"'
+check arch/x86/include/asm/amd/ibs.h '-I "^#include [<\"]\(asm/\)*msr-index.h"'
check arch/arm64/include/asm/cputype.h '-I "^#include [<\"]\(asm/\)*sysreg.h"'
check include/linux/unaligned.h '-I "^#include <linux/unaligned/packed_struct.h>" -I "^#include <asm/byteorder.h>" -I "^#pragma GCC diagnostic"'
check include/uapi/asm-generic/mman.h '-I "^#include <\(uapi/\)*asm-generic/mman-common\(-tools\)*.h>"'
diff --git a/tools/perf/util/amd-sample-raw.c b/tools/perf/util/amd-sample-raw.c
index 9d0ce88e90e4..456ce64ad822 100644
--- a/tools/perf/util/amd-sample-raw.c
+++ b/tools/perf/util/amd-sample-raw.c
@@ -9,7 +9,7 @@
#include <inttypes.h>
#include <linux/string.h>
-#include "../../arch/x86/include/asm/amd-ibs.h"
+#include "../../arch/x86/include/asm/amd/ibs.h"
#include "debug.h"
#include "session.h"
--
2.45.2
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 2/6] x86/platform/amd: Add standard header guards to <asm/amd/ibs.h>
2025-04-13 8:41 [PATCH 0/6] x86/platform: Move AMD specific headers to <asm/amd/*.h> Ingo Molnar
2025-04-13 8:41 ` [PATCH 1/6] x86/platform/amd: Move the <asm/amd-ibs.h> header to <asm/amd/ibs.h> Ingo Molnar
@ 2025-04-13 8:41 ` Ingo Molnar
2025-04-14 8:15 ` [tip: x86/merge] " tip-bot2 for Ingo Molnar
2025-04-13 8:41 ` [PATCH 3/6] x86/platform/amd: Move the <asm/amd_nb.h> header to <asm/amd/nb.h> Ingo Molnar
` (4 subsequent siblings)
6 siblings, 1 reply; 15+ messages in thread
From: Ingo Molnar @ 2025-04-13 8:41 UTC (permalink / raw)
To: linux-kernel
Cc: Mario Limonciello, Borislav Petkov, H . Peter Anvin,
Linus Torvalds, Peter Zijlstra, Thomas Gleixner, Ingo Molnar
Cc: Borislav Petkov <bp@alien8.de>
Cc: Mario Limonciello <superm1@kernel.org>
---
arch/x86/include/asm/amd/ibs.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/x86/include/asm/amd/ibs.h b/arch/x86/include/asm/amd/ibs.h
index 77f3a589a99a..3ee5903982c2 100644
--- a/arch/x86/include/asm/amd/ibs.h
+++ b/arch/x86/include/asm/amd/ibs.h
@@ -1,4 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _ASM_X86_AMD_IBS_H
+#define _ASM_X86_AMD_IBS_H
+
/*
* From PPR Vol 1 for AMD Family 19h Model 01h B1
* 55898 Rev 0.35 - Feb 5, 2021
@@ -151,3 +154,5 @@ struct perf_ibs_data {
};
u64 regs[MSR_AMD64_IBS_REG_COUNT_MAX];
};
+
+#endif /* _ASM_X86_AMD_IBS_H */
--
2.45.2
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 3/6] x86/platform/amd: Move the <asm/amd_nb.h> header to <asm/amd/nb.h>
2025-04-13 8:41 [PATCH 0/6] x86/platform: Move AMD specific headers to <asm/amd/*.h> Ingo Molnar
2025-04-13 8:41 ` [PATCH 1/6] x86/platform/amd: Move the <asm/amd-ibs.h> header to <asm/amd/ibs.h> Ingo Molnar
2025-04-13 8:41 ` [PATCH 2/6] x86/platform/amd: Add standard header guards " Ingo Molnar
@ 2025-04-13 8:41 ` Ingo Molnar
2025-04-14 8:15 ` [tip: x86/merge] " tip-bot2 for Ingo Molnar
2025-04-13 8:41 ` [PATCH 4/6] x86/platform/amd: Move the <asm/amd_hsmp.h> header to <asm/amd/hsmp.h> Ingo Molnar
` (3 subsequent siblings)
6 siblings, 1 reply; 15+ messages in thread
From: Ingo Molnar @ 2025-04-13 8:41 UTC (permalink / raw)
To: linux-kernel
Cc: Mario Limonciello, Borislav Petkov, H . Peter Anvin,
Linus Torvalds, Peter Zijlstra, Thomas Gleixner, Ingo Molnar
Collect AMD specific platform header files in <asm/amd/*.h>.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Mario Limonciello <superm1@kernel.org>
---
arch/x86/include/asm/{amd_nb.h => amd/nb.h} | 0
arch/x86/kernel/amd_gart_64.c | 2 +-
arch/x86/kernel/amd_nb.c | 2 +-
arch/x86/kernel/aperture_64.c | 2 +-
arch/x86/kernel/cpu/cacheinfo.c | 2 +-
arch/x86/kernel/cpu/mce/inject.c | 2 +-
arch/x86/mm/amdtopology.c | 2 +-
arch/x86/mm/numa.c | 2 +-
arch/x86/pci/amd_bus.c | 2 +-
drivers/char/agp/amd64-agp.c | 2 +-
drivers/edac/amd64_edac.c | 2 +-
drivers/platform/x86/amd/pmc/mp1_stb.c | 2 +-
drivers/pnp/quirks.c | 2 +-
drivers/ras/amd/atl/internal.h | 2 +-
14 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/arch/x86/include/asm/amd_nb.h b/arch/x86/include/asm/amd/nb.h
similarity index 100%
rename from arch/x86/include/asm/amd_nb.h
rename to arch/x86/include/asm/amd/nb.h
diff --git a/arch/x86/kernel/amd_gart_64.c b/arch/x86/kernel/amd_gart_64.c
index c884deca839b..3485d419c2f5 100644
--- a/arch/x86/kernel/amd_gart_64.c
+++ b/arch/x86/kernel/amd_gart_64.c
@@ -39,7 +39,7 @@
#include <asm/gart.h>
#include <asm/set_memory.h>
#include <asm/dma.h>
-#include <asm/amd_nb.h>
+#include <asm/amd/nb.h>
#include <asm/x86_init.h>
static unsigned long iommu_bus_base; /* GART remapping area (physical) */
diff --git a/arch/x86/kernel/amd_nb.c b/arch/x86/kernel/amd_nb.c
index 6d12a9b69432..bac445d217e6 100644
--- a/arch/x86/kernel/amd_nb.c
+++ b/arch/x86/kernel/amd_nb.c
@@ -13,7 +13,7 @@
#include <linux/export.h>
#include <linux/spinlock.h>
#include <linux/pci_ids.h>
-#include <asm/amd_nb.h>
+#include <asm/amd/nb.h>
static u32 *flush_words;
diff --git a/arch/x86/kernel/aperture_64.c b/arch/x86/kernel/aperture_64.c
index 89c0c8a3fc7e..769321185a08 100644
--- a/arch/x86/kernel/aperture_64.c
+++ b/arch/x86/kernel/aperture_64.c
@@ -29,7 +29,7 @@
#include <asm/gart.h>
#include <asm/pci-direct.h>
#include <asm/dma.h>
-#include <asm/amd_nb.h>
+#include <asm/amd/nb.h>
#include <asm/x86_init.h>
#include <linux/crash_dump.h>
diff --git a/arch/x86/kernel/cpu/cacheinfo.c b/arch/x86/kernel/cpu/cacheinfo.c
index b3a520959b51..247fa8746fe5 100644
--- a/arch/x86/kernel/cpu/cacheinfo.c
+++ b/arch/x86/kernel/cpu/cacheinfo.c
@@ -16,7 +16,7 @@
#include <linux/stop_machine.h>
#include <linux/sysfs.h>
-#include <asm/amd_nb.h>
+#include <asm/amd/nb.h>
#include <asm/cacheinfo.h>
#include <asm/cpufeature.h>
#include <asm/mtrr.h>
diff --git a/arch/x86/kernel/cpu/mce/inject.c b/arch/x86/kernel/cpu/mce/inject.c
index 06e3cf7229ce..bb060f8326ef 100644
--- a/arch/x86/kernel/cpu/mce/inject.c
+++ b/arch/x86/kernel/cpu/mce/inject.c
@@ -24,7 +24,7 @@
#include <linux/pci.h>
#include <linux/uaccess.h>
-#include <asm/amd_nb.h>
+#include <asm/amd/nb.h>
#include <asm/apic.h>
#include <asm/irq_vectors.h>
#include <asm/mce.h>
diff --git a/arch/x86/mm/amdtopology.c b/arch/x86/mm/amdtopology.c
index 628833afee37..f980b0eb0105 100644
--- a/arch/x86/mm/amdtopology.c
+++ b/arch/x86/mm/amdtopology.c
@@ -25,7 +25,7 @@
#include <asm/numa.h>
#include <asm/mpspec.h>
#include <asm/apic.h>
-#include <asm/amd_nb.h>
+#include <asm/amd/nb.h>
static unsigned char __initdata nodeids[8];
diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c
index 64e5cdb2460a..fed02d1073c7 100644
--- a/arch/x86/mm/numa.c
+++ b/arch/x86/mm/numa.c
@@ -18,7 +18,7 @@
#include <asm/e820/api.h>
#include <asm/proto.h>
#include <asm/dma.h>
-#include <asm/amd_nb.h>
+#include <asm/amd/nb.h>
#include "numa_internal.h"
diff --git a/arch/x86/pci/amd_bus.c b/arch/x86/pci/amd_bus.c
index 631512f7ec85..95ae1971a5f1 100644
--- a/arch/x86/pci/amd_bus.c
+++ b/arch/x86/pci/amd_bus.c
@@ -5,7 +5,7 @@
#include <linux/cpu.h>
#include <linux/range.h>
-#include <asm/amd_nb.h>
+#include <asm/amd/nb.h>
#include <asm/pci_x86.h>
#include <asm/pci-direct.h>
diff --git a/drivers/char/agp/amd64-agp.c b/drivers/char/agp/amd64-agp.c
index 8e41731d3642..bf490967241a 100644
--- a/drivers/char/agp/amd64-agp.c
+++ b/drivers/char/agp/amd64-agp.c
@@ -16,7 +16,7 @@
#include <linux/mmzone.h>
#include <asm/page.h> /* PAGE_SIZE */
#include <asm/e820/api.h>
-#include <asm/amd_nb.h>
+#include <asm/amd/nb.h>
#include <asm/gart.h>
#include "agp.h"
diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c
index 90f0eb7cc5b9..417940f455d3 100644
--- a/drivers/edac/amd64_edac.c
+++ b/drivers/edac/amd64_edac.c
@@ -2,7 +2,7 @@
#include <linux/ras.h>
#include <linux/string_choices.h>
#include "amd64_edac.h"
-#include <asm/amd_nb.h>
+#include <asm/amd/nb.h>
#include <asm/amd_node.h>
static struct edac_pci_ctl_info *pci_ctl;
diff --git a/drivers/platform/x86/amd/pmc/mp1_stb.c b/drivers/platform/x86/amd/pmc/mp1_stb.c
index c005f00988f7..3b9b9f30faa3 100644
--- a/drivers/platform/x86/amd/pmc/mp1_stb.c
+++ b/drivers/platform/x86/amd/pmc/mp1_stb.c
@@ -11,7 +11,7 @@
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-#include <asm/amd_nb.h>
+#include <asm/amd/nb.h>
#include <linux/debugfs.h>
#include <linux/seq_file.h>
#include <linux/uaccess.h>
diff --git a/drivers/pnp/quirks.c b/drivers/pnp/quirks.c
index 6085a1471de2..6e1d4bfd28ac 100644
--- a/drivers/pnp/quirks.c
+++ b/drivers/pnp/quirks.c
@@ -290,7 +290,7 @@ static void quirk_system_pci_resources(struct pnp_dev *dev)
#ifdef CONFIG_AMD_NB
-#include <asm/amd_nb.h>
+#include <asm/amd/nb.h>
static void quirk_amd_mmconfig_area(struct pnp_dev *dev)
{
diff --git a/drivers/ras/amd/atl/internal.h b/drivers/ras/amd/atl/internal.h
index f9be26d25348..c63fee30cc18 100644
--- a/drivers/ras/amd/atl/internal.h
+++ b/drivers/ras/amd/atl/internal.h
@@ -17,7 +17,7 @@
#include <linux/bitops.h>
#include <linux/ras.h>
-#include <asm/amd_nb.h>
+#include <asm/amd/nb.h>
#include <asm/amd_node.h>
#include "reg_fields.h"
--
2.45.2
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 4/6] x86/platform/amd: Move the <asm/amd_hsmp.h> header to <asm/amd/hsmp.h>
2025-04-13 8:41 [PATCH 0/6] x86/platform: Move AMD specific headers to <asm/amd/*.h> Ingo Molnar
` (2 preceding siblings ...)
2025-04-13 8:41 ` [PATCH 3/6] x86/platform/amd: Move the <asm/amd_nb.h> header to <asm/amd/nb.h> Ingo Molnar
@ 2025-04-13 8:41 ` Ingo Molnar
2025-04-14 8:15 ` [tip: x86/merge] " tip-bot2 for Ingo Molnar
2025-04-13 8:41 ` [PATCH 5/6] x86/platform/amd: Clean up the <asm/amd/hsmp.h> header guards a bit Ingo Molnar
` (2 subsequent siblings)
6 siblings, 1 reply; 15+ messages in thread
From: Ingo Molnar @ 2025-04-13 8:41 UTC (permalink / raw)
To: linux-kernel
Cc: Mario Limonciello, Borislav Petkov, H . Peter Anvin,
Linus Torvalds, Peter Zijlstra, Thomas Gleixner, Ingo Molnar,
Naveen Krishna Chatradhi, Carlos Bilbao
Collect AMD specific platform header files in <asm/amd/*.h>.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Mario Limonciello <superm1@kernel.org>
Cc: Naveen Krishna Chatradhi <naveenkrishna.chatradhi@amd.com>
Cc: Carlos Bilbao <carlos.bilbao@kernel.org>
---
Documentation/userspace-api/ioctl/ioctl-number.rst | 2 +-
MAINTAINERS | 4 ++--
arch/x86/include/asm/{amd_hsmp.h => amd/hsmp.h} | 2 +-
drivers/platform/x86/amd/hsmp/acpi.c | 2 +-
drivers/platform/x86/amd/hsmp/hsmp.c | 2 +-
drivers/platform/x86/amd/hsmp/plat.c | 2 +-
6 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/Documentation/userspace-api/ioctl/ioctl-number.rst b/Documentation/userspace-api/ioctl/ioctl-number.rst
index 7a1409ecc238..1142234335ab 100644
--- a/Documentation/userspace-api/ioctl/ioctl-number.rst
+++ b/Documentation/userspace-api/ioctl/ioctl-number.rst
@@ -395,7 +395,7 @@ Code Seq# Include File Comments
<mailto:thomas@winischhofer.net>
0xF6 all LTTng Linux Trace Toolkit Next Generation
<mailto:mathieu.desnoyers@efficios.com>
-0xF8 all arch/x86/include/uapi/asm/amd_hsmp.h AMD HSMP EPYC system management interface driver
+0xF8 all arch/x86/include/uapi/asm/amd/hsmp.h AMD HSMP EPYC system management interface driver
<mailto:nchatrad@amd.com>
0xFD all linux/dm-ioctl.h
0xFE all linux/isst_if.h
diff --git a/MAINTAINERS b/MAINTAINERS
index 96b827049501..ce2942d0fef4 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1097,8 +1097,8 @@ R: Carlos Bilbao <carlos.bilbao@kernel.org>
L: platform-driver-x86@vger.kernel.org
S: Maintained
F: Documentation/arch/x86/amd_hsmp.rst
-F: arch/x86/include/asm/amd_hsmp.h
-F: arch/x86/include/uapi/asm/amd_hsmp.h
+F: arch/x86/include/asm/amd/hsmp.h
+F: arch/x86/include/uapi/asm/amd/hsmp.h
F: drivers/platform/x86/amd/hsmp/
AMD IOMMU (AMD-VI)
diff --git a/arch/x86/include/asm/amd_hsmp.h b/arch/x86/include/asm/amd/hsmp.h
similarity index 91%
rename from arch/x86/include/asm/amd_hsmp.h
rename to arch/x86/include/asm/amd/hsmp.h
index 03c2ce3edaf5..f3253d27bf49 100644
--- a/arch/x86/include/asm/amd_hsmp.h
+++ b/arch/x86/include/asm/amd/hsmp.h
@@ -3,7 +3,7 @@
#ifndef _ASM_X86_AMD_HSMP_H_
#define _ASM_X86_AMD_HSMP_H_
-#include <uapi/asm/amd_hsmp.h>
+#include <uapi/asm/amd/hsmp.h>
#if IS_ENABLED(CONFIG_AMD_HSMP)
int hsmp_send_message(struct hsmp_message *msg);
diff --git a/drivers/platform/x86/amd/hsmp/acpi.c b/drivers/platform/x86/amd/hsmp/acpi.c
index c1eccb3c80c5..3c7acb90c3ab 100644
--- a/drivers/platform/x86/amd/hsmp/acpi.c
+++ b/drivers/platform/x86/amd/hsmp/acpi.c
@@ -9,7 +9,7 @@
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-#include <asm/amd_hsmp.h>
+#include <asm/amd/hsmp.h>
#include <linux/acpi.h>
#include <linux/device.h>
diff --git a/drivers/platform/x86/amd/hsmp/hsmp.c b/drivers/platform/x86/amd/hsmp/hsmp.c
index a3ac09a90de4..e262e8a97b45 100644
--- a/drivers/platform/x86/amd/hsmp/hsmp.c
+++ b/drivers/platform/x86/amd/hsmp/hsmp.c
@@ -7,7 +7,7 @@
* This file provides a device implementation for HSMP interface
*/
-#include <asm/amd_hsmp.h>
+#include <asm/amd/hsmp.h>
#include <linux/acpi.h>
#include <linux/delay.h>
diff --git a/drivers/platform/x86/amd/hsmp/plat.c b/drivers/platform/x86/amd/hsmp/plat.c
index b9782a078dbd..0eb73fcb9806 100644
--- a/drivers/platform/x86/amd/hsmp/plat.c
+++ b/drivers/platform/x86/amd/hsmp/plat.c
@@ -9,7 +9,7 @@
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-#include <asm/amd_hsmp.h>
+#include <asm/amd/hsmp.h>
#include <linux/build_bug.h>
#include <linux/device.h>
--
2.45.2
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 5/6] x86/platform/amd: Clean up the <asm/amd/hsmp.h> header guards a bit
2025-04-13 8:41 [PATCH 0/6] x86/platform: Move AMD specific headers to <asm/amd/*.h> Ingo Molnar
` (3 preceding siblings ...)
2025-04-13 8:41 ` [PATCH 4/6] x86/platform/amd: Move the <asm/amd_hsmp.h> header to <asm/amd/hsmp.h> Ingo Molnar
@ 2025-04-13 8:41 ` Ingo Molnar
2025-04-14 8:15 ` [tip: x86/merge] " tip-bot2 for Ingo Molnar
2025-04-13 8:41 ` [PATCH 6/6] x86/platform/amd: Move the <asm/amd_node.h> header to <asm/amd/node.h> Ingo Molnar
2025-04-13 9:20 ` [PATCH 0/6] x86/platform: Move AMD specific headers to <asm/amd/*.h> Borislav Petkov
6 siblings, 1 reply; 15+ messages in thread
From: Ingo Molnar @ 2025-04-13 8:41 UTC (permalink / raw)
To: linux-kernel
Cc: Mario Limonciello, Borislav Petkov, H . Peter Anvin,
Linus Torvalds, Peter Zijlstra, Thomas Gleixner, Ingo Molnar,
Naveen Krishna Chatradhi, Carlos Bilbao
- There's no need for a newline after the SPDX line
- But there's a need for one before the closing header guard.
Collect AMD specific platform header files in <asm/amd/*.h>.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Mario Limonciello <superm1@kernel.org>
Cc: Naveen Krishna Chatradhi <naveenkrishna.chatradhi@amd.com>
Cc: Carlos Bilbao <carlos.bilbao@kernel.org>
---
arch/x86/include/asm/amd/hsmp.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/include/asm/amd/hsmp.h b/arch/x86/include/asm/amd/hsmp.h
index f3253d27bf49..7674ad9c5cbf 100644
--- a/arch/x86/include/asm/amd/hsmp.h
+++ b/arch/x86/include/asm/amd/hsmp.h
@@ -1,5 +1,4 @@
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
-
#ifndef _ASM_X86_AMD_HSMP_H_
#define _ASM_X86_AMD_HSMP_H_
@@ -13,4 +12,5 @@ static inline int hsmp_send_message(struct hsmp_message *msg)
return -ENODEV;
}
#endif
+
#endif /*_ASM_X86_AMD_HSMP_H_*/
--
2.45.2
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 6/6] x86/platform/amd: Move the <asm/amd_node.h> header to <asm/amd/node.h>
2025-04-13 8:41 [PATCH 0/6] x86/platform: Move AMD specific headers to <asm/amd/*.h> Ingo Molnar
` (4 preceding siblings ...)
2025-04-13 8:41 ` [PATCH 5/6] x86/platform/amd: Clean up the <asm/amd/hsmp.h> header guards a bit Ingo Molnar
@ 2025-04-13 8:41 ` Ingo Molnar
2025-04-14 8:15 ` [tip: x86/merge] " tip-bot2 for Ingo Molnar
2025-04-13 9:20 ` [PATCH 0/6] x86/platform: Move AMD specific headers to <asm/amd/*.h> Borislav Petkov
6 siblings, 1 reply; 15+ messages in thread
From: Ingo Molnar @ 2025-04-13 8:41 UTC (permalink / raw)
To: linux-kernel
Cc: Mario Limonciello, Borislav Petkov, H . Peter Anvin,
Linus Torvalds, Peter Zijlstra, Thomas Gleixner, Ingo Molnar
Collect AMD specific platform header files in <asm/amd/*.h>.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Mario Limonciello <superm1@kernel.org>
---
MAINTAINERS | 2 +-
arch/x86/include/asm/amd/nb.h | 2 +-
arch/x86/include/asm/{amd_node.h => amd/node.h} | 0
arch/x86/kernel/amd_node.c | 2 +-
arch/x86/pci/fixup.c | 2 +-
drivers/edac/amd64_edac.c | 2 +-
drivers/hwmon/k10temp.c | 2 +-
drivers/platform/x86/amd/hsmp/acpi.c | 2 +-
drivers/platform/x86/amd/hsmp/plat.c | 2 +-
drivers/platform/x86/amd/pmc/pmc.c | 2 +-
drivers/platform/x86/amd/pmf/core.c | 2 +-
drivers/ras/amd/atl/internal.h | 2 +-
sound/soc/amd/acp/acp-rembrandt.c | 2 +-
sound/soc/amd/acp/acp63.c | 2 +-
sound/soc/amd/acp/acp70.c | 2 +-
sound/soc/sof/amd/acp.c | 2 +-
16 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/MAINTAINERS b/MAINTAINERS
index ce2942d0fef4..684b62c42014 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1142,7 +1142,7 @@ M: Mario Limonciello <mario.limonciello@amd.com>
M: Yazen Ghannam <yazen.ghannam@amd.com>
L: linux-kernel@vger.kernel.org
S: Supported
-F: arch/x86/include/asm/amd_node.h
+F: arch/x86/include/asm/amd/node.h
F: arch/x86/kernel/amd_node.c
AMD PDS CORE DRIVER
diff --git a/arch/x86/include/asm/amd/nb.h b/arch/x86/include/asm/amd/nb.h
index adfa0854cf2d..ddb5108cf46c 100644
--- a/arch/x86/include/asm/amd/nb.h
+++ b/arch/x86/include/asm/amd/nb.h
@@ -4,7 +4,7 @@
#include <linux/ioport.h>
#include <linux/pci.h>
-#include <asm/amd_node.h>
+#include <asm/amd/node.h>
struct amd_nb_bus_dev_range {
u8 bus;
diff --git a/arch/x86/include/asm/amd_node.h b/arch/x86/include/asm/amd/node.h
similarity index 100%
rename from arch/x86/include/asm/amd_node.h
rename to arch/x86/include/asm/amd/node.h
diff --git a/arch/x86/kernel/amd_node.c b/arch/x86/kernel/amd_node.c
index b670fa85c61b..a40176b62eb5 100644
--- a/arch/x86/kernel/amd_node.c
+++ b/arch/x86/kernel/amd_node.c
@@ -9,7 +9,7 @@
*/
#include <linux/debugfs.h>
-#include <asm/amd_node.h>
+#include <asm/amd/node.h>
/*
* AMD Nodes are a physical collection of I/O devices within an SoC. There can be one
diff --git a/arch/x86/pci/fixup.c b/arch/x86/pci/fixup.c
index efefeb82ab61..36336299596b 100644
--- a/arch/x86/pci/fixup.c
+++ b/arch/x86/pci/fixup.c
@@ -9,7 +9,7 @@
#include <linux/pci.h>
#include <linux/suspend.h>
#include <linux/vgaarb.h>
-#include <asm/amd_node.h>
+#include <asm/amd/node.h>
#include <asm/hpet.h>
#include <asm/pci_x86.h>
diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c
index 417940f455d3..25180165ca8e 100644
--- a/drivers/edac/amd64_edac.c
+++ b/drivers/edac/amd64_edac.c
@@ -3,7 +3,7 @@
#include <linux/string_choices.h>
#include "amd64_edac.h"
#include <asm/amd/nb.h>
-#include <asm/amd_node.h>
+#include <asm/amd/node.h>
static struct edac_pci_ctl_info *pci_ctl;
diff --git a/drivers/hwmon/k10temp.c b/drivers/hwmon/k10temp.c
index 3685906cc57c..472bcf6092f6 100644
--- a/drivers/hwmon/k10temp.c
+++ b/drivers/hwmon/k10temp.c
@@ -20,7 +20,7 @@
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/pci_ids.h>
-#include <asm/amd_node.h>
+#include <asm/amd/node.h>
#include <asm/processor.h>
MODULE_DESCRIPTION("AMD Family 10h+ CPU core temperature monitor");
diff --git a/drivers/platform/x86/amd/hsmp/acpi.c b/drivers/platform/x86/amd/hsmp/acpi.c
index 3c7acb90c3ab..02e22c1f3a1d 100644
--- a/drivers/platform/x86/amd/hsmp/acpi.c
+++ b/drivers/platform/x86/amd/hsmp/acpi.c
@@ -23,7 +23,7 @@
#include <uapi/asm-generic/errno-base.h>
-#include <asm/amd_node.h>
+#include <asm/amd/node.h>
#include "hsmp.h"
diff --git a/drivers/platform/x86/amd/hsmp/plat.c b/drivers/platform/x86/amd/hsmp/plat.c
index 0eb73fcb9806..c9a1b1ed4224 100644
--- a/drivers/platform/x86/amd/hsmp/plat.c
+++ b/drivers/platform/x86/amd/hsmp/plat.c
@@ -18,7 +18,7 @@
#include <linux/platform_device.h>
#include <linux/sysfs.h>
-#include <asm/amd_node.h>
+#include <asm/amd/node.h>
#include "hsmp.h"
diff --git a/drivers/platform/x86/amd/pmc/pmc.c b/drivers/platform/x86/amd/pmc/pmc.c
index d789d6cab794..e5c4e6be37f7 100644
--- a/drivers/platform/x86/amd/pmc/pmc.c
+++ b/drivers/platform/x86/amd/pmc/pmc.c
@@ -28,7 +28,7 @@
#include <linux/seq_file.h>
#include <linux/uaccess.h>
-#include <asm/amd_node.h>
+#include <asm/amd/node.h>
#include "pmc.h"
diff --git a/drivers/platform/x86/amd/pmf/core.c b/drivers/platform/x86/amd/pmf/core.c
index a2cb2d5544f5..cecadae3f3bf 100644
--- a/drivers/platform/x86/amd/pmf/core.c
+++ b/drivers/platform/x86/amd/pmf/core.c
@@ -14,7 +14,7 @@
#include <linux/pci.h>
#include <linux/platform_device.h>
#include <linux/power_supply.h>
-#include <asm/amd_node.h>
+#include <asm/amd/node.h>
#include "pmf.h"
/* PMF-SMU communication registers */
diff --git a/drivers/ras/amd/atl/internal.h b/drivers/ras/amd/atl/internal.h
index c63fee30cc18..05bbee20eeaf 100644
--- a/drivers/ras/amd/atl/internal.h
+++ b/drivers/ras/amd/atl/internal.h
@@ -18,7 +18,7 @@
#include <linux/ras.h>
#include <asm/amd/nb.h>
-#include <asm/amd_node.h>
+#include <asm/amd/node.h>
#include "reg_fields.h"
diff --git a/sound/soc/amd/acp/acp-rembrandt.c b/sound/soc/amd/acp/acp-rembrandt.c
index 746b6ed72029..c30a7b59fbff 100644
--- a/sound/soc/amd/acp/acp-rembrandt.c
+++ b/sound/soc/amd/acp/acp-rembrandt.c
@@ -22,7 +22,7 @@
#include <linux/pci.h>
#include <linux/pm_runtime.h>
-#include <asm/amd_node.h>
+#include <asm/amd/node.h>
#include "amd.h"
#include "../mach-config.h"
diff --git a/sound/soc/amd/acp/acp63.c b/sound/soc/amd/acp/acp63.c
index 52d895e624c7..0ddde14da7d5 100644
--- a/sound/soc/amd/acp/acp63.c
+++ b/sound/soc/amd/acp/acp63.c
@@ -21,7 +21,7 @@
#include <linux/pm_runtime.h>
#include <linux/pci.h>
-#include <asm/amd_node.h>
+#include <asm/amd/node.h>
#include "amd.h"
#include "acp-mach.h"
diff --git a/sound/soc/amd/acp/acp70.c b/sound/soc/amd/acp/acp70.c
index 6d5f5ade075c..7f4a25b46576 100644
--- a/sound/soc/amd/acp/acp70.c
+++ b/sound/soc/amd/acp/acp70.c
@@ -23,7 +23,7 @@
#include "amd.h"
#include "acp-mach.h"
-#include <asm/amd_node.h>
+#include <asm/amd/node.h>
#define DRV_NAME "acp_asoc_acp70"
diff --git a/sound/soc/sof/amd/acp.c b/sound/soc/sof/amd/acp.c
index 7c6d647fa253..7e6f10726ff0 100644
--- a/sound/soc/sof/amd/acp.c
+++ b/sound/soc/sof/amd/acp.c
@@ -16,7 +16,7 @@
#include <linux/module.h>
#include <linux/pci.h>
-#include <asm/amd_node.h>
+#include <asm/amd/node.h>
#include "../ops.h"
#include "acp.h"
--
2.45.2
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH 0/6] x86/platform: Move AMD specific headers to <asm/amd/*.h>
2025-04-13 8:41 [PATCH 0/6] x86/platform: Move AMD specific headers to <asm/amd/*.h> Ingo Molnar
` (5 preceding siblings ...)
2025-04-13 8:41 ` [PATCH 6/6] x86/platform/amd: Move the <asm/amd_node.h> header to <asm/amd/node.h> Ingo Molnar
@ 2025-04-13 9:20 ` Borislav Petkov
2025-04-13 18:35 ` Ingo Molnar
6 siblings, 1 reply; 15+ messages in thread
From: Borislav Petkov @ 2025-04-13 9:20 UTC (permalink / raw)
To: Ingo Molnar, linux-kernel
Cc: Mario Limonciello, H . Peter Anvin, Linus Torvalds,
Peter Zijlstra, Thomas Gleixner
On April 13, 2025 10:41:38 AM GMT+02:00, Ingo Molnar <mingo@kernel.org> wrote:
>Also clean up some details while at it.
>
>The Git tree of these patches can also be found at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/mingo/tip.git WIP.x86/platform
>
>Thanks,
>
> Ingo
>
>===============>
>Ingo Molnar (6):
> x86/platform/amd: Move the <asm/amd-ibs.h> header to <asm/amd/ibs.h>
> x86/platform/amd: Add standard header guards to <asm/amd/ibs.h>
> x86/platform/amd: Move the <asm/amd_nb.h> header to <asm/amd/nb.h>
> x86/platform/amd: Move the <asm/amd_hsmp.h> header to <asm/amd/hsmp.h>
> x86/platform/amd: Clean up the <asm/amd/hsmp.h> header guards a bit
> x86/platform/amd: Move the <asm/amd_node.h> header to <asm/amd/node.h>
>
> Documentation/userspace-api/ioctl/ioctl-number.rst | 2 +-
> MAINTAINERS | 6 +++---
> arch/x86/events/amd/ibs.c | 2 +-
> arch/x86/include/asm/{amd_hsmp.h => amd/hsmp.h} | 4 ++--
> arch/x86/include/asm/{amd-ibs.h => amd/ibs.h} | 5 +++++
> arch/x86/include/asm/{amd_nb.h => amd/nb.h} | 2 +-
> arch/x86/include/asm/{amd_node.h => amd/node.h} | 0
> arch/x86/kernel/amd_gart_64.c | 2 +-
> arch/x86/kernel/amd_nb.c | 2 +-
> arch/x86/kernel/amd_node.c | 2 +-
> arch/x86/kernel/aperture_64.c | 2 +-
> arch/x86/kernel/cpu/cacheinfo.c | 2 +-
> arch/x86/kernel/cpu/mce/inject.c | 2 +-
> arch/x86/mm/amdtopology.c | 2 +-
> arch/x86/mm/numa.c | 2 +-
> arch/x86/pci/amd_bus.c | 2 +-
> arch/x86/pci/fixup.c | 2 +-
> drivers/char/agp/amd64-agp.c | 2 +-
> drivers/edac/amd64_edac.c | 4 ++--
> drivers/hwmon/k10temp.c | 2 +-
> drivers/platform/x86/amd/hsmp/acpi.c | 4 ++--
> drivers/platform/x86/amd/hsmp/hsmp.c | 2 +-
> drivers/platform/x86/amd/hsmp/plat.c | 4 ++--
> drivers/platform/x86/amd/pmc/mp1_stb.c | 2 +-
> drivers/platform/x86/amd/pmc/pmc.c | 2 +-
> drivers/platform/x86/amd/pmf/core.c | 2 +-
> drivers/pnp/quirks.c | 2 +-
> drivers/ras/amd/atl/internal.h | 4 ++--
> sound/soc/amd/acp/acp-rembrandt.c | 2 +-
> sound/soc/amd/acp/acp63.c | 2 +-
> sound/soc/amd/acp/acp70.c | 2 +-
> sound/soc/sof/amd/acp.c | 2 +-
> tools/perf/check-headers.sh | 2 +-
> tools/perf/util/amd-sample-raw.c | 2 +-
> 34 files changed, 44 insertions(+), 39 deletions(-)
> rename arch/x86/include/asm/{amd_hsmp.h => amd/hsmp.h} (91%)
> rename arch/x86/include/asm/{amd-ibs.h => amd/ibs.h} (98%)
> rename arch/x86/include/asm/{amd_nb.h => amd/nb.h} (98%)
> rename arch/x86/include/asm/{amd_node.h => amd/node.h} (100%)
Cool, /me like.
Thx.
--
Sent from a small device: formatting sucks and brevity is inevitable.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 0/6] x86/platform: Move AMD specific headers to <asm/amd/*.h>
2025-04-13 9:20 ` [PATCH 0/6] x86/platform: Move AMD specific headers to <asm/amd/*.h> Borislav Petkov
@ 2025-04-13 18:35 ` Ingo Molnar
0 siblings, 0 replies; 15+ messages in thread
From: Ingo Molnar @ 2025-04-13 18:35 UTC (permalink / raw)
To: Borislav Petkov
Cc: linux-kernel, Mario Limonciello, H . Peter Anvin, Linus Torvalds,
Peter Zijlstra, Thomas Gleixner
* Borislav Petkov <bp@alien8.de> wrote:
> Cool, /me like.
Thx, I turned this into:
Acked-by: Borislav Petkov (AMD) <bp@alien8.de>
:-)
Ingo
^ permalink raw reply [flat|nested] 15+ messages in thread
* [tip: x86/merge] x86/platform/amd: Move the <asm/amd_node.h> header to <asm/amd/node.h>
2025-04-13 8:41 ` [PATCH 6/6] x86/platform/amd: Move the <asm/amd_node.h> header to <asm/amd/node.h> Ingo Molnar
@ 2025-04-14 8:15 ` tip-bot2 for Ingo Molnar
0 siblings, 0 replies; 15+ messages in thread
From: tip-bot2 for Ingo Molnar @ 2025-04-14 8:15 UTC (permalink / raw)
To: linux-tip-commits
Cc: Ingo Molnar, Borislav Petkov (AMD), H. Peter Anvin,
Linus Torvalds, Mario Limonciello, x86, linux-kernel
The following commit has been merged into the x86/merge branch of tip:
Commit-ID: 0a35c9280a9105e601cfe23b7c15522a195fa412
Gitweb: https://git.kernel.org/tip/0a35c9280a9105e601cfe23b7c15522a195fa412
Author: Ingo Molnar <mingo@kernel.org>
AuthorDate: Sun, 13 Apr 2025 10:41:44 +02:00
Committer: Ingo Molnar <mingo@kernel.org>
CommitterDate: Mon, 14 Apr 2025 09:34:17 +02:00
x86/platform/amd: Move the <asm/amd_node.h> header to <asm/amd/node.h>
Collect AMD specific platform header files in <asm/amd/*.h>.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Borislav Petkov (AMD) <bp@alien8.de>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mario Limonciello <superm1@kernel.org>
Link: https://lore.kernel.org/r/20250413084144.3746608-7-mingo@kernel.org
---
MAINTAINERS | 2 +-
arch/x86/include/asm/amd/nb.h | 2 +-
arch/x86/include/asm/amd/node.h | 60 +++++++++++++++++++++++++++-
arch/x86/include/asm/amd_node.h | 60 +---------------------------
arch/x86/kernel/amd_node.c | 2 +-
arch/x86/pci/fixup.c | 2 +-
drivers/edac/amd64_edac.c | 2 +-
drivers/hwmon/k10temp.c | 2 +-
drivers/platform/x86/amd/hsmp/acpi.c | 2 +-
drivers/platform/x86/amd/hsmp/plat.c | 2 +-
drivers/platform/x86/amd/pmc/pmc.c | 2 +-
drivers/platform/x86/amd/pmf/core.c | 2 +-
drivers/ras/amd/atl/internal.h | 2 +-
sound/soc/amd/acp/acp-rembrandt.c | 2 +-
sound/soc/amd/acp/acp63.c | 2 +-
sound/soc/amd/acp/acp70.c | 2 +-
sound/soc/sof/amd/acp.c | 2 +-
17 files changed, 75 insertions(+), 75 deletions(-)
create mode 100644 arch/x86/include/asm/amd/node.h
delete mode 100644 arch/x86/include/asm/amd_node.h
diff --git a/MAINTAINERS b/MAINTAINERS
index d4ea6d7..14bbb43 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1142,7 +1142,7 @@ M: Mario Limonciello <mario.limonciello@amd.com>
M: Yazen Ghannam <yazen.ghannam@amd.com>
L: linux-kernel@vger.kernel.org
S: Supported
-F: arch/x86/include/asm/amd_node.h
+F: arch/x86/include/asm/amd/node.h
F: arch/x86/kernel/amd_node.c
AMD PDS CORE DRIVER
diff --git a/arch/x86/include/asm/amd/nb.h b/arch/x86/include/asm/amd/nb.h
index adfa085..ddb5108 100644
--- a/arch/x86/include/asm/amd/nb.h
+++ b/arch/x86/include/asm/amd/nb.h
@@ -4,7 +4,7 @@
#include <linux/ioport.h>
#include <linux/pci.h>
-#include <asm/amd_node.h>
+#include <asm/amd/node.h>
struct amd_nb_bus_dev_range {
u8 bus;
diff --git a/arch/x86/include/asm/amd/node.h b/arch/x86/include/asm/amd/node.h
new file mode 100644
index 0000000..23fe617
--- /dev/null
+++ b/arch/x86/include/asm/amd/node.h
@@ -0,0 +1,60 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * AMD Node helper functions and common defines
+ *
+ * Copyright (c) 2024, Advanced Micro Devices, Inc.
+ * All Rights Reserved.
+ *
+ * Author: Yazen Ghannam <Yazen.Ghannam@amd.com>
+ *
+ * Note:
+ * Items in this file may only be used in a single place.
+ * However, it's prudent to keep all AMD Node functionality
+ * in a unified place rather than spreading throughout the
+ * kernel.
+ */
+
+#ifndef _ASM_X86_AMD_NODE_H_
+#define _ASM_X86_AMD_NODE_H_
+
+#include <linux/pci.h>
+
+#define MAX_AMD_NUM_NODES 8
+#define AMD_NODE0_PCI_SLOT 0x18
+
+struct pci_dev *amd_node_get_func(u16 node, u8 func);
+struct pci_dev *amd_node_get_root(u16 node);
+
+static inline u16 amd_num_nodes(void)
+{
+ return topology_amd_nodes_per_pkg() * topology_max_packages();
+}
+
+#ifdef CONFIG_AMD_NODE
+int __must_check amd_smn_read(u16 node, u32 address, u32 *value);
+int __must_check amd_smn_write(u16 node, u32 address, u32 value);
+
+/* Should only be used by the HSMP driver. */
+int __must_check amd_smn_hsmp_rdwr(u16 node, u32 address, u32 *value, bool write);
+#else
+static inline int __must_check amd_smn_read(u16 node, u32 address, u32 *value) { return -ENODEV; }
+static inline int __must_check amd_smn_write(u16 node, u32 address, u32 value) { return -ENODEV; }
+
+static inline int __must_check amd_smn_hsmp_rdwr(u16 node, u32 address, u32 *value, bool write)
+{
+ return -ENODEV;
+}
+#endif /* CONFIG_AMD_NODE */
+
+/* helper for use with read_poll_timeout */
+static inline int smn_read_register(u32 reg)
+{
+ int data, rc;
+
+ rc = amd_smn_read(0, reg, &data);
+ if (rc)
+ return rc;
+
+ return data;
+}
+#endif /*_ASM_X86_AMD_NODE_H_*/
diff --git a/arch/x86/include/asm/amd_node.h b/arch/x86/include/asm/amd_node.h
deleted file mode 100644
index 23fe617..0000000
--- a/arch/x86/include/asm/amd_node.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/*
- * AMD Node helper functions and common defines
- *
- * Copyright (c) 2024, Advanced Micro Devices, Inc.
- * All Rights Reserved.
- *
- * Author: Yazen Ghannam <Yazen.Ghannam@amd.com>
- *
- * Note:
- * Items in this file may only be used in a single place.
- * However, it's prudent to keep all AMD Node functionality
- * in a unified place rather than spreading throughout the
- * kernel.
- */
-
-#ifndef _ASM_X86_AMD_NODE_H_
-#define _ASM_X86_AMD_NODE_H_
-
-#include <linux/pci.h>
-
-#define MAX_AMD_NUM_NODES 8
-#define AMD_NODE0_PCI_SLOT 0x18
-
-struct pci_dev *amd_node_get_func(u16 node, u8 func);
-struct pci_dev *amd_node_get_root(u16 node);
-
-static inline u16 amd_num_nodes(void)
-{
- return topology_amd_nodes_per_pkg() * topology_max_packages();
-}
-
-#ifdef CONFIG_AMD_NODE
-int __must_check amd_smn_read(u16 node, u32 address, u32 *value);
-int __must_check amd_smn_write(u16 node, u32 address, u32 value);
-
-/* Should only be used by the HSMP driver. */
-int __must_check amd_smn_hsmp_rdwr(u16 node, u32 address, u32 *value, bool write);
-#else
-static inline int __must_check amd_smn_read(u16 node, u32 address, u32 *value) { return -ENODEV; }
-static inline int __must_check amd_smn_write(u16 node, u32 address, u32 value) { return -ENODEV; }
-
-static inline int __must_check amd_smn_hsmp_rdwr(u16 node, u32 address, u32 *value, bool write)
-{
- return -ENODEV;
-}
-#endif /* CONFIG_AMD_NODE */
-
-/* helper for use with read_poll_timeout */
-static inline int smn_read_register(u32 reg)
-{
- int data, rc;
-
- rc = amd_smn_read(0, reg, &data);
- if (rc)
- return rc;
-
- return data;
-}
-#endif /*_ASM_X86_AMD_NODE_H_*/
diff --git a/arch/x86/kernel/amd_node.c b/arch/x86/kernel/amd_node.c
index b670fa8..a40176b 100644
--- a/arch/x86/kernel/amd_node.c
+++ b/arch/x86/kernel/amd_node.c
@@ -9,7 +9,7 @@
*/
#include <linux/debugfs.h>
-#include <asm/amd_node.h>
+#include <asm/amd/node.h>
/*
* AMD Nodes are a physical collection of I/O devices within an SoC. There can be one
diff --git a/arch/x86/pci/fixup.c b/arch/x86/pci/fixup.c
index efefeb8..3633629 100644
--- a/arch/x86/pci/fixup.c
+++ b/arch/x86/pci/fixup.c
@@ -9,7 +9,7 @@
#include <linux/pci.h>
#include <linux/suspend.h>
#include <linux/vgaarb.h>
-#include <asm/amd_node.h>
+#include <asm/amd/node.h>
#include <asm/hpet.h>
#include <asm/pci_x86.h>
diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c
index 417940f..2518016 100644
--- a/drivers/edac/amd64_edac.c
+++ b/drivers/edac/amd64_edac.c
@@ -3,7 +3,7 @@
#include <linux/string_choices.h>
#include "amd64_edac.h"
#include <asm/amd/nb.h>
-#include <asm/amd_node.h>
+#include <asm/amd/node.h>
static struct edac_pci_ctl_info *pci_ctl;
diff --git a/drivers/hwmon/k10temp.c b/drivers/hwmon/k10temp.c
index 3685906..472bcf6 100644
--- a/drivers/hwmon/k10temp.c
+++ b/drivers/hwmon/k10temp.c
@@ -20,7 +20,7 @@
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/pci_ids.h>
-#include <asm/amd_node.h>
+#include <asm/amd/node.h>
#include <asm/processor.h>
MODULE_DESCRIPTION("AMD Family 10h+ CPU core temperature monitor");
diff --git a/drivers/platform/x86/amd/hsmp/acpi.c b/drivers/platform/x86/amd/hsmp/acpi.c
index 3c7acb9..02e22c1 100644
--- a/drivers/platform/x86/amd/hsmp/acpi.c
+++ b/drivers/platform/x86/amd/hsmp/acpi.c
@@ -23,7 +23,7 @@
#include <uapi/asm-generic/errno-base.h>
-#include <asm/amd_node.h>
+#include <asm/amd/node.h>
#include "hsmp.h"
diff --git a/drivers/platform/x86/amd/hsmp/plat.c b/drivers/platform/x86/amd/hsmp/plat.c
index 0eb73fc..c9a1b1e 100644
--- a/drivers/platform/x86/amd/hsmp/plat.c
+++ b/drivers/platform/x86/amd/hsmp/plat.c
@@ -18,7 +18,7 @@
#include <linux/platform_device.h>
#include <linux/sysfs.h>
-#include <asm/amd_node.h>
+#include <asm/amd/node.h>
#include "hsmp.h"
diff --git a/drivers/platform/x86/amd/pmc/pmc.c b/drivers/platform/x86/amd/pmc/pmc.c
index d789d6c..e5c4e6b 100644
--- a/drivers/platform/x86/amd/pmc/pmc.c
+++ b/drivers/platform/x86/amd/pmc/pmc.c
@@ -28,7 +28,7 @@
#include <linux/seq_file.h>
#include <linux/uaccess.h>
-#include <asm/amd_node.h>
+#include <asm/amd/node.h>
#include "pmc.h"
diff --git a/drivers/platform/x86/amd/pmf/core.c b/drivers/platform/x86/amd/pmf/core.c
index a2cb2d5..cecadae 100644
--- a/drivers/platform/x86/amd/pmf/core.c
+++ b/drivers/platform/x86/amd/pmf/core.c
@@ -14,7 +14,7 @@
#include <linux/pci.h>
#include <linux/platform_device.h>
#include <linux/power_supply.h>
-#include <asm/amd_node.h>
+#include <asm/amd/node.h>
#include "pmf.h"
/* PMF-SMU communication registers */
diff --git a/drivers/ras/amd/atl/internal.h b/drivers/ras/amd/atl/internal.h
index c63fee3..05bbee2 100644
--- a/drivers/ras/amd/atl/internal.h
+++ b/drivers/ras/amd/atl/internal.h
@@ -18,7 +18,7 @@
#include <linux/ras.h>
#include <asm/amd/nb.h>
-#include <asm/amd_node.h>
+#include <asm/amd/node.h>
#include "reg_fields.h"
diff --git a/sound/soc/amd/acp/acp-rembrandt.c b/sound/soc/amd/acp/acp-rembrandt.c
index 746b6ed..c30a7b5 100644
--- a/sound/soc/amd/acp/acp-rembrandt.c
+++ b/sound/soc/amd/acp/acp-rembrandt.c
@@ -22,7 +22,7 @@
#include <linux/pci.h>
#include <linux/pm_runtime.h>
-#include <asm/amd_node.h>
+#include <asm/amd/node.h>
#include "amd.h"
#include "../mach-config.h"
diff --git a/sound/soc/amd/acp/acp63.c b/sound/soc/amd/acp/acp63.c
index 52d895e..0ddde14 100644
--- a/sound/soc/amd/acp/acp63.c
+++ b/sound/soc/amd/acp/acp63.c
@@ -21,7 +21,7 @@
#include <linux/pm_runtime.h>
#include <linux/pci.h>
-#include <asm/amd_node.h>
+#include <asm/amd/node.h>
#include "amd.h"
#include "acp-mach.h"
diff --git a/sound/soc/amd/acp/acp70.c b/sound/soc/amd/acp/acp70.c
index 6d5f5ad..7f4a25b 100644
--- a/sound/soc/amd/acp/acp70.c
+++ b/sound/soc/amd/acp/acp70.c
@@ -23,7 +23,7 @@
#include "amd.h"
#include "acp-mach.h"
-#include <asm/amd_node.h>
+#include <asm/amd/node.h>
#define DRV_NAME "acp_asoc_acp70"
diff --git a/sound/soc/sof/amd/acp.c b/sound/soc/sof/amd/acp.c
index 7c6d647..7e6f107 100644
--- a/sound/soc/sof/amd/acp.c
+++ b/sound/soc/sof/amd/acp.c
@@ -16,7 +16,7 @@
#include <linux/module.h>
#include <linux/pci.h>
-#include <asm/amd_node.h>
+#include <asm/amd/node.h>
#include "../ops.h"
#include "acp.h"
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [tip: x86/merge] x86/platform/amd: Clean up the <asm/amd/hsmp.h> header guards a bit
2025-04-13 8:41 ` [PATCH 5/6] x86/platform/amd: Clean up the <asm/amd/hsmp.h> header guards a bit Ingo Molnar
@ 2025-04-14 8:15 ` tip-bot2 for Ingo Molnar
0 siblings, 0 replies; 15+ messages in thread
From: tip-bot2 for Ingo Molnar @ 2025-04-14 8:15 UTC (permalink / raw)
To: linux-tip-commits
Cc: Ingo Molnar, Borislav Petkov (AMD), Carlos Bilbao, H. Peter Anvin,
Linus Torvalds, Mario Limonciello, Naveen Krishna Chatradhi, x86,
linux-kernel
The following commit has been merged into the x86/merge branch of tip:
Commit-ID: 5bb144e52c666dc0082a90662a5406133415cacc
Gitweb: https://git.kernel.org/tip/5bb144e52c666dc0082a90662a5406133415cacc
Author: Ingo Molnar <mingo@kernel.org>
AuthorDate: Sun, 13 Apr 2025 10:41:43 +02:00
Committer: Ingo Molnar <mingo@kernel.org>
CommitterDate: Mon, 14 Apr 2025 09:34:17 +02:00
x86/platform/amd: Clean up the <asm/amd/hsmp.h> header guards a bit
- There's no need for a newline after the SPDX line
- But there's a need for one before the closing header guard.
Collect AMD specific platform header files in <asm/amd/*.h>.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Borislav Petkov (AMD) <bp@alien8.de>
Cc: Carlos Bilbao <carlos.bilbao@kernel.org>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mario Limonciello <superm1@kernel.org>
Cc: Naveen Krishna Chatradhi <naveenkrishna.chatradhi@amd.com>
Link: https://lore.kernel.org/r/20250413084144.3746608-6-mingo@kernel.org
---
arch/x86/include/asm/amd/hsmp.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/include/asm/amd/hsmp.h b/arch/x86/include/asm/amd/hsmp.h
index 03c2ce3..2137f62 100644
--- a/arch/x86/include/asm/amd/hsmp.h
+++ b/arch/x86/include/asm/amd/hsmp.h
@@ -1,5 +1,4 @@
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
-
#ifndef _ASM_X86_AMD_HSMP_H_
#define _ASM_X86_AMD_HSMP_H_
@@ -13,4 +12,5 @@ static inline int hsmp_send_message(struct hsmp_message *msg)
return -ENODEV;
}
#endif
+
#endif /*_ASM_X86_AMD_HSMP_H_*/
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [tip: x86/merge] x86/platform/amd: Move the <asm/amd_hsmp.h> header to <asm/amd/hsmp.h>
2025-04-13 8:41 ` [PATCH 4/6] x86/platform/amd: Move the <asm/amd_hsmp.h> header to <asm/amd/hsmp.h> Ingo Molnar
@ 2025-04-14 8:15 ` tip-bot2 for Ingo Molnar
0 siblings, 0 replies; 15+ messages in thread
From: tip-bot2 for Ingo Molnar @ 2025-04-14 8:15 UTC (permalink / raw)
To: linux-tip-commits
Cc: Ingo Molnar, Borislav Petkov (AMD), Carlos Bilbao, H. Peter Anvin,
Linus Torvalds, Mario Limonciello, Naveen Krishna Chatradhi, x86,
linux-kernel
The following commit has been merged into the x86/merge branch of tip:
Commit-ID: d96c78684166bc0e7997d12d845882cb5824eed3
Gitweb: https://git.kernel.org/tip/d96c78684166bc0e7997d12d845882cb5824eed3
Author: Ingo Molnar <mingo@kernel.org>
AuthorDate: Sun, 13 Apr 2025 10:41:42 +02:00
Committer: Ingo Molnar <mingo@kernel.org>
CommitterDate: Mon, 14 Apr 2025 09:34:17 +02:00
x86/platform/amd: Move the <asm/amd_hsmp.h> header to <asm/amd/hsmp.h>
Collect AMD specific platform header files in <asm/amd/*.h>.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Borislav Petkov (AMD) <bp@alien8.de>
Cc: Carlos Bilbao <carlos.bilbao@kernel.org>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mario Limonciello <superm1@kernel.org>
Cc: Naveen Krishna Chatradhi <naveenkrishna.chatradhi@amd.com>
Link: https://lore.kernel.org/r/20250413084144.3746608-5-mingo@kernel.org
---
MAINTAINERS | 2 +-
arch/x86/include/asm/amd/hsmp.h | 16 ++++++++++++++++
arch/x86/include/asm/amd_hsmp.h | 16 ----------------
drivers/platform/x86/amd/hsmp/acpi.c | 2 +-
drivers/platform/x86/amd/hsmp/hsmp.c | 2 +-
drivers/platform/x86/amd/hsmp/plat.c | 2 +-
6 files changed, 20 insertions(+), 20 deletions(-)
create mode 100644 arch/x86/include/asm/amd/hsmp.h
delete mode 100644 arch/x86/include/asm/amd_hsmp.h
diff --git a/MAINTAINERS b/MAINTAINERS
index 61b9cc0..d4ea6d7 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1097,7 +1097,7 @@ R: Carlos Bilbao <carlos.bilbao@kernel.org>
L: platform-driver-x86@vger.kernel.org
S: Maintained
F: Documentation/arch/x86/amd_hsmp.rst
-F: arch/x86/include/asm/amd_hsmp.h
+F: arch/x86/include/asm/amd/hsmp.h
F: arch/x86/include/uapi/asm/amd_hsmp.h
F: drivers/platform/x86/amd/hsmp/
diff --git a/arch/x86/include/asm/amd/hsmp.h b/arch/x86/include/asm/amd/hsmp.h
new file mode 100644
index 0000000..03c2ce3
--- /dev/null
+++ b/arch/x86/include/asm/amd/hsmp.h
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
+
+#ifndef _ASM_X86_AMD_HSMP_H_
+#define _ASM_X86_AMD_HSMP_H_
+
+#include <uapi/asm/amd_hsmp.h>
+
+#if IS_ENABLED(CONFIG_AMD_HSMP)
+int hsmp_send_message(struct hsmp_message *msg);
+#else
+static inline int hsmp_send_message(struct hsmp_message *msg)
+{
+ return -ENODEV;
+}
+#endif
+#endif /*_ASM_X86_AMD_HSMP_H_*/
diff --git a/arch/x86/include/asm/amd_hsmp.h b/arch/x86/include/asm/amd_hsmp.h
deleted file mode 100644
index 03c2ce3..0000000
--- a/arch/x86/include/asm/amd_hsmp.h
+++ /dev/null
@@ -1,16 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
-
-#ifndef _ASM_X86_AMD_HSMP_H_
-#define _ASM_X86_AMD_HSMP_H_
-
-#include <uapi/asm/amd_hsmp.h>
-
-#if IS_ENABLED(CONFIG_AMD_HSMP)
-int hsmp_send_message(struct hsmp_message *msg);
-#else
-static inline int hsmp_send_message(struct hsmp_message *msg)
-{
- return -ENODEV;
-}
-#endif
-#endif /*_ASM_X86_AMD_HSMP_H_*/
diff --git a/drivers/platform/x86/amd/hsmp/acpi.c b/drivers/platform/x86/amd/hsmp/acpi.c
index c1eccb3..3c7acb9 100644
--- a/drivers/platform/x86/amd/hsmp/acpi.c
+++ b/drivers/platform/x86/amd/hsmp/acpi.c
@@ -9,7 +9,7 @@
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-#include <asm/amd_hsmp.h>
+#include <asm/amd/hsmp.h>
#include <linux/acpi.h>
#include <linux/device.h>
diff --git a/drivers/platform/x86/amd/hsmp/hsmp.c b/drivers/platform/x86/amd/hsmp/hsmp.c
index a3ac09a..e262e8a 100644
--- a/drivers/platform/x86/amd/hsmp/hsmp.c
+++ b/drivers/platform/x86/amd/hsmp/hsmp.c
@@ -7,7 +7,7 @@
* This file provides a device implementation for HSMP interface
*/
-#include <asm/amd_hsmp.h>
+#include <asm/amd/hsmp.h>
#include <linux/acpi.h>
#include <linux/delay.h>
diff --git a/drivers/platform/x86/amd/hsmp/plat.c b/drivers/platform/x86/amd/hsmp/plat.c
index b9782a0..0eb73fc 100644
--- a/drivers/platform/x86/amd/hsmp/plat.c
+++ b/drivers/platform/x86/amd/hsmp/plat.c
@@ -9,7 +9,7 @@
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-#include <asm/amd_hsmp.h>
+#include <asm/amd/hsmp.h>
#include <linux/build_bug.h>
#include <linux/device.h>
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [tip: x86/merge] x86/platform/amd: Move the <asm/amd_nb.h> header to <asm/amd/nb.h>
2025-04-13 8:41 ` [PATCH 3/6] x86/platform/amd: Move the <asm/amd_nb.h> header to <asm/amd/nb.h> Ingo Molnar
@ 2025-04-14 8:15 ` tip-bot2 for Ingo Molnar
0 siblings, 0 replies; 15+ messages in thread
From: tip-bot2 for Ingo Molnar @ 2025-04-14 8:15 UTC (permalink / raw)
To: linux-tip-commits
Cc: Ingo Molnar, Borislav Petkov (AMD), H. Peter Anvin,
Linus Torvalds, Mario Limonciello, x86, linux-kernel
The following commit has been merged into the x86/merge branch of tip:
Commit-ID: bcbb65559532891148d990527e9df6b8fc98e98d
Gitweb: https://git.kernel.org/tip/bcbb65559532891148d990527e9df6b8fc98e98d
Author: Ingo Molnar <mingo@kernel.org>
AuthorDate: Mon, 14 Apr 2025 09:32:04 +02:00
Committer: Ingo Molnar <mingo@kernel.org>
CommitterDate: Mon, 14 Apr 2025 09:34:14 +02:00
x86/platform/amd: Move the <asm/amd_nb.h> header to <asm/amd/nb.h>
Collect AMD specific platform header files in <asm/amd/*.h>.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Borislav Petkov (AMD) <bp@alien8.de>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mario Limonciello <superm1@kernel.org>
Link: https://lore.kernel.org/r/20250413084144.3746608-4-mingo@kernel.org
---
arch/x86/include/asm/amd/nb.h | 77 ++++++++++++++++++++++++-
arch/x86/include/asm/amd_nb.h | 77 +------------------------
arch/x86/kernel/amd_gart_64.c | 2 +-
arch/x86/kernel/amd_nb.c | 2 +-
arch/x86/kernel/aperture_64.c | 2 +-
arch/x86/kernel/cpu/amd_cache_disable.c | 2 +-
arch/x86/kernel/cpu/cacheinfo.c | 2 +-
arch/x86/kernel/cpu/mce/inject.c | 2 +-
arch/x86/mm/amdtopology.c | 2 +-
arch/x86/mm/numa.c | 2 +-
arch/x86/pci/amd_bus.c | 2 +-
drivers/char/agp/amd64-agp.c | 2 +-
drivers/edac/amd64_edac.c | 2 +-
drivers/platform/x86/amd/pmc/mp1_stb.c | 2 +-
drivers/pnp/quirks.c | 2 +-
drivers/ras/amd/atl/internal.h | 2 +-
16 files changed, 91 insertions(+), 91 deletions(-)
create mode 100644 arch/x86/include/asm/amd/nb.h
delete mode 100644 arch/x86/include/asm/amd_nb.h
diff --git a/arch/x86/include/asm/amd/nb.h b/arch/x86/include/asm/amd/nb.h
new file mode 100644
index 0000000..adfa085
--- /dev/null
+++ b/arch/x86/include/asm/amd/nb.h
@@ -0,0 +1,77 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _ASM_X86_AMD_NB_H
+#define _ASM_X86_AMD_NB_H
+
+#include <linux/ioport.h>
+#include <linux/pci.h>
+#include <asm/amd_node.h>
+
+struct amd_nb_bus_dev_range {
+ u8 bus;
+ u8 dev_base;
+ u8 dev_limit;
+};
+
+extern const struct amd_nb_bus_dev_range amd_nb_bus_dev_ranges[];
+
+extern bool early_is_amd_nb(u32 value);
+extern struct resource *amd_get_mmconfig_range(struct resource *res);
+extern void amd_flush_garts(void);
+extern int amd_numa_init(void);
+extern int amd_get_subcaches(int);
+extern int amd_set_subcaches(int, unsigned long);
+
+struct amd_l3_cache {
+ unsigned indices;
+ u8 subcaches[4];
+};
+
+struct amd_northbridge {
+ struct pci_dev *misc;
+ struct pci_dev *link;
+ struct amd_l3_cache l3_cache;
+};
+
+struct amd_northbridge_info {
+ u16 num;
+ u64 flags;
+ struct amd_northbridge *nb;
+};
+
+#define AMD_NB_GART BIT(0)
+#define AMD_NB_L3_INDEX_DISABLE BIT(1)
+#define AMD_NB_L3_PARTITIONING BIT(2)
+
+#ifdef CONFIG_AMD_NB
+
+u16 amd_nb_num(void);
+bool amd_nb_has_feature(unsigned int feature);
+struct amd_northbridge *node_to_amd_nb(int node);
+
+static inline bool amd_gart_present(void)
+{
+ if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD)
+ return false;
+
+ /* GART present only on Fam15h, up to model 0fh */
+ if (boot_cpu_data.x86 == 0xf || boot_cpu_data.x86 == 0x10 ||
+ (boot_cpu_data.x86 == 0x15 && boot_cpu_data.x86_model < 0x10))
+ return true;
+
+ return false;
+}
+
+#else
+
+#define amd_nb_num(x) 0
+#define amd_nb_has_feature(x) false
+static inline struct amd_northbridge *node_to_amd_nb(int node)
+{
+ return NULL;
+}
+#define amd_gart_present(x) false
+
+#endif
+
+
+#endif /* _ASM_X86_AMD_NB_H */
diff --git a/arch/x86/include/asm/amd_nb.h b/arch/x86/include/asm/amd_nb.h
deleted file mode 100644
index adfa085..0000000
--- a/arch/x86/include/asm/amd_nb.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#ifndef _ASM_X86_AMD_NB_H
-#define _ASM_X86_AMD_NB_H
-
-#include <linux/ioport.h>
-#include <linux/pci.h>
-#include <asm/amd_node.h>
-
-struct amd_nb_bus_dev_range {
- u8 bus;
- u8 dev_base;
- u8 dev_limit;
-};
-
-extern const struct amd_nb_bus_dev_range amd_nb_bus_dev_ranges[];
-
-extern bool early_is_amd_nb(u32 value);
-extern struct resource *amd_get_mmconfig_range(struct resource *res);
-extern void amd_flush_garts(void);
-extern int amd_numa_init(void);
-extern int amd_get_subcaches(int);
-extern int amd_set_subcaches(int, unsigned long);
-
-struct amd_l3_cache {
- unsigned indices;
- u8 subcaches[4];
-};
-
-struct amd_northbridge {
- struct pci_dev *misc;
- struct pci_dev *link;
- struct amd_l3_cache l3_cache;
-};
-
-struct amd_northbridge_info {
- u16 num;
- u64 flags;
- struct amd_northbridge *nb;
-};
-
-#define AMD_NB_GART BIT(0)
-#define AMD_NB_L3_INDEX_DISABLE BIT(1)
-#define AMD_NB_L3_PARTITIONING BIT(2)
-
-#ifdef CONFIG_AMD_NB
-
-u16 amd_nb_num(void);
-bool amd_nb_has_feature(unsigned int feature);
-struct amd_northbridge *node_to_amd_nb(int node);
-
-static inline bool amd_gart_present(void)
-{
- if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD)
- return false;
-
- /* GART present only on Fam15h, up to model 0fh */
- if (boot_cpu_data.x86 == 0xf || boot_cpu_data.x86 == 0x10 ||
- (boot_cpu_data.x86 == 0x15 && boot_cpu_data.x86_model < 0x10))
- return true;
-
- return false;
-}
-
-#else
-
-#define amd_nb_num(x) 0
-#define amd_nb_has_feature(x) false
-static inline struct amd_northbridge *node_to_amd_nb(int node)
-{
- return NULL;
-}
-#define amd_gart_present(x) false
-
-#endif
-
-
-#endif /* _ASM_X86_AMD_NB_H */
diff --git a/arch/x86/kernel/amd_gart_64.c b/arch/x86/kernel/amd_gart_64.c
index c884dec..3485d41 100644
--- a/arch/x86/kernel/amd_gart_64.c
+++ b/arch/x86/kernel/amd_gart_64.c
@@ -39,7 +39,7 @@
#include <asm/gart.h>
#include <asm/set_memory.h>
#include <asm/dma.h>
-#include <asm/amd_nb.h>
+#include <asm/amd/nb.h>
#include <asm/x86_init.h>
static unsigned long iommu_bus_base; /* GART remapping area (physical) */
diff --git a/arch/x86/kernel/amd_nb.c b/arch/x86/kernel/amd_nb.c
index 5a8cc48..ffaad17 100644
--- a/arch/x86/kernel/amd_nb.c
+++ b/arch/x86/kernel/amd_nb.c
@@ -14,7 +14,7 @@
#include <linux/spinlock.h>
#include <linux/pci_ids.h>
-#include <asm/amd_nb.h>
+#include <asm/amd/nb.h>
#include <asm/cpuid.h>
static u32 *flush_words;
diff --git a/arch/x86/kernel/aperture_64.c b/arch/x86/kernel/aperture_64.c
index 89c0c8a..7693211 100644
--- a/arch/x86/kernel/aperture_64.c
+++ b/arch/x86/kernel/aperture_64.c
@@ -29,7 +29,7 @@
#include <asm/gart.h>
#include <asm/pci-direct.h>
#include <asm/dma.h>
-#include <asm/amd_nb.h>
+#include <asm/amd/nb.h>
#include <asm/x86_init.h>
#include <linux/crash_dump.h>
diff --git a/arch/x86/kernel/cpu/amd_cache_disable.c b/arch/x86/kernel/cpu/amd_cache_disable.c
index d860ad3..8843b95 100644
--- a/arch/x86/kernel/cpu/amd_cache_disable.c
+++ b/arch/x86/kernel/cpu/amd_cache_disable.c
@@ -9,7 +9,7 @@
#include <linux/pci.h>
#include <linux/sysfs.h>
-#include <asm/amd_nb.h>
+#include <asm/amd/nb.h>
#include "cpu.h"
diff --git a/arch/x86/kernel/cpu/cacheinfo.c b/arch/x86/kernel/cpu/cacheinfo.c
index cc7ae2b..f866d94 100644
--- a/arch/x86/kernel/cpu/cacheinfo.c
+++ b/arch/x86/kernel/cpu/cacheinfo.c
@@ -13,7 +13,7 @@
#include <linux/cpuhotplug.h>
#include <linux/stop_machine.h>
-#include <asm/amd_nb.h>
+#include <asm/amd/nb.h>
#include <asm/cacheinfo.h>
#include <asm/cpufeature.h>
#include <asm/cpuid.h>
diff --git a/arch/x86/kernel/cpu/mce/inject.c b/arch/x86/kernel/cpu/mce/inject.c
index 06e3cf7..bb060f8 100644
--- a/arch/x86/kernel/cpu/mce/inject.c
+++ b/arch/x86/kernel/cpu/mce/inject.c
@@ -24,7 +24,7 @@
#include <linux/pci.h>
#include <linux/uaccess.h>
-#include <asm/amd_nb.h>
+#include <asm/amd/nb.h>
#include <asm/apic.h>
#include <asm/irq_vectors.h>
#include <asm/mce.h>
diff --git a/arch/x86/mm/amdtopology.c b/arch/x86/mm/amdtopology.c
index 628833a..f980b0e 100644
--- a/arch/x86/mm/amdtopology.c
+++ b/arch/x86/mm/amdtopology.c
@@ -25,7 +25,7 @@
#include <asm/numa.h>
#include <asm/mpspec.h>
#include <asm/apic.h>
-#include <asm/amd_nb.h>
+#include <asm/amd/nb.h>
static unsigned char __initdata nodeids[8];
diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c
index 64e5cdb..fed02d1 100644
--- a/arch/x86/mm/numa.c
+++ b/arch/x86/mm/numa.c
@@ -18,7 +18,7 @@
#include <asm/e820/api.h>
#include <asm/proto.h>
#include <asm/dma.h>
-#include <asm/amd_nb.h>
+#include <asm/amd/nb.h>
#include "numa_internal.h"
diff --git a/arch/x86/pci/amd_bus.c b/arch/x86/pci/amd_bus.c
index 631512f..95ae197 100644
--- a/arch/x86/pci/amd_bus.c
+++ b/arch/x86/pci/amd_bus.c
@@ -5,7 +5,7 @@
#include <linux/cpu.h>
#include <linux/range.h>
-#include <asm/amd_nb.h>
+#include <asm/amd/nb.h>
#include <asm/pci_x86.h>
#include <asm/pci-direct.h>
diff --git a/drivers/char/agp/amd64-agp.c b/drivers/char/agp/amd64-agp.c
index 8e41731..bf49096 100644
--- a/drivers/char/agp/amd64-agp.c
+++ b/drivers/char/agp/amd64-agp.c
@@ -16,7 +16,7 @@
#include <linux/mmzone.h>
#include <asm/page.h> /* PAGE_SIZE */
#include <asm/e820/api.h>
-#include <asm/amd_nb.h>
+#include <asm/amd/nb.h>
#include <asm/gart.h>
#include "agp.h"
diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c
index 90f0eb7..417940f 100644
--- a/drivers/edac/amd64_edac.c
+++ b/drivers/edac/amd64_edac.c
@@ -2,7 +2,7 @@
#include <linux/ras.h>
#include <linux/string_choices.h>
#include "amd64_edac.h"
-#include <asm/amd_nb.h>
+#include <asm/amd/nb.h>
#include <asm/amd_node.h>
static struct edac_pci_ctl_info *pci_ctl;
diff --git a/drivers/platform/x86/amd/pmc/mp1_stb.c b/drivers/platform/x86/amd/pmc/mp1_stb.c
index c005f00..3b9b9f3 100644
--- a/drivers/platform/x86/amd/pmc/mp1_stb.c
+++ b/drivers/platform/x86/amd/pmc/mp1_stb.c
@@ -11,7 +11,7 @@
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-#include <asm/amd_nb.h>
+#include <asm/amd/nb.h>
#include <linux/debugfs.h>
#include <linux/seq_file.h>
#include <linux/uaccess.h>
diff --git a/drivers/pnp/quirks.c b/drivers/pnp/quirks.c
index 6085a14..6e1d4bf 100644
--- a/drivers/pnp/quirks.c
+++ b/drivers/pnp/quirks.c
@@ -290,7 +290,7 @@ static void quirk_system_pci_resources(struct pnp_dev *dev)
#ifdef CONFIG_AMD_NB
-#include <asm/amd_nb.h>
+#include <asm/amd/nb.h>
static void quirk_amd_mmconfig_area(struct pnp_dev *dev)
{
diff --git a/drivers/ras/amd/atl/internal.h b/drivers/ras/amd/atl/internal.h
index f9be26d..c63fee3 100644
--- a/drivers/ras/amd/atl/internal.h
+++ b/drivers/ras/amd/atl/internal.h
@@ -17,7 +17,7 @@
#include <linux/bitops.h>
#include <linux/ras.h>
-#include <asm/amd_nb.h>
+#include <asm/amd/nb.h>
#include <asm/amd_node.h>
#include "reg_fields.h"
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [tip: x86/merge] x86/platform/amd: Add standard header guards to <asm/amd/ibs.h>
2025-04-13 8:41 ` [PATCH 2/6] x86/platform/amd: Add standard header guards " Ingo Molnar
@ 2025-04-14 8:15 ` tip-bot2 for Ingo Molnar
0 siblings, 0 replies; 15+ messages in thread
From: tip-bot2 for Ingo Molnar @ 2025-04-14 8:15 UTC (permalink / raw)
To: linux-tip-commits
Cc: Ingo Molnar, Borislav Petkov (AMD), H. Peter Anvin,
Linus Torvalds, Mario Limonciello, x86, linux-kernel
The following commit has been merged into the x86/merge branch of tip:
Commit-ID: 861c6b1185fbb2e3fa158aa3aca75d2f767db2a8
Gitweb: https://git.kernel.org/tip/861c6b1185fbb2e3fa158aa3aca75d2f767db2a8
Author: Ingo Molnar <mingo@kernel.org>
AuthorDate: Sun, 13 Apr 2025 10:41:40 +02:00
Committer: Ingo Molnar <mingo@kernel.org>
CommitterDate: Mon, 14 Apr 2025 09:31:47 +02:00
x86/platform/amd: Add standard header guards to <asm/amd/ibs.h>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Borislav Petkov (AMD) <bp@alien8.de>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mario Limonciello <superm1@kernel.org>
Link: https://lore.kernel.org/r/20250413084144.3746608-3-mingo@kernel.org
---
arch/x86/include/asm/amd/ibs.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/x86/include/asm/amd/ibs.h b/arch/x86/include/asm/amd/ibs.h
index 77f3a58..3ee5903 100644
--- a/arch/x86/include/asm/amd/ibs.h
+++ b/arch/x86/include/asm/amd/ibs.h
@@ -1,4 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _ASM_X86_AMD_IBS_H
+#define _ASM_X86_AMD_IBS_H
+
/*
* From PPR Vol 1 for AMD Family 19h Model 01h B1
* 55898 Rev 0.35 - Feb 5, 2021
@@ -151,3 +154,5 @@ struct perf_ibs_data {
};
u64 regs[MSR_AMD64_IBS_REG_COUNT_MAX];
};
+
+#endif /* _ASM_X86_AMD_IBS_H */
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [tip: x86/merge] x86/platform/amd: Move the <asm/amd-ibs.h> header to <asm/amd/ibs.h>
2025-04-13 8:41 ` [PATCH 1/6] x86/platform/amd: Move the <asm/amd-ibs.h> header to <asm/amd/ibs.h> Ingo Molnar
@ 2025-04-14 8:15 ` tip-bot2 for Ingo Molnar
0 siblings, 0 replies; 15+ messages in thread
From: tip-bot2 for Ingo Molnar @ 2025-04-14 8:15 UTC (permalink / raw)
To: linux-tip-commits
Cc: Ingo Molnar, Borislav Petkov (AMD), H. Peter Anvin,
Linus Torvalds, Mario Limonciello, x86, linux-kernel
The following commit has been merged into the x86/merge branch of tip:
Commit-ID: 3846389c03a8518884f09056611619bd1461ffc7
Gitweb: https://git.kernel.org/tip/3846389c03a8518884f09056611619bd1461ffc7
Author: Ingo Molnar <mingo@kernel.org>
AuthorDate: Sun, 13 Apr 2025 10:41:39 +02:00
Committer: Ingo Molnar <mingo@kernel.org>
CommitterDate: Mon, 14 Apr 2025 09:31:47 +02:00
x86/platform/amd: Move the <asm/amd-ibs.h> header to <asm/amd/ibs.h>
Collect AMD specific platform header files in <asm/amd/*.h>.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Borislav Petkov (AMD) <bp@alien8.de>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mario Limonciello <superm1@kernel.org>
Link: https://lore.kernel.org/r/20250413084144.3746608-2-mingo@kernel.org
---
arch/x86/events/amd/ibs.c | 2 +-
arch/x86/include/asm/amd-ibs.h | 153 +------------------------------
arch/x86/include/asm/amd/ibs.h | 153 ++++++++++++++++++++++++++++++-
| 2 +-
tools/perf/util/amd-sample-raw.c | 2 +-
5 files changed, 156 insertions(+), 156 deletions(-)
delete mode 100644 arch/x86/include/asm/amd-ibs.h
create mode 100644 arch/x86/include/asm/amd/ibs.h
diff --git a/arch/x86/events/amd/ibs.c b/arch/x86/events/amd/ibs.c
index 0252b7e..1726199 100644
--- a/arch/x86/events/amd/ibs.c
+++ b/arch/x86/events/amd/ibs.c
@@ -26,7 +26,7 @@ static u32 ibs_caps;
#include <linux/hardirq.h>
#include <asm/nmi.h>
-#include <asm/amd-ibs.h>
+#include <asm/amd/ibs.h>
/* attr.config2 */
#define IBS_SW_FILTER_MASK 1
diff --git a/arch/x86/include/asm/amd-ibs.h b/arch/x86/include/asm/amd-ibs.h
deleted file mode 100644
index 77f3a58..0000000
--- a/arch/x86/include/asm/amd-ibs.h
+++ /dev/null
@@ -1,153 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/*
- * From PPR Vol 1 for AMD Family 19h Model 01h B1
- * 55898 Rev 0.35 - Feb 5, 2021
- */
-
-#include <asm/msr-index.h>
-
-/* IBS_OP_DATA2 DataSrc */
-#define IBS_DATA_SRC_LOC_CACHE 2
-#define IBS_DATA_SRC_DRAM 3
-#define IBS_DATA_SRC_REM_CACHE 4
-#define IBS_DATA_SRC_IO 7
-
-/* IBS_OP_DATA2 DataSrc Extension */
-#define IBS_DATA_SRC_EXT_LOC_CACHE 1
-#define IBS_DATA_SRC_EXT_NEAR_CCX_CACHE 2
-#define IBS_DATA_SRC_EXT_DRAM 3
-#define IBS_DATA_SRC_EXT_FAR_CCX_CACHE 5
-#define IBS_DATA_SRC_EXT_PMEM 6
-#define IBS_DATA_SRC_EXT_IO 7
-#define IBS_DATA_SRC_EXT_EXT_MEM 8
-#define IBS_DATA_SRC_EXT_PEER_AGENT_MEM 12
-
-/*
- * IBS Hardware MSRs
- */
-
-/* MSR 0xc0011030: IBS Fetch Control */
-union ibs_fetch_ctl {
- __u64 val;
- struct {
- __u64 fetch_maxcnt:16,/* 0-15: instruction fetch max. count */
- fetch_cnt:16, /* 16-31: instruction fetch count */
- fetch_lat:16, /* 32-47: instruction fetch latency */
- fetch_en:1, /* 48: instruction fetch enable */
- fetch_val:1, /* 49: instruction fetch valid */
- fetch_comp:1, /* 50: instruction fetch complete */
- ic_miss:1, /* 51: i-cache miss */
- phy_addr_valid:1,/* 52: physical address valid */
- l1tlb_pgsz:2, /* 53-54: i-cache L1TLB page size
- * (needs IbsPhyAddrValid) */
- l1tlb_miss:1, /* 55: i-cache fetch missed in L1TLB */
- l2tlb_miss:1, /* 56: i-cache fetch missed in L2TLB */
- rand_en:1, /* 57: random tagging enable */
- fetch_l2_miss:1,/* 58: L2 miss for sampled fetch
- * (needs IbsFetchComp) */
- l3_miss_only:1, /* 59: Collect L3 miss samples only */
- fetch_oc_miss:1,/* 60: Op cache miss for the sampled fetch */
- fetch_l3_miss:1,/* 61: L3 cache miss for the sampled fetch */
- reserved:2; /* 62-63: reserved */
- };
-};
-
-/* MSR 0xc0011033: IBS Execution Control */
-union ibs_op_ctl {
- __u64 val;
- struct {
- __u64 opmaxcnt:16, /* 0-15: periodic op max. count */
- l3_miss_only:1, /* 16: Collect L3 miss samples only */
- op_en:1, /* 17: op sampling enable */
- op_val:1, /* 18: op sample valid */
- cnt_ctl:1, /* 19: periodic op counter control */
- opmaxcnt_ext:7, /* 20-26: upper 7 bits of periodic op maximum count */
- reserved0:5, /* 27-31: reserved */
- opcurcnt:27, /* 32-58: periodic op counter current count */
- ldlat_thrsh:4, /* 59-62: Load Latency threshold */
- ldlat_en:1; /* 63: Load Latency enabled */
- };
-};
-
-/* MSR 0xc0011035: IBS Op Data 1 */
-union ibs_op_data {
- __u64 val;
- struct {
- __u64 comp_to_ret_ctr:16, /* 0-15: op completion to retire count */
- tag_to_ret_ctr:16, /* 15-31: op tag to retire count */
- reserved1:2, /* 32-33: reserved */
- op_return:1, /* 34: return op */
- op_brn_taken:1, /* 35: taken branch op */
- op_brn_misp:1, /* 36: mispredicted branch op */
- op_brn_ret:1, /* 37: branch op retired */
- op_rip_invalid:1, /* 38: RIP is invalid */
- op_brn_fuse:1, /* 39: fused branch op */
- op_microcode:1, /* 40: microcode op */
- reserved2:23; /* 41-63: reserved */
- };
-};
-
-/* MSR 0xc0011036: IBS Op Data 2 */
-union ibs_op_data2 {
- __u64 val;
- struct {
- __u64 data_src_lo:3, /* 0-2: data source low */
- reserved0:1, /* 3: reserved */
- rmt_node:1, /* 4: destination node */
- cache_hit_st:1, /* 5: cache hit state */
- data_src_hi:2, /* 6-7: data source high */
- reserved1:56; /* 8-63: reserved */
- };
-};
-
-/* MSR 0xc0011037: IBS Op Data 3 */
-union ibs_op_data3 {
- __u64 val;
- struct {
- __u64 ld_op:1, /* 0: load op */
- st_op:1, /* 1: store op */
- dc_l1tlb_miss:1, /* 2: data cache L1TLB miss */
- dc_l2tlb_miss:1, /* 3: data cache L2TLB hit in 2M page */
- dc_l1tlb_hit_2m:1, /* 4: data cache L1TLB hit in 2M page */
- dc_l1tlb_hit_1g:1, /* 5: data cache L1TLB hit in 1G page */
- dc_l2tlb_hit_2m:1, /* 6: data cache L2TLB hit in 2M page */
- dc_miss:1, /* 7: data cache miss */
- dc_mis_acc:1, /* 8: misaligned access */
- reserved:4, /* 9-12: reserved */
- dc_wc_mem_acc:1, /* 13: write combining memory access */
- dc_uc_mem_acc:1, /* 14: uncacheable memory access */
- dc_locked_op:1, /* 15: locked operation */
- dc_miss_no_mab_alloc:1, /* 16: DC miss with no MAB allocated */
- dc_lin_addr_valid:1, /* 17: data cache linear address valid */
- dc_phy_addr_valid:1, /* 18: data cache physical address valid */
- dc_l2_tlb_hit_1g:1, /* 19: data cache L2 hit in 1GB page */
- l2_miss:1, /* 20: L2 cache miss */
- sw_pf:1, /* 21: software prefetch */
- op_mem_width:4, /* 22-25: load/store size in bytes */
- op_dc_miss_open_mem_reqs:6, /* 26-31: outstanding mem reqs on DC fill */
- dc_miss_lat:16, /* 32-47: data cache miss latency */
- tlb_refill_lat:16; /* 48-63: L1 TLB refill latency */
- };
-};
-
-/* MSR 0xc001103c: IBS Fetch Control Extended */
-union ic_ibs_extd_ctl {
- __u64 val;
- struct {
- __u64 itlb_refill_lat:16, /* 0-15: ITLB Refill latency for sampled fetch */
- reserved:48; /* 16-63: reserved */
- };
-};
-
-/*
- * IBS driver related
- */
-
-struct perf_ibs_data {
- u32 size;
- union {
- u32 data[0]; /* data buffer starts here */
- u32 caps;
- };
- u64 regs[MSR_AMD64_IBS_REG_COUNT_MAX];
-};
diff --git a/arch/x86/include/asm/amd/ibs.h b/arch/x86/include/asm/amd/ibs.h
new file mode 100644
index 0000000..77f3a58
--- /dev/null
+++ b/arch/x86/include/asm/amd/ibs.h
@@ -0,0 +1,153 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * From PPR Vol 1 for AMD Family 19h Model 01h B1
+ * 55898 Rev 0.35 - Feb 5, 2021
+ */
+
+#include <asm/msr-index.h>
+
+/* IBS_OP_DATA2 DataSrc */
+#define IBS_DATA_SRC_LOC_CACHE 2
+#define IBS_DATA_SRC_DRAM 3
+#define IBS_DATA_SRC_REM_CACHE 4
+#define IBS_DATA_SRC_IO 7
+
+/* IBS_OP_DATA2 DataSrc Extension */
+#define IBS_DATA_SRC_EXT_LOC_CACHE 1
+#define IBS_DATA_SRC_EXT_NEAR_CCX_CACHE 2
+#define IBS_DATA_SRC_EXT_DRAM 3
+#define IBS_DATA_SRC_EXT_FAR_CCX_CACHE 5
+#define IBS_DATA_SRC_EXT_PMEM 6
+#define IBS_DATA_SRC_EXT_IO 7
+#define IBS_DATA_SRC_EXT_EXT_MEM 8
+#define IBS_DATA_SRC_EXT_PEER_AGENT_MEM 12
+
+/*
+ * IBS Hardware MSRs
+ */
+
+/* MSR 0xc0011030: IBS Fetch Control */
+union ibs_fetch_ctl {
+ __u64 val;
+ struct {
+ __u64 fetch_maxcnt:16,/* 0-15: instruction fetch max. count */
+ fetch_cnt:16, /* 16-31: instruction fetch count */
+ fetch_lat:16, /* 32-47: instruction fetch latency */
+ fetch_en:1, /* 48: instruction fetch enable */
+ fetch_val:1, /* 49: instruction fetch valid */
+ fetch_comp:1, /* 50: instruction fetch complete */
+ ic_miss:1, /* 51: i-cache miss */
+ phy_addr_valid:1,/* 52: physical address valid */
+ l1tlb_pgsz:2, /* 53-54: i-cache L1TLB page size
+ * (needs IbsPhyAddrValid) */
+ l1tlb_miss:1, /* 55: i-cache fetch missed in L1TLB */
+ l2tlb_miss:1, /* 56: i-cache fetch missed in L2TLB */
+ rand_en:1, /* 57: random tagging enable */
+ fetch_l2_miss:1,/* 58: L2 miss for sampled fetch
+ * (needs IbsFetchComp) */
+ l3_miss_only:1, /* 59: Collect L3 miss samples only */
+ fetch_oc_miss:1,/* 60: Op cache miss for the sampled fetch */
+ fetch_l3_miss:1,/* 61: L3 cache miss for the sampled fetch */
+ reserved:2; /* 62-63: reserved */
+ };
+};
+
+/* MSR 0xc0011033: IBS Execution Control */
+union ibs_op_ctl {
+ __u64 val;
+ struct {
+ __u64 opmaxcnt:16, /* 0-15: periodic op max. count */
+ l3_miss_only:1, /* 16: Collect L3 miss samples only */
+ op_en:1, /* 17: op sampling enable */
+ op_val:1, /* 18: op sample valid */
+ cnt_ctl:1, /* 19: periodic op counter control */
+ opmaxcnt_ext:7, /* 20-26: upper 7 bits of periodic op maximum count */
+ reserved0:5, /* 27-31: reserved */
+ opcurcnt:27, /* 32-58: periodic op counter current count */
+ ldlat_thrsh:4, /* 59-62: Load Latency threshold */
+ ldlat_en:1; /* 63: Load Latency enabled */
+ };
+};
+
+/* MSR 0xc0011035: IBS Op Data 1 */
+union ibs_op_data {
+ __u64 val;
+ struct {
+ __u64 comp_to_ret_ctr:16, /* 0-15: op completion to retire count */
+ tag_to_ret_ctr:16, /* 15-31: op tag to retire count */
+ reserved1:2, /* 32-33: reserved */
+ op_return:1, /* 34: return op */
+ op_brn_taken:1, /* 35: taken branch op */
+ op_brn_misp:1, /* 36: mispredicted branch op */
+ op_brn_ret:1, /* 37: branch op retired */
+ op_rip_invalid:1, /* 38: RIP is invalid */
+ op_brn_fuse:1, /* 39: fused branch op */
+ op_microcode:1, /* 40: microcode op */
+ reserved2:23; /* 41-63: reserved */
+ };
+};
+
+/* MSR 0xc0011036: IBS Op Data 2 */
+union ibs_op_data2 {
+ __u64 val;
+ struct {
+ __u64 data_src_lo:3, /* 0-2: data source low */
+ reserved0:1, /* 3: reserved */
+ rmt_node:1, /* 4: destination node */
+ cache_hit_st:1, /* 5: cache hit state */
+ data_src_hi:2, /* 6-7: data source high */
+ reserved1:56; /* 8-63: reserved */
+ };
+};
+
+/* MSR 0xc0011037: IBS Op Data 3 */
+union ibs_op_data3 {
+ __u64 val;
+ struct {
+ __u64 ld_op:1, /* 0: load op */
+ st_op:1, /* 1: store op */
+ dc_l1tlb_miss:1, /* 2: data cache L1TLB miss */
+ dc_l2tlb_miss:1, /* 3: data cache L2TLB hit in 2M page */
+ dc_l1tlb_hit_2m:1, /* 4: data cache L1TLB hit in 2M page */
+ dc_l1tlb_hit_1g:1, /* 5: data cache L1TLB hit in 1G page */
+ dc_l2tlb_hit_2m:1, /* 6: data cache L2TLB hit in 2M page */
+ dc_miss:1, /* 7: data cache miss */
+ dc_mis_acc:1, /* 8: misaligned access */
+ reserved:4, /* 9-12: reserved */
+ dc_wc_mem_acc:1, /* 13: write combining memory access */
+ dc_uc_mem_acc:1, /* 14: uncacheable memory access */
+ dc_locked_op:1, /* 15: locked operation */
+ dc_miss_no_mab_alloc:1, /* 16: DC miss with no MAB allocated */
+ dc_lin_addr_valid:1, /* 17: data cache linear address valid */
+ dc_phy_addr_valid:1, /* 18: data cache physical address valid */
+ dc_l2_tlb_hit_1g:1, /* 19: data cache L2 hit in 1GB page */
+ l2_miss:1, /* 20: L2 cache miss */
+ sw_pf:1, /* 21: software prefetch */
+ op_mem_width:4, /* 22-25: load/store size in bytes */
+ op_dc_miss_open_mem_reqs:6, /* 26-31: outstanding mem reqs on DC fill */
+ dc_miss_lat:16, /* 32-47: data cache miss latency */
+ tlb_refill_lat:16; /* 48-63: L1 TLB refill latency */
+ };
+};
+
+/* MSR 0xc001103c: IBS Fetch Control Extended */
+union ic_ibs_extd_ctl {
+ __u64 val;
+ struct {
+ __u64 itlb_refill_lat:16, /* 0-15: ITLB Refill latency for sampled fetch */
+ reserved:48; /* 16-63: reserved */
+ };
+};
+
+/*
+ * IBS driver related
+ */
+
+struct perf_ibs_data {
+ u32 size;
+ union {
+ u32 data[0]; /* data buffer starts here */
+ u32 caps;
+ };
+ u64 regs[MSR_AMD64_IBS_REG_COUNT_MAX];
+};
--git a/tools/perf/check-headers.sh b/tools/perf/check-headers.sh
index a4499e5..493a138 100755
--- a/tools/perf/check-headers.sh
+++ b/tools/perf/check-headers.sh
@@ -185,7 +185,7 @@ done
# diff with extra ignore lines
check arch/x86/lib/memcpy_64.S '-I "^EXPORT_SYMBOL" -I "^#include <asm/export.h>" -I"^SYM_FUNC_START\(_LOCAL\)*(memcpy_\(erms\|orig\))" -I"^#include <linux/cfi_types.h>"'
check arch/x86/lib/memset_64.S '-I "^EXPORT_SYMBOL" -I "^#include <asm/export.h>" -I"^SYM_FUNC_START\(_LOCAL\)*(memset_\(erms\|orig\))"'
-check arch/x86/include/asm/amd-ibs.h '-I "^#include [<\"]\(asm/\)*msr-index.h"'
+check arch/x86/include/asm/amd/ibs.h '-I "^#include [<\"]\(asm/\)*msr-index.h"'
check arch/arm64/include/asm/cputype.h '-I "^#include [<\"]\(asm/\)*sysreg.h"'
check include/linux/unaligned.h '-I "^#include <linux/unaligned/packed_struct.h>" -I "^#include <asm/byteorder.h>" -I "^#pragma GCC diagnostic"'
check include/uapi/asm-generic/mman.h '-I "^#include <\(uapi/\)*asm-generic/mman-common\(-tools\)*.h>"'
diff --git a/tools/perf/util/amd-sample-raw.c b/tools/perf/util/amd-sample-raw.c
index 9d0ce88..456ce64 100644
--- a/tools/perf/util/amd-sample-raw.c
+++ b/tools/perf/util/amd-sample-raw.c
@@ -9,7 +9,7 @@
#include <inttypes.h>
#include <linux/string.h>
-#include "../../arch/x86/include/asm/amd-ibs.h"
+#include "../../arch/x86/include/asm/amd/ibs.h"
#include "debug.h"
#include "session.h"
^ permalink raw reply related [flat|nested] 15+ messages in thread
end of thread, other threads:[~2025-04-14 8:15 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-13 8:41 [PATCH 0/6] x86/platform: Move AMD specific headers to <asm/amd/*.h> Ingo Molnar
2025-04-13 8:41 ` [PATCH 1/6] x86/platform/amd: Move the <asm/amd-ibs.h> header to <asm/amd/ibs.h> Ingo Molnar
2025-04-14 8:15 ` [tip: x86/merge] " tip-bot2 for Ingo Molnar
2025-04-13 8:41 ` [PATCH 2/6] x86/platform/amd: Add standard header guards " Ingo Molnar
2025-04-14 8:15 ` [tip: x86/merge] " tip-bot2 for Ingo Molnar
2025-04-13 8:41 ` [PATCH 3/6] x86/platform/amd: Move the <asm/amd_nb.h> header to <asm/amd/nb.h> Ingo Molnar
2025-04-14 8:15 ` [tip: x86/merge] " tip-bot2 for Ingo Molnar
2025-04-13 8:41 ` [PATCH 4/6] x86/platform/amd: Move the <asm/amd_hsmp.h> header to <asm/amd/hsmp.h> Ingo Molnar
2025-04-14 8:15 ` [tip: x86/merge] " tip-bot2 for Ingo Molnar
2025-04-13 8:41 ` [PATCH 5/6] x86/platform/amd: Clean up the <asm/amd/hsmp.h> header guards a bit Ingo Molnar
2025-04-14 8:15 ` [tip: x86/merge] " tip-bot2 for Ingo Molnar
2025-04-13 8:41 ` [PATCH 6/6] x86/platform/amd: Move the <asm/amd_node.h> header to <asm/amd/node.h> Ingo Molnar
2025-04-14 8:15 ` [tip: x86/merge] " tip-bot2 for Ingo Molnar
2025-04-13 9:20 ` [PATCH 0/6] x86/platform: Move AMD specific headers to <asm/amd/*.h> Borislav Petkov
2025-04-13 18:35 ` Ingo Molnar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox