Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753406AbbKQJoQ (ORCPT ); Tue, 17 Nov 2015 04:44:16 -0500 Received: from mail-wm0-f42.google.com ([74.125.82.42]:33747 "EHLO mail-wm0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752920AbbKQJoN (ORCPT ); Tue, 17 Nov 2015 04:44:13 -0500 Date: Tue, 17 Nov 2015 09:44:10 +0000 From: Matt Fleming To: Dave Hansen Cc: Ingo Molnar , Thomas Gleixner , "H . Peter Anvin" , Toshi Kani , linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org, Sai Praneeth Prakhya , Borislav Petkov Subject: Re: [PATCH v2 1/5] x86/mm/pageattr: Ensure cpa->pfn only contains page frame numbers Message-ID: <20151117094410.GA2727@codeblueprint.co.uk> References: <1447538451-5793-1-git-send-email-matt@codeblueprint.co.uk> <1447538451-5793-2-git-send-email-matt@codeblueprint.co.uk> <5649FCA1.1000600@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5649FCA1.1000600@intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1460 Lines: 38 On Mon, 16 Nov, at 07:56:17AM, Dave Hansen wrote: > I'm glad you're looking at this. It obviously needed some love. :) > > On 11/14/2015 02:00 PM, Matt Fleming wrote: > > + npages = (_end - _text) >> PAGE_SHIFT; > > + text = __pa(_text); > > + pfn = text >> PAGE_SHIFT; > > + > > + if (kernel_map_pages_in_pgd(pgd, pfn, text, npages, 0)) { > > + pr_err("Failed to map kernel text 1:1\n"); > > + return 1; > > + } > > Are _end and _text guaranteed to be aligned? If not, I think the > calculation might be wrong. Just for fun, imagine that _end=0xfff and > _text=0x1001. npages would be 0. Bugger. Good catch, thanks. > Some other code like set_kernel_text_rw() does alignment on _text. > > One nit is that there's quite a bit going on here, like rearranging the > phys_stack arithmetic ordering that is far beyond just simplifying the > paddr vs. pfn issue, but that isn't called out in the changelog at all. Yeah, the phys_stack hunk actually slipped into this patch by accident. It ensures the stack is mapped into the EFI page tables. I'll split this out. > Your fixes all look correct to me, fwiw. Thanks! If you could respond to the next version with an ACK or Reviewed-by tag, that'd be great. -- 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/