From nobody Thu Nov 6 06:16:03 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=intel.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1539768878440476.56305090667945; Wed, 17 Oct 2018 02:34:38 -0700 (PDT) Received: from localhost ([::1]:34920 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gCiDt-00066j-Do for importer@patchew.org; Wed, 17 Oct 2018 05:34:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44464) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gCiBT-0004i2-WB for qemu-devel@nongnu.org; Wed, 17 Oct 2018 05:32:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gCiBS-0004aj-9Z for qemu-devel@nongnu.org; Wed, 17 Oct 2018 05:32:07 -0400 Received: from mga06.intel.com ([134.134.136.31]:10864) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gCiBQ-0004R8-2k for qemu-devel@nongnu.org; Wed, 17 Oct 2018 05:32:04 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Oct 2018 02:32:02 -0700 Received: from vmmtaopc.sh.intel.com ([10.239.13.110]) by fmsmga002.fm.intel.com with ESMTP; 17 Oct 2018 02:32:01 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,391,1534834800"; d="scan'208";a="95953387" From: Tao Xu To: ehabkost@redhat.com Date: Wed, 17 Oct 2018 17:30:53 +0800 Message-Id: <20181017093053.8811-2-tao3.xu@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181017093053.8811-1-tao3.xu@intel.com> References: <20181017093053.8811-1-tao3.xu@intel.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 134.134.136.31 Subject: [Qemu-devel] [PATCH 1/1] i386: Add PKU/OSPKE on Skylake-Server CPU model X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jingqi.liu@intel.com, Tao Xu , qemu-devel@nongnu.org, robert.hu@intel.com, pbonzini@redhat.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" As the release document ref below link (page 13): https://software.intel.com/sites/default/files/managed/c5/15/\ architecture-instruction-set-extensions-programming-reference.pdf PKU is supported in Skylake Server (Only Server) and later, and=20 on Intel(R) Xeon(R) Processor Scalable Family. OSPKE is to reads=20 the value of PKRU (Instruction of PKU) into EAX and clears EDX. So PKU/OSPKE are supposed to be in Skylake-Server CPU model.=20 And PKU/OSPKE 's CPUID has been exposed to QEMU. But PKU/OSPKE can't be find in Skylake-Server CPU model in the code.=20 So this patch will fix PKU/OSPKE this issue in Skylake-Server=20 CPU model. =20 Signed-off-by: Tao Xu --- target/i386/cpu.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index f24295e6e4..6ecd28c8a2 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -2322,6 +2322,8 @@ static X86CPUDefinition builtin_x86_defs[] =3D { CPUID_7_0_EBX_AVX512F | CPUID_7_0_EBX_AVX512DQ | CPUID_7_0_EBX_AVX512BW | CPUID_7_0_EBX_AVX512CD | CPUID_7_0_EBX_AVX512VL | CPUID_7_0_EBX_CLFLUSHOPT, + .features[FEAT_7_0_ECX] =3D + CPUID_7_0_ECX_PKU | CPUID_7_0_ECX_OSPKE, /* Missing: XSAVES (not supported by some Linux versions, * including v4.1 to v4.12). * KVM doesn't yet expose any XSAVES state save component, @@ -2372,6 +2374,8 @@ static X86CPUDefinition builtin_x86_defs[] =3D { CPUID_7_0_EBX_AVX512F | CPUID_7_0_EBX_AVX512DQ | CPUID_7_0_EBX_AVX512BW | CPUID_7_0_EBX_AVX512CD | CPUID_7_0_EBX_AVX512VL, + .features[FEAT_7_0_ECX] =3D + CPUID_7_0_ECX_PKU | CPUID_7_0_ECX_OSPKE, /* Missing: XSAVES (not supported by some Linux versions, * including v4.1 to v4.12). * KVM doesn't yet expose any XSAVES state save component, --=20 2.17.1