public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Eduardo Habkost <ehabkost@redhat.com>
To: Jeremy Fitzhardinge <jeremy@goop.org>
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 10:19:55 -0200	[thread overview]
Message-ID: <20071220121954.GY5322@blackpad.ctb.virtua.com.br> (raw)
In-Reply-To: <20071219223604.519474386@goop.org>

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.

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?

-- 
Eduardo

  reply	other threads:[~2007-12-20 12:21 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 [this message]
2007-12-20 21:02     ` Jeremy Fitzhardinge
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=20071220121954.GY5322@blackpad.ctb.virtua.com.br \
    --to=ehabkost@redhat.com \
    --cc=Jeremy.Fitzhardinge@citrix.com \
    --cc=ak@suse.de \
    --cc=glommer@gmail.com \
    --cc=jbeulich@novell.com \
    --cc=jeremy@goop.org \
    --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