WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

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

To: "Jan Beulich" <JBeulich@xxxxxxxxxx>, "Andrew Lyon" <andrew.lyon@xxxxxxxxx>
Subject: RE: [Xen-devel] Re: [Xen-users] rebased openSUSE Xen dom0 Patches
From: "Simon Graham" <simon.graham@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 16 Apr 2010 08:42:48 -0500
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Sun, 18 Apr 2010 08:04:23 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4BC834C4020000780003A947@xxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <BC8BC73D12649F439B502B4CB6FD58B10148E4A4@xxxxxxxxxxxxxxxxxxxxx> <4BC834C4020000780003A947@xxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcrdOncltX8276kgS9asu//ATnRnygAKuW3A
Thread-topic: [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