From nobody Tue Apr 7 00:37:12 2026 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 AA17FECAAD4 for ; Wed, 31 Aug 2022 21:18:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232063AbiHaVS2 (ORCPT ); Wed, 31 Aug 2022 17:18:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230168AbiHaVSY (ORCPT ); Wed, 31 Aug 2022 17:18:24 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D7ACDD4DE for ; Wed, 31 Aug 2022 14:18:24 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id l9-20020a252509000000b00695eb4f1422so3047142ybl.13 for ; Wed, 31 Aug 2022 14:18:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date; bh=HQoamibmfiE7nHkPok6wkO/VrN3C9PG9bTmDWvCccbk=; b=RM73ZeGV2Mc9trz/Y+eYzIsek+lL/FJPh0dfjJiMsD4be0IeN/45OOfjp2UtKkYxic O0Sxih6/wtCvmnSMixTlF9y6oy3HW61up/wkroQyNEfgkxPbjaFghlGqejhuneShNAWy SiERD6130vTyZKJBy3zfvNjSnERooNVyWeHn1GyiK9zQOdYNgZ+JpZ9G+iIMBz3djU/Z u61LXYV7/iofEIviig+Dq4zqdQYQHH/uz/d1V/fdIm8Gm5I8+jtYpNiRUkMnCL6LnjGQ DW3tGpe5Vp9ALSQA5wwZ4W7/yoPKIAj84M7vZuWTO1AfWEBvohQtOJH4agT0CNPMZHWD +rtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date; bh=HQoamibmfiE7nHkPok6wkO/VrN3C9PG9bTmDWvCccbk=; b=G0Ds6RQ5PxoJSTRA9Qbuljseb8QlnZtd29CaJIeM+R/taoQmdrgTAvSCM6jJBoYhjU zONL5I90Ww/+GW++h/Tjb2gLupROhUv343wuxUI6b0a49x1FGhbX+MTB9NlGrZqA8fCP SvQt5ivOPshcnXwOLRfDrsa8lCgspzcztYCZJ+/X7ATLRUwJ3m9AwVv2Z9Ry2EwWPyzg O0TlDK3Yw84W07ekeQsDw3+1gt3HjJBsgJ/cha6nOzRhleeaRPDp3QrMIwyOJbrZllUk YoMCzRdCNE6zpIv8xgXvlt7cFjURpLGggcjCpsiBgh9o2BnQaTXN9xC9iANYSGgNikA5 /khA== X-Gm-Message-State: ACgBeo3CocEwropiQeR6cl580YIklw45e2oRkFRgNzki4jTCC8M5UU00 3g0gV99QldAdpGEjA8PHzOXgy/e1MZk6Pw== X-Google-Smtp-Source: AA6agR6jr60mo5mSxkMIToL0MvcfQG1tk+RIJvxs7V7tT8sGusQzxjuz8oqDdBcMfbEUr7EmLw1o88hgKYolWw== X-Received: from loggerhead.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:29a]) (user=jmattson job=sendgmr) by 2002:a25:9d8d:0:b0:676:a71d:edad with SMTP id v13-20020a259d8d000000b00676a71dedadmr16453866ybp.94.1661980703428; Wed, 31 Aug 2022 14:18:23 -0700 (PDT) Date: Wed, 31 Aug 2022 14:18:10 -0700 Mime-Version: 1.0 X-Mailer: git-send-email 2.37.2.672.g94769d06f0-goog Message-ID: <20220831211810.2575536-1-jmattson@google.com> Subject: [PATCH v2] x86/cpufeatures: Add macros for Intel's new fast rep string features From: Jim Mattson To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" Cc: kvm@vger.kernel.org, Jim Mattson , linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" KVM_GET_SUPPORTED_CPUID should reflect these host CPUID bits. The bits are already cached in word 12. Give the bits X86_FEATURE names, so that they can be easily referenced. Hide these bits from /proc/cpuinfo, since the host kernel makes no use of them at present. Signed-off-by: Jim Mattson --- v1 -> v2: Hide from /proc/cpuinfo [Dave Hansen] arch/x86/include/asm/cpufeatures.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpuf= eatures.h index ef4775c6db01..454f0faa8e90 100644 --- a/arch/x86/include/asm/cpufeatures.h +++ b/arch/x86/include/asm/cpufeatures.h @@ -308,6 +308,9 @@ /* Intel-defined CPU features, CPUID level 0x00000007:1 (EAX), word 12 */ #define X86_FEATURE_AVX_VNNI (12*32+ 4) /* AVX VNNI instructions */ #define X86_FEATURE_AVX512_BF16 (12*32+ 5) /* AVX512 BFLOAT16 instruction= s */ +#define X86_FEATURE_FZRM (12*32+10) /* "" Fast zero-length REP MOVSB */ +#define X86_FEATURE_FSRS (12*32+11) /* "" Fast short REP STOSB */ +#define X86_FEATURE_FSRC (12*32+12) /* "" Fast short REP {CMPSB,SCASB} */ =20 /* AMD-defined CPU features, CPUID level 0x80000008 (EBX), word 13 */ #define X86_FEATURE_CLZERO (13*32+ 0) /* CLZERO instruction */ --=20 2.37.2.672.g94769d06f0-goog