public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-plaforms PATCH 1/1] SbsaQemu: Fix CPUID generation in SSDT
@ 2020-08-27 13:17 Graeme Gregory
  2020-08-27 13:57 ` Leif Lindholm
  0 siblings, 1 reply; 2+ messages in thread
From: Graeme Gregory @ 2020-08-27 13:17 UTC (permalink / raw)
  To: devel; +Cc: leif, tanmay.jagdale, Graeme Gregory

The SBSAQEMU_ACPI_ITOA contains a typo that puts invalid characters in
the ASL for any number of CPUs > 10.

Signed-off-by: Graeme Gregory <graeme@nuviainc.com>
---
 Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuAcpi.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuAcpi.h b/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuAcpi.h
index 1a7d9dda2b99..0f79d8a9c3c8 100644
--- a/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuAcpi.h
+++ b/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuAcpi.h
@@ -51,7 +51,7 @@
 #define SBSAQEMU_ACPI_CPU_DEV_NAME       { 'C', '0', '0', '0' }
 
 // Macro to convert Integer to Character
-#define SBSAQEMU_ACPI_ITOA(Byte)         (0x30 + (Byte > 9 ? (Byte + 1) : Byte))
+#define SBSAQEMU_ACPI_ITOA(Byte)         (0x30 + (Byte > 9 ? (Byte + 7) : Byte))
 
 #define SBSAQEMU_ACPI_CPU_HID           {                                      \
   AML_NAME_OP, AML_NAME_CHAR__, 'H', 'I', 'D',                                 \
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [edk2-plaforms PATCH 1/1] SbsaQemu: Fix CPUID generation in SSDT
  2020-08-27 13:17 [edk2-plaforms PATCH 1/1] SbsaQemu: Fix CPUID generation in SSDT Graeme Gregory
@ 2020-08-27 13:57 ` Leif Lindholm
  0 siblings, 0 replies; 2+ messages in thread
From: Leif Lindholm @ 2020-08-27 13:57 UTC (permalink / raw)
  To: Graeme Gregory; +Cc: devel, tanmay.jagdale

On Thu, Aug 27, 2020 at 14:17:15 +0100, Graeme Gregory wrote:
> The SBSAQEMU_ACPI_ITOA contains a typo that puts invalid characters in
> the ASL for any number of CPUs > 10.

Whoops.

However, looking at where this is actually used, in SbsaQemuAcpiDxe.c,
that looks like an accident waiting to happen.

Could you possibly rewrite it using PrintLib AsciiSPrint, and drop
this macro?

/
    Leif

> Signed-off-by: Graeme Gregory <graeme@nuviainc.com>
> ---
>  Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuAcpi.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuAcpi.h b/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuAcpi.h
> index 1a7d9dda2b99..0f79d8a9c3c8 100644
> --- a/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuAcpi.h
> +++ b/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuAcpi.h
> @@ -51,7 +51,7 @@
>  #define SBSAQEMU_ACPI_CPU_DEV_NAME       { 'C', '0', '0', '0' }
>  
>  // Macro to convert Integer to Character
> -#define SBSAQEMU_ACPI_ITOA(Byte)         (0x30 + (Byte > 9 ? (Byte + 1) : Byte))
> +#define SBSAQEMU_ACPI_ITOA(Byte)         (0x30 + (Byte > 9 ? (Byte + 7) : Byte))
>  
>  #define SBSAQEMU_ACPI_CPU_HID           {                                      \
>    AML_NAME_OP, AML_NAME_CHAR__, 'H', 'I', 'D',                                 \
> -- 
> 2.25.1
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-08-27 13:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-27 13:17 [edk2-plaforms PATCH 1/1] SbsaQemu: Fix CPUID generation in SSDT Graeme Gregory
2020-08-27 13:57 ` Leif Lindholm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox