From patchwork Mon Aug 31 18:42:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Moger, Babu" X-Patchwork-Id: 275067 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, RCVD_ILLEGAL_IP, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 32B97C433E6 for ; Mon, 31 Aug 2020 18:43:27 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F25B02071B for ; Mon, 31 Aug 2020 18:43:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="jBBsrvsj" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F25B02071B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:49566 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kCom6-00079A-1q for qemu-devel@archiver.kernel.org; Mon, 31 Aug 2020 14:43:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40504) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kCol2-0005ol-4F for qemu-devel@nongnu.org; Mon, 31 Aug 2020 14:42:20 -0400 Received: from mail-eopbgr750043.outbound.protection.outlook.com ([40.107.75.43]:51695 helo=NAM02-BL2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kCokw-0007Sz-Mz for qemu-devel@nongnu.org; Mon, 31 Aug 2020 14:42:19 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=L/75WMe8NNbgRBi5a8qhtlyGvgkg7Ukgd3gFvL1xTaKZOhxHfsPGK036jGDf56JrVfKr2aNRJnLejK8CB6qJVPsiPv2IHvli79LCj/lJvoJqLyZGwljbEZy7h8wSrfLQKxf+NnHbbnNYHdxxWcFtFwKX1imTgaJoGkJfcOmQ0LgZnR9ngPtQPAuxlXPsqAKdN/zHWS/Rg/HXjbBKzrZ8XjxZWl3QtlWbZj9jwWsEf7N8zIc3f5xcQUAYKA8PMmlBiVT1t7Re4z3cRA5IM1tXVfRSHcx7ubITc5ov8ynja+HNWrcju3NNWQZKKX9JTS7X6c/YAKZmtGulUNfa3TL+og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KYYZTgO74ACxkoabLIb2olY7JXFiOKa11FI3TlIZwsA=; b=IbCuaCMxKoCN3zzc/XgYblczVf2oMorHLhM9T5jfEIdJ05+ePb3OqyafwfGT7qZX1b6t8pHSByNHUSpNEHNu7ljoUyt0wo0K8ehx1msPTsxBobwheiLYsbTk0v77UT3HGsjcbFs+cBOGWYw4fstfJeavPzV7lJhphegikfW2MEM4Rd0w58jbCZJNrSAja8wHJO5iFF8R2WikSr6T4166CDtZT8NXTrAUg6GNJw7z92KxrPnNwr0wYVH0yogAXfjpKcReydeVcWRK1gsK2HGGKaM3kQL+qmKuY1q7Ang0DYmM1WgvsZE0SLHIQB2OmAN+lMAwRvBkvm0H3j9KaG9svw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KYYZTgO74ACxkoabLIb2olY7JXFiOKa11FI3TlIZwsA=; b=jBBsrvsjVJXHE0G4c7doBHSc824oKsECUrnj50bEtSy2gOy9JhDcNQWgOpr8NxfHq4m8fZ6FD3ashsQ0mLWZayea2/3/xFAtVTIYos/hPr+9fN0iMtw75/GO+uG/h4OUiCmf8M6hei2qrUR3es3cHVOQmsf9kvJukRLiulIjsy8= Authentication-Results: redhat.com; dkim=none (message not signed) header.d=none; redhat.com; dmarc=none action=none header.from=amd.com; Received: from SN1PR12MB2560.namprd12.prod.outlook.com (2603:10b6:802:26::19) by SN1PR12MB2559.namprd12.prod.outlook.com (2603:10b6:802:29::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3326.23; Mon, 31 Aug 2020 18:42:12 +0000 Received: from SN1PR12MB2560.namprd12.prod.outlook.com ([fe80::ccd9:728:9577:200d]) by SN1PR12MB2560.namprd12.prod.outlook.com ([fe80::ccd9:728:9577:200d%4]) with mapi id 15.20.3326.025; Mon, 31 Aug 2020 18:42:12 +0000 Subject: [PATCH v6 01/10] Revert "i386: Fix pkg_id offset for EPYC cpu models" From: Babu Moger To: pbonzini@redhat.com, rth@twiddle.net, ehabkost@redhat.com, imammedo@redhat.com Date: Mon, 31 Aug 2020 13:42:11 -0500 Message-ID: <159889933119.21294.8112825730577505757.stgit@naples-babu.amd.com> In-Reply-To: <159889924378.21294.16494070903874534542.stgit@naples-babu.amd.com> References: <159889924378.21294.16494070903874534542.stgit@naples-babu.amd.com> User-Agent: StGit/unknown-version X-ClientProxiedBy: SA9PR10CA0010.namprd10.prod.outlook.com (2603:10b6:806:a7::15) To SN1PR12MB2560.namprd12.prod.outlook.com (2603:10b6:802:26::19) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from 255.255.255.255 (255.255.255.255) by SA9PR10CA0010.namprd10.prod.outlook.com (2603:10b6:806:a7::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3326.20 via Frontend Transport; Mon, 31 Aug 2020 18:42:12 +0000 X-Originating-IP: [165.204.78.2] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 21708d3a-ee29-4043-6ebf-08d84ddd930d X-MS-TrafficTypeDiagnostic: SN1PR12MB2559: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:247; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IJ5ugb/D2rum+EgUPW7QXRgBmtz0KBvX7ANy6fezXjX9dGr/PF66Awu2jH6VlZaYypIPI3vbex82lDZTEIE1eUTo7BrmlE7sNkJacuOwJgqjfQrLp1Y3aokpMSOIq3Oky+A1ri4t5PngQbTvlnxCmck6wK2m/oQvBLcEulgmDEUQGxS+DdjYOFfAhxiRifYE+tnc/e7uGEaPmMHsFQqHFJswkHBYmu6eIkuSQXvRfQRI6hoUtRa6TW4k4/tZw1zh2edTTuZbfNOHHGcPMXYkGictIbapJ+m7pVdig4XH0UAyee9YF1F30+OnvBipktvdx3zn6wqYfXkS3mbkZgq1eg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN1PR12MB2560.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(346002)(39860400002)(396003)(136003)(366004)(2906002)(66946007)(83380400001)(66556008)(4326008)(26005)(956004)(316002)(16576012)(5660300002)(186003)(66476007)(6486002)(8676002)(478600001)(44832011)(8936002)(86362001)(52116002)(103116003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 7aqXeXW+Uetkjkdvgag9S1ez+5H7u5Cbiub4cvZIRXWX6NW3gEuQl1aGseigwZke8gQxNHwxcuPmc6e5xfwIvB2fdq92cA6atAmsdw5+JIjmCB54Ckms2WhmlxoViKIWNGIjYMFq+PE/TlSBOOGKTPmsTOgRaFE7i62SYBp5l4Lf5RF6+Me+CqZFcpsRbxMnyKPO8c++o9k4+vz65VxO0rEsCCRs/MKPUWv5sjVVqa5ruFj7sGKo2gZRJeeTZXT9spEYDF+z9m1vo34ygdxZgbAZ5xTNy5V4jzk1PhMM0c+xiabXGWO+c6VMHoyzupN06TxTcgoGnzfc/Fj99RZUWA00IZrANdxXm1N7WagCMipo063lOTcYpI65ZsgK6A+3ndNRV1qXcRXeqKfi4YhhOPkj5hJr8SEx54vf3AwxtR8KYbhQ0Otx02AB3vZTUKaQdhL7dlRU4bUlmHjAbjcj7zFuJMP6aXFsFt+B2j5T2ZdZMrPXAr07SbNRUaMMDpDVyTWY0Yc2gKSVaS5S7X5UqvlywC/3vCpjG2xcT72YM12w1m1O9DgtIpIs6z61RmmCMloFDlNN20LCQWS9afJVBYKJaFU4NeihJ1FuUgR7/0bphYdhJel/cduT1ubwhpVlztWxVWKYy3T2bIyvf0pV2A== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 21708d3a-ee29-4043-6ebf-08d84ddd930d X-MS-Exchange-CrossTenant-AuthSource: SN1PR12MB2560.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2020 18:42:12.4016 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 1msdWkkKzUYljHDDv+gBx84LPVQJe7i5hMPeFKPIqGVjHLSQMPzxLaODTPkYL90q X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB2559 Received-SPF: none client-ip=40.107.75.43; envelope-from=Babu.Moger@amd.com; helo=NAM02-BL2-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/31 14:42:13 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Spam_score_int: 4 X-Spam_score: 0.4 X-Spam_bar: / X-Spam_report: (0.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FORGED_SPF_HELO=1, MSGID_FROM_MTA_HEADER=0.001, RCVD_ILLEGAL_IP=1.3, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_NONE=0.001 autolearn=no 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: babu.moger@amd.com, qemu-devel@nongnu.org, mst@redhat.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" This reverts commit 7b225762c8c05fd31d4c2be116aedfbc00383f8b. Remove the EPYC specific apicid decoding and use the generic default decoding. Also fix all the references of pkg_offset. Signed-off-by: Babu Moger --- hw/i386/pc.c | 1 - target/i386/cpu.c | 9 ++++----- target/i386/cpu.h | 1 - 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 5d8d5ef8b3..6b708f4341 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1502,7 +1502,6 @@ static void pc_cpu_pre_plug(HotplugHandler *hotplug_dev, env->nr_dies = x86ms->smp_dies; env->nr_nodes = topo_info.nodes_per_pkg; - env->pkg_offset = x86ms->apicid_pkg_offset(&topo_info); /* * If APIC ID is not set, diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 588f32e136..173e6f4a07 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -5678,7 +5678,7 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count, *ecx |= CPUID_TOPOLOGY_LEVEL_SMT; break; case 1: - *eax = env->pkg_offset; + *eax = apicid_pkg_offset(&topo_info); *ebx = cs->nr_cores * cs->nr_threads; *ecx |= CPUID_TOPOLOGY_LEVEL_CORE; break; @@ -5712,7 +5712,7 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count, *ecx |= CPUID_TOPOLOGY_LEVEL_CORE; break; case 2: - *eax = env->pkg_offset; + *eax = apicid_pkg_offset(&topo_info); *ebx = env->nr_dies * cs->nr_cores * cs->nr_threads; *ecx |= CPUID_TOPOLOGY_LEVEL_DIE; break; @@ -5889,11 +5889,10 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count, /* * Bits 15:12 is "The number of bits in the initial * Core::X86::Apic::ApicId[ApicId] value that indicate - * thread ID within a package". This is already stored at - * CPUX86State::pkg_offset. + * thread ID within a package". * Bits 7:0 is "The number of threads in the package is NC+1" */ - *ecx = (env->pkg_offset << 12) | + *ecx = (apicid_pkg_offset(&topo_info) << 12) | ((cs->nr_cores * cs->nr_threads) - 1); } else { *ecx = 0; diff --git a/target/i386/cpu.h b/target/i386/cpu.h index e1a5c174dc..d5ad42d694 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -1630,7 +1630,6 @@ typedef struct CPUX86State { unsigned nr_dies; unsigned nr_nodes; - unsigned pkg_offset; } CPUX86State; struct kvm_msrs; From patchwork Mon Aug 31 18:42:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Moger, Babu" X-Patchwork-Id: 275064 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, RCVD_ILLEGAL_IP, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5780BC433E6 for ; Mon, 31 Aug 2020 18:46:49 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 208AF206FA for ; Mon, 31 Aug 2020 18:46:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="TT0sRTug" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 208AF206FA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:34972 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kCopL-0004Qh-UT for qemu-devel@archiver.kernel.org; Mon, 31 Aug 2020 14:46:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40520) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kCol3-0005r2-Gr for qemu-devel@nongnu.org; Mon, 31 Aug 2020 14:42:21 -0400 Received: from mail-eopbgr750043.outbound.protection.outlook.com ([40.107.75.43]:51695 helo=NAM02-BL2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kCol2-0007Sz-5h for qemu-devel@nongnu.org; Mon, 31 Aug 2020 14:42:21 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iLzEmllLAPZOdSfsJC56EO9zGOCCddWEv8jYQ18WuHx9zHbn7jJX8AJtt6y5FJhux92CfpduYuQrYtUEFOD9B10LtZkRccFHUryHbUREIhrd5STjZ8efz4fRZgoZDxW35HZKvIYsIj3JFkI//ScJypAHcqf/2rZakntuGhVGGHylauxWpQmKiVqPIInRkurNqEv23MsgZTD+RmLs5IbyjvpWJVLr90xakRvMWfYvfQ3NJw1J/ZgIJJ4woFIj7jQIoWkl1xmX8YCXfPAUaXFp5VQG6RpCRdC2UFUytUn1w4rakGB1SHWo0mg9pKNnwKYrzvliBGeBjhU6U+uHGoZcIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=e9p0ovwqYrpmecY/lG8nSMN2vBRA6yCFMS067YaxtJY=; b=aKcRd48srridNhO9tWkNBNxBKmCvwYsv9flqZcsvt7feAkDE7vACYgnhZ+jSH5Ha4vHd10CrU4+KSxRydMJxTZKhLZXmoG/8A4aIcKhQKY217iAY9gQt4fWoERMBQ4uvJ01dnmBvjlhbN4kY8HPDeQQQ6EK6dhY88RRvdK5p3QnbnDMrevxHuDFPuyOOBQbuPUtba64VSngjSmNXhV8rSzpYiXxtU1giQ82LhtrbSJyeQ+jj5zfYiUUFL60GaNwLgIiKTjcAxE0GqD1100ciBo9djS2kCWDJXLGBBBvOFkwCJ5YPHzyj71TdgS22kAUGxPKNrzggPbKrJShX1piaJQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=e9p0ovwqYrpmecY/lG8nSMN2vBRA6yCFMS067YaxtJY=; b=TT0sRTugoTuB7GNqFNmG+3+0sh9/PsTaqYz5nOPmn7m0fz5bPFsjzpudFhGymBFBbx/WQcbC6Wt0C4TFC6wOKZYjI0OzOpE/kJV3/zkM0PkkNxv1zCli9kAxRQPBB4CJS2k+y7nyQUYe25rGES6NP1+zZeqjs4C8fmpHqRqoyMQ= Authentication-Results: redhat.com; dkim=none (message not signed) header.d=none; redhat.com; dmarc=none action=none header.from=amd.com; Received: from SN1PR12MB2560.namprd12.prod.outlook.com (2603:10b6:802:26::19) by SN1PR12MB2559.namprd12.prod.outlook.com (2603:10b6:802:29::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3326.23; Mon, 31 Aug 2020 18:42:18 +0000 Received: from SN1PR12MB2560.namprd12.prod.outlook.com ([fe80::ccd9:728:9577:200d]) by SN1PR12MB2560.namprd12.prod.outlook.com ([fe80::ccd9:728:9577:200d%4]) with mapi id 15.20.3326.025; Mon, 31 Aug 2020 18:42:18 +0000 Subject: [PATCH v6 02/10] Revert "target/i386: Enable new apic id encoding for EPYC based cpus models" From: Babu Moger To: pbonzini@redhat.com, rth@twiddle.net, ehabkost@redhat.com, imammedo@redhat.com Date: Mon, 31 Aug 2020 13:42:17 -0500 Message-ID: <159889933756.21294.13999336052652073520.stgit@naples-babu.amd.com> In-Reply-To: <159889924378.21294.16494070903874534542.stgit@naples-babu.amd.com> References: <159889924378.21294.16494070903874534542.stgit@naples-babu.amd.com> User-Agent: StGit/unknown-version X-ClientProxiedBy: SN4PR0201CA0051.namprd02.prod.outlook.com (2603:10b6:803:20::13) To SN1PR12MB2560.namprd12.prod.outlook.com (2603:10b6:802:26::19) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from 255.255.255.255 (255.255.255.255) by SN4PR0201CA0051.namprd02.prod.outlook.com (2603:10b6:803:20::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3326.19 via Frontend Transport; Mon, 31 Aug 2020 18:42:18 +0000 X-Originating-IP: [165.204.78.2] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: dbdcac55-e85f-4a6f-bf3a-08d84ddd96c2 X-MS-TrafficTypeDiagnostic: SN1PR12MB2559: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:126; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZdP9x0UGoHtVr+AjF2HGzxN8VgDPwcyP0LPTdLdTeOMrCS0ve9FF4fZuFKZH6Zg3TKRm0zj+ixau2OWbIw/a0JDyQ31Sc2huxw8zfJErhzTOFkpDFF+Iot6zdRhc7w1hS9m9RRkH5ZbEWW9ifIpIjQ5v+cJYZ+SCLBAEZpZlPJiYVTs2D18Qu62AP0buPTiI4tlesFoq+sBK++/eCtIIsc5RFWOWGOkNaereD1tkibHUem+4zeFoVBIn+MupcKuGTdlhNJ7ZKk5Ifz4Cei/SL0dWYuFg4x0anRUoW/R5w0Xz92DpU2EuHeEcd3mfCht/mopdSD3cK179CzaekWrjww== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN1PR12MB2560.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(346002)(39860400002)(396003)(136003)(366004)(2906002)(66946007)(83380400001)(66556008)(4326008)(26005)(956004)(316002)(16576012)(5660300002)(186003)(66476007)(6486002)(8676002)(478600001)(44832011)(8936002)(4744005)(86362001)(52116002)(103116003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: P/O2FsT2RWezebM45KB3SNPkgypu6rkYCC9tb0qUZ4nrd9W3bs1I5KPRYl6BhfHziv5TN5NCq2vBJeux38kyPDUiUWaVUtMSK66zRUM9NhZ4Pcra3iHIr3qn/Sfk+9DPRKXpZkDxbcTTD8fc0vCPkwCVuolPgDIi3z2Z9lY47A4kCRYbbF1tdLW3CEISUw6KK/K8ktFKvB+aIAd8kzvhX/li+c1ph2rku+pJvzqAUf0WcVCtxDQbTNPE0xnzO4fmdDqu8HwkpdcH1Pd+E8iqsubyVlSMTSDKVsZguXe0rUwZrsolFlv5fcJdXKTLb/BkSjGd6GmyiG+G4eYNoa+6Y8+9hyZzuhkTpcKGsKHPfi1Rkn4x7b4DmureMUgmWR2dnjIP7L7ODahq82gKQlKoy0qsLcNyujx2LsmcazM0xRXNzL8I8kraAnbePFAkX0hRQ2aKeZP3smGpfFNELeG92BItFL+PDgFtd8/lZl2bHsRBT8iOnXHit2RAROEABCrn4WgW/fWE7u+xlN1aiJqjDSGsGWGHwLap4ygvMVYfbf09yAAFhI8chOFrhbM/krfqq+jPI+2Vthdloh6FHL/hF6z5Ah89mAE6vTzx394CpMUj/GKjxNE3zywLvqkqZ36cAKeKHi1P49gZJ881wOJsjA== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: dbdcac55-e85f-4a6f-bf3a-08d84ddd96c2 X-MS-Exchange-CrossTenant-AuthSource: SN1PR12MB2560.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2020 18:42:18.6590 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: BST5in+6AD/yG672+lfMZ6iy1DsuoKhGV5YhPe6ygfPVJlhSmkHTruD3NEA3C+HF X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB2559 Received-SPF: none client-ip=40.107.75.43; envelope-from=Babu.Moger@amd.com; helo=NAM02-BL2-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/31 14:42:13 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Spam_score_int: 4 X-Spam_score: 0.4 X-Spam_bar: / X-Spam_report: (0.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FORGED_SPF_HELO=1, MSGID_FROM_MTA_HEADER=0.001, RCVD_ILLEGAL_IP=1.3, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_NONE=0.001 autolearn=no 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: babu.moger@amd.com, qemu-devel@nongnu.org, mst@redhat.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" This reverts commit 247b18c593ec298446645af8d5d28911daf653b1. Remove the EPYC specific apicid decoding and use the generic default decoding. Signed-off-by: Babu Moger Reviewed-by: Igor Mammedov --- target/i386/cpu.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 173e6f4a07..c9c1e681c2 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -3995,7 +3995,6 @@ static X86CPUDefinition builtin_x86_defs[] = { .xlevel = 0x8000001E, .model_id = "AMD EPYC Processor", .cache_info = &epyc_cache_info, - .use_epyc_apic_id_encoding = 1, .versions = (X86CPUVersionDefinition[]) { { .version = 1 }, { @@ -4123,7 +4122,6 @@ static X86CPUDefinition builtin_x86_defs[] = { .xlevel = 0x8000001E, .model_id = "AMD EPYC-Rome Processor", .cache_info = &epyc_rome_cache_info, - .use_epyc_apic_id_encoding = 1, }, }; From patchwork Mon Aug 31 18:42:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Moger, Babu" X-Patchwork-Id: 275062 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, RCVD_ILLEGAL_IP, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DC27FC433E2 for ; Mon, 31 Aug 2020 18:48:54 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A584A206FA for ; Mon, 31 Aug 2020 18:48:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="AQ+w3XbI" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A584A206FA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:42510 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kCorN-0007dX-Rs for qemu-devel@archiver.kernel.org; Mon, 31 Aug 2020 14:48:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40554) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kColB-00068e-Sf for qemu-devel@nongnu.org; Mon, 31 Aug 2020 14:42:29 -0400 Received: from mail-eopbgr750079.outbound.protection.outlook.com ([40.107.75.79]:20910 helo=NAM02-BL2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kColA-0007Uh-5N for qemu-devel@nongnu.org; Mon, 31 Aug 2020 14:42:29 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GiLBMYFJTeMoFpyxeKsHARSCWY5ymDsB1QLoTnV3oMZndCCJiQ4bPGDMx5/2MVo1W0/KKm8njCdIYUQ9eQAjlNuLyuGEnRCdxE6I8jkDoj9Nf4VxST3meBIy++HRTtaCDlD7RC+HrzTsazroCBRch6wluvaovEV5xcx4yGJVbnItzUmluTGOGY2rm5PVzY7IXnkYWO+wHbMOHQtTFFWNiGXXJvRxNwleYd3CLL2CEgBgHyEF520T1LvCgRsnvNTZe2qVCDw6mDgI6LqVcfS1OiM21rOxp+TywScFldi+v9ooEnWqyAxwIYkuXoayeap1c8SStp88MW26FysqXAXHcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6RifX0ctDpmOifbi7XCqPWHAAJNQ6Z6wtmfyU0cxe2A=; b=J6eJws5D0s6DR08sSvBmwbKy5vHscL+p+LvsH7nCoiA8vH/KmDWuroEM1yRyULeWd/TmUiwu+gWHoZxT3vUzNYNlro/DWJj1YOHWs7yOMcFxMrGDQBndJ7S5a4858RSipJMJn9jIj+vKSs7wDl12mUhk7Z/mrEJhTr6qsI7GrDYzugz9yVIuYskbunFMoDrInNgYnywiPFtbYF0792DFxmBjIp3aG1Dfx8NZqSqBGyqeEk0VoBOevV1hCOr7aQtR+ZPfDhoxfbro/5MvtvqpmBNl2bnbi0iWivnrB8KdbXsqI78hlA9CExCYwaY7IBDnC5M/DwFnnKqdrqnjrgvETQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6RifX0ctDpmOifbi7XCqPWHAAJNQ6Z6wtmfyU0cxe2A=; b=AQ+w3XbIl3TE4gQ5NLeBgvImJBRWQfTbqqD7B5dfHD3Qj0doltISoWx1qfy4HnJpBOFEcmQswyAXCJdacK48L18zVueftbAwb8QN1LFhtVTR/N4rrU92rgXW4hBeS2F8Gvs5i6EGXLpkWAmya8xvLUxDh0IezB0LXNlF5BzRCW0= Authentication-Results: redhat.com; dkim=none (message not signed) header.d=none; redhat.com; dmarc=none action=none header.from=amd.com; Received: from SN1PR12MB2560.namprd12.prod.outlook.com (2603:10b6:802:26::19) by SN1PR12MB2559.namprd12.prod.outlook.com (2603:10b6:802:29::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3326.23; Mon, 31 Aug 2020 18:42:24 +0000 Received: from SN1PR12MB2560.namprd12.prod.outlook.com ([fe80::ccd9:728:9577:200d]) by SN1PR12MB2560.namprd12.prod.outlook.com ([fe80::ccd9:728:9577:200d%4]) with mapi id 15.20.3326.025; Mon, 31 Aug 2020 18:42:24 +0000 Subject: [PATCH v6 03/10] Revert "hw/i386: Move arch_id decode inside x86_cpus_init" From: Babu Moger To: pbonzini@redhat.com, rth@twiddle.net, ehabkost@redhat.com, imammedo@redhat.com Date: Mon, 31 Aug 2020 13:42:23 -0500 Message-ID: <159889934379.21294.15323080164340490855.stgit@naples-babu.amd.com> In-Reply-To: <159889924378.21294.16494070903874534542.stgit@naples-babu.amd.com> References: <159889924378.21294.16494070903874534542.stgit@naples-babu.amd.com> User-Agent: StGit/unknown-version X-ClientProxiedBy: SA9PR11CA0028.namprd11.prod.outlook.com (2603:10b6:806:6e::33) To SN1PR12MB2560.namprd12.prod.outlook.com (2603:10b6:802:26::19) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from 255.255.255.255 (255.255.255.255) by SA9PR11CA0028.namprd11.prod.outlook.com (2603:10b6:806:6e::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3326.19 via Frontend Transport; Mon, 31 Aug 2020 18:42:24 +0000 X-Originating-IP: [165.204.78.2] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 631f2d78-c72b-4d99-1c7d-08d84ddd9a7b X-MS-TrafficTypeDiagnostic: SN1PR12MB2559: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:162; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eVbJLgZ0LwfzLbhDF/BAZJwk0/v/qeXi1AQnAzUPiaoU4sQZKFhKnbg6slTcx2gPfrRKM0A75yIBlk7L4CWA7cQfvPCEcV6i9LpVJqz4SQJz0yTVdXarLAY6XVraFx4n0Eji1SyC3+h/0d507sDAB47EQ6R/7rLK60O70pvMIOmEYZxSicCZ+bwnANky3KoiZnGRH3+8SnQ54RWY/mW0/JwSYjvBqQ2EJuB81aVGyCJesMwfgivYeGSZAbgNB2I+d9ltGW7+eQFU8f5/rGk6iSHyLN/q6URZ871jVSrSw656EIAkMZCV2Xw0qbHPk/B9RcCT95z07rKfP7uWMlmfow== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN1PR12MB2560.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(346002)(39860400002)(396003)(136003)(366004)(2906002)(66946007)(83380400001)(66556008)(4326008)(26005)(956004)(316002)(16576012)(5660300002)(186003)(66476007)(6486002)(8676002)(478600001)(44832011)(8936002)(86362001)(52116002)(103116003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: Guy8oaZenw2c91FfKHI2n3InQPyWcCTDFbz9HU81+GC11FIouu9qwWmfg7BXCnhMstOoD5hVw5MUIvHf4FZhA1T6G6WiTxf8u6QLBUUGjkt+nq1KTX8qpfN5Ew83l7W3CUjaekLPKo+syFCndZcZr2GIEaBmFZvM3fa8c8oR/0VZ9nggN/H0U3bU4MQSNvqNKMi/40WVaPrO/FNcDthwWlgwc4N644UtEwZ1IaMZs0qUJk3d7ZZhOFhp8RkL76YJW2YCIp+yCwqZhij6Ob4JNIyVnYmeqMf0EgJmfvdTYHAp1PDU6QlOUe5Pi4xn8sRvccZ9Q0H27E3pKKlbiuFRmVFXYm8lOrYtfdd/yFMP8/l3XXdEs9MRBfB6lo6SWfHHdXe7Qla4CwdAbWCicT2j+F9AAEeUwrxWKSw3BcNnNZzFNsTVmrVP2xYso8GJaUNZHt3pMGdtdk/ncd53JBleh2+mm/ho6+iKC1K+1mJMo6lpMX5vpHcSiaLxttzPTV24Y1QN9uKlfqB8VId5w/3jJxF2L9IUMLqsCWgkPiTI4V3cDmecd17RQuIZ9wOWidjvdg4BoI7iOBtynw/jt8w4e4evHdzHo8FduiIAknhCOZcgjkiuiZFSLzcmwXSFpupy5DobMs99Xsz2TWXx5c8gmg== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 631f2d78-c72b-4d99-1c7d-08d84ddd9a7b X-MS-Exchange-CrossTenant-AuthSource: SN1PR12MB2560.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2020 18:42:24.8905 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 15yf/z2t604LCSe1+2Mh/AeeBEpLA0kF1Svm4m1NzVXkakn1uA1zsdhn0yZhdLtt X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB2559 Received-SPF: none client-ip=40.107.75.79; envelope-from=Babu.Moger@amd.com; helo=NAM02-BL2-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/31 14:42:27 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Spam_score_int: 4 X-Spam_score: 0.4 X-Spam_bar: / X-Spam_report: (0.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FORGED_SPF_HELO=1, MSGID_FROM_MTA_HEADER=0.001, RCVD_ILLEGAL_IP=1.3, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_NONE=0.001 autolearn=no 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: babu.moger@amd.com, qemu-devel@nongnu.org, mst@redhat.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" This reverts commit 2e26f4ab3bf8390a2677d3afd9b1a04f015d7721. Remove the EPYC specific apicid decoding and use the generic default decoding. Signed-off-by: Babu Moger Reviewed-by: Igor Mammedov --- hw/i386/pc.c | 6 +++--- hw/i386/x86.c | 37 +++++++------------------------------ 2 files changed, 10 insertions(+), 33 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 6b708f4341..0677d6a272 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1556,14 +1556,14 @@ static void pc_cpu_pre_plug(HotplugHandler *hotplug_dev, topo_ids.die_id = cpu->die_id; topo_ids.core_id = cpu->core_id; topo_ids.smt_id = cpu->thread_id; - cpu->apic_id = x86ms->apicid_from_topo_ids(&topo_info, &topo_ids); + cpu->apic_id = x86_apicid_from_topo_ids(&topo_info, &topo_ids); } cpu_slot = pc_find_cpu_slot(MACHINE(pcms), cpu->apic_id, &idx); if (!cpu_slot) { MachineState *ms = MACHINE(pcms); - x86ms->topo_ids_from_apicid(cpu->apic_id, &topo_info, &topo_ids); + x86_topo_ids_from_apicid(cpu->apic_id, &topo_info, &topo_ids); error_setg(errp, "Invalid CPU [socket: %u, die: %u, core: %u, thread: %u] with" " APIC ID %" PRIu32 ", valid index range 0:%d", @@ -1584,7 +1584,7 @@ static void pc_cpu_pre_plug(HotplugHandler *hotplug_dev, /* TODO: move socket_id/core_id/thread_id checks into x86_cpu_realizefn() * once -smp refactoring is complete and there will be CPU private * CPUState::nr_cores and CPUState::nr_threads fields instead of globals */ - x86ms->topo_ids_from_apicid(cpu->apic_id, &topo_info, &topo_ids); + x86_topo_ids_from_apicid(cpu->apic_id, &topo_info, &topo_ids); if (cpu->socket_id != -1 && cpu->socket_id != topo_ids.pkg_id) { error_setg(errp, "property socket-id: %u doesn't match set apic-id:" " 0x%x (socket-id: %u)", cpu->socket_id, cpu->apic_id, diff --git a/hw/i386/x86.c b/hw/i386/x86.c index cf384b9743..3cc2318212 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -68,22 +68,6 @@ inline void init_topo_info(X86CPUTopoInfo *topo_info, topo_info->threads_per_core = ms->smp.threads; } -/* - * Set up with the new EPYC topology handlers - * - * AMD uses different apic id encoding for EPYC based cpus. Override - * the default topo handlers with EPYC encoding handlers. - */ -static void x86_set_epyc_topo_handlers(MachineState *machine) -{ - X86MachineState *x86ms = X86_MACHINE(machine); - - x86ms->apicid_from_cpu_idx = x86_apicid_from_cpu_idx_epyc; - x86ms->topo_ids_from_apicid = x86_topo_ids_from_apicid_epyc; - x86ms->apicid_from_topo_ids = x86_apicid_from_topo_ids_epyc; - x86ms->apicid_pkg_offset = apicid_pkg_offset_epyc; -} - /* * Calculates initial APIC ID for a specific CPU index * @@ -102,7 +86,7 @@ uint32_t x86_cpu_apic_id_from_index(X86MachineState *x86ms, init_topo_info(&topo_info, x86ms); - correct_id = x86ms->apicid_from_cpu_idx(&topo_info, cpu_index); + correct_id = x86_apicid_from_cpu_idx(&topo_info, cpu_index); if (x86mc->compat_apic_id_mode) { if (cpu_index != correct_id && !warned && !qtest_enabled()) { error_report("APIC IDs set in compatibility mode, " @@ -136,11 +120,6 @@ void x86_cpus_init(X86MachineState *x86ms, int default_cpu_version) MachineState *ms = MACHINE(x86ms); MachineClass *mc = MACHINE_GET_CLASS(x86ms); - /* Check for apicid encoding */ - if (cpu_x86_use_epyc_apic_id_encoding(ms->cpu_type)) { - x86_set_epyc_topo_handlers(ms); - } - x86_cpu_set_default_version(default_cpu_version); /* @@ -154,12 +133,6 @@ void x86_cpus_init(X86MachineState *x86ms, int default_cpu_version) x86ms->apic_id_limit = x86_cpu_apic_id_from_index(x86ms, ms->smp.max_cpus - 1) + 1; possible_cpus = mc->possible_cpu_arch_ids(ms); - - for (i = 0; i < ms->possible_cpus->len; i++) { - ms->possible_cpus->cpus[i].arch_id = - x86_cpu_apic_id_from_index(x86ms, i); - } - for (i = 0; i < ms->smp.cpus; i++) { x86_cpu_new(x86ms, possible_cpus->cpus[i].arch_id, &error_fatal); } @@ -184,7 +157,8 @@ int64_t x86_get_default_cpu_node_id(const MachineState *ms, int idx) init_topo_info(&topo_info, x86ms); assert(idx < ms->possible_cpus->len); - x86_topo_ids_from_idx(&topo_info, idx, &topo_ids); + x86_topo_ids_from_apicid(ms->possible_cpus->cpus[idx].arch_id, + &topo_info, &topo_ids); return topo_ids.pkg_id % ms->numa_state->num_nodes; } @@ -215,7 +189,10 @@ const CPUArchIdList *x86_possible_cpu_arch_ids(MachineState *ms) ms->possible_cpus->cpus[i].type = ms->cpu_type; ms->possible_cpus->cpus[i].vcpus_count = 1; - x86_topo_ids_from_idx(&topo_info, i, &topo_ids); + ms->possible_cpus->cpus[i].arch_id = + x86_cpu_apic_id_from_index(x86ms, i); + x86_topo_ids_from_apicid(ms->possible_cpus->cpus[i].arch_id, + &topo_info, &topo_ids); ms->possible_cpus->cpus[i].props.has_socket_id = true; ms->possible_cpus->cpus[i].props.socket_id = topo_ids.pkg_id; if (x86ms->smp_dies > 1) { From patchwork Mon Aug 31 18:42:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Moger, Babu" X-Patchwork-Id: 275065 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, RCVD_ILLEGAL_IP, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 722DFC433E6 for ; Mon, 31 Aug 2020 18:45:17 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3C7BA2071B for ; Mon, 31 Aug 2020 18:45:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="KiOMW+Vr" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3C7BA2071B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:58018 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kCons-00028O-BL for qemu-devel@archiver.kernel.org; Mon, 31 Aug 2020 14:45:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40582) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kColG-0006JB-TT for qemu-devel@nongnu.org; Mon, 31 Aug 2020 14:42:34 -0400 Received: from mail-eopbgr750074.outbound.protection.outlook.com ([40.107.75.74]:39303 helo=NAM02-BL2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kColF-0007VD-BM for qemu-devel@nongnu.org; Mon, 31 Aug 2020 14:42:34 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a/YLprAIE/Zkgb8t8ZNAj7YG3o3ygZHILnfDIgdB2vRBNoJuNfJlnb3BvKJY+X4dJ4sktIF0bWG+em+Rsn2uyQOORD13tEwg75perwM+nF9AWMhBBctX4kIrvbPyK7UFEINtec7U89rocrnM4vVULGeCpDNGrPPs+p7BC56kKyr61NMNdvQHvlwTTB/n09D8c4XZC0mAv8RE3rdQP122z6KFgSESwcVd0TqHl6/Wy12fnhnOVSe6T6DQeNQrj9Y9qUNbpKe657c30+XAaj6htZQDhsxdP2EI9DvKExLrtY2eE93du/ejDFYnYXpbsKrlEgeE6DP1wGloM3Wfd9+Ozw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=J9IGypxYas902igNImmGd5TTMPeGRqNBq9ZlYS/7SwI=; b=jvjEho6E2MPxcRNQkD/Dz2C7q/bBvyW7ucoU0I5qvUL/J+iIiEly665QV5YKWTKl/Y5WdYMnBWILetRtoSiWjQKrN5gNLMZ4dQKoREsDO53lOHFc53C9kUTEvPGIko3wVQUZeugW/SE16Ly4G7In1JBmTa3hT+rY/OO3404ipZYhy1x5gEuw5+0Hn+nFvLwpI0cFXyUGdKK4cITWyYAxU2fm8AzkujgzS3qxVsjVEi20g9nAdoBuiilSNbDYZ5QMfnkJPA5wjmCE4iHtKotIRwotp2Lf8fkhzpvyssxxXyXCvq/cJu5TFAW+9fDhcOtAffJBLD2Nu/5miPq2+spmRw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=J9IGypxYas902igNImmGd5TTMPeGRqNBq9ZlYS/7SwI=; b=KiOMW+Vr4/H5kHe9oHuL7TjBr+Md4jjgvvmPOwlbSY1uPbjMf5TIsyaD2YvF3mJ35ScPKl+lSWzTqYrO+iKXflUQkHcxxxjTvQ90wGefNqOvrJHd7y14/YXmqjQcywreB+ZG1YpbyXjUKJ90b9bcFTfqAa1fhvTwy0yGh396rBo= Authentication-Results: redhat.com; dkim=none (message not signed) header.d=none; redhat.com; dmarc=none action=none header.from=amd.com; Received: from SN1PR12MB2560.namprd12.prod.outlook.com (2603:10b6:802:26::19) by SN1PR12MB2559.namprd12.prod.outlook.com (2603:10b6:802:29::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3326.23; Mon, 31 Aug 2020 18:42:31 +0000 Received: from SN1PR12MB2560.namprd12.prod.outlook.com ([fe80::ccd9:728:9577:200d]) by SN1PR12MB2560.namprd12.prod.outlook.com ([fe80::ccd9:728:9577:200d%4]) with mapi id 15.20.3326.025; Mon, 31 Aug 2020 18:42:31 +0000 Subject: [PATCH v6 04/10] Revert "i386: Introduce use_epyc_apic_id_encoding in X86CPUDefinition" From: Babu Moger To: pbonzini@redhat.com, rth@twiddle.net, ehabkost@redhat.com, imammedo@redhat.com Date: Mon, 31 Aug 2020 13:42:30 -0500 Message-ID: <159889935015.21294.1425332462852607813.stgit@naples-babu.amd.com> In-Reply-To: <159889924378.21294.16494070903874534542.stgit@naples-babu.amd.com> References: <159889924378.21294.16494070903874534542.stgit@naples-babu.amd.com> User-Agent: StGit/unknown-version X-ClientProxiedBy: SA9PR11CA0011.namprd11.prod.outlook.com (2603:10b6:806:6e::16) To SN1PR12MB2560.namprd12.prod.outlook.com (2603:10b6:802:26::19) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from 255.255.255.255 (255.255.255.255) by SA9PR11CA0011.namprd11.prod.outlook.com (2603:10b6:806:6e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3326.20 via Frontend Transport; Mon, 31 Aug 2020 18:42:30 +0000 X-Originating-IP: [165.204.78.2] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 565d1c80-be9b-44b9-5d90-08d84ddd9e51 X-MS-TrafficTypeDiagnostic: SN1PR12MB2559: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:346; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: laYlAA4XYuaL10JNVMPiA6BP6XrpYYvhBLRBQb5yZjUz5l53ZZ6OWpai09wJiOIUgvurnjhMmv6VSOo1F5zSKlSODnJmRGAq2nUev2PwaZ74siiY8IKLudyJwYUMrAn/kk4e8069+PrNvNaOLQ/iei2aqau9k1uSsH2mxWKF2ndYYvXpUgh6oZfXAVFRvNfMOIO10UdqiWDMnckYqTA+zyTnsGEIlic7HyhwQYq87m5BdeZz4SUWKS6CqZ9kdpFAqSzmXi95kwrV2075SWFgWNo3qyIUaMrooXN7cGCDGWyNq0p0Fv2GJPBuIlnq7IDJAZ/WxPI2DGraN0Pw+Uhvhg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN1PR12MB2560.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(346002)(39860400002)(396003)(136003)(366004)(2906002)(66946007)(83380400001)(66556008)(4326008)(26005)(956004)(316002)(16576012)(5660300002)(186003)(66476007)(6486002)(8676002)(478600001)(44832011)(8936002)(86362001)(52116002)(103116003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: ePT2hk46raKDew5nkvsomOJkJ+0/IDbffQUOEo2dA9VRAcX6hMtofZ+c4XxzRb5Vgb10ufLNjviUi+OqdBuBJa/6NBN0WtDCIK7mJ+kZ1NvFosqFEu9DcqvbNiz+ck1SfCRBvaGc9/l24Rc4pM/RewmGh7eylZSBeaX4Ym4w9o0YqwLW09khvZWQUjNjyfQK2C+Zl/oTklrwbC5tMpzWLME1v0hB9bFx8MqPKJVe1QIwy0tBiXIggSVLMYiQj7K6wRH4dIGEKh3E/wZcDy4zggV1+8e8TxnylwMKjQMaZSYXX21gjXCuzFYP6CFmkCYqdjewYex2kXujWWIxvsS4ZGqY0dvV9LUQaQMhrVR/JuHAw6NQwijiYx3ATNUkipCs5wLKa1zFSRqpLhWqE4TsZwFeJ+GkhqfLNbgsGDJyEj8IsBU3tuYZvzURcn+5gAzEiIXyuEUxASxH+pL6Vpov5zkJahI34BO/9pQ6J9eYGS5nKasDZtg4CoLrbUt0EPiDeA7e9l0KZLZMZ9ihMEUFZbtneEBlaSDA7K5VI1wvge995CDsSA3tHn5aICdt4Gq+L65lOiBweMNukDkThAtxRR+tX2er8N1JKyxFuaU0VeoHiZQvHQtcQ/StiBcT1dimVJuN3XIf8b8TBNDYKrT/ow== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 565d1c80-be9b-44b9-5d90-08d84ddd9e51 X-MS-Exchange-CrossTenant-AuthSource: SN1PR12MB2560.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2020 18:42:31.3228 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ZUtWdm0WOQL2zk+J7xX36FH2RmuJHOk1kx10MgpldyPmIqgrGGox6S7kuNsByH6m X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB2559 Received-SPF: none client-ip=40.107.75.74; envelope-from=Babu.Moger@amd.com; helo=NAM02-BL2-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/31 14:42:32 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Spam_score_int: 4 X-Spam_score: 0.4 X-Spam_bar: / X-Spam_report: (0.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FORGED_SPF_HELO=1, MSGID_FROM_MTA_HEADER=0.001, RCVD_ILLEGAL_IP=1.3, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_NONE=0.001 autolearn=no 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: babu.moger@amd.com, qemu-devel@nongnu.org, mst@redhat.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" This reverts commit 0c1538cb1a26287c072645f4759b9872b1596d79. Remove the EPYC specific apicid decoding and use the generic default decoding. Signed-off-by: Babu Moger --- target/i386/cpu.c | 16 ---------------- target/i386/cpu.h | 1 - 2 files changed, 17 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index c9c1e681c2..b72b4b08ac 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -1638,10 +1638,6 @@ typedef struct X86CPUDefinition { FeatureWordArray features; const char *model_id; CPUCaches *cache_info; - - /* Use AMD EPYC encoding for apic id */ - bool use_epyc_apic_id_encoding; - /* * Definitions for alternative versions of CPU model. * List is terminated by item with version == 0. @@ -1683,18 +1679,6 @@ static const X86CPUVersionDefinition *x86_cpu_def_get_versions(X86CPUDefinition return def->versions ?: default_version_list; } -bool cpu_x86_use_epyc_apic_id_encoding(const char *cpu_type) -{ - X86CPUClass *xcc = X86_CPU_CLASS(object_class_by_name(cpu_type)); - - assert(xcc); - if (xcc->model && xcc->model->cpudef) { - return xcc->model->cpudef->use_epyc_apic_id_encoding; - } else { - return false; - } -} - static CPUCaches epyc_cache_info = { .l1d_cache = &(CPUCacheInfo) { .type = DATA_CACHE, diff --git a/target/i386/cpu.h b/target/i386/cpu.h index d5ad42d694..5ff8ad8427 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -1918,7 +1918,6 @@ void cpu_clear_apic_feature(CPUX86State *env); void host_cpuid(uint32_t function, uint32_t count, uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx); void host_vendor_fms(char *vendor, int *family, int *model, int *stepping); -bool cpu_x86_use_epyc_apic_id_encoding(const char *cpu_type); /* helper.c */ bool x86_cpu_tlb_fill(CPUState *cs, vaddr address, int size, From patchwork Mon Aug 31 18:42:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Moger, Babu" X-Patchwork-Id: 275063 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, RCVD_ILLEGAL_IP, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D53FFC433E2 for ; Mon, 31 Aug 2020 18:48:01 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 98A7E206FA for ; Mon, 31 Aug 2020 18:48:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="wN9SI7CZ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 98A7E206FA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:37998 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kCoqW-0005jh-85 for qemu-devel@archiver.kernel.org; Mon, 31 Aug 2020 14:48:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40612) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kColM-0006Wa-P5 for qemu-devel@nongnu.org; Mon, 31 Aug 2020 14:42:40 -0400 Received: from mail-eopbgr750073.outbound.protection.outlook.com ([40.107.75.73]:50756 helo=NAM02-BL2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kColL-0007VR-6j for qemu-devel@nongnu.org; Mon, 31 Aug 2020 14:42:40 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Vyn6A9bS/HzTKizioFNWrPKqLJ2sW21+kmhySMeKeNs11DnQlrUn3a9Y5sogtoVXYx15n9LhbVPPtkgiu1dSWMMRaZj6fKRfMOGonUNwZ4ss+pqVHCq7+bPGrs2V7st5gNpjC3eEO4UWA7QDYh5yd99Fgqh39wkxwp1ENVIlgLz1Qims72WPxN8UEQ4G1SxZWWwnCCdCc3RHebBiS3/8hskcUINyiqd0G8iFSwFXIyqAXXP1cBfYiZYy150AA2Aa97IUaNwiIrHQLUiZlJCcHDzOCwmfFLndXpT0tpIUH3DeefnPOWjy6Dl6Dy0246tNyczhAH1O4uJbJT9UFCeApA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oz9/vr0RtSjw+QTEjZPNKRKielVluz3EjNwJfVjl268=; b=cbfey7Un2JpxvH4hqTV/l+GZqKiY3SgXx94/WZB5EhozErBuirJtrCKV0GqMUmDMTth+2C8b0aoyK4PijKvqUMgK0qu+Z8EREc4x5Ep6GcR+i8xnDo0bZK8ZxdtrJ0qORiiq1mKb9/2n/K7bkkIt9lDanpiocd5Y2ywfcdGWrZoByrScpEvPxq4CIDMXALhJW5vZecs+0GHZUu7bBo+c/gSTuMRPXKvI+vh4IFUb+FWXWQQr5mIYKrJb5vCjWFlB17i+NBIT9FED4NjC6179KjPA0WcezW1iJbTuEk15CLN6H7rGt14JObtYkqnCcw1Bwb9fl3FnW1mHHzNLTil/yA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oz9/vr0RtSjw+QTEjZPNKRKielVluz3EjNwJfVjl268=; b=wN9SI7CZ6HiDbzJYHwiaNjjDsK4s40dSe1BMspyedJtJ0uID5xXKWsVqsKKEiUZ5Sb6uZX2Ud5opGTm4KTDp0mP/zaMxCI7ELs8utLNHAutNKLPYewabxccbfUCd0kpb29CxC0sfxTzraMkLdh1ipGX58FAaNbdRsY6rmnUnr74= Authentication-Results: redhat.com; dkim=none (message not signed) header.d=none; redhat.com; dmarc=none action=none header.from=amd.com; Received: from SN1PR12MB2560.namprd12.prod.outlook.com (2603:10b6:802:26::19) by SN1PR12MB2559.namprd12.prod.outlook.com (2603:10b6:802:29::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3326.23; Mon, 31 Aug 2020 18:42:37 +0000 Received: from SN1PR12MB2560.namprd12.prod.outlook.com ([fe80::ccd9:728:9577:200d]) by SN1PR12MB2560.namprd12.prod.outlook.com ([fe80::ccd9:728:9577:200d%4]) with mapi id 15.20.3326.025; Mon, 31 Aug 2020 18:42:37 +0000 Subject: [PATCH v6 05/10] Revert "hw/i386: Introduce apicid functions inside X86MachineState" From: Babu Moger To: pbonzini@redhat.com, rth@twiddle.net, ehabkost@redhat.com, imammedo@redhat.com Date: Mon, 31 Aug 2020 13:42:36 -0500 Message-ID: <159889935648.21294.8095493980805969544.stgit@naples-babu.amd.com> In-Reply-To: <159889924378.21294.16494070903874534542.stgit@naples-babu.amd.com> References: <159889924378.21294.16494070903874534542.stgit@naples-babu.amd.com> User-Agent: StGit/unknown-version X-ClientProxiedBy: SN4PR0501CA0073.namprd05.prod.outlook.com (2603:10b6:803:22::11) To SN1PR12MB2560.namprd12.prod.outlook.com (2603:10b6:802:26::19) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from 255.255.255.255 (255.255.255.255) by SN4PR0501CA0073.namprd05.prod.outlook.com (2603:10b6:803:22::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3348.5 via Frontend Transport; Mon, 31 Aug 2020 18:42:37 +0000 X-Originating-IP: [165.204.78.2] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: fcda55d4-8b29-4607-1fea-08d84ddda1f7 X-MS-TrafficTypeDiagnostic: SN1PR12MB2559: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:175; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: POQRKpm8OzwI/pc8beLIJWB0crhqCFFaXWwZ3hGSrT6Ckrb6lONF96GVqcdMOPadTJUtp6ma+eQ/jLYwGSULljesUUBoMAOek6VqwpMoots3efoHzyhphcNdmYsuV8vrfJwajCxFZ9fT4SBS+7R1b7j3ODwjswIKlpEnuPktjXo/6ed34o6dLCgB81/hoUoaakD3sRZXJ6//nvBLhpy2+qOTdjA3CbKWir9BQTCmK2HASTIG8l1w1/SSarEqZp6J8yHOn+P80+7+vWsUil4M1lrxNhAnD4fMaSNoKyVQmfnk++47pmWqqRzA1HW5ogLUW434ECzjtaMXtfBVtXBtdQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN1PR12MB2560.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(346002)(39860400002)(396003)(136003)(366004)(2906002)(66946007)(83380400001)(66556008)(4326008)(26005)(956004)(316002)(16576012)(5660300002)(186003)(66476007)(6486002)(8676002)(478600001)(44832011)(8936002)(86362001)(52116002)(103116003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: fNYtjFHMBNO4GitOcRCBcIfOxSUWcvFcuf1+c8oATmyu2fj4uWy1kAym4FCw6oaLKYApeTzs2AbgZt97ZPgeztSW9tDvn6J1nqHGtKSDIPMslMXUGd9FuYnaVVKxcz7xeGXsn4SmN27YP3dfzosMBAqT5CeEt36LCrwY4r6366RkqdXsJf5gEgWH3Zjm65RhK5PxafzDTvOOj/zM4z5NLydDhK1X/p89FSdvz4Jr9svjdL91K9U0XIrNQA4SCWS8L26QQO1uvzNOo3rTlauuXrILnAjo0UVMF5lBgU4KEXVqp37Omd3kxvciHVUjw3vJhl3e8pbg+fdFO3YspS0RWPpVJMMoSxkefuBIdB0vVraPks3DXxoBaOVttJCndislMPIswJjhqUnbTyul8DdSwuIK8fUlsofcSCZOWTn9ZIcm//CUqevhKgz7K/YRbp1acOZVaBLEqS4Q+sVyC5gwzlOHVsGIdr9lbflBUSOhV4VPJVO0tPyBaQk+jl8OZ+761oCsnk4A/vFyVdUDAzSVg1/2TBAN8DjDjEgsrd4yBNdmtqz0/d0WYesoMuH731ch/pVAla5FG987b9wKB9hnqadzBtJK9m1/x9puaae9v9E7MRaRv2CvSqqOW0P9o+VWqmS4Vuue2K+TWDsASliGYA== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: fcda55d4-8b29-4607-1fea-08d84ddda1f7 X-MS-Exchange-CrossTenant-AuthSource: SN1PR12MB2560.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2020 18:42:37.4323 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: vIyAN25ZY6WnyTfLTcMlpWsn8XstkuGa14wQ7xOLutHYcFCgGxqlogiUUdU21voq X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB2559 Received-SPF: none client-ip=40.107.75.73; envelope-from=Babu.Moger@amd.com; helo=NAM02-BL2-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/31 14:42:38 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Spam_score_int: 4 X-Spam_score: 0.4 X-Spam_bar: / X-Spam_report: (0.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FORGED_SPF_HELO=1, MSGID_FROM_MTA_HEADER=0.001, RCVD_ILLEGAL_IP=1.3, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_NONE=0.001 autolearn=no 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: babu.moger@amd.com, qemu-devel@nongnu.org, mst@redhat.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" This reverts commit 6121c7fbfd98dbc3af1b00b56ff2eef66df87828. Remove the EPYC specific apicid decoding and use the generic default decoding. Signed-off-by: Babu Moger Reviewed-by: Igor Mammedov --- hw/i386/x86.c | 5 ----- include/hw/i386/x86.h | 9 --------- 2 files changed, 14 deletions(-) diff --git a/hw/i386/x86.c b/hw/i386/x86.c index 3cc2318212..727c4a0f1d 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -896,11 +896,6 @@ static void x86_machine_initfn(Object *obj) x86ms->smm = ON_OFF_AUTO_AUTO; x86ms->acpi = ON_OFF_AUTO_AUTO; x86ms->smp_dies = 1; - - x86ms->apicid_from_cpu_idx = x86_apicid_from_cpu_idx; - x86ms->topo_ids_from_apicid = x86_topo_ids_from_apicid; - x86ms->apicid_from_topo_ids = x86_apicid_from_topo_ids; - x86ms->apicid_pkg_offset = apicid_pkg_offset; } static void x86_machine_class_init(ObjectClass *oc, void *data) diff --git a/include/hw/i386/x86.h b/include/hw/i386/x86.h index b79f24e285..4d9a26326d 100644 --- a/include/hw/i386/x86.h +++ b/include/hw/i386/x86.h @@ -63,15 +63,6 @@ typedef struct { OnOffAuto smm; OnOffAuto acpi; - /* Apic id specific handlers */ - uint32_t (*apicid_from_cpu_idx)(X86CPUTopoInfo *topo_info, - unsigned cpu_index); - void (*topo_ids_from_apicid)(apic_id_t apicid, X86CPUTopoInfo *topo_info, - X86CPUTopoIDs *topo_ids); - apic_id_t (*apicid_from_topo_ids)(X86CPUTopoInfo *topo_info, - const X86CPUTopoIDs *topo_ids); - uint32_t (*apicid_pkg_offset)(X86CPUTopoInfo *topo_info); - /* * Address space used by IOAPIC device. All IOAPIC interrupts * will be translated to MSI messages in the address space. From patchwork Mon Aug 31 18:43:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Moger, Babu" X-Patchwork-Id: 275061 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, RCVD_ILLEGAL_IP, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 12370C433E2 for ; Mon, 31 Aug 2020 18:51:42 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CE9D8206FA for ; Mon, 31 Aug 2020 18:51:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="W2byJEKy" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CE9D8206FA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:51872 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kCou4-0003Fu-Vy for qemu-devel@archiver.kernel.org; Mon, 31 Aug 2020 14:51:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40730) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kColp-0007It-K7 for qemu-devel@nongnu.org; Mon, 31 Aug 2020 14:43:09 -0400 Received: from mail-dm6nam10on2085.outbound.protection.outlook.com ([40.107.93.85]:37504 helo=NAM10-DM6-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kColk-0007Y8-9J for qemu-devel@nongnu.org; Mon, 31 Aug 2020 14:43:09 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W+6XsRPsa+1K3X3/NxR8iiTpoTuFYtazsrbwO7CvlpVvCpRc6GZp+/QlSHI9z3sXjlsDJf1pVjXy2+UPD3oqdaTeOz/KCEW3H3Nu60mj1CUm9Q6LWyeXqLHu/YqTTanFhBzq3ay729VrZYF/bqTvDWuqqN2gLoURskbNM4TA+p5jLpZFplJz+3D2Nw5FvUlr/bCYm57PY6W4lfQ5mpwdiW0928USGJ02mJv/UjZJBMACF/XlwaD1G+URyDWPk8eQzaYyd9YhJpNS2Fp7kv7Ygo56swM7YysNhboEdFhIaovK/tPZpshPK317ez3eKLPCLFG0elsvvnnBiJliQYwdqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/+8KtUav/FQdspK9sDZqTmizubAzUAiaEsaNU3DLNWk=; b=gjaUox2nLL5QpU8tqF7MbOIy2BlqybOalI7//S/aUi++gDGQb32I7dNJChLcDpq7bFpT21xPB01p0fe5uq8bhXMXosgzl6EId4gSOPjBmG2Fs0XwU4SRZN2sd/oeK4WHWHPDlFB37w3qS3WSGa91O2duXLcuDVK7D6owc2bw3dGkdLzy3io77kmQeM5vOl4BcWYG7wTIYdBgcbIDTjtFXZTNpXUngnCWCZOu8r94K/q8pJjl5xWZ9QimyFE3Pqpn+OM/GToYC65y9nhgB9LSP4RCFMozvpWYD13RaoTkG0V6gWylD0tShxwQY0gzh73TI234amYGez43O92Q6kbS8Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/+8KtUav/FQdspK9sDZqTmizubAzUAiaEsaNU3DLNWk=; b=W2byJEKyEAU8dzv/gJ40gqxm71qbUGDGzrXU5ae9hNmdgLdey8HNKQi6mEygrNQV7KmEdCW4gqgG27rFW7iKz9uk0/IJf1NSUJFl5OWwk5AhTHpfMxe3S+YCPJfOmXYqHRMGFIL7/PTSPwB7QF2PCnjVBPF+jmDZm8WqZ5yJeXU= Authentication-Results: redhat.com; dkim=none (message not signed) header.d=none; redhat.com; dmarc=none action=none header.from=amd.com; Received: from SN1PR12MB2560.namprd12.prod.outlook.com (2603:10b6:802:26::19) by SA0PR12MB4383.namprd12.prod.outlook.com (2603:10b6:806:94::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3326.21; Mon, 31 Aug 2020 18:43:02 +0000 Received: from SN1PR12MB2560.namprd12.prod.outlook.com ([fe80::ccd9:728:9577:200d]) by SN1PR12MB2560.namprd12.prod.outlook.com ([fe80::ccd9:728:9577:200d%4]) with mapi id 15.20.3326.025; Mon, 31 Aug 2020 18:43:02 +0000 Subject: [PATCH v6 09/10] i386: Simplify CPUID_8000_001E for AMD From: Babu Moger To: pbonzini@redhat.com, rth@twiddle.net, ehabkost@redhat.com, imammedo@redhat.com Date: Mon, 31 Aug 2020 13:43:01 -0500 Message-ID: <159889938099.21294.9493474163204060713.stgit@naples-babu.amd.com> In-Reply-To: <159889924378.21294.16494070903874534542.stgit@naples-babu.amd.com> References: <159889924378.21294.16494070903874534542.stgit@naples-babu.amd.com> User-Agent: StGit/unknown-version X-ClientProxiedBy: SN4PR0401CA0041.namprd04.prod.outlook.com (2603:10b6:803:2a::27) To SN1PR12MB2560.namprd12.prod.outlook.com (2603:10b6:802:26::19) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from 255.255.255.255 (255.255.255.255) by SN4PR0401CA0041.namprd04.prod.outlook.com (2603:10b6:803:2a::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3326.19 via Frontend Transport; Mon, 31 Aug 2020 18:43:01 +0000 X-Originating-IP: [165.204.78.2] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: e4be18f2-5db2-4cdc-6dad-08d84dddb09b X-MS-TrafficTypeDiagnostic: SA0PR12MB4383: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1388; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: z+AxekWJJO+4s9PFclE3GP26VPX5n1hKHbBfb4erO/rcwLDFuDYNYtRvTQYP7MZxus5fEX3fogu1C5dSbtvcqmMzy8jpp7K+ZKIUkscKB+2QPvDxLDDGgu1DQNb4oWtI940Vw2cUQxLBqTv80etMFvRG7wtdI7H+FpLPo+0s4L+sD8L2mhVbK7wk36uJ68HbCwTMkF1wDYA6/rB6gDFKmgLUHYeXZobjv7r889hYScuX6fyiK94uzRfAgCyg70LGCBN7PnKeb3mZ+2n9ALKZdu4tWhyeyWEWAvyKbsVTxmKORwzRvHz8SukY+UtqpyiUHJAdrcJ+4m3TaJ8PQwaZ+w== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN1PR12MB2560.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(39860400002)(136003)(376002)(346002)(396003)(316002)(2906002)(26005)(66556008)(478600001)(6486002)(4326008)(186003)(956004)(83380400001)(8676002)(66946007)(86362001)(5660300002)(52116002)(103116003)(8936002)(66476007)(16576012)(44832011); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: ntNommQdT7tsdh6GkKKaGZp63sD5ybjHSVdVwPgWokEILAt9JBdHS4etdXJTN/sq48Bqa1SRkJF/1+XUYKBjkeLv2UJvFlERaoECDZmK0vA8VlZtfsnVBgBwf/asIqH8ZuAPMwnI04BUDqdp1Y+Fz8u++wJrqPE/sYwvn8eFqqH9RN600tfiQRIy5O8zjGR7SKxkkEgJGw6P7XS4uEN5dDtlRFdZ0E5vA4RBdI/hiLzQz55iFthZiZesn3TzOOvYDr4ULcvVWfePpdCX30Wl1Xri81YTljYDaXs2eWQCe4VQR9gu0LwRohylN4/8zQyPJvNfOlaV1LZADsGdY2nMAvPxmYiGT4pZWAI9uenCPHURABvWIt89/YKfDplpF9vDV7fmBGWH+LeD/DdAn/4kbo5WEpM0wDvFO/eeqK7Bqz54HlY4Vz1lHPEQMDrc74Z/KYRND4Pnq5ytAHx/yJE+FSszG4eUJXSqocb2bHJoJCnTaRHXcfwGTy7MblYzYLzrP4mOLJXPFqByfULD12mc4A+XDyCf6zpF8c+A0W+9El9MkInTWky4FiT7vyGS07WMW9FjRNMkcr/dMwem6wOVE46+XCq75CRwZS6Mwfn0wowCo30ciB5xg6CR66NEguVMc4bA2B1bcpTUB4HQURYNKg== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: e4be18f2-5db2-4cdc-6dad-08d84dddb09b X-MS-Exchange-CrossTenant-AuthSource: SN1PR12MB2560.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2020 18:43:02.0721 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: sOMEzK6KMsf58mjIUOYMcjfIr19sAjUqea2lyhXYwmuWltdzx6OhldzhsHZWygGp X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB4383 Received-SPF: none client-ip=40.107.93.85; envelope-from=Babu.Moger@amd.com; helo=NAM10-DM6-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/31 14:43:02 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Spam_score_int: 4 X-Spam_score: 0.4 X-Spam_bar: / X-Spam_report: (0.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FORGED_SPF_HELO=1, MSGID_FROM_MTA_HEADER=0.001, RCVD_ILLEGAL_IP=1.3, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_NONE=0.001 autolearn=no 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: babu.moger@amd.com, qemu-devel@nongnu.org, mst@redhat.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Remove all the hardcoded values and replace with generalized fields. Signed-off-by: Babu Moger --- target/i386/cpu.c | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index ba4667b33c..d434c8545a 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -395,9 +395,10 @@ static int cores_in_core_complex(int nr_cores) } /* Encode cache info for CPUID[8000001D] */ -static void encode_cache_cpuid8000001d(CPUCacheInfo *cache, CPUState *cs, - uint32_t *eax, uint32_t *ebx, - uint32_t *ecx, uint32_t *edx) +static void encode_cache_cpuid8000001d(CPUCacheInfo *cache, + X86CPUTopoInfo *topo_info, + uint32_t *eax, uint32_t *ebx, + uint32_t *ecx, uint32_t *edx) { uint32_t l3_cores; assert(cache->size == cache->line_size * cache->associativity * @@ -408,10 +409,12 @@ static void encode_cache_cpuid8000001d(CPUCacheInfo *cache, CPUState *cs, /* L3 is shared among multiple cores */ if (cache->level == 3) { - l3_cores = cores_in_core_complex(cs->nr_cores); - *eax |= ((l3_cores * cs->nr_threads) - 1) << 14; + l3_cores = DIV_ROUND_UP((topo_info->cores_per_die * + topo_info->threads_per_core), + topo_info->dies_per_pkg); + *eax |= (l3_cores - 1) << 14; } else { - *eax |= ((cs->nr_threads - 1) << 14); + *eax |= ((topo_info->threads_per_core - 1) << 14); } assert(cache->line_size > 0); @@ -5994,20 +5997,20 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count, } switch (count) { case 0: /* L1 dcache info */ - encode_cache_cpuid8000001d(env->cache_info_amd.l1d_cache, cs, - eax, ebx, ecx, edx); + encode_cache_cpuid8000001d(env->cache_info_amd.l1d_cache, + &topo_info, eax, ebx, ecx, edx); break; case 1: /* L1 icache info */ - encode_cache_cpuid8000001d(env->cache_info_amd.l1i_cache, cs, - eax, ebx, ecx, edx); + encode_cache_cpuid8000001d(env->cache_info_amd.l1i_cache, + &topo_info, eax, ebx, ecx, edx); break; case 2: /* L2 cache info */ - encode_cache_cpuid8000001d(env->cache_info_amd.l2_cache, cs, - eax, ebx, ecx, edx); + encode_cache_cpuid8000001d(env->cache_info_amd.l2_cache, + &topo_info, eax, ebx, ecx, edx); break; case 3: /* L3 cache info */ - encode_cache_cpuid8000001d(env->cache_info_amd.l3_cache, cs, - eax, ebx, ecx, edx); + encode_cache_cpuid8000001d(env->cache_info_amd.l3_cache, + &topo_info, eax, ebx, ecx, edx); break; default: /* end of info */ *eax = *ebx = *ecx = *edx = 0;