Skip to contentSkip to conversation

iommu/amd: Use MAX buffer size when SNP is enabled on Family 0x19

PATCH Applied Vasant Hegde 6 participants 14 messages Apr 20 – Aug 26

Subsystems (2)
lore
Share & tools
lore

Vasant Hegde

author maintainer
#0 lore raw

cover iommu/amd: Use MAX buffer size when SNP is enabled on Family 0x19

This series addresses CVE-2023-20585 [1] by increasing the AMD IOMMU Event log and PPR log buffer sizes to the maximum supported value (512K) on affected CPU families when SNP is enabled.

Use MAX buffer size when SNP is enabled on Milan/Genoa. Impacted buffers:
- Milan : Event log (PPR/GALog is not supported when SNP is enabled)
- Genoa : Event and PPR log (GALog is not supported when SNP is enabled)

[1] https://www.amd.com/en/resources/product-security/bulletin/amd-sb-3016.html

Cc Borislav Petkov <[email protected]>
Cc Suravee Suthikulpanit <[email protected]>
Cc Joerg Roedel <[email protected]>

Vasant Hegde (2):
iommu/amd: Use maximum Event log buffer size when SNP is enabled on Family 0x19 iommu/amd: Use maximum PPR log buffer size when SNP is enabled on Family 0x19

 drivers/iommu/amd/amd_iommu.h       |   3 +
 drivers/iommu/amd/amd_iommu_types.h |  21 +++--
 drivers/iommu/amd/init.c            | 123 ++++++++++++++++++++--------
 drivers/iommu/amd/iommu.c           |   2 +-
 drivers/iommu/amd/ppr.c             |   8 +-
 5 files changed, 110 insertions(+), 47 deletions(-)
Signature · 1 line
2.31.1
author maintainer
#1 lore raw

PATCH 1/2 iommu/amd: Use maximum Event log buffer size when SNP is enabled on Family 0x19

Due to CVE-2023-20585, the Event log buffer must use the maximum supported size (512K) on Milan/Genoa (Family 0x19) systems when SNP is enabled, to mitigate a potential security vulnerability. All other systems continue to use the default Event log buffer size (8K).

Apply the errata fix by making the following changes:

* Introduce new global variable (amd_iommu_evtlog_size) to have event log buffer size. Adjust variable size for family 0x19.

* Since 'iommu_snp_enable()' must be called after the core IOMMU subsystem is initialized, it cannot be moved to the early init stage. The SNP errata must also be applied after the 'iommu_snp_enable()' check. Therefore, 'alloc_event_buffer()' and 'iommu_enable_event_buffer()' are now called in the IOMMU_ENABLED state, after the errata is applied.

* Adjust alloc_event_buffer() and iommu_enable_event_buffer() to handle all IOMMU instances.

* Also rename EVT_* macros to make it more readable.

---
 drivers/iommu/amd/amd_iommu.h       |   2 +
 drivers/iommu/amd/amd_iommu_types.h |  10 ++-
 drivers/iommu/amd/init.c            | 110 +++++++++++++++++++---------
 drivers/iommu/amd/iommu.c           |   2 +-
 4 files changed, 86 insertions(+), 38 deletions(-)
drivers/iommu/amd/amd_iommu.h +2 -0
index 1342e764a548..f1c486dcf0f3 100644
@@ -11,6 +11,8 @@
 
 #include "amd_iommu_types.h"
 
+extern int amd_iommu_evtlog_size;
+
 irqreturn_t amd_iommu_int_thread(int irq, void *data);
 irqreturn_t amd_iommu_int_thread_evtlog(int irq, void *data);
 irqreturn_t amd_iommu_int_thread_pprlog(int irq, void *data);
drivers/iommu/amd/amd_iommu_types.h +7 -3
index c685d3771436..c3430c09bc5c 100644
@@ -15,6 +15,7 @@
 #include <linux/mutex.h>
 #include <linux/msi.h>
 #include <linux/list.h>
+#include <linux/sizes.h>
 #include <linux/spinlock.h>
 #include <linux/pci.h>
 #include <linux/iommufd.h>
@@ -141,7 +142,6 @@
 #define MMIO_STATUS_GALOG_INT_MASK		BIT(10)
 
 /* event logging constants */
-#define EVENT_ENTRY_SIZE	0x10
 #define EVENT_TYPE_SHIFT	28
 #define EVENT_TYPE_MASK		0xf
 #define EVENT_TYPE_ILL_DEV	0x1
@@ -259,8 +259,12 @@
 #define MMIO_CMD_BUFFER_TAIL(x) FIELD_GET(MMIO_CMD_TAIL_MASK, (x))
 
 /* constants for event buffer handling */
-#define EVT_BUFFER_SIZE		8192 /* 512 entries */
-#define EVT_LEN_MASK		(0x9ULL << 56)
+#define EVTLOG_ENTRY_SIZE	0x10
+#define EVTLOG_SIZE_SHIFT	56
+#define EVTLOG_SIZE_DEF		SZ_8K /* 512 entries */
+#define EVTLOG_LEN_MASK_DEF	(0x9ULL << EVTLOG_SIZE_SHIFT)
+#define EVTLOG_SIZE_MAX		SZ_512K /* 32K entries */
+#define EVTLOG_LEN_MASK_MAX	(0xFULL << EVTLOG_SIZE_SHIFT)
 
 /* Constants for PPR Log handling */
 #define PPR_LOG_ENTRIES		512
drivers/iommu/amd/init.c +76 -34

191 lines not on this page · raw message

drivers/iommu/amd/iommu.c +1 -1
index 760d5f4623b5..02b5eaae6843 100644
@@ -1009,7 +1009,7 @@ static void iommu_poll_events(struct amd_iommu *iommu)
 		iommu_print_event(iommu, iommu->evt_buf + head);
 
 		/* Update head pointer of hardware ring-buffer */
-		head = (head + EVENT_ENTRY_SIZE) % EVT_BUFFER_SIZE;
+		head = (head + EVTLOG_ENTRY_SIZE) % amd_iommu_evtlog_size;
 		writel(head, iommu->mmio_base + MMIO_EVT_HEAD_OFFSET);
 	}
 
Signature · 1 line
2.31.1
author maintainer
#2 lore raw

PATCH 2/2 iommu/amd: Use maximum PPR log buffer size when SNP is enabled on Family 0x19

In reply to Vasant Hegde

Due to CVE-2023-20585, the PPR log buffer must use the maximum supported size (512K) on Genoa (Family 0x19, model >= 0x10) systems when SNP is enabled, to mitigate a potential security vulnerability. Note that Family 0x19 models below 0x10 (Milan) do not support PPR when SNP is enabled. Hence the PPR log size increase is only applied for model >= 0x10. All other systems continue to use the default PPR log buffer size (8K).

Apply the errata fix by making the following changes:

- Introduce global new variable (amd_iommu_pprlog_size) to have PPR log buffer size. Adjust variable size for Genoa family.

- Extend 'amd_iommu_apply_erratum_snp()' to also set the PPR log buffer size to maximum for Family 0x19 model >= 0x10 when SNP is enabled.

- Rename rename PPR_* macros to make it more readable.

---
 drivers/iommu/amd/amd_iommu.h       |  1 +
 drivers/iommu/amd/amd_iommu_types.h | 11 ++++++-----
 drivers/iommu/amd/init.c            | 13 ++++++++++++-
 drivers/iommu/amd/ppr.c             |  8 +++++---
 4 files changed, 24 insertions(+), 9 deletions(-)
drivers/iommu/amd/amd_iommu.h +1 -0
index f1c486dcf0f3..834d8fabfba3 100644
@@ -12,6 +12,7 @@
 #include "amd_iommu_types.h"
 
 extern int amd_iommu_evtlog_size;
+extern int amd_iommu_pprlog_size;
 
 irqreturn_t amd_iommu_int_thread(int irq, void *data);
 irqreturn_t amd_iommu_int_thread_evtlog(int irq, void *data);
drivers/iommu/amd/amd_iommu_types.h +6 -5
index c3430c09bc5c..f9f718087893 100644
@@ -267,11 +267,12 @@
 #define EVTLOG_LEN_MASK_MAX	(0xFULL << EVTLOG_SIZE_SHIFT)
 
 /* Constants for PPR Log handling */
-#define PPR_LOG_ENTRIES		512
-#define PPR_LOG_SIZE_SHIFT	56
-#define PPR_LOG_SIZE_512	(0x9ULL << PPR_LOG_SIZE_SHIFT)
-#define PPR_ENTRY_SIZE		16
-#define PPR_LOG_SIZE		(PPR_ENTRY_SIZE * PPR_LOG_ENTRIES)
+#define PPRLOG_ENTRY_SIZE	0x10
+#define PPRLOG_SIZE_SHIFT	56
+#define PPRLOG_SIZE_DEF		SZ_8K	/* 512 entries */
+#define PPRLOG_LEN_MASK_DEF	(0x9ULL << PPRLOG_SIZE_SHIFT)
+#define PPRLOG_SIZE_MAX		SZ_512K	/* 32K entries */
+#define PPRLOG_LEN_MASK_MAX	(0xFULL << PPRLOG_SIZE_SHIFT)
 
 /* PAGE_SERVICE_REQUEST PPR Log Buffer Entry flags */
 #define PPR_FLAG_EXEC		0x002	/* Execute permission requested */
drivers/iommu/amd/init.c +12 -1
index 74effb847f48..a590f487937b 100644
@@ -133,6 +133,7 @@ struct ivhd_entry {
 } __attribute__((packed));
 
 int amd_iommu_evtlog_size = EVTLOG_SIZE_DEF;
+int amd_iommu_pprlog_size = PPRLOG_SIZE_DEF;
 
 /*
  * An AMD IOMMU memory definition structure. It defines things like exclusion
@@ -3420,6 +3421,16 @@ static void amd_iommu_apply_erratum_snp(void)
 	amd_iommu_evtlog_size = EVTLOG_SIZE_MAX;
 	pr_info("Applying erratum: Increase Event log size to 0x%x\n",
 		amd_iommu_evtlog_size);
+
+	/*
+	 * Set PPR log buffer size to max.
+	 * (Family 0x19, model < 0x10 doesn't support PPR when SNP is enabled).
+	 */
+	if (boot_cpu_data.x86_model >= 0x10) {
+		amd_iommu_pprlog_size = PPRLOG_SIZE_MAX;
+		pr_info("Applying erratum: Increase PPR log size to 0x%x\n",
+			amd_iommu_pprlog_size);
+	}
 #endif
 }
 
@@ -4080,7 +4091,7 @@ int amd_iommu_snp_disable(void)
 		if (ret)
 			return ret;
 
-		ret = iommu_make_shared(iommu->ppr_log, PPR_LOG_SIZE);
+		ret = iommu_make_shared(iommu->ppr_log, amd_iommu_pprlog_size);
 		if (ret)
 			return ret;
 
drivers/iommu/amd/ppr.c +5 -3
index e6767c057d01..1f8d2823bea4 100644
@@ -20,7 +20,7 @@
 int __init amd_iommu_alloc_ppr_log(struct amd_iommu *iommu)
 {
 	iommu->ppr_log = iommu_alloc_4k_pages(iommu, GFP_KERNEL | __GFP_ZERO,
-					      PPR_LOG_SIZE);
+					      amd_iommu_pprlog_size);
 	return iommu->ppr_log ? 0 : -ENOMEM;
 }
 
@@ -33,7 +33,9 @@ void amd_iommu_enable_ppr_log(struct amd_iommu *iommu)
 
 	iommu_feature_enable(iommu, CONTROL_PPR_EN);
 
-	entry = iommu_virt_to_phys(iommu->ppr_log) | PPR_LOG_SIZE_512;
+	entry = iommu_virt_to_phys(iommu->ppr_log);
+	entry |= (amd_iommu_pprlog_size == PPRLOG_SIZE_DEF) ?
+			PPRLOG_LEN_MASK_DEF : PPRLOG_LEN_MASK_MAX;
 
 	memcpy_toio(iommu->mmio_base + MMIO_PPR_LOG_OFFSET,
 		    &entry, sizeof(entry));
@@ -201,7 +203,7 @@ void amd_iommu_poll_ppr_log(struct amd_iommu *iommu)
 			raw[0] = raw[1] = 0UL;
 
 		/* Update head pointer of hardware ring-buffer */
-		head = (head + PPR_ENTRY_SIZE) % PPR_LOG_SIZE;
+		head = (head + PPRLOG_ENTRY_SIZE) % amd_iommu_pprlog_size;
 		writel(head, iommu->mmio_base + MMIO_PPR_HEAD_OFFSET);
 
 		/* Handle PPR entry */
Signature · 1 line
2.31.1
Tested-by Dheeraj Kumar Srivastava on the v1 series
#3 lore raw
In reply to Vasant Hegde
Quoted 18 lines · Vasant Hegde

This series addresses CVE-2023-20585 [1] by increasing the AMD IOMMU Event log and PPR log buffer sizes to the maximum supported value (512K) on affected CPU families when SNP is enabled.

Use MAX buffer size when SNP is enabled on Milan/Genoa. Impacted buffers:
- Milan : Event log (PPR/GALog is not supported when SNP is enabled)
- Genoa : Event and PPR log (GALog is not supported when SNP is enabled)

[1] https://www.amd.com/en/resources/product-security/bulletin/amd-sb-3016.html

Cc Borislav Petkov <[email protected]>
Cc Suravee Suthikulpanit <[email protected]>
Cc Joerg Roedel <[email protected]>

Vasant Hegde (2):
iommu/amd: Use maximum Event log buffer size when SNP is enabled on Family 0x19 iommu/amd: Use maximum PPR log buffer size when SNP is enabled on Family 0x19

Quoted 7 lines
  drivers/iommu/amd/amd_iommu.h       |   3 +
  drivers/iommu/amd/amd_iommu_types.h |  21 +++--
  drivers/iommu/amd/init.c            | 123 ++++++++++++++++++++--------
  drivers/iommu/amd/iommu.c           |   2 +-
  drivers/iommu/amd/ppr.c             |   8 +-
  5 files changed, 110 insertions(+), 47 deletions(-)

Thanks
Dheeraj

maintainer Applied
#4 lore raw
In reply to Vasant Hegde
Quoted 3 lines · Vasant Hegde

Vasant Hegde (2):
iommu/amd: Use maximum Event log buffer size when SNP is enabled on Family 0x19 iommu/amd: Use maximum PPR log buffer size when SNP is enabled on Family 0x19

Applied to fixes, thanks Vasant.

#5 lore raw
In reply to Vasant Hegde
Quoted 8 lines · On Mon, 20 Apr 2026 08:42:02 +0000 Vasant Hegde <[email protected]> wrote:

This series addresses CVE-2023-20585 [1] by increasing the AMD IOMMU Event log and PPR log buffer sizes to the maximum supported value (512K) on affected CPU families when SNP is enabled.

Use MAX buffer size when SNP is enabled on Milan/Genoa. Impacted buffers:
- Milan : Event log (PPR/GALog is not supported when SNP is enabled)
- Genoa : Event and PPR log (GALog is not supported when SNP is enabled)

Hi,

This series seems to break kexec in our production on Milan hosts with SEV enabled. This is on the 6.18.43 stable kernel backport.

If on top of 6.18.43 release, we revert the 2 commits, i.e.
Revert "iommu/amd: Use maximum PPR log buffer size when SNP is enabled on Family 0x19" Revert "iommu/amd: Use maximum Event log buffer size when SNP is enabled on Family 0x19"

kexec starts working again.

Could you help in fixing this issue?

Thanks

Quoted 21 lines

[1] https://www.amd.com/en/resources/product-security/bulletin/amd-sb-3016.html

Cc Borislav Petkov <[email protected]>
Cc Suravee Suthikulpanit <[email protected]>
Cc Joerg Roedel <[email protected]>

Vasant Hegde (2):
iommu/amd: Use maximum Event log buffer size when SNP is enabled on Family 0x19 iommu/amd: Use maximum PPR log buffer size when SNP is enabled on Family 0x19

 drivers/iommu/amd/amd_iommu.h       |   3 +
 drivers/iommu/amd/amd_iommu_types.h |  21 +++--
 drivers/iommu/amd/init.c            | 123 ++++++++++++++++++++--------
 drivers/iommu/amd/iommu.c           |   2 +-
 drivers/iommu/amd/ppr.c             |   8 +-
 5 files changed, 110 insertions(+), 47 deletions(-)
Signature · 1 line
2.31.1
#6 lore raw
Quoted 13 lines · Usama Arif
Quoted 8 lines · On Mon, 20 Apr 2026 08:42:02 +0000 Vasant Hegde <[email protected]> wrote:

This series addresses CVE-2023-20585 [1] by increasing the AMD IOMMU Event log and PPR log buffer sizes to the maximum supported value (512K) on affected CPU families when SNP is enabled.

Use MAX buffer size when SNP is enabled on Milan/Genoa. Impacted buffers:
- Milan : Event log (PPR/GALog is not supported when SNP is enabled)
- Genoa : Event and PPR log (GALog is not supported when SNP is enabled)

Hi,

Quoted 8 lines

This series seems to break kexec in our production on Milan hosts with SEV enabled. This is on the 6.18.43 stable kernel backport.

If on top of 6.18.43 release, we revert the 2 commits, i.e.
Revert "iommu/amd: Use maximum PPR log buffer size when SNP is enabled on Family 0x19" Revert "iommu/amd: Use maximum Event log buffer size when SNP is enabled on Family 0x19"

kexec starts working again.

This sounds like the same issue Nicolin is facing on SMMUv3, these larger allocations OOM the kexec kernel

Jason

#7 lore raw
Quoted 21 lines · Jason Gunthorpe
Quoted 20 lines · Usama Arif
Quoted 8 lines · On Mon, 20 Apr 2026 08:42:02 +0000 Vasant Hegde <[email protected]> wrote:

This series addresses CVE-2023-20585 [1] by increasing the AMD IOMMU Event log and PPR log buffer sizes to the maximum supported value (512K) on affected CPU families when SNP is enabled.

Use MAX buffer size when SNP is enabled on Milan/Genoa. Impacted buffers:
- Milan : Event log (PPR/GALog is not supported when SNP is enabled)
- Genoa : Event and PPR log (GALog is not supported when SNP is enabled)

Hi,

This series seems to break kexec in our production on Milan hosts with SEV enabled. This is on the 6.18.43 stable kernel backport.

If on top of 6.18.43 release, we revert the 2 commits, i.e.
Revert "iommu/amd: Use maximum PPR log buffer size when SNP is enabled on Family 0x19" Revert "iommu/amd: Use maximum Event log buffer size when SNP is enabled on Family 0x19"

Quoted 6 lines
Quoted 1 line

kexec starts working again.

This sounds like the same issue Nicolin is facing on SMMUv3, these larger allocations OOM the kexec kernel

Jason

Thanks Jason!

Was there any solution for this issue. Could you point to a lore link for this?

author maintainer
#8 lore raw
In reply to Usama Arif

Usama,

Quoted 13 lines · Usama Arif

[You don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]

Quoted 8 lines · On Mon, 20 Apr 2026 08:42:02 +0000 Vasant Hegde <[email protected]> wrote:

This series addresses CVE-2023-20585 [1] by increasing the AMD IOMMU Event log and PPR log buffer sizes to the maximum supported value (512K) on affected CPU families when SNP is enabled.

Use MAX buffer size when SNP is enabled on Milan/Genoa. Impacted buffers:
- Milan : Event log (PPR/GALog is not supported when SNP is enabled)
- Genoa : Event and PPR log (GALog is not supported when SNP is enabled)

Quoted 4 lines

Hi,

This series seems to break kexec in our production on Milan hosts with SEV enabled. This is on the 6.18.43 stable kernel backport.

Do you have dmesg?

Quoted 7 lines

If on top of 6.18.43 release, we revert the 2 commits, i.e.
Revert "iommu/amd: Use maximum PPR log buffer size when SNP is enabled on Family 0x19" Revert "iommu/amd: Use maximum Event log buffer size when SNP is enabled on Family 0x19"

kexec starts working again.

Quoted 1 line

Could you help in fixing this issue?

Sure. We will try to reproduce it internally and get back to you.

-Vasant

#9 lore raw
Quoted 16 lines · Vasant Hegde

Usama,

Quoted 13 lines · Usama Arif

[You don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]

Quoted 8 lines · On Mon, 20 Apr 2026 08:42:02 +0000 Vasant Hegde <[email protected]> wrote:

This series addresses CVE-2023-20585 [1] by increasing the AMD IOMMU Event log and PPR log buffer sizes to the maximum supported value (512K) on affected CPU families when SNP is enabled.

Use MAX buffer size when SNP is enabled on Milan/Genoa. Impacted buffers:
- Milan : Event log (PPR/GALog is not supported when SNP is enabled)
- Genoa : Event and PPR log (GALog is not supported when SNP is enabled)

Quoted 7 lines
Quoted 4 lines

Hi,

This series seems to break kexec in our production on Milan hosts with SEV enabled. This is on the 6.18.43 stable kernel backport.

Do you have dmesg?

We don't get any logs after kexec. So the last logs are:

[  OK  ] Reached target shutdown.target - System Shutdown.                                                                                                                                                                                                                                                    
[  OK  ] Reached target final.target - Late Shutdown Services.                                                                                                                                                                                                                                                
[  OK  ] Finished systemd-kexec.service - Reboot via kexec.                                                                                                                                                                                                                                                   
[  OK  ] Reached target kexec.target - Reboot via kexec. 

And then nothing after.

Quoted 10 lines
Quoted 7 lines

If on top of 6.18.43 release, we revert the 2 commits, i.e.
Revert "iommu/amd: Use maximum PPR log buffer size when SNP is enabled on Family 0x19" Revert "iommu/amd: Use maximum Event log buffer size when SNP is enabled on Family 0x19"

kexec starts working again.

Quoted 1 line

Could you help in fixing this issue?

Sure. We will try to reproduce it internally and get back to you.

Thanks!

Quoted 2 lines

-Vasant

#10 lore raw
In reply to Vasant Hegde
Quoted 24 lines · On Thu, 13 Aug 2026 19:28:55 +0530 Vasant Hegde <[email protected]> wrote:

Usama,

Quoted 13 lines · Usama Arif

[You don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]

Quoted 8 lines · On Mon, 20 Apr 2026 08:42:02 +0000 Vasant Hegde <[email protected]> wrote:

This series addresses CVE-2023-20585 [1] by increasing the AMD IOMMU Event log and PPR log buffer sizes to the maximum supported value (512K) on affected CPU families when SNP is enabled.

Use MAX buffer size when SNP is enabled on Milan/Genoa. Impacted buffers:
- Milan : Event log (PPR/GALog is not supported when SNP is enabled)
- Genoa : Event and PPR log (GALog is not supported when SNP is enabled)

Quoted 4 lines

Hi,

This series seems to break kexec in our production on Milan hosts with SEV enabled. This is on the 6.18.43 stable kernel backport.

Do you have dmesg?

Quoted 1 line
Quoted 8 lines
Quoted 6 lines

If on top of 6.18.43 release, we revert the 2 commits, i.e.
Revert "iommu/amd: Use maximum PPR log buffer size when SNP is enabled on Family 0x19" Revert "iommu/amd: Use maximum Event log buffer size when SNP is enabled on Family 0x19"

kexec starts working again.

Quoted 1 line

Could you help in fixing this issue?

Sure. We will try to reproduce it internally and get back to you.

Hi,

Just following up, were you able to reproduce this?

I was able to trace down the hang to this do while loop [1].

Could this be a firmware bug? We are currently running 1.53 (below shows up in the dmesg).

[   22.245942] ccp 0000:41:00.1: SEV-SNP API:1.53 build:5
[   22.308933] ccp 0000:41:00.1: SEV API:1.53 build:5

[1] https://elixir.bootlin.com/linux/v7.2/source/arch/x86/virt/svm/sev.c#L1017

Thanks,
Usama

Quoted 4 lines

-Vasant

author maintainer
#11 lore raw

Hi Usama,

Quoted 30 lines · Usama Arif
Quoted 28 lines · On Thu, 13 Aug 2026 19:28:55 +0530 Vasant Hegde <[email protected]> wrote:

Usama,

Quoted 13 lines · Usama Arif

[You don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]

Quoted 8 lines · On Mon, 20 Apr 2026 08:42:02 +0000 Vasant Hegde <[email protected]> wrote:

This series addresses CVE-2023-20585 [1] by increasing the AMD IOMMU Event log and PPR log buffer sizes to the maximum supported value (512K) on affected CPU families when SNP is enabled.

Use MAX buffer size when SNP is enabled on Milan/Genoa. Impacted buffers:
- Milan : Event log (PPR/GALog is not supported when SNP is enabled)
- Genoa : Event and PPR log (GALog is not supported when SNP is enabled)

Quoted 4 lines

Hi,

This series seems to break kexec in our production on Milan hosts with SEV enabled. This is on the 6.18.43 stable kernel backport.

Do you have dmesg?

Quoted 5 lines

If on top of 6.18.43 release, we revert the 2 commits, i.e.
Revert "iommu/amd: Use maximum PPR log buffer size when SNP is enabled on Family 0x19" Revert "iommu/amd: Use maximum Event log buffer size when SNP is enabled on Family 0x19"

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

kexec starts working again.

Quoted 1 line

Could you help in fixing this issue?

Sure. We will try to reproduce it internally and get back to you.

Hi,

Just following up, were you able to reproduce this?

So far no luck with SEV and SEV/SNP.

Quoted 2 lines

I was able to trace down the hang to this do while loop [1].

In allocation path, we explicitly set 4K pages (iommu_alloc_4k_pages()).

If SNP is enabled in host, then in shutdown path, amd_iommu_snp_disable() gets called and it tries to mark event log memory as shared. In this path, it calls rmpupdate. But I can't think of reason for it to hang in the rmpupdate loop.

@Tom, Ashish, Any idea?

Quoted 6 lines

Could this be a firmware bug? We are currently running 1.53 (below shows up in the dmesg).

[   22.245942] ccp 0000:41:00.1: SEV-SNP API:1.53 build:5
[   22.308933] ccp 0000:41:00.1: SEV API:1.53 build:5

We are on

[   24.783307] ccp 0000:46:00.1: SEV-SNP API:1.55 build:29
[   24.844646] ccp 0000:46:00.1: SEV API:1.55 build:29

Is it possible to upgrade BIOS and verify?

Can you please share the dmesg of the booted system (before doing the kexec)?

-Vasant

#12 lore raw
Quoted 48 lines · Vasant Hegde

Hi Usama,

Quoted 30 lines · Usama Arif
Quoted 28 lines · On Thu, 13 Aug 2026 19:28:55 +0530 Vasant Hegde <[email protected]> wrote:

Usama,

Quoted 13 lines · Usama Arif

[You don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]

Quoted 8 lines · On Mon, 20 Apr 2026 08:42:02 +0000 Vasant Hegde <[email protected]> wrote:

This series addresses CVE-2023-20585 [1] by increasing the AMD IOMMU Event log and PPR log buffer sizes to the maximum supported value (512K) on affected CPU families when SNP is enabled.

Use MAX buffer size when SNP is enabled on Milan/Genoa. Impacted buffers:
- Milan : Event log (PPR/GALog is not supported when SNP is enabled)
- Genoa : Event and PPR log (GALog is not supported when SNP is enabled)

Quoted 4 lines

Hi,

This series seems to break kexec in our production on Milan hosts with SEV enabled. This is on the 6.18.43 stable kernel backport.

Do you have dmesg?

Quoted 5 lines

If on top of 6.18.43 release, we revert the 2 commits, i.e.
Revert "iommu/amd: Use maximum PPR log buffer size when SNP is enabled on Family 0x19" Revert "iommu/amd: Use maximum Event log buffer size when SNP is enabled on Family 0x19"

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

kexec starts working again.

Quoted 1 line

Could you help in fixing this issue?

Sure. We will try to reproduce it internally and get back to you.

Hi,

Just following up, were you able to reproduce this?

So far no luck with SEV and SEV/SNP.

Quoted 2 lines

I was able to trace down the hang to this do while loop [1].

Quoted 7 lines

In allocation path, we explicitly set 4K pages (iommu_alloc_4k_pages()).

If SNP is enabled in host, then in shutdown path, amd_iommu_snp_disable() gets called and it tries to mark event log memory as shared. In this path, it calls rmpupdate. But I can't think of reason for it to hang in the rmpupdate loop.

@Tom, Ashish, Any idea?

Not knowing what the physical address is or what the RMP state is, I would have to speculate a bit. I wonder if the memory is now PMD aligned and marked as a 2M page? In iommu_page_make_shared() there is an explicit check for the level of the page being made shared being greater than PG_LEVEL_4K. If it is greater than 4K it does a psmash() and then continues. However, this check is only done if the PFN is not on a 2M boundary. That could result in RMPUPDATE returning FAIL_OVERLAP if the RMP has the range marked as 2M but the request is for a 4K page.

What happens if you always take the if path iommu_page_make_shared()? @Usama, could you try making that modification and see if that helps?

Thanks,
Tom

Quoted 21 lines
Quoted 7 lines

Could this be a firmware bug? We are currently running 1.53 (below shows up in the dmesg).

[   22.245942] ccp 0000:41:00.1: SEV-SNP API:1.53 build:5
[   22.308933] ccp 0000:41:00.1: SEV API:1.53 build:5

We are on

[   24.783307] ccp 0000:46:00.1: SEV-SNP API:1.55 build:29
[   24.844646] ccp 0000:46:00.1: SEV API:1.55 build:29

Is it possible to upgrade BIOS and verify?

Can you please share the dmesg of the booted system (before doing the kexec)?

-Vasant

author maintainer
#13 lore raw
In reply to Usama Arif

Usama,

Quoted 18 lines · Usama Arif
Quoted 16 lines · On Thu, 13 Aug 2026 19:28:55 +0530 Vasant Hegde <[email protected]> wrote:

Usama,

Quoted 13 lines · Usama Arif

[You don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]

Quoted 8 lines · On Mon, 20 Apr 2026 08:42:02 +0000 Vasant Hegde <[email protected]> wrote:

This series addresses CVE-2023-20585 [1] by increasing the AMD IOMMU Event log and PPR log buffer sizes to the maximum supported value (512K) on affected CPU families when SNP is enabled.

Use MAX buffer size when SNP is enabled on Milan/Genoa. Impacted buffers:
- Milan : Event log (PPR/GALog is not supported when SNP is enabled)
- Genoa : Event and PPR log (GALog is not supported when SNP is enabled)

Quoted 6 lines
Quoted 6 lines
Quoted 4 lines

Hi,

This series seems to break kexec in our production on Milan hosts with SEV enabled. This is on the 6.18.43 stable kernel backport.

Do you have dmesg?

We downgrade the firmware version to match the version you reported and able to reproduce this issue. But this is the CVE fix and I'd recommend you to upgrade the FW. With latest FW we don't see any issues.

-Vasant