qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] target/i386/sev: Ensure sev_fw_errlist is sync with update-l


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH] target/i386/sev: Ensure sev_fw_errlist is sync with update-linux-headers
Date: Mon, 8 Mar 2021 11:21:25 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0

ping?

On 2/19/21 7:01 PM, Philippe Mathieu-Daudé wrote:
> Ensure sev_fw_errlist[] is updated after running
> the update-linux-headers.sh script.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> Based-on: <20210218151633.215374-1-ckuehl@redhat.com>
> ---
>  target/i386/sev.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/target/i386/sev.c b/target/i386/sev.c
> index 37690ae809c..92c69a23769 100644
> --- a/target/i386/sev.c
> +++ b/target/i386/sev.c
> @@ -87,7 +87,7 @@ typedef struct __attribute__((__packed__)) SevInfoBlock {
>  static SevGuestState *sev_guest;
>  static Error *sev_mig_blocker;
>  
> -static const char *const sev_fw_errlist[] = {
> +static const char *const sev_fw_errlist[SEV_RET_MAX] = {
>      [SEV_RET_SUCCESS]                = "",
>      [SEV_RET_INVALID_PLATFORM_STATE] = "Platform state is invalid",
>      [SEV_RET_INVALID_GUEST_STATE]    = "Guest state is invalid",
> @@ -114,6 +114,8 @@ static const char *const sev_fw_errlist[] = {
>      [SEV_RET_RESOURCE_LIMIT]         = "Required firmware resource depleted",
>      [SEV_RET_SECURE_DATA_INVALID]    = "Part-specific integrity check 
> failure",
>  };
> +/* Ensure sev_fw_errlist[] is updated after running update-linux-headers.sh 
> */
> +QEMU_BUILD_BUG_ON(SEV_RET_SECURE_DATA_INVALID + 1 != SEV_RET_MAX);
>  
>  #define SEV_FW_MAX_ERROR      ARRAY_SIZE(sev_fw_errlist)
>  
> @@ -160,6 +162,7 @@ fw_error_to_str(int code)
>      if (code < 0 || code >= SEV_FW_MAX_ERROR) {
>          return "unknown error";
>      }
> +    assert(sev_fw_errlist[code]);
>  
>      return sev_fw_errlist[code];
>  }
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]