Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9224668ybi; Wed, 10 Jul 2019 06:45:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqwnlVlFCTTORnUgTKtQJFevLgDLQtrrGSNsIEm8P5NATH/lQxH0d+W3ATTbMUhaLg2dC1/U X-Received: by 2002:a17:90a:9bca:: with SMTP id b10mr7136022pjw.90.1562766346963; Wed, 10 Jul 2019 06:45:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562766346; cv=none; d=google.com; s=arc-20160816; b=YqAuMIpCruXO4JYuNGCPRqAT1lojC2QR078ol9f9gdMlEoag69wnuwWyNx2peDHe5y 0kvEO0mLjtLpaNCG3RGc7nVqjV5ypfMgYcx4YkDztOFaVDX/PilAiDJVOb2063ASMAQc 5pXq0nqwZPWupf/kZritlhjUbgab+9dWoNsAu7jRm6XG0idIiwWHmE3bhPOQKNM3rOuX tadcxxwd3pgiGMUb95luhTgI+UB7KpYkMlufjN/4qqU0oWyUzUvjfoWpVN4FjdYLY41i J3s+h6bOsgLwahl3ROGYsTHFJAstbrdi7Il7ARsXaCMVo1kL9IaxQeh048GssUqMjG96 nA8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=5it4G6eaywghVnR4elg3H5x4iunu3dNhSVWHqmcRde4=; b=U/hx0EIYAxpHc+crfMDC7+Wple/6tl1IIQShBqLw85B4a9tuul2zX98a5G7j0tRonn bkBCTf+3xiIZi7KufLytBzFzHUUUlmtkZZ5L/q4Q7h/ZZxGL10RHfve9UaI+RNQFAPo3 BQ6e+Nn+hZqYwPsxthMcHI6JpMGWnulPfq+v27CQnggbrpvEcEQAQ1hXc0lhdj3+n6LP HE6Ck2ddg1+ODDwsRXO64kRQQhec7iO/dUImsMTR8Ll76GFsCxzMUCuHTKyukZvHfKOw JT/ioGwl5zv7QB4BAC0ICvr6UYDGyzVVUMkGEOYmwLZCpYjQ5Ggs59/oT+ei09KAF/gm CODw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=mHjBG21V; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f7si2067800pgv.105.2019.07.10.06.45.30; Wed, 10 Jul 2019 06:45:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=mHjBG21V; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727726AbfGJNot (ORCPT + 99 others); Wed, 10 Jul 2019 09:44:49 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:59518 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727389AbfGJNos (ORCPT ); Wed, 10 Jul 2019 09:44:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=5it4G6eaywghVnR4elg3H5x4iunu3dNhSVWHqmcRde4=; b=mHjBG21VKFos5ObtmXA/gZ5eL CY+VtlaF6Qv+nMoWEk8bkvUaA1+70L5QWplR8unDu+0jrcE8s2Ii3+acNiJOoRc/TmC33Uu/tMw4d ngGfiyZCH4Niuvf/ZFsc6QOQNu60C331dF9n6RsTWIUexqQd/hQ1HZjM/fX07wTJu0TSJihx/ll4T J2HeDBBDLOoLOXwD7/xapiDYDeasMhXa+z+vCPRmo317iHzxI6detG/a+uWz2o0CQdgfJdWFcABMY UMfBoR6ak4rw5eI1wJeV+PHNG2DcqSd8MgiH+MOU6puSJYB5gaxunAGJzHsHliiyzJFaHWMiCszsB ZQoXK4yqA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1hlCtf-00022s-Ki; Wed, 10 Jul 2019 13:44:35 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 735F420976EE4; Wed, 10 Jul 2019 15:44:33 +0200 (CEST) Date: Wed, 10 Jul 2019 15:44:33 +0200 From: Peter Zijlstra To: Xi Ruoyao Cc: Jiri Kosina , Thomas Gleixner , Kees Cook , Linus Torvalds , Ingo Molnar , Linux List Kernel Mailing , Borislav Petkov , Len Brown , Andrew Morton , "Rafael J. Wysocki" , Tony Luck , Bob Moore , Erik Schmauss , Josh Poimboeuf , Daniel Bristot de Oliveira , Nadav Amit Subject: Re: [GIT PULL] x86/topology changes for v5.3 Message-ID: <20190710134433.GN3402@hirez.programming.kicks-ass.net> References: <201907091727.91CC6C72D8@keescook> <1ad2de95e694a29909801d022fe2d556df9a4bd5.camel@mengyan1223.wang> <768463eb26a2feb0fcc374fd7f9cc28b96976917.camel@mengyan1223.wang> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <768463eb26a2feb0fcc374fd7f9cc28b96976917.camel@mengyan1223.wang> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 10, 2019 at 09:25:16PM +0800, Xi Ruoyao wrote: > On 2019-07-10 14:31 +0200, Jiri Kosina wrote: > > Adding Daniel to check whether this couldn't be some fallout of jumplabel > > batching. > > I don't think so. I tried to revert Daniel's jumplabel batching commits and the > issue wasn't solved. But reverting Kees' CR0 and CR4 commits can "fix" it > (apprently). Xi, could you please try the below instead? If we mark the key as RO after init, and then try and modify the key to link module usage sites, things might go bang as described. Thanks! diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index 27d7864e7252..5bf7a8354da2 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -366,7 +366,7 @@ static __always_inline void setup_umip(struct cpuinfo_x86 *c) cr4_clear_bits(X86_CR4_UMIP); } -DEFINE_STATIC_KEY_FALSE_RO(cr_pinning); +DEFINE_STATIC_KEY_FALSE(cr_pinning); EXPORT_SYMBOL(cr_pinning); unsigned long cr4_pinned_bits __ro_after_init; EXPORT_SYMBOL(cr4_pinned_bits);