Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755794Ab2HWWPf (ORCPT ); Thu, 23 Aug 2012 18:15:35 -0400 Received: from gate.crashing.org ([63.228.1.57]:46264 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755336Ab2HWWPb (ORCPT ); Thu, 23 Aug 2012 18:15:31 -0400 Message-ID: <1345759998.29170.20.camel@pasglop> Subject: Re: [PATCH 33/36] autonuma: powerpc port From: Benjamin Herrenschmidt To: Andrea Arcangeli Cc: Vaidyanathan Srinivasan , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Hillf Danton , Dan Smith , Linus Torvalds , Andrew Morton , Thomas Gleixner , Ingo Molnar , Paul Turner , Suresh Siddha , Mike Galbraith , "Paul E. McKenney" , Lai Jiangshan , Bharata B Rao , Lee Schermerhorn , Rik van Riel , Johannes Weiner , Srivatsa Vaddagiri , Christoph Lameter , Alex Shi , Mauricio Faria de Oliveira , Konrad Rzeszutek Wilk , Don Morris , Tony Breeds , Kumar Gala Date: Fri, 24 Aug 2012 08:13:18 +1000 In-Reply-To: <1345698660.13399.23.camel@pasglop> References: <1345647560-30387-1-git-send-email-aarcange@redhat.com> <1345647560-30387-34-git-send-email-aarcange@redhat.com> <1345672907.2617.44.camel@pasglop> <20120822223542.GG8107@redhat.com> <1345698660.13399.23.camel@pasglop> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1918 Lines: 52 On Thu, 2012-08-23 at 15:11 +1000, Benjamin Herrenschmidt wrote: > So we don't do protnone, and now that you mention it, I think that > means > that some of our embedded stuff is busted :-) > > Basically PROT_NONE turns into _PAGE_PRESENT without _PAGE_USER for > us. .../... > Looks like the SW TLB handlers used on embedded should also check > whether the address is a user or kernel address, and enforce > _PAGE_USER > in the former case. They might have done in the past, it's possible > that > it's code we lost, but as it is, it's broken. > > The case of HW loaded TLB embedded will need a different definition of > PAGE_NONE as well I suspect. Kumar, can you have a look ? Ok, replying to myself... I wrote some of that stuff so I was all ready to put the brown paper bag on etc... but in fact: - On Book3e.h, we have all 6 protection bits in the PTE (user R,W,X and supervisor R,W,X). _PAGE_BASE has none of them and _PAGE_USER brings both UR and SR. Since _PAGE_USER is not set for PROT_NONE we should be fine. That's the one I wrote so here goes the brown paper bag :-) - 44x/47x is in trouble. _PAGE_USER is just a bit in the PTE that the TLB load handler uses to copy the S bits into the U bits. So we need to modify the code to also refuse to load a TLB entry with an EA below PAGE_OFFSET if _PAGE_USER isn't set. I'll give a try at a patch today if I get a chance, else it will have to wait til after I'm back from Plumbers. - 8xx is probably in trouble, I don't know, I never touch that code, so somebody from FSL should have a look if they care. - FSL BookE looks wrong after a quick look, I'll also let FSL take care of it. Cheers, Ben. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/