From nobody Thu Nov 14 18:11:04 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=1708416470; cv=none; d=zohomail.com; s=zohoarc; b=Li/+IvB1bWQei0xl7RrRlMj70N7yOT7aIbJrfDeigulrMcbKVt6m3e0WBS47uWM/HTBogWrGPH9Gdagx3Q7Y1hbBnMTyqAz8u5R9rFXXrlEeGd6BQXmjDZQ2urb0T4S8egzQ/Z85Ziox4MaqZJcK3hKG1zQILgSg6SIWAC9FxUU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1708416470; h=Content-Type: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=cDTEy60SoXRleDwrAWU00Ca7c/Scw+qH/gbVv2mAVbk=; b=nwiYiPgYDh3D0uT3XlOWVmbxKosU7jTWWEsaTSqG1sjxMqDcqziF+094DsBcMC6hDeTWXDOMW620kytckovzMQChuBdiofD3T6SRYEIo/dSjF7zxN3tEPyMuDLdNk6ExTTRr3Slrvs+ycaq1HyxpJCqsI4caOus5fbkuCrknZ/4= 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 1708416470920614.9216859155172; Tue, 20 Feb 2024 00:07:50 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rcL9o-0003G5-2S; Tue, 20 Feb 2024 03:07:16 -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 1rcL9l-0003Dq-Rz for qemu-devel@nongnu.org; Tue, 20 Feb 2024 03:07:13 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rcL9k-0000UV-GG for qemu-devel@nongnu.org; Tue, 20 Feb 2024 03:07:13 -0500 Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-684-m-GOe33WM4eh57CbgpRPJg-1; Tue, 20 Feb 2024 03:07:10 -0500 Received: by mail-ed1-f70.google.com with SMTP id 4fb4d7f45d1cf-559555e38b0so3977597a12.3 for ; Tue, 20 Feb 2024 00:07:10 -0800 (PST) Received: from [192.168.10.118] ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id el14-20020a056402360e00b0055fba4996d9sm3400912edb.71.2024.02.20.00.06.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 00:07:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1708416432; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cDTEy60SoXRleDwrAWU00Ca7c/Scw+qH/gbVv2mAVbk=; b=VSTtuowJ7SQEtTfkuSmnjkLfHKjowLicjWf9YWz/vFZ9s1Ha7v3Gh8a4t/0dtgffhxpG3H LnR+BY9lUramrqL+B2VX/HfqdzogZrzrr+fQis457Ics9OBmmgufUhihZ09iIxuIrJdT2x Jv7WZ1mblFlcFrlCG6sAcG6khce0HJs= X-MC-Unique: m-GOe33WM4eh57CbgpRPJg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708416429; x=1709021229; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cDTEy60SoXRleDwrAWU00Ca7c/Scw+qH/gbVv2mAVbk=; b=o99tnGC4REjXG+Nf2FvtArOYdYoDy3zPexWs1GH/gXijJfw5gw8MxBo8Ta1MWB1cSV gH62BJll7pFYMuJWsoaacHmdqQpRhd3tF7I/+Cu7iln4ZrLWCZN/YglArO3TNucHDyTW YubdgzO2qQKOslhCuxeSZDDhPeL+2DGrCdFJ+SQyh08BsrKfCT0z8Wno4ywANzMQdUXj Ob/fV15+cF4DaZUUOL7ty1vuGIX7ZQ/UmxHc1ggPZxurCIAl3YZ+CjzLVDR48DjMfF30 b3s0eJq+OjLifuy+x3u060UXRAbUhhm6bV10t4iTNhFElBXf8JPoZa8ujH4WlCxg4WVH wTog== X-Gm-Message-State: AOJu0YyjrrLVI8uWO13FcQgDlECvIDWksbNRExE2zsaQoBhaga1rzPX3 Svn8H/jCbEouHYlkvqBkjOgHWjCA/ZIbWy44o1Bjgsvx3D+JMdt2iytMwOFs3ri49jvDoNCB4A5 dR8I+iy43eDRolSBQzhlkkT7rn2rdgodEVqAEuAZ7xvcdEF6l4xjPZfwnUuvlz9vUSV5Vkb16mQ LtrQI1gHGELAX82kdHclv142whgQBakV79rNnE X-Received: by 2002:aa7:cd13:0:b0:564:d702:a17d with SMTP id b19-20020aa7cd13000000b00564d702a17dmr145590edw.30.1708416429190; Tue, 20 Feb 2024 00:07:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IGP8rOQMfzXxVWWob46EKejnNlkcajUWma2Rf+DU9Kt6tE0PQDz/+XBgQfmZA8W3veSwgr3Eg== X-Received: by 2002:aa7:cd13:0:b0:564:d702:a17d with SMTP id b19-20020aa7cd13000000b00564d702a17dmr145573edw.30.1708416428905; Tue, 20 Feb 2024 00:07:08 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Xiaoyao Li , qemu-stable@nongnu.org Subject: [PULL 08/17] i386/cpuid: Move leaf 7 to correct group Date: Tue, 20 Feb 2024 09:05:49 +0100 Message-ID: <20240220080558.365903-9-pbonzini@redhat.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240220080558.365903-1-pbonzini@redhat.com> References: <20240220080558.365903-1-pbonzini@redhat.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=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.072, 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_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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: 1708416472220100003 Content-Type: text/plain; charset="utf-8" From: Xiaoyao Li CPUID leaf 7 was grouped together with SGX leaf 0x12 by commit b9edbadefb9e ("i386: Propagate SGX CPUID sub-leafs to KVM") by mistake. SGX leaf 0x12 has its specific logic to check if subleaf (starting from 2) is valid or not by checking the bit 0:3 of corresponding EAX is 1 or not. Leaf 7 follows the logic that EAX of subleaf 0 enumerates the maximum valid subleaf. Fixes: b9edbadefb9e ("i386: Propagate SGX CPUID sub-leafs to KVM") Signed-off-by: Xiaoyao Li Message-ID: <20240125024016.2521244-4-xiaoyao.li@intel.com> Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini --- target/i386/kvm/kvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index 9758c83693e..42970ab046f 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -1951,7 +1951,6 @@ int kvm_arch_init_vcpu(CPUState *cs) c =3D &cpuid_data.entries[cpuid_i++]; } break; - case 0x7: case 0x12: for (j =3D 0; ; j++) { c->function =3D i; @@ -1971,6 +1970,7 @@ int kvm_arch_init_vcpu(CPUState *cs) c =3D &cpuid_data.entries[cpuid_i++]; } break; + case 0x7: case 0x14: case 0x1d: case 0x1e: { --=20 2.43.0