public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Leif Lindholm" <leif@nuviainc.com>
To: Graeme Gregory <graeme@nuviainc.com>
Cc: devel@edk2.groups.io, tanmay.jagdale@linaro.org
Subject: Re: [edk2-plaforms PATCH 1/1] SbsaQemu: Fix CPUID generation in SSDT
Date: Thu, 27 Aug 2020 14:57:26 +0100	[thread overview]
Message-ID: <20200827135726.GW1191@vanye> (raw)
In-Reply-To: <20200827131715.234476-1-graeme@nuviainc.com>

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
> 

      reply	other threads:[~2020-08-27 13:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200827135726.GW1191@vanye \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox