From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752005AbZAZHvB (ORCPT ); Mon, 26 Jan 2009 02:51:01 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751301AbZAZHuw (ORCPT ); Mon, 26 Jan 2009 02:50:52 -0500 Received: from vpn.id2.novell.com ([195.33.99.129]:10168 "EHLO vpn.id2.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751263AbZAZHuw convert rfc822-to-8bit (ORCPT ); Mon, 26 Jan 2009 02:50:52 -0500 Message-Id: <497D798C.76E4.0078.0@novell.com> X-Mailer: Novell GroupWise Internet Agent 8.0.0 Date: Mon, 26 Jan 2009 07:51:24 +0000 From: "Jan Beulich" To: "Jeremy Fitzhardinge" Cc: "Ingo Molnar" , "Xen-devel" , "Linux Kernel Mailing List" , "Nick Piggin" Subject: Re: [Xen-devel] [PATCH 2/2] x86: add pte_set_flags/clear_flags forpteflag manipulation References: <4978F216.5040803@goop.org> <49798A5E.76E4.0078.0@novell.com> <497A3117.2070809@goop.org> In-Reply-To: <497A3117.2070809@goop.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8BIT Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >>> Jeremy Fitzhardinge 23.01.09 22:05 >>> >Jan Beulich wrote: >> 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. >> > >I don't see any particular problem with changing PSE or even Present >with these functions; they don't operate on live in-memory ptes, so its >not like they could ever be used to modify a pte unless followed with >some kind of set_pte operation. It is unwise to change any pte flag >without knowing what you're doing (though P or PSE would probably have >less subtle effects than some of the others). Whether a pte is live doesn't matter here: If you change P on Xen, the frame number representation *must* change from/to PFN to/from MFN. In no case (other than iomem pages) is it allowed to flip just this bit. Jan From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: Re: [PATCH 2/2] x86: add pte_set_flags/clear_flags forpteflag manipulation Date: Mon, 26 Jan 2009 07:51:24 +0000 Message-ID: <497D798C.76E4.0078.0@novell.com> References: <4978F216.5040803@goop.org> <49798A5E.76E4.0078.0@novell.com> <497A3117.2070809@goop.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <497A3117.2070809@goop.org> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Jeremy Fitzhardinge Cc: Nick Piggin , Ingo Molnar , Xen-devel , Linux Kernel Mailing List List-Id: xen-devel@lists.xenproject.org >>> Jeremy Fitzhardinge 23.01.09 22:05 >>> >Jan Beulich wrote: >> 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. >> =20 > >I don't see any particular problem with changing PSE or even Present=20 >with these functions; they don't operate on live in-memory ptes, so = its=20 >not like they could ever be used to modify a pte unless followed with=20 >some kind of set_pte operation. It is unwise to change any pte flag=20 >without knowing what you're doing (though P or PSE would probably have=20 >less subtle effects than some of the others). Whether a pte is live doesn't matter here: If you change P on Xen, the frame number representation *must* change from/to PFN to/from MFN. In no case (other than iomem pages) is it allowed to flip just this bit. Jan