From nobody Tue Nov 26 20:30:29 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=@intel.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=pass(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1705310085; cv=none; d=zohomail.com; s=zohoarc; b=USvzjIXKjw4hh+M/PmMS6shsWd69oC95o4iFLYeWI4RCrq2gWy+gIH1Js7fZ3BMtmWbpA4PiAbL+AcB428YpqG2YF7yrmyqa5c+xVN0Qv8O0ON4Fy02r39C634WVvWqwZNuKCm7BwYos0AS3EHWRdAcwduOW0/f7ns1FjIFGh7g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1705310085; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=HdUHrzWYEZ3FRWfo1vicB2QpL+x5PUOvYwjnBezq1Uo=; b=fns99U8Kb43XpmVgFSUeh7LmSC0J0ayPrHcu7D7uxRXRqK0MjqklvSFhJPFxBIzFwwWvmWEin9t0Tq9Y4S1PDMV6luHU/MiYKt8u0EiL1xxxM1FCEypFzMPFaq4LvSW+vDU0edVhYIqY8we7iRNznHd9WASB/YraFeG+K1BrIbU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@intel.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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1705310085644592.6072089395478; Mon, 15 Jan 2024 01:14:45 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rPJ2M-0002xR-G6; Mon, 15 Jan 2024 04:13:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rPJ2H-0002lK-QH for qemu-devel@nongnu.org; Mon, 15 Jan 2024 04:13:39 -0500 Received: from mgamail.intel.com ([198.175.65.10]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rPJ2D-0003eA-Tl for qemu-devel@nongnu.org; Mon, 15 Jan 2024 04:13:35 -0500 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jan 2024 01:13:32 -0800 Received: from lxy-clx-4s.sh.intel.com ([10.239.48.52]) by fmsmga002.fm.intel.com with ESMTP; 15 Jan 2024 01:13:28 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1705310014; x=1736846014; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=4POKoLQSTQibc+jS6vVE7uV8ynTlKVai1gHsD3hGN1U=; b=D8a22G2HqEQ/bEoPC2u9z2IDU0xB64aIzvGiWqF+Sy+igGYBoeS4AI8+ STjAEVpj/NdiDolX8KXUubdBBbXnyHEFPqNvvlmvKTIi/9H2UwAJYPEua CRipsVRIE/7PZQRgOg7K9/6K2VtHL0FZqi8sFWxlMk+8zhoVPYys4J+h/ KGFhrOM3E4panHOd1eeOy8NdHHkMyNYWwwRd29boSnktlPXazAcIki+4K 4j2AyJm7qT4B87rNFefIuejZCL5aS/hnVP+/naD47K9ZkIuDl17AABUTg d6h7L3ybXLuFkAUOfpQxk50pnWKBE1PeJpPnACWYzDO0iVP70IrfEuDJu Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10953"; a="12928492" X-IronPort-AV: E=Sophos;i="6.04,196,1695711600"; d="scan'208";a="12928492" X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10953"; a="902720581" X-IronPort-AV: E=Sophos;i="6.04,196,1695711600"; d="scan'208";a="902720581" From: Xiaoyao Li To: Paolo Bonzini Cc: qemu-devel@nongnu.org, Yang Weijiang Subject: [PATCH 2/2] i386/cpu: Mask with XCR0/XSS mask for FEAT_XSAVE_XCR0_HI and FEAT_XSAVE_XSS_HI leafs Date: Mon, 15 Jan 2024 04:13:25 -0500 Message-Id: <20240115091325.1904229-3-xiaoyao.li@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240115091325.1904229-1-xiaoyao.li@intel.com> References: <20240115091325.1904229-1-xiaoyao.li@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=198.175.65.10; envelope-from=xiaoyao.li@intel.com; helo=mgamail.intel.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.758, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HK_RANDOM_ENVFROM=0.998, HK_RANDOM_FROM=0.998, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @intel.com) X-ZM-MESSAGEID: 1705310087643100003 Content-Type: text/plain; charset="utf-8" The value of FEAT_XSAVE_XCR0_HI leaf and FEAT_XSAVE_XSS_HI leaf also need to be masked by XCR0 and XSS mask respectively, to make it logically correct. Fixes: 301e90675c3f ("target/i386: Enable support for XSAVES based features= ") Signed-off-by: Xiaoyao Li Reviewed-by: Yang Weijiang --- target/i386/cpu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index b445e2957c4f..a5c08944a483 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -6946,9 +6946,9 @@ static void x86_cpu_enable_xsave_components(X86CPU *c= pu) } =20 env->features[FEAT_XSAVE_XCR0_LO] =3D mask & CPUID_XSTATE_XCR0_MASK; - env->features[FEAT_XSAVE_XCR0_HI] =3D mask >> 32; + env->features[FEAT_XSAVE_XCR0_HI] =3D (mask & CPUID_XSTATE_XCR0_MASK) = >> 32; env->features[FEAT_XSAVE_XSS_LO] =3D mask & CPUID_XSTATE_XSS_MASK; - env->features[FEAT_XSAVE_XSS_HI] =3D mask >> 32; + env->features[FEAT_XSAVE_XSS_HI] =3D (mask & CPUID_XSTATE_XSS_MASK) >>= 32; } =20 /***** Steps involved on loading and filtering CPUID data --=20 2.34.1