From patchwork Mon Nov 4 20:50:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Babu Moger X-Patchwork-Id: 11226525 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6CBFF112B for ; Mon, 4 Nov 2019 20:51:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 35C85214E0 for ; Mon, 4 Nov 2019 20:51:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="LeNdSKGZ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729194AbfKDUu5 (ORCPT ); Mon, 4 Nov 2019 15:50:57 -0500 Received: from mail-eopbgr730056.outbound.protection.outlook.com ([40.107.73.56]:40965 "EHLO NAM05-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728709AbfKDUu5 (ORCPT ); Mon, 4 Nov 2019 15:50:57 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HLAhDeJq8Jm9Z8PaIiHrwlNEdl5v+l69tIZzjxyU/RYk7IYEj0B9XwgTUnQZVdVwg7V+MhmKD8wBkvkq23bsCR7TCsJPg0H6dGejzwRSSZFNjreGxH9gz27cEgf4R/z5CB5AimIJVmEzSPTHxfvTHAxTNAUAxHXPsbgvHhqhkKqAhvJ0eNlQ/0W0IcksP37id5TfJv8iQEGzWf9lEYTzDYllmlQ67tXLOp38sH3FdkaJJpC+0E3E3h4ojsGc2Yo7IlXMWdxTcrVoC15Yw3jhcIr7mr4uL7zwszKUxHkIGLMFShaHk8ZddKvs7rU/Ntg6udT8KINmdAw9FF7wmxkang== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+hIm65fFHkWsdG3pG0gTYIsbsd41pXbC++QaJQTsW2E=; b=Aqd1Q15dp9yXCCkTabanD6oKWifJIJzLiwQBMUYG3QAePSjAqbbqV8ozUbOfYgCyppOWfUgIG7mF5dGDhuZFu1+T8WKJitjEwTqGq0jJwLNpWvy6ZAO22DCKvyUlmk0gytxXk99pyJSzF/xt2pqMVWRli64LcQVapVJRhqg38t6z6jGhcyJSpAEaEQp7y8N5DJnFJAcJEPgriFA2JEo/HOBxRhKGG68JbOcVMm1fk6cmYm1FXTDubFYuXbWYjLuXGsSDdCEHXHljKcN14SiiKUmAcF1JKwrZGEi3Hw4IO9QGoQ/EA3oxQ0BQe98k2nG4kpASEdATeFbFgjgBeof4dA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+hIm65fFHkWsdG3pG0gTYIsbsd41pXbC++QaJQTsW2E=; b=LeNdSKGZa8/37w23wtS4c8deSAetSreZzWc3dl3afupg5M/vTySgIUZnx//yTBIx3umnEGpEqyvwLr0YyuAsfVztpBLuqCR6uFvB4/ugn4xvLu+vy0z5VKdsiqOCDCrq0cKEN5A4DemiiqA07UaQOvKqTDy059kID4A2bL5aFKk= Received: from DM5PR12MB2471.namprd12.prod.outlook.com (52.132.141.138) by DM5PR12MB1387.namprd12.prod.outlook.com (10.168.233.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2387.31; Mon, 4 Nov 2019 20:50:51 +0000 Received: from DM5PR12MB2471.namprd12.prod.outlook.com ([fe80::c5a3:6a2e:8699:1999]) by DM5PR12MB2471.namprd12.prod.outlook.com ([fe80::c5a3:6a2e:8699:1999%6]) with mapi id 15.20.2408.024; Mon, 4 Nov 2019 20:50:51 +0000 From: "Moger, Babu" To: "tglx@linutronix.de" , "mingo@redhat.com" , "bp@alien8.de" , "hpa@zytor.com" , "pbonzini@redhat.com" , "rkrcmar@redhat.com" , "sean.j.christopherson@intel.com" , "vkuznets@redhat.com" , "wanpengli@tencent.com" , "jmattson@google.com" CC: "x86@kernel.org" , "joro@8bytes.org" , "Moger, Babu" , "luto@kernel.org" , "zohar@linux.ibm.com" , "yamada.masahiro@socionext.com" , "nayna@linux.ibm.com" , "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" Subject: [PATCH v2] x86/Kconfig: Rename UMIP config parameter Thread-Topic: [PATCH v2] x86/Kconfig: Rename UMIP config parameter Thread-Index: AQHVk1GLQf345nN80kenPnepADNDDg== Date: Mon, 4 Nov 2019 20:50:51 +0000 Message-ID: <157290058655.2477.5193340480187879024.stgit@naples-babu.amd.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: SN6PR15CA0011.namprd15.prod.outlook.com (2603:10b6:805:16::24) To DM5PR12MB2471.namprd12.prod.outlook.com (2603:10b6:4:b5::10) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Babu.Moger@amd.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [165.204.78.2] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 29a8e5a2-2388-4dc8-80fd-08d76168ada3 x-ms-traffictypediagnostic: DM5PR12MB1387: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6108; x-forefront-prvs: 0211965D06 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(4636009)(366004)(346002)(376002)(396003)(39860400002)(136003)(189003)(199004)(305945005)(26005)(54906003)(316002)(66066001)(66476007)(2201001)(6436002)(103116003)(14444005)(71200400001)(5660300002)(3846002)(6116002)(4326008)(256004)(2906002)(7416002)(386003)(6506007)(102836004)(14454004)(8676002)(8936002)(81156014)(81166006)(25786009)(6486002)(7736002)(66446008)(66946007)(64756008)(66556008)(86362001)(6512007)(71190400001)(110136005)(478600001)(2501003)(476003)(186003)(99286004)(52116002)(486006)(921003)(1121003);DIR:OUT;SFP:1101;SCL:1;SRVR:DM5PR12MB1387;H:DM5PR12MB2471.namprd12.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: amd.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 3qcjTzdD+dE2Ay5b8StNudg/5fshAwQxWF9WPwps4P9Lc0T2Kw8ZOnPKr9KCr/V1MhkNzLTBTo6fVy5MzgcwTSuExaIbllr61PfvdUGBk6AU8gIs2AfstTy+mMUt2r6GibgUkZyliwiPacvSCmAsrWPzYVyC9Vv6mOFIJhc/AMFMeWZ8q+9PTVZz7ROdyZtrQZPrWkoKA1dfkTznxr3nkhjiKASDakEGX8s6eMy/9Npu2fFRcHqqZb8wxWtNdoN+yS409lynG7NGYFKzuKZ38ppTnncF1GvMUBa7rZMIe6/z8PRQM2e87Z7t3dnZ8rOQUeqpIJPjMfmda50OCeUqqWTcNqyiPHct4KfNWXWE82pMxpYs4bb3glmALYDMWoTDdFqz62Dxcc9GoMhHQYkI8uK6r/b6WSKe3LC3JlM1PRUKi3UtjWbxQgB+khT2Sa5R Content-ID: MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 29a8e5a2-2388-4dc8-80fd-08d76168ada3 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Nov 2019 20:50:51.6030 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: smQOp3TKevWys9tbIIgK5X5kOHHxfd+AM+oXx31rDgKu1XWYTCdilJDagIDlN22p X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1387 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org AMD 2nd generation EPYC processors support the UMIP (User-Mode Instruction Prevention) feature. So, rename X86_INTEL_UMIP to generic X86_UMIP and modify the text to cover both Intel and AMD. Signed-off-by: Babu Moger --- v2: Learned that for the hardware that support UMIP, we dont need to emulate. Removed the emulation related code and just submitting the config changes. arch/x86/Kconfig | 8 ++++---- arch/x86/include/asm/disabled-features.h | 2 +- arch/x86/include/asm/umip.h | 4 ++-- arch/x86/kernel/Makefile | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index d6e1faa28c58..821b7cebff31 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -1880,13 +1880,13 @@ config X86_SMAP If unsure, say Y. -config X86_INTEL_UMIP +config X86_UMIP def_bool y - depends on CPU_SUP_INTEL - prompt "Intel User Mode Instruction Prevention" if EXPERT + depends on X86 && (CPU_SUP_INTEL || CPU_SUP_AMD) + prompt "User Mode Instruction Prevention" if EXPERT ---help--- The User Mode Instruction Prevention (UMIP) is a security - feature in newer Intel processors. If enabled, a general + feature in newer x86 processors. If enabled, a general protection fault is issued if the SGDT, SLDT, SIDT, SMSW or STR instructions are executed in user mode. These instructions unnecessarily expose information about the hardware state. diff --git a/arch/x86/include/asm/disabled-features.h b/arch/x86/include/asm/disabled-features.h index a5ea841cc6d2..8e1d0bb46361 100644 --- a/arch/x86/include/asm/disabled-features.h +++ b/arch/x86/include/asm/disabled-features.h @@ -22,7 +22,7 @@ # define DISABLE_SMAP (1<<(X86_FEATURE_SMAP & 31)) #endif -#ifdef CONFIG_X86_INTEL_UMIP +#ifdef CONFIG_X86_UMIP # define DISABLE_UMIP 0 #else # define DISABLE_UMIP (1<<(X86_FEATURE_UMIP & 31)) diff --git a/arch/x86/include/asm/umip.h b/arch/x86/include/asm/umip.h index db43f2a0d92c..aeed98c3c9e1 100644 --- a/arch/x86/include/asm/umip.h +++ b/arch/x86/include/asm/umip.h @@ -4,9 +4,9 @@ #include #include -#ifdef CONFIG_X86_INTEL_UMIP +#ifdef CONFIG_X86_UMIP bool fixup_umip_exception(struct pt_regs *regs); #else static inline bool fixup_umip_exception(struct pt_regs *regs) { return false; } -#endif /* CONFIG_X86_INTEL_UMIP */ +#endif /* CONFIG_X86_UMIP */ #endif /* _ASM_X86_UMIP_H */ diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile index 3578ad248bc9..52ce1e239525 100644 --- a/arch/x86/kernel/Makefile +++ b/arch/x86/kernel/Makefile @@ -134,7 +134,7 @@ obj-$(CONFIG_EFI) += sysfb_efi.o obj-$(CONFIG_PERF_EVENTS) += perf_regs.o obj-$(CONFIG_TRACING) += tracepoint.o obj-$(CONFIG_SCHED_MC_PRIO) += itmt.o -obj-$(CONFIG_X86_INTEL_UMIP) += umip.o +obj-$(CONFIG_X86_UMIP) += umip.o obj-$(CONFIG_UNWINDER_ORC) += unwind_orc.o obj-$(CONFIG_UNWINDER_FRAME_POINTER) += unwind_frame.o