Hi Philippe,

On 11/11/25 12:48 AM, Philippe Mathieu-Daudé wrote:
On 5/11/25 12:44, Gavin Shan wrote:
In the situation where host and guest has 64KiB and 4KiB page sizes,
one problematic host page affects 16 guest pages. we need to send 16
consective errors in this specific case.

Extend acpi_ghes_memory_errors() to support multiple CPERs after the
hunk of code to generate the GHES error status is pulled out from
ghes_gen_err_data_uncorrectable_recoverable(). The status field of
generic error status block is also updated accordingly if multiple
error data entries are contained in the generic error status block.

Signed-off-by: Gavin Shan <[email protected]>
---
  hw/acpi/ghes-stub.c    |  2 +-
  hw/acpi/ghes.c         | 60 +++++++++++++++++++++++-------------------
  include/hw/acpi/ghes.h |  2 +-
  target/arm/kvm.c       |  4 ++-
  4 files changed, 38 insertions(+), 30 deletions(-)


diff --git a/hw/acpi/ghes.c b/hw/acpi/ghes.c
index a9c08e73c0..527b85c8d8 100644
--- a/hw/acpi/ghes.c
+++ b/hw/acpi/ghes.c
@@ -57,8 +57,12 @@
  /* The memory section CPER size, UEFI 2.6: N.2.5 Memory Error Section */
  #define ACPI_GHES_MEM_CPER_LENGTH           80
-/* Masks for block_status flags */
-#define ACPI_GEBS_UNCORRECTABLE         1
+/* Bits for block_status flags */
+#define ACPI_GEBS_UNCORRECTABLE           0
+#define ACPI_GEBS_CORRECTABLE             1
+#define ACPI_GEBS_MULTIPLE_UNCORRECTABLE  2
+#define ACPI_GEBS_MULTIPLE_CORRECTABLE    3
+#define ACPI_GEBS_ERROR_DATA_ENTRIES      4

Alternatively using "hw/registerfields.h" API:

   ...
   FIELD(ACPI_GEBS, MULTIPLE_CORRECTABLE, 3, 1)
   FIELD(ACPI_GEBS, ERROR_DATA_ENTRIES, 4, 10)

then use FIELD_DP32() to only set the correct bits.


Acked. It's a nice point and will do in next revision.

Thanks,
Gavin


Reply via email to