Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2941493rwb; Mon, 19 Sep 2022 12:20:33 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7a2PRqZEooSbac+wuS40evVQfth9GlD4ks6CbyLJmu80h8W4I9nguPtFdwaW5jYCxDKG8t X-Received: by 2002:a05:6402:5168:b0:44e:9ca8:bf6 with SMTP id d8-20020a056402516800b0044e9ca80bf6mr16849920ede.384.1663615233458; Mon, 19 Sep 2022 12:20:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663615233; cv=none; d=google.com; s=arc-20160816; b=tfCPzfpM88sIEZV4ae28tWuM4amCN1eP9JQKfhs7Lq17rXalPUQc4pv7gKnmCzZX9O 4Ng4eM45wYHUoan15gS0DCA0h+XL4dX3l5SLbLOm+qpXYfI/5S5OtfJKwqiVBpSmMWnT 2NCWv29jQl323OCh3Bpyn8YvQUfIvL6lkDDkhAc6bVe6fJaLj4QnKvOyUw2aw+98BZD0 6J3DHetWhOADgXmmm1gPrYcd8x+PUVcPh0IUllG7Ywqvf21ksJ47O5ttONlyaKTjNxgv Iz55NeUe9pbSMazm9FPAIpBVOZnBm6ZOaz84le4o2QyUBHGEYvoEX3xEkdfnNU4EnjNo zPCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :dkim-signature; bh=9pKGjGT0BqChjzFN5mK6yu1xhqR6LbRCMXLnjsZxu34=; b=U9u61dac9ZHaJ4O6uqGq2gibBxFfyHAvlCplBiLlhoP4I30UzLQHMbrzGjlAVA+1Hi rUzCwY8WWheXclt6urBcd7M6nu7RyD9X9MVnIMbBDDqYTl21408mLMo9+G26yEWtjZQ3 mjaVkP1CSd7unkKuYT/GQpmMUDsNstVWfuTEI/fRg15B4TUFnyKv2Oqaj9HNaAvWpaJ+ mfh35V4gOrvvXoT9WUR9W5zgLOGDOIsAST1wz/JTCbmRVICl7z/RC1iC4b+jBgHngdoj v7L0NCi3rAS4+RBxYib/TyneRESsvmf2Q2J5xSD8Rc0hFMAF/bheKD/7b2QU4yfI++NQ iDvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=NCWZxrln; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u22-20020a170906781600b007306307b9bbsi21975726ejm.788.2022.09.19.12.20.08; Mon, 19 Sep 2022 12:20:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=NCWZxrln; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229632AbiISSai (ORCPT + 99 others); Mon, 19 Sep 2022 14:30:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229602AbiISSah (ORCPT ); Mon, 19 Sep 2022 14:30:37 -0400 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68FB72B61F for ; Mon, 19 Sep 2022 11:30:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663612236; x=1695148236; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to; bh=Gn5QeiWrMiahoSLBSm3/k0G4eI3kTGCsp0uJTykBkRs=; b=NCWZxrlnBAnUta6VxE9ysorL/qH2V5gq1XOX6SLra/zC9GsxudKdF9vR h+jzpp2CkaXtAtId4R3YkFwRIUtZ3KnYQ21W5qzj4INvxKsRSEasA0rMR ov2b4394xiO7Ni6V8DyOROzYe1eBuwYjFkvNY/oBiUtX6vUXeGP/NqjV7 xT+WnViX66vppd+Uo+4W/Xy0IEEwdHmjmZ7xqiA66qR7L6JKb2tc2VsPL uDZszdHcRMW2iURF4AVtZL11B8qKsrvQqyLbxcp1Xd34PhXS70bNx+SyC slsrgEp7Fcx19AzbJfhxzcWAN48nU6QkxbMjk5BECmoUyVS0ECGN8ap4m A==; X-IronPort-AV: E=McAfee;i="6500,9779,10475"; a="282511399" X-IronPort-AV: E=Sophos;i="5.93,328,1654585200"; d="scan'208";a="282511399" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Sep 2022 11:30:11 -0700 X-IronPort-AV: E=Sophos;i="5.93,328,1654585200"; d="scan'208";a="680962255" Received: from dvanwage-mobl1.amr.corp.intel.com (HELO [10.209.74.97]) ([10.209.74.97]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Sep 2022 11:30:10 -0700 Content-Type: multipart/mixed; boundary="------------oCJ0Y9e0uXZlFEqiFZbruT0p" Message-ID: Date: Mon, 19 Sep 2022 11:30:09 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH] x86/mm: Set NX bit when making pages present Content-Language: en-US To: "Edgecombe, Rick P" , "linux-kernel@vger.kernel.org" , "dave.hansen@linux.intel.com" Cc: "peterz@infradead.org" , "tglx@linutronix.de" , "x86@kernel.org" , "hpa@zytor.com" , "mingo@redhat.com" , "Lutomirski, Andy" , "Liu, Yujie" , "bp@alien8.de" References: <20220909152721.1685334-1-dave.hansen@linux.intel.com> <14fea0e6809b42393388d20f5b62509108a87a71.camel@intel.com> From: Dave Hansen In-Reply-To: <14fea0e6809b42393388d20f5b62509108a87a71.camel@intel.com> X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is a multi-part message in MIME format. --------------oCJ0Y9e0uXZlFEqiFZbruT0p Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 9/19/22 11:14, Edgecombe, Rick P wrote: > Clearly somehow it is though. The original report has this in the log: > Notice: NX (Execute Disable) protection cannot be enabled: non-PAE > kernel! Ah, crud. Nice catch, btw. So, the CPU has NX, making cpu_feature_enabled(X86_FEATURE_NX)==1, but the page table mode does not have support. I guess we can either clear X86_FEATURE_NX around the "protection cannot be enabled" message, or do something like the attached patch and just do the check at runtime. I'm not sure we want to mess with X86_FEATURE_NX itself. It seems to get used for a few different things, including on the KVM side. 0day folks, can you see if _this_ one (totally untested) helps the situation? At least this is a real oddball case. It's not something that folks are very likely to hit at all. --------------oCJ0Y9e0uXZlFEqiFZbruT0p Content-Type: text/x-patch; charset=UTF-8; name="nx.patch" Content-Disposition: attachment; filename="nx.patch" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2FyY2gveDg2L2tlcm5lbC9zZXR1cC5jIGIvYXJjaC94ODYva2VybmVs L3NldHVwLmMKaW5kZXggMjE2ZmVlNzE0NGVlLi4wMDU0OTIyNTdhYmIgMTAwNjQ0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