From patchwork Tue Apr 10 23:16:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Babu Moger X-Patchwork-Id: 10334515 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 82586601A0 for ; Tue, 10 Apr 2018 23:16:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7E54428565 for ; Tue, 10 Apr 2018 23:16:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 732062856D; Tue, 10 Apr 2018 23:16:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B8B3528565 for ; Tue, 10 Apr 2018 23:16:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752826AbeDJXQv (ORCPT ); Tue, 10 Apr 2018 19:16:51 -0400 Received: from mail-by2nam01on0081.outbound.protection.outlook.com ([104.47.34.81]:40576 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754258AbeDJXQ2 (ORCPT ); Tue, 10 Apr 2018 19:16:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=AelhNrcBqvDL/InqNpcDQknPEe6yppMN9FDadWALy4c=; b=hbgNG9/SdEF5/SpWEAnAVM9hp3vscfyjlLlnDZ8nbOy9NOa3WxJKKJG0iaiORc0k631NnEJgnYQpuD70keztFmSGPy6AzwdAODp1IuTBQ6WZsP9BQNPOnUmLb8O9p2Wmfw/9/SbxzWcFEwqoochTpf0GSIIIl9l1pOkald74paA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Babu.Moger@amd.com; Received: from linux-pyp0.amd.com (165.204.77.1) by CY4PR12MB1767.namprd12.prod.outlook.com (2603:10b6:903:122::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.653.12; Tue, 10 Apr 2018 23:16:23 +0000 From: Babu Moger To: mst@redhat.com, marcel@redhat.com, pbonzini@redhat.com, rth@twiddle.net, ehabkost@redhat.com, mtosatti@redhat.com Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org, kash@tripleback.net, geoff@hostfission.com, babu.moger@amd.com Subject: [PATCH v6 4/9] i386: Add new property to control cache info Date: Tue, 10 Apr 2018 19:16:04 -0400 Message-Id: <1523402169-113351-5-git-send-email-babu.moger@amd.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1523402169-113351-1-git-send-email-babu.moger@amd.com> References: <1523402169-113351-1-git-send-email-babu.moger@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: MWHPR2201CA0048.namprd22.prod.outlook.com (2603:10b6:301:16::22) To CY4PR12MB1767.namprd12.prod.outlook.com (2603:10b6:903:122::9) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(2017052603328)(7153060)(7193020); SRVR:CY4PR12MB1767; X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1767; 3:uB6RmlcoDPZYZa+0eQpNnW3qaF6ABH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ztMiLQn4D38H4ne/jAebwHMxB8WdQLZClzyz6/6pWLzHYgSTNBx4qxScaFj08qdM/3afde615UR5d7aUpc0flU8cbD0P2VAQ1mJAxmx3k+m1LApLjzEvpAz3C7U94C7cRm7AeL8tfGQNQkt4QT4xWrAu28eVVRWJw3vsWWgEJqE7L9caJa8dVsleYn9mqV1rZoY5xwcdt1w8giMVV+J05IbF69obDFL01JdlzQo2XJz/wZSaTzxFoYYuv+thPO7z36CKX9iAE8TdRPoAltYVv3qUR/SDfUbGF8ZvOlP6rlCrjXVRGKD9kJq; 4:OhSicr4uWGNo1znvRCzg2zFLrn8bgZSv3lXJooMUiHgQYmmpchEHuwVOokELGZ/G5j/zmoa56WJHllq8awpuUFTYGLLLIjOFydKnuBtu8bGvCQckvR4QhUI/QFzCe4KHcnUZKT2gxhnSxBMlC9aAVl9o+G/F9YwJOyCQdkCulweJY6WSR/pBue1Ds4DWU6SIzPWrpSjvl2MPDMPbF6yKgWVWNq9zpvpUyqTKIxlH4rOWu23+gKpSovzKpnRWO14i/nymE8KIAH17uUqUuTe0fxXooLeMbfDP/AhC4jHP0TkEkxIzbQneiGDuDpwjicK/ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231221)(944501327)(52105095)(3002001)(10201501046)(6055026)(6041310)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:CY4PR12MB1767; BCL:0; PCL:0; RULEID:; SRVR:CY4PR12MB1767; X-Forefront-PRVS: 0638FD5066 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(376002)(366004)(39860400002)(39380400002)(396003)(199004)(189003)(476003)(2906002)(52116002)(26005)(86362001)(50466002)(50226002)(305945005)(5660300001)(186003)(48376002)(7736002)(16526019)(6666003)(25786009)(6116002)(446003)(11346002)(105586002)(4720700003)(2616005)(6486002)(4326008)(956004)(3846002)(66066001)(53416004)(8936002)(386003)(72206003)(478600001)(316002)(16586007)(8676002)(81156014)(81166006)(97736004)(36756003)(47776003)(76176011)(106356001)(7416002)(7696005)(51416003)(45080400002)(68736007)(53936002)(486006); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR12MB1767; H:linux-pyp0.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR12MB1767; 23:Espn7W8EEcEe3xXdeA4hRzfH1idnwd6Qa0k25rdi/?= =?us-ascii?Q?60XoPzKEVZgTIoXsWw++XHyhYqFqJHZt1lrk055El8gQ5dPMH/9lBBDoUp6B?= =?us-ascii?Q?foQABl7bb0WZaiPrzkwdupIW7NbbLt8RdQoLTFnHBhWvQeONmxQ4Yo9BEyM0?= =?us-ascii?Q?lGTgmCQleB5pSd81WiTLzpl+sPPNn80FNbp1Xs3/NAbyHaM2PPOGbIrfzyTm?= =?us-ascii?Q?S7s7Pi2Ohvf+chxZC1rvEtN2X3XqC09FxwAY0QvlEXSjUIBhPuX0iPRYTCQ7?= =?us-ascii?Q?e3LTFFw+BcnOi6SAokybQNQH1JMAQrq5yERnrVkMpDbGplHcMOFPQ49I7EQM?= =?us-ascii?Q?KcE79o3Nl9KW+E4DHAznihCu2RlkTHOh+gaLwv8krcyzdReoqZAS22xH+qeh?= =?us-ascii?Q?t2eqCzV5K/wn1YAQiPU2yVP4Gby/CBj6jFJfKeaVzCi4hq0mqp2piM6MtLgA?= =?us-ascii?Q?QlZ8rFBYQG9MC378khYDNetU7/d9182TiW7bDPKMSwG/Nj7sgoKNYhtfJLZ6?= =?us-ascii?Q?GCZQRGu6UQLZiLLSdQkQ4B/HsR4FfSfeRY0eN8zzQxp5jilsxDktXY9qMd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exchange-Diagnostics: 1; CY4PR12MB1767; 6:s1zAseTou0yQEtAUiL+mG9AwEVhV7eQprY3fyhsOEaexBT/yFX77mD5ZzhX9s1sgcgDNyf1XaNeuaMK7jFnjoz8VMlKVeAc/v/YJ4HOboAje99/D2xDCshdvhdqxWfJWn2nOd+/dLxpV4oi1grwCyREPJNSYTTPdcNhSk2DPrDgwQza1q+OibAeac8RZ3FScocpNVIlh2z2O7u0/OPDTLwHKHHT9KusJ0L6mfwesmpLpkOxAOE+5brZKRN6KfOq33+qYJkbpFKMX6kxbYgbrNKuLeZaeAXH4auyhvoVC61qYdxOK+DLoyC6WHmkmIJ65YCEeZYgtl0YgqtmXHRgBzns9oqXeeyNDPGn85Pt+vfS/gKKSQ1xssVszqSnuhb8z9G5PHnmhbFyz7e0b3eggoZh2Q8EzkppWj7jeDzLO9L3kKqyV5iB7ycAbSuFuhynpXBosSLFZ9Tw8giV5YyXpCw==; 5:nQtlllbJP/81tq85d+Ta7TpY2Tw0hrSFT8HXUmmsx7E1OinueHgZpmSii8HsahL1TvSjExoSjBtl4f+fTTCVci6pWwHCT/hw/V7A/6xWjUWDN/ebzLSlwKoTo+bWMRcls2FOUs6SLdRT3DsQw52PEm779QA0t2ebFFV6tY6ECME=; 24:ggEntTsmBz8CGfp7O9+JGoz9SloRd2KO+w3Qip+8adeHr7lJQ4sQ/MmgjPUYMujE/e00Tqk5P3yZTCiA6/8PVcqK3lFje7VaM6rcA1GHfQI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1767; 7:D5lH469AaFd3zigILZLh9VveZeQSvVKuFq/eFEmOFvQV10KaM7jUy0xiTN1XP2yXIT3LI/fx2IIMdRtA1Q2ccnYduKLmEph+yCIrUriWVre24Xat4fG/laVRrMo50WbuyNnqZhca8xyEWguiV69ewqebGhsZSXiB0zw+q/VUKFxu5LnMqBSmbzJLx3F7lt7/gonXlX440TdmjsHGYJmlxp92eXPIXrpWgW24bxDpzDraxQeKJZcKt8De2Vva/udH; 20:If4DwOYsrDB3+FaqMQsLb3JNkAk+gdki87lb+/xw9WFvt0FO5HeThGGhh1bzlpomw7vhNa0kFkjWXbJtdYafrUQKCGsIpDzrQb3Z0DO8fTLT2Q/1O6a9uOzDdY5FyPc32jIIET0NDk/wLZ64+JvxVLyn6y62O8+AIGqEUZjaFhGoBMXVrTHxQf3DWIXq6sMvlfRkUK9Ad/fisuxPsLpyNXfDpjeU/mm0yhIQCBCnY/qgmTLts1dWPNjgVLsV4xsB X-MS-Office365-Filtering-Correlation-Id: 392f95cf-38e3-4e87-c5af-08d59f39144e X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Apr 2018 23:16:23.5139 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 392f95cf-38e3-4e87-c5af-08d59f39144e X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1767 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This will be used to control the cache information. By default new information will be displayed. If user passes "-cpu legacy-cache" then older information will be displayed even if the hardware supports new information. It will be "on" for machine type "pc-q35-2.10" for compatibility. Signed-off-by: Babu Moger Tested-by: Geoffrey McRae --- include/hw/i386/pc.h | 4 ++++ target/i386/cpu.c | 1 + target/i386/cpu.h | 5 +++++ 3 files changed, 10 insertions(+) diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index ffee841..d904a3c 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -327,6 +327,10 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); .driver = "q35-pcihost",\ .property = "x-pci-hole64-fix",\ .value = "off",\ + },{\ + .driver = TYPE_X86_CPU,\ + .property = "legacy-cache",\ + .value = "on",\ }, #define PC_COMPAT_2_9 \ diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 3b2a19a..1659320 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -5129,6 +5129,7 @@ static Property x86_cpu_properties[] = { false), DEFINE_PROP_BOOL("vmware-cpuid-freq", X86CPU, vmware_cpuid_freq, true), DEFINE_PROP_BOOL("tcg-cpuid", X86CPU, expose_tcg, true), + DEFINE_PROP_BOOL("legacy-cache", X86CPU, legacy_cache, false), /* * From "Requirements for Implementing the Microsoft diff --git a/target/i386/cpu.h b/target/i386/cpu.h index aff8396..fe8edf6 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -1394,6 +1394,11 @@ struct X86CPU { */ bool enable_l3_cache; + /* Compatibility bits for old machine types. + * If true present the old cache topology information + */ + bool legacy_cache; + /* Compatibility bits for old machine types: */ bool enable_cpuid_0xb;