From patchwork Wed Oct 19 08:47:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaxi Chen X-Patchwork-Id: 328 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp206519wrs; Wed, 19 Oct 2022 01:52:37 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7H5Byt/L1MvRyXr3uOTk6xa9DggJO0bsc65O4VI74iryKg2SlG+XJIHtjZ1p5wOKwQa8Bu X-Received: by 2002:a17:90b:3804:b0:20d:4e77:373a with SMTP id mq4-20020a17090b380400b0020d4e77373amr44295429pjb.212.1666169556859; Wed, 19 Oct 2022 01:52:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666169556; cv=none; d=google.com; s=arc-20160816; b=BsbCNNd/hCeoTecw87ZNGtxpVDQMpyKS5y3MoJ68K+T4E+XlW3INp26Jq2GTKaiFEQ SpjSpdSs8WhOGxEWD9plP5fxMDazZ94LBzokUOKdidfbspoOsib5KctMATeawyqXKC4H iPxf+IPX1fTBtAMQ5bE+0EM3ApyRpyKvbrOa25k34M/Uq4lMi/f4GI7J7nrJmC1I5gzr boedJCG/0qCH0lXHON5NezRmo8/KDU5dErXVKCtG3xTqSNh6t8d+p0kwhPwSd/5iRTNB +Unmj81mcjas7Cw5pT317r6xlimhdWwA7hKMi4Be8lEc0iGHXMjpeHVdaLIv5bJ627Gs EyCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=MQXRN2pFszFqHzjg63JtDSuQPoZO3vbjUi3VpDMcQSI=; b=uQDwKe7GUWSSgt6hf35/fMVYf6qY0sk3SB1nq+q1GgveDqf3N5fwF44Aoyre6eRPyI p8Tu4UvSkmXx54HqKTY2xbc2mhlyrU+S2POYiw052km7lSH8LpobQCLjlAgqTBdDYdoB zeJRMxXkXB+tTDRoYcjmz3WVYXG9xrjo+IiXT4oLEE/m52/K+gL8ml74xZ0hA1dKFn/m SVg3DvgXn1cC/WAiyfDLMdSog2v3VyyZmMMRMXUO5lFPBFC+nRydW7/qK+7lTLZma9MK 1EP1D+acghrKOKODrVy+cwZgMIsN02YVRlLks5JiP1oCN/9x197WmLK10y7sZlIG2CAG 5lfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Xu6Xu43E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 136-20020a63028e000000b0044f07a986f4si17937464pgc.779.2022.10.19.01.52.23; Wed, 19 Oct 2022 01:52:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Xu6Xu43E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231758AbiJSIwI (ORCPT + 99 others); Wed, 19 Oct 2022 04:52:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232065AbiJSIuO (ORCPT ); Wed, 19 Oct 2022 04:50:14 -0400 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9766E391; Wed, 19 Oct 2022 01:48:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666169327; x=1697705327; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=bke7pt/L5leJggylT7vFGl+uEMcqyFQEdIPltWZFGKA=; b=Xu6Xu43ExYiG7toCdIlX9dm7H69ikqz/XaV8AXRE19ksRRNwR8VJFkCS 4CGxULOgPNH7XN6P9/gBkBH3B+vTojinLA34yqbkjeDWJP/phu4EsVXJx GYiTHv+eMS/dYY7rNqilnpr3iOeiRvU/tyUX3YdmRPQf7yy/Q8Pxg62XR wnVhXzXWjkdfb/dputd+NItTvXzGiiY2A4F9AZ50MXaIH3JrE2hYbqV1P AOe2vYyxj4MFy+7v9DhltthXoE7bcNgcvpbgIkG7tGupQ6oyN9Ewzp00g ZmmZ+LwyWyuRcFW0PgjlSzqI7x2avTzhkWDtnF6EcXBllrU7ikfyLvlUZ Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10504"; a="289665536" X-IronPort-AV: E=Sophos;i="5.95,195,1661842800"; d="scan'208";a="289665536" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Oct 2022 01:47:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10504"; a="804195807" X-IronPort-AV: E=Sophos;i="5.95,195,1661842800"; d="scan'208";a="804195807" Received: from jiaxichen-precision-3650-tower.sh.intel.com ([10.239.159.75]) by orsmga005.jf.intel.com with ESMTP; 19 Oct 2022 01:47:34 -0700 From: Jiaxi Chen To: kvm@vger.kernel.org Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, seanjc@google.com, pbonzini@redhat.com, ndesaulniers@google.com, alexandre.belloni@bootlin.com, peterz@infradead.org, jiaxi.chen@linux.intel.com, jpoimboe@kernel.org, chang.seok.bae@intel.com, pawan.kumar.gupta@linux.intel.com, babu.moger@amd.com, jmattson@google.com, sandipan.das@amd.com, tony.luck@intel.com, sathyanarayanan.kuppuswamy@linux.intel.com, fenghua.yu@intel.com, keescook@chromium.org, jane.malalane@citrix.com, nathan@kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/6] x86: KVM: Expose CPUID to guest for new Intel platform instructions Date: Wed, 19 Oct 2022 16:47:28 +0800 Message-Id: <20221019084734.3590760-1-jiaxi.chen@linux.intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747105409166002425?= X-GMAIL-MSGID: =?utf-8?q?1747105409166002425?= Latest Intel platform Granite Rapids/Sierra Forest has introduced below new instructions and CPUIDs: - CMPccXADD CPUID.(EAX=7,ECX=1):EAX[bit 7] - AMX-FP16 CPUID.(EAX=7,ECX=1):EAX[bit 21] - AVX-IFMA CPUID.(EAX=7,ECX=1):EAX[bit 23] - AVX-VNNI-INT8 CPUID.(EAX=7,ECX=1):EDX[bit 4] - AVX-NE-CONVERT CPUID.(EAX=7,ECX=1):EDX[bit 5] - PREFETCHITI CPUID.(EAX=7,ECX=1):EDX[bit 14] Details can be found in recent Intel ISE (Instruction Set Extensions)[1]. This series enables related CPUID bit in the kernel feature bits and expose them to KVM guest OS. [1] Intel ISE: https://cdrdv2.intel.com/v1/dl/getContent/671368 Chang S. Bae (1): x86: KVM: Enable AMX-FP16 CPUID and expose it to guest Jiaxi Chen (5): x86: KVM: Enable CMPccXADD CPUID and expose it to guest x86: KVM: Enable AVX-IFMA CPUID and expose it to guest x86: KVM: Enable AVX-VNNI-INT8 CPUID and expose it to guest x86: KVM: Enable AVX-NE-CONVERT CPUID and expose it to guest x86: KVM: Enable PREFETCHIT0/1 CPUID and expose it to guest arch/x86/include/asm/cpufeature.h | 7 +++++-- arch/x86/include/asm/cpufeatures.h | 10 +++++++++- arch/x86/include/asm/disabled-features.h | 3 ++- arch/x86/include/asm/required-features.h | 3 ++- arch/x86/kernel/cpu/common.c | 1 + arch/x86/kvm/cpuid.c | 8 ++++++-- arch/x86/kvm/reverse_cpuid.h | 1 + 7 files changed, 26 insertions(+), 7 deletions(-) base-commit: e18d6152ff0f41b7f01f9817372022df04e0d354