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

RE: [Xen-devel] Re: [Xen-users] rebased openSUSE Xen dom0 Patches



Thanks Jan,

> >...
> >Another common failure is shown below.  Dom0 expects a page to be
> PGT_l1_page_table but instead finds the page's type is
> PGT_writable_page:
> 
> Well, we certainly aren't experiencing anything like that with our
> "original" version of those patches, and I would suppose Andy didn't
> see such either. Hence perhaps a problem that got introduced
> by how you made use of the patches and/or some specifics of the
> source tree you applied them to?
> 

The patches seem to apply cleanly to the Ubuntu 10.4 kernel source tree
(but I agree that this might be the problem)...

We've actually narrowed the problem down a bit -- the pages we fail on
are always in the range of those freed by free_init_pages("unused kernel
memory") from free_initmem(). Now, the specific problem is that a
writable page cant be turned into a page table page because it's page
type ref count is non-zero -- I see in the free_init_pages() routine
that two hypercalls are made for each page, one of which sets the pte to
zero (which would decrement the page type ref count I think) and one of
which does not -- doesn't this leave the page type ref count at 1 which
in turn means the page cant be turned into a page table page? Or is
there some other magic that occurs later on that should decrement the
page type ref count before attempting to use the page as a page table
page?

Here's the extract of the code I am talking about (yes, we are using a
64-bit Dom0):

        printk(KERN_INFO "Freeing %s: %luk freed\n", what, (end - begin)
>> 10);

        for (; addr < end; addr += PAGE_SIZE) {
                ClearPageReserved(virt_to_page(addr));
                init_page_count(virt_to_page(addr));
                memset((void *)(addr & ~(PAGE_SIZE-1)),
                        POISON_FREE_INITMEM, PAGE_SIZE);
#ifdef CONFIG_X86_64
                if (addr >= __START_KERNEL_map) {
                        /* make_readonly() reports all kernel addresses.
*/
                        if (HYPERVISOR_update_va_mapping((unsigned
long)__va(__pa(addr)),
 
pfn_pte(__pa(addr) >> PAGE_SHIFT,
 
PAGE_KERNEL),
                                                         0))
                                BUG();
                        if (HYPERVISOR_update_va_mapping(addr, __pte(0),
0))
                                BUG();
                }
#endif
...

Simon

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

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