* [PATCH] tools/libs/light: set video_mem for PVH guests
@ 2021-12-03 7:30 Juergen Gross
2021-12-03 8:14 ` Roger Pau Monné
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Juergen Gross @ 2021-12-03 7:30 UTC (permalink / raw)
To: xen-devel; +Cc: Juergen Gross, Ian Jackson, Wei Liu, Anthony PERARD
The size of the video memory of PVH guests should be set to 0 in case
no value has been specified.
Doing not so will leave it to be -1, resulting in an additional 1 kB
of RAM being advertised in the memory map (here the output of a PVH
Mini-OS boot with 16 MB of RAM assigned):
Memory map:
000000000000-0000010003ff: RAM
0000feff8000-0000feffffff: Reserved
0000fc008000-0000fc00803f: ACPI
0000fc000000-0000fc000fff: ACPI
0000fc001000-0000fc007fff: ACPI
Signed-off-by: Juergen Gross <jgross@suse.com>
---
tools/libs/light/libxl_create.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tools/libs/light/libxl_create.c b/tools/libs/light/libxl_create.c
index dcd09d32ba..d7a40d7550 100644
--- a/tools/libs/light/libxl_create.c
+++ b/tools/libs/light/libxl_create.c
@@ -427,6 +427,8 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
break;
case LIBXL_DOMAIN_TYPE_PVH:
libxl_defbool_setdefault(&b_info->u.pvh.pvshim, false);
+ if (b_info->video_memkb == LIBXL_MEMKB_DEFAULT)
+ b_info->video_memkb = 0;
if (libxl_defbool_val(b_info->u.pvh.pvshim)) {
if (!b_info->u.pvh.pvshim_path)
b_info->u.pvh.pvshim_path =
--
2.26.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] tools/libs/light: set video_mem for PVH guests
2021-12-03 7:30 [PATCH] tools/libs/light: set video_mem for PVH guests Juergen Gross
@ 2021-12-03 8:14 ` Roger Pau Monné
2021-12-08 10:27 ` Anthony PERARD
2021-12-08 14:00 ` Andrew Cooper
2 siblings, 0 replies; 5+ messages in thread
From: Roger Pau Monné @ 2021-12-03 8:14 UTC (permalink / raw)
To: Juergen Gross; +Cc: xen-devel, Ian Jackson, Wei Liu, Anthony PERARD
On Fri, Dec 03, 2021 at 08:30:58AM +0100, Juergen Gross wrote:
> The size of the video memory of PVH guests should be set to 0 in case
> no value has been specified.
>
> Doing not so will leave it to be -1, resulting in an additional 1 kB
> of RAM being advertised in the memory map (here the output of a PVH
> Mini-OS boot with 16 MB of RAM assigned):
>
> Memory map:
> 000000000000-0000010003ff: RAM
> 0000feff8000-0000feffffff: Reserved
> 0000fc008000-0000fc00803f: ACPI
> 0000fc000000-0000fc000fff: ACPI
> 0000fc001000-0000fc007fff: ACPI
>
> Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Thanks, Roger.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] tools/libs/light: set video_mem for PVH guests
2021-12-03 7:30 [PATCH] tools/libs/light: set video_mem for PVH guests Juergen Gross
2021-12-03 8:14 ` Roger Pau Monné
@ 2021-12-08 10:27 ` Anthony PERARD
2021-12-08 14:00 ` Andrew Cooper
2 siblings, 0 replies; 5+ messages in thread
From: Anthony PERARD @ 2021-12-08 10:27 UTC (permalink / raw)
To: Juergen Gross; +Cc: xen-devel, Ian Jackson, Wei Liu
On Fri, Dec 03, 2021 at 08:30:58AM +0100, Juergen Gross wrote:
> The size of the video memory of PVH guests should be set to 0 in case
> no value has been specified.
>
> Doing not so will leave it to be -1, resulting in an additional 1 kB
> of RAM being advertised in the memory map (here the output of a PVH
> Mini-OS boot with 16 MB of RAM assigned):
>
> Memory map:
> 000000000000-0000010003ff: RAM
> 0000feff8000-0000feffffff: Reserved
> 0000fc008000-0000fc00803f: ACPI
> 0000fc000000-0000fc000fff: ACPI
> 0000fc001000-0000fc007fff: ACPI
>
> Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
Thanks,
--
Anthony PERARD
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] tools/libs/light: set video_mem for PVH guests
2021-12-03 7:30 [PATCH] tools/libs/light: set video_mem for PVH guests Juergen Gross
2021-12-03 8:14 ` Roger Pau Monné
2021-12-08 10:27 ` Anthony PERARD
@ 2021-12-08 14:00 ` Andrew Cooper
2022-01-11 11:26 ` Roger Pau Monné
2 siblings, 1 reply; 5+ messages in thread
From: Andrew Cooper @ 2021-12-08 14:00 UTC (permalink / raw)
To: Juergen Gross, xen-devel
Cc: Ian Jackson, Wei Liu, Anthony PERARD, Roger Pau Monné,
Jan Beulich
On 03/12/2021 07:30, Juergen Gross wrote:
> The size of the video memory of PVH guests should be set to 0 in case
> no value has been specified.
>
> Doing not so will leave it to be -1, resulting in an additional 1 kB
> of RAM being advertised in the memory map (here the output of a PVH
> Mini-OS boot with 16 MB of RAM assigned):
>
> Memory map:
> 000000000000-0000010003ff: RAM
> 0000feff8000-0000feffffff: Reserved
> 0000fc008000-0000fc00803f: ACPI
> 0000fc000000-0000fc000fff: ACPI
> 0000fc001000-0000fc007fff: ACPI
The patch itself is fine, but some further observations based on the
memory map alone.
It is rude to provide an unsorted memory map.
The LAPIC range is required to be reserved by the ACPI spec, missing
here. Conversely, it's unclear what the reserved region is trying to
describe.
Of the 3 ACPI ranges, one is RSDP (the first 64 bytes), one is the info
block (4k), and one is the ACPI tables themselves.
RSDP really ought to be merged into the same block as the rest of the
ACPI tables.
The info block must not be marked ACPI reclaimable RAM, because it is
referenced by AML inside the DSDT/etc. This is a very serious issue if
the OS actually exercises its right to reclaim those regions and use
them as RAM.
~Andrew
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] tools/libs/light: set video_mem for PVH guests
2021-12-08 14:00 ` Andrew Cooper
@ 2022-01-11 11:26 ` Roger Pau Monné
0 siblings, 0 replies; 5+ messages in thread
From: Roger Pau Monné @ 2022-01-11 11:26 UTC (permalink / raw)
To: Andrew Cooper
Cc: Juergen Gross, xen-devel, Ian Jackson, Wei Liu, Anthony PERARD,
Jan Beulich
On Wed, Dec 08, 2021 at 02:00:48PM +0000, Andrew Cooper wrote:
> On 03/12/2021 07:30, Juergen Gross wrote:
> > The size of the video memory of PVH guests should be set to 0 in case
> > no value has been specified.
> >
> > Doing not so will leave it to be -1, resulting in an additional 1 kB
> > of RAM being advertised in the memory map (here the output of a PVH
> > Mini-OS boot with 16 MB of RAM assigned):
> >
> > Memory map:
> > 000000000000-0000010003ff: RAM
> > 0000feff8000-0000feffffff: Reserved
> > 0000fc008000-0000fc00803f: ACPI
> > 0000fc000000-0000fc000fff: ACPI
> > 0000fc001000-0000fc007fff: ACPI
>
> The patch itself is fine, but some further observations based on the
> memory map alone.
>
> It is rude to provide an unsorted memory map.
>
> The LAPIC range is required to be reserved by the ACPI spec, missing
> here. Conversely, it's unclear what the reserved region is trying to
> describe.
IIRC those are the special pages used by Xen console, store, identity
page tables, ioreq...
> Of the 3 ACPI ranges, one is RSDP (the first 64 bytes), one is the info
> block (4k), and one is the ACPI tables themselves.
>
> RSDP really ought to be merged into the same block as the rest of the
> ACPI tables.
>
> The info block must not be marked ACPI reclaimable RAM, because it is
> referenced by AML inside the DSDT/etc. This is a very serious issue if
> the OS actually exercises its right to reclaim those regions and use
> them as RAM.
There's no DSDT on PVH, but I'm unsure whether it's also marked as
reclaimable RAM on HVM which does have a DSDT. Last two blocks should
likely be ACPI NVS I assume.
Thanks, Roger.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-01-11 11:26 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-03 7:30 [PATCH] tools/libs/light: set video_mem for PVH guests Juergen Gross
2021-12-03 8:14 ` Roger Pau Monné
2021-12-08 10:27 ` Anthony PERARD
2021-12-08 14:00 ` Andrew Cooper
2022-01-11 11:26 ` Roger Pau Monné
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.