From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: Ingo Molnar <mingo@elte.hu>, LKML <linux-kernel@vger.kernel.org>,
Andi Kleen <ak@suse.de>, Thomas Gleixner <tglx@linutronix.de>,
Glauber de Oliveira Costa <glommer@gmail.com>,
Jan Beulich <jbeulich@novell.com>,
Jeremy Fitzhardinge <Jeremy.Fitzhardinge@citrix.com>
Subject: Re: [PATCH 2/5] x86: unify pgtable*.h
Date: Thu, 20 Dec 2007 13:02:35 -0800 [thread overview]
Message-ID: <476AD86B.8000901@goop.org> (raw)
In-Reply-To: <20071220121954.GY5322@blackpad.ctb.virtua.com.br>
Eduardo Habkost wrote:
> On Wed, Dec 19, 2007 at 02:35:36PM -0800, Jeremy Fitzhardinge wrote:
>
>> +static inline pte_t pte_mkclean(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_DIRTY)); return pte; }
>> +static inline pte_t pte_mkold(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_ACCESSED)); return pte; }
>> +static inline pte_t pte_wrprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_RW)); return pte; }
>> +static inline pte_t pte_mkexec(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_NX)); return pte; }
>> +static inline pte_t pte_mkdirty(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_DIRTY)); return pte; }
>> +static inline pte_t pte_mkyoung(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_ACCESSED)); return pte; }
>> +static inline pte_t pte_mkwrite(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_RW)); return pte; }
>> +static inline pte_t pte_mkhuge(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_PSE)); return pte; }
>> +static inline pte_t pte_clrhuge(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_PSE)); return pte; }
>>
>
>
> Is set_pte() really supposed to be used here? pte_val() and __pte()
> are already hooked by paravirt_ops if needed, and it looks like we
> don't want to call paravirt_ops set_pte() here.
>
No, you're right. That looks pretty stupid. It will work, but it's
clearly sub-optimal.
> I don't know if I understood fully the semantics of set_pte(), but
> it seems that the paravirt_ops implementations expect set_pte() to be
> called for PTEs that are actually inside existing pagetables (and not
> for short-lived stack variables, like on this case).
>
> Was this tested under Xen and/or VMI?
>
Yes, Xen. It's always OK to use set_pte on something that isn't
actually part of a pagetable, since it can be used on pagetables which
are under construction. But it may end up doing too much work.
J
next prev parent reply other threads:[~2007-12-20 21:02 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-19 22:35 [PATCH 0/5] x86: another attempt at x86 pagetable unification Jeremy Fitzhardinge
2007-12-19 22:35 ` [PATCH 1/5] x86: clean up asm-x86/page*.h Jeremy Fitzhardinge
2007-12-19 22:35 ` [PATCH 2/5] x86: unify pgtable*.h Jeremy Fitzhardinge
2007-12-20 12:19 ` Eduardo Habkost
2007-12-20 21:02 ` Jeremy Fitzhardinge [this message]
2007-12-19 22:35 ` [PATCH 3/5] x86: fix up formatting in pgtable*.h Jeremy Fitzhardinge
2007-12-19 22:35 ` [PATCH 4/5] x86: use a uniform structure for pte_t Jeremy Fitzhardinge
2007-12-19 22:35 ` [PATCH 5/5] x86: clean up pagetable-related printk format warnings Jeremy Fitzhardinge
2007-12-20 9:13 ` [PATCH 0/5] x86: another attempt at x86 pagetable unification Ingo Molnar
2007-12-20 9:49 ` Ingo Molnar
2007-12-20 11:20 ` Ingo Molnar
2007-12-20 21:08 ` Jeremy Fitzhardinge
2007-12-20 21:39 ` Ingo Molnar
2007-12-20 22:08 ` Jeremy Fitzhardinge
2007-12-20 22:24 ` Ingo Molnar
2007-12-21 0:52 ` Jeremy Fitzhardinge
2007-12-21 0:58 ` Ingo Molnar
2007-12-21 1:03 ` Glauber de Oliveira Costa
2007-12-20 21:03 ` Jeremy Fitzhardinge
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=476AD86B.8000901@goop.org \
--to=jeremy@goop.org \
--cc=Jeremy.Fitzhardinge@citrix.com \
--cc=ak@suse.de \
--cc=ehabkost@redhat.com \
--cc=glommer@gmail.com \
--cc=jbeulich@novell.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--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