[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 09/22] vixen: modify the e820 table to advertise HVM special pages as RAM



On Sun, Jan 07, 2018 at 07:27:48AM -0800, Anthony Liguori wrote:
> On Sun, Jan 7, 2018 at 12:16 AM, Roger Pau Monné <roger.pau@xxxxxxxxxx> wrote:
> > On Sat, Jan 06, 2018 at 02:54:24PM -0800, Anthony Liguori wrote:
> >> diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
> >> index a56f875..935901b 100644
> >> --- a/xen/arch/x86/mm.c
> >> +++ b/xen/arch/x86/mm.c
> >> @@ -122,6 +122,7 @@
> >>  #include <asm/fixmap.h>
> >>  #include <asm/io_apic.h>
> >>  #include <asm/pci.h>
> >> +#include <asm/guest.h>
> >>
> >>  #include <asm/hvm/grant_table.h>
> >>  #include <asm/pv/grant_table.h>
> >> @@ -945,7 +946,7 @@ get_page_from_l1e(
> >>              case 0:
> >>                  break;
> >>              case 1:
> >> -                if ( !is_hardware_domain(l1e_owner) )
> >> +                if ( !is_vixen() && !is_hardware_domain(l1e_owner) )
> >>                      break;
> >>                  /* fallthrough */
> >>              case -1:
> >> @@ -5536,6 +5537,21 @@ void arch_dump_shared_mem_info(void)
> >>              mem_sharing_get_nr_saved_mfns());
> >>  }
> >>
> >> +const unsigned long *__init
> >> +vixen_get_platform_badpages(unsigned int *array_size)
> >> +{
> >> +    static unsigned long __initdata bad_pages[] = {
> >> +        0xfeffc000,
> >> +        0xfeffd000,
> >> +        0xfeffe000,
> >> +        0xfefff000,
> >
> > This values shouldn't be hardcoded. IMHO it would also be good to
> > place all the vixen_ helpers in a single file.
> 
> Ack on moving to a helper.
> 
> I don't know of a way to call the hypervisor to ask "what's the
> special page range?".  I can find special pages via the hvm get
> parameters calls but there's no guarantee they are contiguous so the
> resulting code to punch holes in the e820 because fairly complex.  Any
> ideas how to do this nicely?

I've done something similar for the shim, but the values in the
bag_pages array are dynamic:

http://xenbits.xen.org/gitweb/?p=people/liuw/xen.git;a=commit;h=d5a72acaa2ced1bd66a1ef1ef7a4a1bda43a9df3

Also, why do you need to add 4 GFNs to the list of bad pages? Just
adding the console/xenstore pages to the e820 and to the list of bad
pages should be enough.

It's a nit at this stage, but I again think vixen related code should
live in a separate file instead of polluting x86/mm.c

Thanks, Roger.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.