From nobody Sat Nov 23 17:56:13 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1730207081; cv=none; d=zohomail.com; s=zohoarc; b=mYE2SGq1nX9WtN4s5w0mOWkG8QhsbgdlmEkduuDD1avoXB+0U2BHy0chAaUlRkln1rzsVs2iHIb48mnrYBreempFtzCe8EuV+GmSB1rcCyu2uJvMrz1Wl3GEOdIL4ryoemoH/h6XZhY3pAQqQvHVr5mL75TaG5j8KHS/18nqJ1E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1730207081; h=Content-Transfer-Encoding:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=WeDRNxekEYihTsixUQdXV3kTi+xv/VScjBpg04RytOY=; b=URr/J1twjWz6WPfLi6qNsppPjdJ9Cj5YAuA9FvxOl+tHxU2tJWi8mYAjOFFIHMxghJYQU+rN12I53YdnLa1RumyP6HDMp2sABrc13z4vOUnEkJduCjtVjv8RfXDdAbwcaa749E0M/r6yz7rh3HsgYt5h46ktqVrMCC2+oRRYekI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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 173020708112917.230864659486087; Tue, 29 Oct 2024 06:04:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t5ltV-0004QC-H9; Tue, 29 Oct 2024 09:04:22 -0400 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 1t5ltL-0004Ow-Rc for qemu-devel@nongnu.org; Tue, 29 Oct 2024 09:04:12 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t5ltJ-0004sA-L5 for qemu-devel@nongnu.org; Tue, 29 Oct 2024 09:04:11 -0400 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-339-8ROoe2nLPZeNlnMu1fOU9Q-1; Tue, 29 Oct 2024 09:04:04 -0400 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-43163a40ee0so41476915e9.0 for ; Tue, 29 Oct 2024 06:04:04 -0700 (PDT) Received: from [192.168.10.3] ([151.49.226.83]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4319360cc2esm143353545e9.44.2024.10.29.06.04.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Oct 2024 06:04:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1730207047; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=WeDRNxekEYihTsixUQdXV3kTi+xv/VScjBpg04RytOY=; b=cRG/K4C73IKa3oj0doU5gwtkAGnDgz8Mzvr0quuEWxhxHCc8ocemNUaz8/kFIbPmDYUekY HbRLhyDO7bqdre8YKWzpSJu56ZKvHIdm5v0M77dfS5M++WaynGgmJtl5zcUCMKjpd5TuFy bDhwLrUq1U6ZgqFsWkfiDJo8CEmMCaI= X-MC-Unique: 8ROoe2nLPZeNlnMu1fOU9Q-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730207043; x=1730811843; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=WeDRNxekEYihTsixUQdXV3kTi+xv/VScjBpg04RytOY=; b=he+dSN9GzPRZ63lhlb5j9svR9bTlWEdHpmQEq5MOchasOEi03REZZeiqrtzQ92MNnL +kwhTW0DJfV4IvFVRIX10sDdSJnvOeueNIYGMcf1RMi1XCy9ajWWoU8s4OwpdFCYTwi5 NmJtNw7IBmzYsksIrkNazmzxRhvspl8OBR96iNFToeBk/YYU+G2GfBvhRB2xCu+NkkIK YdjxhZwD9akN5x1Xfq9ZkSXC58mUUZNZdx3K3NDZf/jbewnTsLJTcfXFnyYHB61Yinuo h18hTrj5SqBaDqd9ZqnLm+x5S4R1YdRKM7RitcG+y7ZeUU5UFYdJ8sxl+jPWSAUrfOQq v5tw== X-Gm-Message-State: AOJu0YzLvtlAmBbrH9DAFHRenW6zWa/pIXzNdvAvbaP+pv2kJPEhhV4N 1YFq6dvmAtP3asFaw4yMnx8XdeCzDX9hVLNEodJXYQ/Zp2VJibExlomKnFz33lFaApMrbZhun1C y3NQNItkUVRsa6LJ5N2GWhAPf67bqjrtynxYrnro/iB+75l4Z3tpWdgU6qLkGrpubmRGrnQEx47 sEtHyLlZjzBFtJ6O+Bg8hLCUuhoOF3GLEQe2+79jg= X-Received: by 2002:a05:600c:5118:b0:426:627e:37af with SMTP id 5b1f17b1804b1-4319ac7065emr108445005e9.3.1730207042943; Tue, 29 Oct 2024 06:04:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGK1EFXb99xDPMzqvKew008+Pkybg4gr34Q4YNdDHg/Kq6Xdm5YvU7HOqH/E9tsOme7bzHvfQ== X-Received: by 2002:a05:600c:5118:b0:426:627e:37af with SMTP id 5b1f17b1804b1-4319ac7065emr108444245e9.3.1730207042254; Tue, 29 Oct 2024 06:04:02 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH] target/i386/hvf: hide MPX states from XCR0 Date: Tue, 29 Oct 2024 14:04:01 +0100 Message-ID: <20241029130401.525297-1-pbonzini@redhat.com> X-Mailer: git-send-email 2.47.0 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=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.302, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, 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.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 @redhat.com) X-ZM-MESSAGEID: 1730207082246116600 Content-Type: text/plain; charset="utf-8" QEMU does not show availability of MPX in CPUID when running under Hypervisor.framework. Therefore, in the unlikely chance that the host has MPX enabled, hide those bits from leaf 0xD as well. Signed-off-by: Paolo Bonzini --- target/i386/hvf/x86_cpuid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/i386/hvf/x86_cpuid.c b/target/i386/hvf/x86_cpuid.c index e56cd8411ba..4b184767f4a 100644 --- a/target/i386/hvf/x86_cpuid.c +++ b/target/i386/hvf/x86_cpuid.c @@ -110,9 +110,9 @@ uint32_t hvf_get_supported_cpuid(uint32_t func, uint32_= t idx, if (idx =3D=3D 0) { uint64_t host_xcr0; if (xgetbv(ecx, 0, &host_xcr0)) { + /* Only show xcr0 bits corresponding to usable features. = */ uint64_t supp_xcr0 =3D host_xcr0 & (XSTATE_FP_MASK | XSTATE_SSE_MASK | XSTATE_YMM_MASK | - XSTATE_BNDREGS_MASK | XSTATE_BNDCSR_MASK= | XSTATE_OPMASK_MASK | XSTATE_ZMM_Hi256_MA= SK | XSTATE_Hi16_ZMM_MASK); eax &=3D supp_xcr0; --=20 2.47.0