Received: by 10.223.164.202 with SMTP id h10csp2771291wrb; Fri, 24 Nov 2017 17:23:59 -0800 (PST) X-Google-Smtp-Source: AGs4zMZmKnZ9IeQOYgrSnR1ks7nCT8WkQ0xa84XD6rvoFaJSxRV80WYfWyPZqbgxaSA0NXyCrV/j X-Received: by 10.84.252.23 with SMTP id x23mr31292246pll.54.1511573039042; Fri, 24 Nov 2017 17:23:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511573039; cv=none; d=google.com; s=arc-20160816; b=bEXmMlL797taEIYR3kdu7b3a1BCAKHNQftprBtdef2Th9huPAs1VxMt16oQdmJl44R ChHzbRbVHW3gWRx/o1eL3X8zM3LHJzUSH7jr5s9fxjBsqAOsoyete8lRXsBULNHGc4q9 WZPZVDLYaOATL9XKRWqWHBQT5BFJgfFgQaBmAC189Ljfiu5OWDq0/bsRIcmP1BJjTdXj zSusLeWtx5FDu9/gbTIEHUAFI3DhMZdgUruyZhmqlkoCM6LUbLNxhv+wIhNb2JIs6kAX dNQxFHSKXKGR9jhav+S1axHE43byd9L43TXTIsNnX9bp8HIPz1gLyyG03ek+dnZsZrPu Xg4A== 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:arc-authentication-results; bh=8zdYCgvQ6HoYpqVXGydSxFaT5oUPrT6fpAtPnCNRMSc=; b=wvPiNb/cYR/75QLSfhGSHZef0S/WDR7bWLHAR/aGZODIpza25shK4msjeLkXE8eUVN FbMjkayC4kbbZoYRfJJpMnGyjnXsIDEU3+nOhG5Skf3r5j7FnQAyAcNJ88qIy/ZpOwt7 7a5f6okA32DzJxsZrdH3IbMDr8T0Moe8qHp6exjAH01yb4ER4vUro39PEwxnixID2ksD RXShKYco5iLoH+wb7bPV5Rfu/Ed9zqz/ar875Hpuqf9dnIRyixZ/4oDcJJO9wyEXDKMA mIBY9MKVbkdEz+wsYYJFcqpyA/tNAQc8liBcEyaZmeP1xx311BHKE7mR+C3Hq8JH0BWO EMsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=qM8zxwhA; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j1si15134282pgq.328.2017.11.24.17.23.47; Fri, 24 Nov 2017 17:23:59 -0800 (PST) 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=pass header.i=@amazon.com header.s=amazon201209 header.b=qM8zxwhA; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751865AbdKYBXL (ORCPT + 77 others); Fri, 24 Nov 2017 20:23:11 -0500 Received: from smtp-fw-33001.amazon.com ([207.171.190.10]:8790 "EHLO smtp-fw-33001.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751629AbdKYBXK (ORCPT ); Fri, 24 Nov 2017 20:23:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1511572990; x=1543108990; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=8zdYCgvQ6HoYpqVXGydSxFaT5oUPrT6fpAtPnCNRMSc=; b=qM8zxwhA8N135YVs1oc/SCsSUz+qsTLyAzPt68UpnbDhG76UbBbx7Rtc d4IU82dLKl1H9PFX80nYGLy9sgZDYDVjMKx5OOzZC+UITy0YMi13PQ0Ya qCIkDqOq89Rd+VRGQEfOZ2p1dejnkLbYbpFX7md1rNdiCSzvHcGIACrij E=; X-IronPort-AV: E=Sophos;i="5.44,450,1505779200"; d="scan'208";a="704720755" Received: from sea3-co-svc-lb6-vlan2.sea.amazon.com (HELO email-inbound-relay-1d-2c665b5d.us-east-1.amazon.com) ([10.47.22.34]) by smtp-border-fw-out-33001.sea14.amazon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 25 Nov 2017 01:23:08 +0000 Received: from EX13MTAUWC001.ant.amazon.com (iad55-ws-svc-p15-lb9-vlan3.iad.amazon.com [10.40.159.166]) by email-inbound-relay-1d-2c665b5d.us-east-1.amazon.com (8.14.7/8.14.7) with ESMTP id vAP1MvRD067099 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=FAIL); Sat, 25 Nov 2017 01:23:04 GMT Received: from EX13d09UWC004.ant.amazon.com (10.43.162.114) by EX13MTAUWC001.ant.amazon.com (10.43.162.135) with Microsoft SMTP Server (TLS) id 15.0.1236.3; Sat, 25 Nov 2017 01:23:03 +0000 Received: from EX13MTAUWC001.ant.amazon.com (10.43.162.135) by EX13d09UWC004.ant.amazon.com (10.43.162.114) with Microsoft SMTP Server (TLS) id 15.0.1236.3; Sat, 25 Nov 2017 01:23:02 +0000 Received: from localhost (10.85.21.20) by mail-relay.amazon.com (10.43.162.232) with Microsoft SMTP Server id 15.0.1236.3 via Frontend Transport; Sat, 25 Nov 2017 01:23:02 +0000 Date: Fri, 24 Nov 2017 17:23:02 -0800 From: Eduardo Valentin To: Dave Hansen CC: , , , , , , , , , , , Subject: Re: [PATCH 20/23] x86, kaiser: add a function to check for KAISER being enabled Message-ID: <20171125012302.GD2017@u40b0340c692b58f6553c.ant.amazon.com> References: <20171123003438.48A0EEDE@viggo.jf.intel.com> <20171123003518.B7D81B14@viggo.jf.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20171123003518.B7D81B14@viggo.jf.intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 22, 2017 at 04:35:18PM -0800, Dave Hansen wrote: > > From: Dave Hansen > > Currently, all of the checks for KAISER are compile-time checks. > > Runtime checks are needed for turning it on/off at runtime. > > Add a function to do that. > > Signed-off-by: Dave Hansen > Cc: Moritz Lipp > Cc: Daniel Gruss > Cc: Michael Schwarz > Cc: Richard Fellner > Cc: Andy Lutomirski > Cc: Linus Torvalds > Cc: Kees Cook > Cc: Hugh Dickins > Cc: x86@kernel.org > --- > > b/arch/x86/include/asm/kaiser.h | 5 +++++ > b/include/linux/kaiser.h | 5 +++++ > 2 files changed, 10 insertions(+) > > diff -puN arch/x86/include/asm/kaiser.h~kaiser-dynamic-check-func arch/x86/include/asm/kaiser.h > --- a/arch/x86/include/asm/kaiser.h~kaiser-dynamic-check-func 2017-11-22 15:45:55.262619723 -0800 > +++ b/arch/x86/include/asm/kaiser.h 2017-11-22 15:45:55.267619723 -0800 > @@ -56,6 +56,11 @@ extern void kaiser_remove_mapping(unsign > */ > extern void kaiser_init(void); > > +static inline bool kaiser_active(void) > +{ > + extern int kaiser_enabled; Should this really be extern ? I am getting a compilation error while linking the bzImage with this series: arch/x86/boot/compressed/pagetable.o: In function `kernel_ident_mapping_init': pagetable.c:(.text+0x336): undefined reference to `kaiser_enabled' arch/x86/boot/compressed/Makefile:109: recipe for target 'arch/x86/boot/compressed/vmlinux' failed make[2]: *** [arch/x86/boot/compressed/vmlinux] Error 1 arch/x86/boot/Makefile:112: recipe for target 'arch/x86/boot/compressed/vmlinux' failed make[1]: *** [arch/x86/boot/compressed/vmlinux] Error 2 arch/x86/Makefile:296: recipe for target 'bzImage' failed make: *** [bzImage] Error 2 What I did was to remove the extern and EXPORT_SYMBOL(kaiser_enabled) and initialize kaiser_enabled as 0, after that I got a proper bzImage. > + return kaiser_enabled; > +} > #endif > > #endif /* __ASSEMBLY__ */ > diff -puN include/linux/kaiser.h~kaiser-dynamic-check-func include/linux/kaiser.h > --- a/include/linux/kaiser.h~kaiser-dynamic-check-func 2017-11-22 15:45:55.264619723 -0800 > +++ b/include/linux/kaiser.h 2017-11-22 15:45:55.268619723 -0800 > @@ -28,5 +28,10 @@ static inline int kaiser_add_mapping(uns > static inline void kaiser_add_mapping_cpu_entry(int cpu) > { > } > + > +static inline bool kaiser_active(void) > +{ > + return 0; > +} > #endif /* !CONFIG_KAISER */ > #endif /* _INCLUDE_KAISER_H */ > _ > -- All the best, Eduardo Valentin From 1584815247132834352@xxx Thu Nov 23 00:39:57 +0000 2017 X-GM-THRID: 1584815247132834352 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread