public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Jones <andrew.jones@linux.dev>
To: Pavan Kumar Paluri <papaluri@amd.com>
Cc: kvm@vger.kernel.org, pbonzini@redhat.com,
	nikos.nikoleris@arm.com,  thomas.lendacky@amd.com,
	michael.roth@amd.com, amit.shah@amd.com
Subject: Re: [kvm-unit-tests RFC PATCH 1/3] x86 EFI: Bypass call to fdt_check_header()
Date: Tue, 26 Mar 2024 09:51:25 +0100	[thread overview]
Message-ID: <20240326-663042e3295513fb8814f80d@orel> (raw)
In-Reply-To: <20240325213623.747590-1-papaluri@amd.com>

On Mon, Mar 25, 2024 at 04:36:21PM -0500, Pavan Kumar Paluri wrote:
> Issuing a call to fdt_check_header() prevents running any of x86 UEFI
> enabled tests. Bypass this call for x86 in order to enable UEFI
> supported tests for KUT x86 arch.

Ouch! Sorry about that. I think I prefer something like below, though.

Thanks,
drew

diff --git a/lib/efi.c b/lib/efi.c
index 5314eaa81e66..335b66d26092 100644
--- a/lib/efi.c
+++ b/lib/efi.c
@@ -312,6 +312,7 @@ static void* efi_get_var(efi_handle_t handle, struct efi_loaded_image_64 *image,
        return val;
 }
 
+#if defined(__aarch64__) || defined(__riscv)
 static void *efi_get_fdt(efi_handle_t handle, struct efi_loaded_image_64 *image)
 {
        efi_char16_t var[] = ENV_VARNAME_DTBFILE;
@@ -330,6 +331,12 @@ static void *efi_get_fdt(efi_handle_t handle, struct efi_loaded_image_64 *image)
 
        return fdt_check_header(fdt) == 0 ? fdt : NULL;
 }
+#else
+static void *efi_get_fdt(efi_handle_t handle, struct efi_loaded_image_64 *image)
+{
+       return NULL;
+}
+#endif
 
 static const struct {
        struct efi_vendor_dev_path      vendor;

> 
> Fixes: 9632ce446b8f ("arm64: efi: Improve device tree discovery")
> Signed-off-by: Pavan Kumar Paluri <papaluri@amd.com>
> ---
>  lib/efi.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/lib/efi.c b/lib/efi.c
> index 5314eaa81e66..124e77685230 100644
> --- a/lib/efi.c
> +++ b/lib/efi.c
> @@ -328,6 +328,10 @@ static void *efi_get_fdt(efi_handle_t handle, struct efi_loaded_image_64 *image)
>  		return NULL;
>  	}
>  
> +#ifdef __x86_64__
> +	return fdt;
> +#endif
> +
>  	return fdt_check_header(fdt) == 0 ? fdt : NULL;
>  }
>  
> -- 
> 2.34.1
> 

  parent reply	other threads:[~2024-03-26  8:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-25 21:36 [kvm-unit-tests RFC PATCH 1/3] x86 EFI: Bypass call to fdt_check_header() Pavan Kumar Paluri
2024-03-25 21:36 ` [kvm-unit-tests RFC PATCH 2/3] x86/efi: Retry call to efi exit boot services Pavan Kumar Paluri
2024-03-26  8:57   ` Andrew Jones
2024-03-26 13:29     ` Paluri, PavanKumar
2024-03-26 13:38   ` Michael Roth
2024-03-26 13:45     ` Paluri, PavanKumar
2024-03-26 13:58       ` Michael Roth
2024-03-25 21:36 ` [kvm-unit-tests RFC PATCH 3/3] x86 AMD SEV-ES: Setup a new page table and install level 1 PTEs Pavan Kumar Paluri
2024-03-26 14:01   ` Tom Lendacky
2024-03-26 15:35     ` Paluri, PavanKumar
2024-03-26  8:51 ` Andrew Jones [this message]
2024-03-26 13:28   ` [kvm-unit-tests RFC PATCH 1/3] x86 EFI: Bypass call to fdt_check_header() Paluri, PavanKumar
2024-03-26 15:30   ` Paluri, PavanKumar

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-all 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=20240326-663042e3295513fb8814f80d@orel \
    --to=andrew.jones@linux.dev \
    --cc=amit.shah@amd.com \
    --cc=kvm@vger.kernel.org \
    --cc=michael.roth@amd.com \
    --cc=nikos.nikoleris@arm.com \
    --cc=papaluri@amd.com \
    --cc=pbonzini@redhat.com \
    --cc=thomas.lendacky@amd.com \
    /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