From nobody Sun May 19 10:14:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1594887719; cv=none; d=zohomail.com; s=zohoarc; b=V6iFYrPFCqCozasQFVUzhEronGxa9HkO6uMZ2x1qkOi7plE1EI6OBy3ipFBYbB6ufPNZIpOYscU0FZACRU8ykgQ7uejmji1uInC6389awbnKj/n/kfO5fQwY72+0htnIth7mH9BiSw7vX68tkbvDOF2UQvCNvimNtvFYamVdz+I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594887719; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=+DgIcq79IQ/epRTvhAvc7JonxSBHeiYmdzPCtDL6s14=; b=FBl7mNnBadKue+HxcRMqufP5tFmZA5FGSjEwlY9zEXjD+XoWGBwAmAkZQ2vEeHzH0sN0VxqSO3gxMCVgSeG/Vk29oLhUsjXgat+bSotIf1Z1wAPwUZ1VgIUbURFlnSoPl7AT76PHO+9QAbjsGUGvUwypGXhOFXLN6CT/7BNRIzE= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1594887719011906.5764478673599; Thu, 16 Jul 2020 01:21:59 -0700 (PDT) Received: from localhost ([::1]:43426 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jvz9R-0004UY-SW for importer@patchew.org; Thu, 16 Jul 2020 04:21:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51700) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jvz85-0002p3-L0 for qemu-devel@nongnu.org; Thu, 16 Jul 2020 04:20:33 -0400 Received: from mga06.intel.com ([134.134.136.31]:38840) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jvz83-0000Hh-Nx for qemu-devel@nongnu.org; Thu, 16 Jul 2020 04:20:33 -0400 Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jul 2020 01:20:27 -0700 Received: from lxy-dell.sh.intel.com ([10.239.159.21]) by orsmga006.jf.intel.com with ESMTP; 16 Jul 2020 01:20:23 -0700 IronPort-SDR: 1ObO1bXvFmHof383yI7zaM/A7YuqvqP1dPszPftm7YYAArmU0ARQF50zfICIQ4KK6pkjX0S/pP 9afJFoa+gY0w== X-IronPort-AV: E=McAfee;i="6000,8403,9683"; a="210871089" X-IronPort-AV: E=Sophos;i="5.75,358,1589266800"; d="scan'208";a="210871089" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False IronPort-SDR: 1N7LCXM+bfDWOvADM/qwYmGdTkP85zTcUZLCxuo/Ro/+ZplEJPB06VIN/s3O8sYhk1aXnvefUU bwKiIM+/ubVQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,358,1589266800"; d="scan'208";a="286403894" From: Xiaoyao Li To: Paolo Bonzini , Richard Henderson , Eduardo Habkost Subject: [PATCH 1/2] i386/cpu: Clear FEAT_XSAVE_COMP_{LO, HI} when XSAVE is not available Date: Thu, 16 Jul 2020 16:20:18 +0800 Message-Id: <20200716082019.215316-2-xiaoyao.li@intel.com> X-Mailer: git-send-email 2.18.4 In-Reply-To: <20200716082019.215316-1-xiaoyao.li@intel.com> References: <20200716082019.215316-1-xiaoyao.li@intel.com> Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=134.134.136.31; envelope-from=xiaoyao.li@intel.com; helo=mga06.intel.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/16 04:20:23 X-ACL-Warn: Detected OS = FreeBSD 9.x or newer [fuzzy] X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, HK_RANDOM_ENVFROM=0.001, HK_RANDOM_FROM=1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Xiaoyao Li , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Per Intel SDM vol 1, 13.2, if CPUID.1:ECX.XSAVE[bit 26] is 0, the processor provides no further enumeration through CPUID function 0DH. Signed-off-by: Xiaoyao Li --- target/i386/cpu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 1e5123251d74..f5f11603e805 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -6261,6 +6261,8 @@ static void x86_cpu_enable_xsave_components(X86CPU *c= pu) uint64_t mask; =20 if (!(env->features[FEAT_1_ECX] & CPUID_EXT_XSAVE)) { + env->features[FEAT_XSAVE_COMP_LO] =3D 0; + env->features[FEAT_XSAVE_COMP_HI] =3D 0; return; } =20 --=20 2.18.4 From nobody Sun May 19 10:14:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1594887719; cv=none; d=zohomail.com; s=zohoarc; b=mhXtXudVST9pQxR4xNZabPFk98NRUZVa2fNIgg4XThu2k3C0KJHfFZAdopQ6K7mMcxn2VbftAInsVDxM2F1n8j1hhrYvpC1DArRJx6eJO8d2ComhzYnsO86s9jFDBKpj2jYlxNSzBAZy0UnYz9hA2cbLOuYh6yT8QNbE5o77WuU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594887719; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=vWCDMz4DKcfHkFfHDlVaaK3+wYWw5e46H7gLuR/Thfc=; b=TDa2Xk4AFz5qlClhd1SQTmYze62Nvz7nfJXtiDeQtJaJQZs7U0EQPw5OHxKrMoWAZXm/xV4sWqHgbKKMh6To+5kvk2UVSp8YayI5jY+2W830kbec5sP0GF6INpNy8mK1DK37ycZNts7PGw5t/ky6zcJP0CPNwFbiRRJIUUXlvJM= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1594887719629845.9341712897344; Thu, 16 Jul 2020 01:21:59 -0700 (PDT) Received: from localhost ([::1]:43402 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jvz9S-0004U4-9x for importer@patchew.org; Thu, 16 Jul 2020 04:21:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51704) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jvz86-0002qM-BL for qemu-devel@nongnu.org; Thu, 16 Jul 2020 04:20:34 -0400 Received: from mga06.intel.com ([134.134.136.31]:38844) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jvz84-0000Ih-GS for qemu-devel@nongnu.org; Thu, 16 Jul 2020 04:20:34 -0400 Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jul 2020 01:20:30 -0700 Received: from lxy-dell.sh.intel.com ([10.239.159.21]) by orsmga006.jf.intel.com with ESMTP; 16 Jul 2020 01:20:27 -0700 IronPort-SDR: ZzWOrB/zrLjXgyJGQ7IXxCIqzgbbaWJzJ6ZBEpmSQWOB8mmYSSx0FTINohtd1Lx0mGo53TTicD qmgyZ4uxb3sg== X-IronPort-AV: E=McAfee;i="6000,8403,9683"; a="210871090" X-IronPort-AV: E=Sophos;i="5.75,358,1589266800"; d="scan'208";a="210871090" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False IronPort-SDR: bkkLh9L8zpygOMsOm1BVjgDaNw0b1DwsKnkbtY8/miA8wcWibt0c4RT1C0gpVr96hgWigyj4mB qwZfs5vWvCEQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,358,1589266800"; d="scan'208";a="286403906" From: Xiaoyao Li To: Paolo Bonzini , Richard Henderson , Eduardo Habkost Subject: [PATCH 2/2] i386/cpu: Mask off unsupported XSAVE components Date: Thu, 16 Jul 2020 16:20:19 +0800 Message-Id: <20200716082019.215316-3-xiaoyao.li@intel.com> X-Mailer: git-send-email 2.18.4 In-Reply-To: <20200716082019.215316-1-xiaoyao.li@intel.com> References: <20200716082019.215316-1-xiaoyao.li@intel.com> Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=134.134.136.31; envelope-from=xiaoyao.li@intel.com; helo=mga06.intel.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/16 04:20:23 X-ACL-Warn: Detected OS = FreeBSD 9.x or newer [fuzzy] X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, HK_RANDOM_ENVFROM=0.001, HK_RANDOM_FROM=1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Xiaoyao Li , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" When setting up XSAVE components, it needs to mask off those unsupported by KVM. Signed-off-by: Xiaoyao Li --- target/i386/cpu.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index f5f11603e805..efc92334b7b1 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -6274,8 +6274,10 @@ static void x86_cpu_enable_xsave_components(X86CPU *= cpu) } } =20 - env->features[FEAT_XSAVE_COMP_LO] =3D mask; - env->features[FEAT_XSAVE_COMP_HI] =3D mask >> 32; + env->features[FEAT_XSAVE_COMP_LO] =3D mask & + x86_cpu_get_supported_feature_word(FEAT_XSAVE_COMP_LO, cpu->migrat= able); + env->features[FEAT_XSAVE_COMP_HI] =3D (mask >> 32) & + x86_cpu_get_supported_feature_word(FEAT_XSAVE_COMP_HI, cpu->migrat= able); } =20 /***** Steps involved on loading and filtering CPUID data --=20 2.18.4