lkml.org 
[lkml]   [2012]   [Aug]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Q:pt_base in COMPAT mode offset by two pages. Was:Re: [Xen-devel] [PATCH 02/11] xen/x86: Use memblock_reserve for sensitive areas.
> > +	/* Under 64-bit hypervisor with a 32-bit domain, the hypervisor
> > + * offsets the pt_base by two pages. Hence the reservation that is done
> > + * in mmu.c misses two pages. We correct it here if we detect this. */
> > + if (last_phys < __pa(xen_start_info->pt_base))
> > + memblock_reserve(last_phys, __pa(xen_start_info->pt_base) - last_phys);
> > }
>
> What are these two pages used for? They are not documented in xen.h, why
> should we reserve them?
>
> After all we still have:
>
> memblock_reserve(PFN_PHYS(pt_base), (pt_end - pt_base) * PAGE_SIZE);
>
> that should protect what we are interested in anyway...

You are looking at the x86_64 piece of code. This issue only appears
on 32-bit which was not modified by my patches and has:

2003 memblock_reserve(__pa(xen_start_info->pt_base),
2004 xen_start_info->nr_pt_frames * PAGE_SIZE);

and as I found out, the pt_base is wrong. The cr3 we load and use is actually
two pages back!


\
 
 \ /
  Last update: 2012-08-22 17:01    [W:0.127 / U:1.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site