[PATCH] lguest: Accept guest _PAGE_PWT page table entries

From: Ahmed S. Darwish
Date: Wed Feb 06 2008 - 19:57:35 EST


On Thu, Feb 07, 2008 at 12:59:23AM +0100, Ingo Molnar wrote:
>
> * Ahmed S. Darwish <darwish.07@xxxxxxxxx> wrote:
>
> > Hi all,
> >
> > Beginning from commit 4138cc3418f5, ioremap_nocache() sets the _PAGE_PWT
> > flag.
> >
> > Lguest doesn't accept a guest pte with a _PWT flag and reports a "bad
> > page table entry" in that case.
> >
> > I've removed check from lguest code and everything worked fine. Is
> > this safe from the Lguest side ?
>
> yes, should be safe. Could you send a patch so that others can apply it
> too?
>

Ofcourse :) :

Accept guest _PAGE_PWT page table entries, otherwise lguest will
always fail with a "bad page table entry" message.

Signed-off-by: Ahmed S. Darwish <darwish.07@xxxxxxxxx>
---

diff --git a/drivers/lguest/page_tables.c b/drivers/lguest/page_tables.c
index 74b4cf2..952160b 100644
--- a/drivers/lguest/page_tables.c
+++ b/drivers/lguest/page_tables.c
@@ -178,8 +178,8 @@ static void release_pte(pte_t pte)

static void check_gpte(struct lg_cpu *cpu, pte_t gpte)
{
- if ((pte_flags(gpte) & (_PAGE_PWT|_PAGE_PSE))
- || pte_pfn(gpte) >= cpu->lg->pfn_limit)
+ if ((pte_flags(gpte) & _PAGE_PSE) ||
+ pte_pfn(gpte) >= cpu->lg->pfn_limit)
kill_guest(cpu, "bad page table entry");
}


Regards,

--
Ahmed S. Darwish
Homepage: http://darwish.07.googlepages.com
Blog: http://darwish-07.blogspot.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/