From: Stefano Garzarella <sgarzare@redhat.com>
To: David Edmondson <david.edmondson@oracle.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
Richard Henderson <richard.henderson@linaro.org>,
qemu-devel@nongnu.org, Eduardo Habkost <ehabkost@redhat.com>
Subject: Re: [PATCH 2/2] x86/pvh: extract only 4 bytes of start address for 32 bit kernels
Date: Tue, 2 Mar 2021 14:54:53 +0100 [thread overview]
Message-ID: <20210302135453.5ijlf3idwxn2q3rd@steredhat> (raw)
In-Reply-To: <20210302090315.3031492-3-david.edmondson@oracle.com>
On Tue, Mar 02, 2021 at 09:03:15AM +0000, David Edmondson wrote:
>When loading the PVH start address from a 32 bit ELF note, extract
>only the appropriate number of bytes.
>
>Fixes: ab969087da65 ("pvh: Boot uncompressed kernel using direct boot ABI")
>Signed-off-by: David Edmondson <david.edmondson@oracle.com>
>---
> hw/i386/x86.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
>diff --git a/hw/i386/x86.c b/hw/i386/x86.c
>index 6329f90ef9..7865660e2c 100644
>--- a/hw/i386/x86.c
>+++ b/hw/i386/x86.c
>@@ -690,6 +690,8 @@ static uint64_t read_pvh_start_addr(void *arg1, void *arg2, bool is64)
> elf_note_data_addr =
> ((void *)nhdr64) + nhdr_size64 +
> QEMU_ALIGN_UP(nhdr_namesz, phdr_align);
>+
>+ pvh_start_addr = *elf_note_data_addr;
> } else {
> struct elf32_note *nhdr32 = (struct elf32_note *)arg1;
> uint32_t nhdr_size32 = sizeof(struct elf32_note);
>@@ -699,9 +701,9 @@ static uint64_t read_pvh_start_addr(void *arg1, void *arg2, bool is64)
> elf_note_data_addr =
> ((void *)nhdr32) + nhdr_size32 +
> QEMU_ALIGN_UP(nhdr_namesz, phdr_align);
>- }
>
>- pvh_start_addr = *elf_note_data_addr;
>+ pvh_start_addr = *(uint32_t *)elf_note_data_addr;
>+ }
>
> return pvh_start_addr;
> }
>--
>2.30.0
>
>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
next prev parent reply other threads:[~2021-03-02 13:56 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-02 9:03 [PATCH 0/2] improve loading of 32 bit PVH kernels David Edmondson
2021-03-02 9:03 ` [PATCH 1/2] elf_ops: correct loading of 32 bit PVH kernel David Edmondson
2021-03-02 10:31 ` Philippe Mathieu-Daudé
2021-03-02 13:36 ` Stefano Garzarella
2021-03-02 14:26 ` Alex Bennée
2021-03-02 9:03 ` [PATCH 2/2] x86/pvh: extract only 4 bytes of start address for 32 bit kernels David Edmondson
2021-03-02 13:54 ` Stefano Garzarella [this message]
2021-03-02 10:30 ` [PATCH 0/2] improve loading of 32 bit PVH kernels Philippe Mathieu-Daudé
2021-03-02 14:11 ` Paolo Bonzini
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=20210302135453.5ijlf3idwxn2q3rd@steredhat \
--to=sgarzare@redhat.com \
--cc=david.edmondson@oracle.com \
--cc=ehabkost@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/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;
as well as URLs for NNTP newsgroup(s).