[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <49798A5E.76E4.0078.0@novell.com>
Date: Fri, 23 Jan 2009 08:14:06 +0000
From: "Jan Beulich" <jbeulich@...ell.com>
To: "Ingo Molnar" <mingo@...e.hu>,
"Jeremy Fitzhardinge" <jeremy@...p.org>
Cc: "Xen-devel" <xen-devel@...ts.xensource.com>,
"Linux Kernel Mailing List" <linux-kernel@...r.kernel.org>,
"Nick Piggin" <nickpiggin@...oo.com.au>
Subject: Re: [Xen-devel] [PATCH 2/2] x86: add pte_set_flags/clear_flags
for pteflag manipulation
>>> Jeremy Fitzhardinge <jeremy@...p.org> 22.01.09 23:24 >>>
>+static inline pte_t pte_set_flags(pte_t pte, pteval_t set)
>+{
>+ pteval_t v = native_pte_val(pte);
>+
>+ return native_make_pte(v | set);
>+}
>+
>+static inline pte_t pte_clear_flags(pte_t pte, pteval_t clear)
>+{
>+ pteval_t v = native_pte_val(pte);
>+
>+ return native_make_pte(v & ~clear);
>+}
I think a comment (or event a BUG_ON()) should be added here to make
clear that this absolutely must not be used to toggle the present bit. I
even view toggling _PAGE_PSE as dangerous this way.
And alternative would be to make these macros and #undef them (or keep
them inline functions but add destructive #define-s) after all their users.
Jan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists