From nobody Mon Feb 9 15:10:25 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1614606780; cv=none; d=zohomail.com; s=zohoarc; b=bgdIuiqO4l8dQnH2UIW+dRZXAiAEDtWzJ+FZafBDaP36KovWI1E0836yAcT74A5/0xSnONcJpnjk0YK3MpAsD6dSwNc5qrbpiI42qC2ApFRr31JMWJLk1xXyZ70c+VE2JF4x3yCGftnNF4DtRsYPHDr3KXkIXLm4NFVTNyld+jY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614606780; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=lxKYocY3dRF/V489uoPf+ippWT4zDZvTE/iE/p81QxM=; b=nPYw1d2HdXswnS/109qc8Pi1Lli1nNCVClYdEUGcXQgxwYExU3A26Q4P6uU2eQpIIaPOfDn8P2FtCQKVbueP/jYdoSUiURiA89WDuBBpSL+LPjqD7X3JZHKn5aweNNYlJeH7fXwDRgfZ1PREtFOFsswOkijVn7JgqATAouaTLm8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 1614606780447127.65111885570411; Mon, 1 Mar 2021 05:53:00 -0800 (PST) Received: from localhost ([::1]:40020 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lGiyp-00085e-0V for importer@patchew.org; Mon, 01 Mar 2021 08:52:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:32956) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGixD-0006Pd-9o for qemu-devel@nongnu.org; Mon, 01 Mar 2021 08:51:19 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:57957) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lGixB-0008DH-OQ for qemu-devel@nongnu.org; Mon, 01 Mar 2021 08:51:19 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-528-ix8e_eFfOEShsRlYRF6mhQ-1; Mon, 01 Mar 2021 08:51:14 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 30E878030CC for ; Mon, 1 Mar 2021 13:51:13 +0000 (UTC) Received: from vitty.brq.redhat.com (unknown [10.40.195.135]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8C14C5D71F; Mon, 1 Mar 2021 13:51:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614606676; 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=lxKYocY3dRF/V489uoPf+ippWT4zDZvTE/iE/p81QxM=; b=AFfDfnHbVpSpOLEPmK0QsOk3tOzWw7Hi82W44RuJWuAjKnmaO8umJ0pqTMicBESnnhejHU gz8VKif8VpW7P6DqHpP6jUiryiJyRKerxZYfycwaFb6AWy5LXdWHFj5Z2FniPI8keD0sdv iVsh+KyQXovWXXShdu9SQtZSnjpMUzw= X-MC-Unique: ix8e_eFfOEShsRlYRF6mhQ-1 From: Vitaly Kuznetsov To: qemu-devel@nongnu.org Subject: [PATCH v5 03/17] i386: always fill Hyper-V CPUID feature leaves from X86CPU data Date: Mon, 1 Mar 2021 14:50:49 +0100 Message-Id: <20210301135103.306003-4-vkuznets@redhat.com> In-Reply-To: <20210301135103.306003-1-vkuznets@redhat.com> References: <20210301135103.306003-1-vkuznets@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=vkuznets@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=63.128.21.124; envelope-from=vkuznets@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Marcelo Tosatti , Eduardo Habkost , Igor Mammedov Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" We have all the required data in X86CPU already and as we are about to split hyperv_handle_properties() into hyperv_expand_features()/ hyperv_fill_cpuids() we can remove the blind copy. The functional change is that QEMU won't pass CPUID leaves it doesn't currently know about to the guest but arguably this is a good change. Signed-off-by: Vitaly Kuznetsov --- target/i386/kvm/kvm.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index 3c1202333d9d..1b1934362a89 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -1207,9 +1207,6 @@ static int hyperv_handle_properties(CPUState *cs, } =20 if (cpu->hyperv_passthrough) { - memcpy(cpuid_ent, &cpuid->entries[0], - cpuid->nent * sizeof(cpuid->entries[0])); - c =3D cpuid_find_entry(cpuid, HV_CPUID_VENDOR_AND_MAX_FUNCTIONS, 0= ); if (c) { cpu->hyperv_vendor_id[0] =3D c->ebx; @@ -1309,12 +1306,6 @@ static int hyperv_handle_properties(CPUState *cs, goto free; } =20 - if (cpu->hyperv_passthrough) { - /* We already copied all feature words from KVM as is */ - r =3D cpuid->nent; - goto free; - } - c =3D &cpuid_ent[cpuid_i++]; c->function =3D HV_CPUID_VENDOR_AND_MAX_FUNCTIONS; c->eax =3D hyperv_feat_enabled(cpu, HYPERV_FEAT_EVMCS) ? --=20 2.29.2