|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v2] x86/dom0: add extra RAM regions as UNUSABLE for PVH memory map
>>> On 03.05.18 at 16:13, <roger.pau@xxxxxxxxxx> wrote:
> Changes since v1:
> - Report the ranges as UNUSABLE instead of RESERVED.
Ehem:
> --- a/xen/arch/x86/hvm/dom0_build.c
> +++ b/xen/arch/x86/hvm/dom0_build.c
> @@ -314,8 +314,10 @@ static __init void pvh_setup_e820(struct domain *d,
> unsigned long nr_pages)
>
> /*
> * Craft the e820 memory map for Dom0 based on the hardware e820 map.
> + * Add an extra entry in case we have to split a RAM entry into a RAM
> and a
> + * RESERVED one in order to truncate it.
Here.
> @@ -323,19 +325,20 @@ static __init void pvh_setup_e820(struct domain *d,
> unsigned long nr_pages)
> /* Clamp e820 memory map to match the memory assigned to Dom0 */
> for ( i = 0, entry = e820.map; i < e820.nr_map; i++, entry++ )
> {
> + *entry_guest = *entry;
> +
> if ( entry->type != E820_RAM )
> - {
> - *entry_guest = *entry;
> goto next;
> - }
>
> if ( nr_pages == cur_pages )
> {
> /*
> - * We already have all the assigned memory,
> - * skip this entry
> + * We already have all the requested memory, turn this RAM region
> + * into a RESERVED region in order to prevent Dom0 from placing
And here.
> + * BARs in this area.
> */
> - continue;
> + entry_guest->type = E820_RESERVED;
And here.
> @@ -358,6 +361,12 @@ static __init void pvh_setup_e820(struct domain *d,
> unsigned long nr_pages)
> {
> /* Truncate region */
> entry_guest->size = (nr_pages - cur_pages) << PAGE_SHIFT;
> + /* Add the remaining of the RAM region as RESERVED. */
> + entry_guest++;
> + d->arch.nr_e820++;
> + entry_guest->type = E820_RESERVED;
And yet one more.
Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |