From patchwork Thu Nov 17 09:19:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suleiman Souhlal X-Patchwork-Id: 13046366 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 98205C43217 for ; Thu, 17 Nov 2022 09:20:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239864AbiKQJUq (ORCPT ); Thu, 17 Nov 2022 04:20:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239853AbiKQJUi (ORCPT ); Thu, 17 Nov 2022 04:20:38 -0500 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D946697E3 for ; Thu, 17 Nov 2022 01:20:37 -0800 (PST) Received: by mail-yb1-xb4a.google.com with SMTP id s77-20020a257750000000b006e5e383ec68so1025745ybc.6 for ; Thu, 17 Nov 2022 01:20:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=A3XSLXpnm3peAFX4SkwU1UTCaP2K+GcdXoBa9S6a9Ow=; b=FHLU4BxNR15V2FFqCHwNZrtWlCNq5IUnX5r59jpp8mPp5soARo8eN8xT06yKj7mbqY bXU8ReuV+2p6K9vj0+/+lNwLT4VQ7pkiRHLCwDXUVQt5V8OeGgIJA/pry/bDZIHPux+u Tk+bdi4+IRlXl6wO5Ccw0k23JX2C/Gx0IswXoUQ157YcswRC/+Yy6X8eMLAfHGZHy3oV JH0p09BPDmFr2PhhrEpBUoO1CZfLyiQxMV6SgcFeVITS9ZcLvpM3DdQKK/8j3lhS91kr pRP56rn8ixKHovfcVea+mp7zZLbOky4rTtIYettmOjLu/QdeUeTpIA4mMc5pAmhiV5B7 myIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=A3XSLXpnm3peAFX4SkwU1UTCaP2K+GcdXoBa9S6a9Ow=; b=MqS0BFXiS5japGiBdUDACHTvwixkFu1FZGoYyym4BFhehTMAN61paDOtJ4CLgADKER lym4+HNN5Sl8VgdijguTixU7cOOGprJJBi64SBC8FviPa7n0Y24TVqPfpvg6nZvOYkxF X8nRoJtBphZ3VpCl6Lz148Lufv9qcn+Iej0l27PwYlRRF3fhY+L53CdU1XULNiS/sGBJ pnuoiHSGN8aol/VKS4m9fZlcmY++EeiDV3CO/PBnBzNPgZyI1mfU9/IWRpIB5nLbiOK3 b6dWMReKmlzmXJlara1yoKgnW3aHNK5WI5a8BJ6bYPoulgp8LXCa7uCLN68/yTOjfjDx mYxQ== X-Gm-Message-State: ANoB5pk0x4o/EZiZzvxVOGIYEmI2qDNNL2trkoe0RxKP1lf1/DRSataA XtVuqxcpc8u2pVY7R/mh9eWB8vi0EDPBFQ== X-Google-Smtp-Source: AA0mqf5ckQZecqK6pWG33qQEqpQJoKDwhNldxu3flsQk3muMzt+s/Dr3dSpeKeJSiFoTMXhC3lvyta4PKXW+6w== X-Received: from suleiman1.tok.corp.google.com ([2401:fa00:8f:203:416e:f3c7:7f1d:6e]) (user=suleiman job=sendgmr) by 2002:a81:1045:0:b0:35d:7f88:12f9 with SMTP id 66-20020a811045000000b0035d7f8812f9mr1134609ywq.471.1668676836745; Thu, 17 Nov 2022 01:20:36 -0800 (PST) Date: Thu, 17 Nov 2022 18:19:26 +0900 In-Reply-To: <20221117091952.1940850-1-suleiman@google.com> Message-Id: <20221117091952.1940850-9-suleiman@google.com> Mime-Version: 1.0 References: <20221117091952.1940850-1-suleiman@google.com> X-Mailer: git-send-email 2.38.1.431.g37b22c650d-goog Subject: [PATCH 4.19 08/34] x86/cpufeatures: Move RETPOLINE flags to word 11 From: Suleiman Souhlal To: stable@vger.kernel.org Cc: x86@kernel.org, kvm@vger.kernel.org, bp@alien8.de, pbonzini@redhat.com, peterz@infradead.org, jpoimboe@kernel.org, cascardo@canonical.com, surajjs@amazon.com, ssouhlal@FreeBSD.org, suleiman@google.com Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Peter Zijlstra commit a883d624aed463c84c22596006e5a96f5b44db31 upstream. In order to extend the RETPOLINE features to 4, move them to word 11 where there is still room. This mostly keeps DISABLE_RETPOLINE simple. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Reviewed-by: Josh Poimboeuf Signed-off-by: Borislav Petkov Signed-off-by: Thadeu Lima de Souza Cascardo Signed-off-by: Greg Kroah-Hartman Signed-off-by: Suleiman Souhlal --- arch/x86/include/asm/cpufeatures.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufeatures.h index 3a270a2da5b4..84b75711b0a5 100644 --- a/arch/x86/include/asm/cpufeatures.h +++ b/arch/x86/include/asm/cpufeatures.h @@ -202,8 +202,8 @@ #define X86_FEATURE_PROC_FEEDBACK ( 7*32+ 9) /* AMD ProcFeedbackInterface */ #define X86_FEATURE_SME ( 7*32+10) /* AMD Secure Memory Encryption */ #define X86_FEATURE_PTI ( 7*32+11) /* Kernel Page Table Isolation enabled */ -#define X86_FEATURE_RETPOLINE ( 7*32+12) /* "" Generic Retpoline mitigation for Spectre variant 2 */ -#define X86_FEATURE_RETPOLINE_LFENCE ( 7*32+13) /* "" Use LFENCE for Spectre variant 2 */ +/* FREE! ( 7*32+12) */ +/* FREE! ( 7*32+13) */ #define X86_FEATURE_INTEL_PPIN ( 7*32+14) /* Intel Processor Inventory Number */ #define X86_FEATURE_CDP_L2 ( 7*32+15) /* Code and Data Prioritization L2 */ #define X86_FEATURE_MSR_SPEC_CTRL ( 7*32+16) /* "" MSR SPEC_CTRL is implemented */ @@ -283,6 +283,14 @@ #define X86_FEATURE_CQM_MBM_LOCAL (11*32+ 3) /* LLC Local MBM monitoring */ #define X86_FEATURE_FENCE_SWAPGS_USER (11*32+ 4) /* "" LFENCE in user entry SWAPGS path */ #define X86_FEATURE_FENCE_SWAPGS_KERNEL (11*32+ 5) /* "" LFENCE in kernel entry SWAPGS path */ +/* FREE! (11*32+ 6) */ +/* FREE! (11*32+ 7) */ +/* FREE! (11*32+ 8) */ +/* FREE! (11*32+ 9) */ +/* FREE! (11*32+10) */ +/* FREE! (11*32+11) */ +#define X86_FEATURE_RETPOLINE (11*32+12) /* "" Generic Retpoline mitigation for Spectre variant 2 */ +#define X86_FEATURE_RETPOLINE_LFENCE (11*32+13) /* "" Use LFENCE for Spectre variant 2 */ /* AMD-defined CPU features, CPUID level 0x80000008 (EBX), word 13 */ #define X86_FEATURE_CLZERO (13*32+ 0) /* CLZERO instruction */