Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932702AbbLNWZd (ORCPT ); Mon, 14 Dec 2015 17:25:33 -0500 Received: from mail-lf0-f52.google.com ([209.85.215.52]:34130 "EHLO mail-lf0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753575AbbLNWZc (ORCPT ); Mon, 14 Dec 2015 17:25:32 -0500 MIME-Version: 1.0 In-Reply-To: <566F3378.8070009@linux.intel.com> References: <20151115070022.GA15417@amd> <20151214080403.GA3708@amd> <20151214085803.GA10520@pd.tnic> <20151214090726.GA6472@amd> <20151214202627.GA15104@amd> <566F3378.8070009@linux.intel.com> From: Andy Lutomirski Date: Mon, 14 Dec 2015 14:25:10 -0800 Message-ID: Subject: Re: 4.4-rc5: ugly warn on: 5 W+X pages found To: Arjan van de Ven Cc: Pavel Machek , Linus Torvalds , Borislav Petkov , kernel list , Stephen Smalley , Brian Gerst , Denys Vlasenko , Peter Anvin , Mike Galbraith , Peter Zijlstra , Thomas Gleixner Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1453 Lines: 37 On Mon, Dec 14, 2015 at 1:24 PM, Arjan van de Ven wrote: > >> That's weird. The only API to do that seems to be manually setting >> kmap_prot to _PAGE_KERNEL_EXEC, and nothing does that. (Why is >> kmap_prot a variable on x86 at all? It has exactly one writer, and >> that's the code that initializes it in the first place. Shouldn't we >> #define kmap_prot _PAGE_KERNEL? > > > iirc it changes based on runtime detection of NX capability > Maybe it did, but if it still does, I can't find the code. What *does* change is __supported_pte_mask. If we're willing to make disable_nx work a little less well, we could try to initialize __supported_pte_mask from the very beginning. (We currently seem to detect and enable NX even before we enable paging.) I suspect that Pavel is seeing a kmap mapping left over from so early that it didn't have NX set (killed by massage_pgprot). Borislav, could we do that? (Why do we have disable_nx at all? I suspect it was for debugging a long, long time ago.) Alternatively, we could go through and set NX everywhere after we decide we have NX, but that seems rather error-prone. --Andy -- Andy Lutomirski AMA Capital Management, LLC -- 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/