linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ahmed S. Darwish" <darwish.07@gmail.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Rusty Russel <rusty@rustcorp.com.au>,
	Suresh Siddha <suresh.b.siddha@intel.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	lguest@ozlabs.org, linux-kernel@vger.kernel.org
Subject: [PATCH] lguest: Accept guest _PAGE_PWT page table entries
Date: Thu, 7 Feb 2008 02:51:20 +0200	[thread overview]
Message-ID: <20080207005120.GA5751@ubuntu> (raw)
In-Reply-To: <20080206235923.GA19843@elte.hu>

On Thu, Feb 07, 2008 at 12:59:23AM +0100, Ingo Molnar wrote:
> 
> * Ahmed S. Darwish <darwish.07@gmail.com> 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@gmail.com>
---

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

  reply	other threads:[~2008-02-07  0:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-06 23:21 [Lguest/x86]: Clash with ioremap_nocache() + _PAGE_PWT Ahmed S. Darwish
2008-02-06 23:59 ` Ingo Molnar
2008-02-07  0:51   ` Ahmed S. Darwish [this message]
2008-02-07  1:00     ` [PATCH] lguest: Accept guest _PAGE_PWT page table entries Ingo Molnar
2008-03-04  1:37     ` Rusty Russell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080207005120.GA5751@ubuntu \
    --to=darwish.07@gmail.com \
    --cc=lguest@ozlabs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rusty@rustcorp.com.au \
    --cc=suresh.b.siddha@intel.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).