From nobody Tue Feb 10 04:13:23 2026 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=linux.intel.com ARC-Seal: i=1; a=rsa-sha256; t=1676281949; cv=none; d=zohomail.com; s=zohoarc; b=fvvb+O1XP7/KvbLIB5EOTX5VewAvQMC0GWlPXHCfnNnZHDsq2nRGrDcOCKfPmdP8ZZN4lPY2a0jy1eVfhEqk4KYCiGn2wDhheFurbSiFAMgwrBrXn/OllPSyaBYjVZOIvP1lupPu1cL07CI+iZ0KoZ0LX+iGv8OEzDsY/JIci8U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676281949; h=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=WWkzU6tbFyZ2A9xJ6CTTRhP8sXGV4gdsGxr1AoNv1qo=; b=WMBDh5+zzdQGppZZv85fWdpimo7p2M8Ay40whYbeGwO0O8VGhLb3dh91gXNFj2FL254hILcqL4fIY9CUjOyymqk8ESwErapuXnm56v7fW7qWE5P8K3G3lnXYa1yzCm2AMNc2qZv+LJFD7viNsB1GJriD5AlRVlufpV0gj/qX7r0= 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 1676281949398815.548807783746; Mon, 13 Feb 2023 01:52:29 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRVQD-0002tK-CY; Mon, 13 Feb 2023 04:46:53 -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 1pRVPU-0001U7-Vw for qemu-devel@nongnu.org; Mon, 13 Feb 2023 04:46:09 -0500 Received: from mga12.intel.com ([192.55.52.136]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pRVPP-0002kj-7g for qemu-devel@nongnu.org; Mon, 13 Feb 2023 04:46:07 -0500 Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Feb 2023 01:45:27 -0800 Received: from liuzhao-optiplex-7080.sh.intel.com ([10.239.160.112]) by fmsmga007.fm.intel.com with ESMTP; 13 Feb 2023 01:45:23 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676281563; x=1707817563; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=9mDVdyYem//hjkBSE+XAPySWoyseWNH8mXJMpF1YKf8=; b=g+kUUcG2DJ8+TxN4dWiJTfwwJQqUc6yhdCUT/Ai+BFatMCR0J2AV8xFL 32DdJlUexuKsgkufPSD1Ka2x93PXQzhdMCTbu/0Gl5nYS8viJ1TUs8zMy VseBYiMIheqf+eBjDtSecXEH2wnCqDbhcFClaUVU0DVEaXl9uJa0znfyp mVNxhp/z4Qnz+9UMf91Qx2Ytz6h18IRnCoNHgBO7Ms98QfbebAOVE/aIW BbEUXJ+4RKmub3+9VwZGaIyPZTqWK+6KEegGxsYjy5A5oTkl9qHWiVzDU +P/XBHpuEY4QcNZOk8mk/8E1p+8RorB2qiDf5GbyWq4HEYmTRi9aaSbtT w==; X-IronPort-AV: E=McAfee;i="6500,9779,10619"; a="310487015" X-IronPort-AV: E=Sophos;i="5.97,293,1669104000"; d="scan'208";a="310487015" X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10619"; a="670760621" X-IronPort-AV: E=Sophos;i="5.97,293,1669104000"; d="scan'208";a="670760621" From: Zhao Liu To: Eduardo Habkost , Marcel Apfelbaum , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yanan Wang , "Michael S . Tsirkin" , Richard Henderson , Paolo Bonzini , Eric Blake , Markus Armbruster Cc: qemu-devel@nongnu.org, Zhenyu Wang , Dapeng Mi , Zhuocheng Ding , Robert Hoo , Sean Christopherson , Like Xu , Zhao Liu Subject: [RFC 36/52] i386: Use init_apicid_topo_info() to initialize APIC ID topology for system emulator Date: Mon, 13 Feb 2023 17:50:19 +0800 Message-Id: <20230213095035.158240-37-zhao1.liu@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230213095035.158240-1-zhao1.liu@linux.intel.com> References: <20230213095035.158240-1-zhao1.liu@linux.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: none client-ip=192.55.52.136; envelope-from=zhao1.liu@linux.intel.com; helo=mga12.intel.com X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_PASS=-0.001, SPF_NONE=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 @intel.com) X-ZM-MESSAGEID: 1676281950767100005 Content-Type: text/plain; charset="utf-8" From: Zhao Liu Since APIC ID for hybrid CPU topology needs to consider maximum possible structures for each topology levels, the APIC IDs for hybrid CPU topology and smp CPU topology may be different. User emulator doesn't support hybrid CPU topology so use init_apicid_topo_info() for system emulator. Co-Developed-by: Zhuocheng Ding Signed-off-by: Zhuocheng Ding Signed-off-by: Zhao Liu --- target/i386/cpu.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 844b6df63a4a..7d6722ab3292 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -39,6 +39,7 @@ #include "exec/address-spaces.h" #include "hw/boards.h" #include "hw/i386/sgx-epc.h" +#include "hw/i386/x86.h" #endif =20 #include "disas/capstone.h" @@ -5260,10 +5261,15 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index= , uint32_t count, uint32_t signature[3]; X86ApicidTopoInfo apicid_topo; =20 +#ifndef CONFIG_USER_ONLY + X86MachineState *x86ms =3D X86_MACHINE(qdev_get_machine()); + init_apicid_topo_info(&apicid_topo, x86ms); +#else apicid_topo.max_dies =3D cs->topo.dies_per_socket; apicid_topo.max_modules =3D cs->topo.clusters_per_die; apicid_topo.max_cores =3D cs->topo.cores_per_cluster; apicid_topo.max_threads =3D cs->topo.threads_per_core; +#endif =20 /* Calculate & apply limits for different index ranges */ if (index >=3D 0xC0000000) { --=20 2.34.1