Re: [PATCH] libelf: Handle PVH kernels lacking ENTRY elfnote

2020-10-19 Thread Jan Beulich
On 19.10.2020 17:26, Jason Andryuk wrote: > On Mon, Oct 19, 2020 at 3:38 AM Jan Beulich wrote: >> On 16.10.2020 18:28, Jason Andryuk wrote: >>> Looks like we can pass XC_DOM_PV_CONTAINER/XC_DOM_HVM_CONTAINER down >>> into elf_xen_parse(). Then we would just validate phys_entry for HVM >>> and vir

Re: [PATCH] libelf: Handle PVH kernels lacking ENTRY elfnote

2020-10-19 Thread Jason Andryuk
On Mon, Oct 19, 2020 at 3:38 AM Jan Beulich wrote: > > On 16.10.2020 18:28, Jason Andryuk wrote: > > Looks like we can pass XC_DOM_PV_CONTAINER/XC_DOM_HVM_CONTAINER down > > into elf_xen_parse(). Then we would just validate phys_entry for HVM > > and virt_entry for PV. Does that sound reasonable

Re: [PATCH] libelf: Handle PVH kernels lacking ENTRY elfnote

2020-10-19 Thread Jan Beulich
On 16.10.2020 18:28, Jason Andryuk wrote: > Looks like we can pass XC_DOM_PV_CONTAINER/XC_DOM_HVM_CONTAINER down > into elf_xen_parse(). Then we would just validate phys_entry for HVM > and virt_entry for PV. Does that sound reasonable? I think so, yes. Assuming of course that you'll convert the

Re: [PATCH] libelf: Handle PVH kernels lacking ENTRY elfnote

2020-10-16 Thread Jason Andryuk
On Thu, Oct 15, 2020 at 11:14 AM Jan Beulich wrote: > > On 15.10.2020 16:50, Jason Andryuk wrote: > > On Thu, Oct 15, 2020 at 3:00 AM Jan Beulich wrote: > >> And why is there no bounds check of ->phys_entry paralleling the > >> ->virt_entry one? > > > > What is the purpose of this checking? It's

Re: [PATCH] libelf: Handle PVH kernels lacking ENTRY elfnote

2020-10-15 Thread Andrew Cooper
On 15/10/2020 16:14, Jan Beulich wrote: > On 15.10.2020 16:50, Jason Andryuk wrote: >> On Thu, Oct 15, 2020 at 3:00 AM Jan Beulich wrote: >>> And why is there no bounds check of ->phys_entry paralleling the >>> ->virt_entry one? >> What is the purpose of this checking? It's sanity checking which

Re: [PATCH] libelf: Handle PVH kernels lacking ENTRY elfnote

2020-10-15 Thread Jan Beulich
On 15.10.2020 16:50, Jason Andryuk wrote: > On Thu, Oct 15, 2020 at 3:00 AM Jan Beulich wrote: >> And why is there no bounds check of ->phys_entry paralleling the >> ->virt_entry one? > > What is the purpose of this checking? It's sanity checking which is > generally good, but what is the harm f

Re: [PATCH] libelf: Handle PVH kernels lacking ENTRY elfnote

2020-10-15 Thread Roger Pau Monné
On Thu, Oct 15, 2020 at 09:00:09AM +0200, Jan Beulich wrote: > On 14.10.2020 18:27, Jason Andryuk wrote: > > On Wed, Oct 14, 2020 at 12:02 PM Jan Beulich wrote: > >> > >> On 14.10.2020 17:31, Jason Andryuk wrote: > >>> Linux kernels only have an ENTRY elfnote when built with CONFIG_PV. A > >>> ke

Re: [PATCH] libelf: Handle PVH kernels lacking ENTRY elfnote

2020-10-15 Thread Jason Andryuk
On Thu, Oct 15, 2020 at 3:00 AM Jan Beulich wrote: > > On 14.10.2020 18:27, Jason Andryuk wrote: > > On Wed, Oct 14, 2020 at 12:02 PM Jan Beulich wrote: > >> > >> On 14.10.2020 17:31, Jason Andryuk wrote: > >>> Linux kernels only have an ENTRY elfnote when built with CONFIG_PV. A > >>> kernel bu

Re: [PATCH] libelf: Handle PVH kernels lacking ENTRY elfnote

2020-10-15 Thread Jan Beulich
On 14.10.2020 18:27, Jason Andryuk wrote: > On Wed, Oct 14, 2020 at 12:02 PM Jan Beulich wrote: >> >> On 14.10.2020 17:31, Jason Andryuk wrote: >>> Linux kernels only have an ENTRY elfnote when built with CONFIG_PV. A >>> kernel build CONFIG_PVH=y CONFIG_PV=n lacks the note. In this case, >>> vi

Re: [PATCH] libelf: Handle PVH kernels lacking ENTRY elfnote

2020-10-14 Thread Jürgen Groß
On 14.10.20 18:27, Jason Andryuk wrote: On Wed, Oct 14, 2020 at 12:12 PM Jürgen Groß wrote: On 14.10.20 17:31, Jason Andryuk wrote: Linux kernels only have an ENTRY elfnote when built with CONFIG_PV. A This wrong. Have a look into arch/x86/platform/pvh/head.S That is XEN_ELFNOTE_PHYS32_E

Re: [PATCH] libelf: Handle PVH kernels lacking ENTRY elfnote

2020-10-14 Thread Jason Andryuk
On Wed, Oct 14, 2020 at 12:12 PM Jürgen Groß wrote: > > On 14.10.20 17:31, Jason Andryuk wrote: > > Linux kernels only have an ENTRY elfnote when built with CONFIG_PV. A > > This wrong. Have a look into arch/x86/platform/pvh/head.S That is XEN_ELFNOTE_PHYS32_ENTRY, which is different from XEN_EL

Re: [PATCH] libelf: Handle PVH kernels lacking ENTRY elfnote

2020-10-14 Thread Jason Andryuk
On Wed, Oct 14, 2020 at 12:02 PM Jan Beulich wrote: > > On 14.10.2020 17:31, Jason Andryuk wrote: > > Linux kernels only have an ENTRY elfnote when built with CONFIG_PV. A > > kernel build CONFIG_PVH=y CONFIG_PV=n lacks the note. In this case, > > virt_entry will be UNSET_ADDR, overwritten by th

Re: [PATCH] libelf: Handle PVH kernels lacking ENTRY elfnote

2020-10-14 Thread Jürgen Groß
On 14.10.20 17:31, Jason Andryuk wrote: Linux kernels only have an ENTRY elfnote when built with CONFIG_PV. A This wrong. Have a look into arch/x86/platform/pvh/head.S Juergen

Re: [PATCH] libelf: Handle PVH kernels lacking ENTRY elfnote

2020-10-14 Thread Jan Beulich
On 14.10.2020 17:31, Jason Andryuk wrote: > Linux kernels only have an ENTRY elfnote when built with CONFIG_PV. A > kernel build CONFIG_PVH=y CONFIG_PV=n lacks the note. In this case, > virt_entry will be UNSET_ADDR, overwritten by the ELF header e_entry, > and fail the check against the virt add

Re: [PATCH] libelf: Handle PVH kernels lacking ENTRY elfnote

2020-10-14 Thread Wei Liu
On Wed, Oct 14, 2020 at 11:31:50AM -0400, Jason Andryuk wrote: > Linux kernels only have an ENTRY elfnote when built with CONFIG_PV. A > kernel build CONFIG_PVH=y CONFIG_PV=n lacks the note. In this case, > virt_entry will be UNSET_ADDR, overwritten by the ELF header e_entry, > and fail the check