From patchwork Thu Jun 14 01:18:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Babu Moger X-Patchwork-Id: 10463145 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 67457603EE for ; Thu, 14 Jun 2018 01:18:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 57B3A28A7E for ; Thu, 14 Jun 2018 01:18:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4C0B528C59; Thu, 14 Jun 2018 01:18:50 +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 D5E2A28A7E for ; Thu, 14 Jun 2018 01:18:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935823AbeFNBSr (ORCPT ); Wed, 13 Jun 2018 21:18:47 -0400 Received: from mail-eopbgr700079.outbound.protection.outlook.com ([40.107.70.79]:4864 "EHLO NAM04-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S935616AbeFNBSn (ORCPT ); Wed, 13 Jun 2018 21:18:43 -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:X-MS-Exchange-SenderADCheck; bh=5E+kbjk79JpXypuDEA+OmxmJc1DN7TrzskGF9TqZZLY=; b=pFw7lif+pCgdvzokf0kXr49ZatEvJlEqIn3yKvWPJhyZtIgh1wEuR+4swZLhJ3R/0hHwrNCVRl0cffeLI+H/6Wa/iYifzZXLSOZtE4ASywsBDF5VgKuOtccfK0WH3fnFOTxol+S8nVdtlSEplojl77t8eC+eX0UtuK+5yG54s94= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Babu.Moger@amd.com; Received: from linux-h3ml.amd.com (165.204.77.1) by SN1PR12MB2480.namprd12.prod.outlook.com (2603:10b6:802:29::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.841.14; Thu, 14 Jun 2018 01:18:40 +0000 From: Babu Moger To: mst@redhat.com, marcel.apfelbaum@gmail.com, pbonzini@redhat.com, rth@twiddle.net, ehabkost@redhat.com, mtosatti@redhat.com Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org, babu.moger@amd.com, kash@tripleback.net, geoff@hostfission.com Subject: [PATCH v14 1/6] i386: Set TOPOEXT unconditionally for comapatibility Date: Wed, 13 Jun 2018 21:18:22 -0400 Message-Id: <1528939107-17193-2-git-send-email-babu.moger@amd.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1528939107-17193-1-git-send-email-babu.moger@amd.com> References: <1528939107-17193-1-git-send-email-babu.moger@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: SN4PR0201CA0064.namprd02.prod.outlook.com (2603:10b6:803:20::26) To SN1PR12MB2480.namprd12.prod.outlook.com (2603:10b6:802:29::19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9334d472-2747-4fd1-8d0b-08d5d194c364 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(711020)(48565401081)(2017052603328)(7153060)(7193020); SRVR:SN1PR12MB2480; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB2480; 3:l5V1EwuaJOJFjKGpBVHk+XYBiFdWdBHyM1xmGkwFOG5DZcuj0Za7Abhz9c0srr2PhhixCBMDLysBElN0TTT3+kh+3ef5z5kl6dntYRXbiHgInBm4z2i2lfG/+6jHJWJorJm+zm/1d8TKinpNH5OttHN4DjGcM4bUv8dfuvG0Gw/JuOuxPTwBCdKwCnLgFB+/aWArKJ4AyJgGMHwAwzNbpxAtPBFsi0Nb//XZGtE8VQEZhOX955QUpx/cfRmmi3h3; 25:zu2Yg014SqWjNFAFcGuJkB50MTGgEdf4R8ZfziT9Vhq/OBikUqVwhA9mHZ6d1AWZoHOwAiCJ32MigCbJxm1IID3B3wOWcjY+Ap5fOfOSyeGkwZLi42Il5J8XXWM/xpeIdt9D8O092NaaXmt7IDqy2xYZwvjXzkSHkqvkceKyfo3j2/lIemI41tviDE11TYUP2whODf+9W0chZGc+ivotDQB2L544XaP9iZHnFvZ8RvKDGSi6ru1eD4uRoc33l2t39avlilL2bSLqxaVDupUVBGoi392Gp9jA5FppAL16zKC/SgU3Rv/+fSaC5Tfg2eKdMhJIrmgJIEmf3ArWE8Sgpg==; 31:so4T5joB2rDH4cCnY+C/1y/9GFLkroYegRfvJqyAXYlCicBUh7Bdn/cFJ9ma8x460gWGCD69iDfcrlwQDUH6UeAfRWHOXZ4bqOtel7CkYHHYApQyHZSMJM7dTjoZEoGeeG6GAE/w8PvXj/Chi+3Vf4FMoohujvp0jLuxcj4NwHH6FdzavtytpHFgDB8bLgqD7EwMzjN7QhSn6JW4/tN13kGXN29flplMC7O3WpyXw4A= X-MS-TrafficTypeDiagnostic: SN1PR12MB2480: X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB2480; 20:htQuTq5e5XeM7A83fdUPaJ+IqAfz/i+UWQbbPl2J4oGGwwgFJ+42TUyoHRSp84VH4FML1mkz4a/RI/+aPB0NLCibM1deJttdBvE5rND9Sz13ZnNXAMjwMAyFNa5rgise92d7W5RHQHaN1SaQsLJAxPGKlID8n0XYFtSlhQewbkSIx7/D2+AZHwnUG39tUSE5AgJ8fo7dAhSUkSE/vv5OkqZh0wq4O78OoyRQpMZNAxROLkeRw2BzCyG/asuix0Wqz2GhRIulBoTAar9zfbg+K/nqrWjjCYdyh0uZ6W7tbHp5+nBG1CSWnZ8q9vXGNf4KrUm7iGktVpTpj9siQ8Xr761HDb8ISw/mUJOBMmvzSbHulc4cMAn5NzEJwE1syJIHnRefqVsCfKiKlnuWD/EW7no/BxyxGLKVf7k6+bYzKvq0wmmPSQxcN2VqujU6V0JE9SH2dyU2Xb0sn3AUmy8VFB8i50z8p2rqVhzNDXxOcLlOg945v8M7qTAaMZRLWDOf; 4:c8MHgtPlR0UnsadRbu9mYmTGwLDtIpP6zl0uQihEiKUtCrUDD523J5DjvBMReFfK0h4ONxSflIUUSaBM3MuXd27VfQO3hxM5VVmlx07nZIkvAlFQMf+MiY9ZwYk8ayQvLm6ArI7wNbaLTG+mjhC2ROqej6CCHYnsB7ebGLHn8jTVUFteXsvtqmMjmgnbZBOFZ6K8Jh2CBMxnCbdK7zOVFvtWpusZdmIMT+c5S5uvWgUX7XzvvPzF+G1Z8yk+slV68ic2u+MpwHhvfGUr8hIIIduA56hp6scPUAuMKV5gKhcXO4O2Gv3zv03DfGpRqzJa X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3231254)(944501410)(52105095)(3002001)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011)(7699016); SRVR:SN1PR12MB2480; BCL:0; PCL:0; RULEID:; SRVR:SN1PR12MB2480; X-Forefront-PRVS: 0703B549E4 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(396003)(39860400002)(366004)(376002)(39380400002)(189003)(199004)(68736007)(2906002)(25786009)(52116002)(7696005)(72206003)(51416003)(4720700003)(956004)(6666003)(2616005)(11346002)(44832011)(486006)(53936002)(7416002)(476003)(446003)(76176011)(6486002)(39060400002)(36756003)(478600001)(4326008)(6116002)(5660300001)(7736002)(305945005)(86362001)(575784001)(8676002)(186003)(97736004)(16586007)(66066001)(3846002)(53416004)(8936002)(16526019)(316002)(386003)(48376002)(26005)(81156014)(81166006)(50466002)(106356001)(50226002)(47776003)(105586002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB2480; H:linux-h3ml.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR12MB2480; 23:XpTai2jJeyZlN7HvNZxuv8ovIMgmohPEql7nrU3pF?= =?us-ascii?Q?n6rOV+ynBpemJ4VynG71NdZbANtELj/h2IowmJWWUuQlrwof+X0njMlf6lNS?= =?us-ascii?Q?C7ZXLhN5irPYKGaOVd+kBr4QgZt/j7iQ1kpgxXDEdHxdTsAgLpI+8qpRFIqe?= =?us-ascii?Q?ORoJJVLiWYibcGLNDhFGx4zQiAtOZTQzncu8RYZlakJxt03128gkzZsWTixt?= =?us-ascii?Q?rbTgPY3f6P3Wtg3oKVRPu1dpa621aSLMENEkjZaR+gDbWbYoEUy2iaV1owCG?= =?us-ascii?Q?mzy264eQSa6TBv2lYHzA07f3LWOBpnH8lfov6atdumPkjMbQV1qQSRf+ErAS?= =?us-ascii?Q?O6kfsI6NfHPjdXx2PK64Gf/oewDJyWPoo+W3SvnupJNqg51ffUQy4rCRBstM?= =?us-ascii?Q?zer1ZirnYE3sSkgiX3AXqpVH1lLXVkWnM9k+ZXnPFyulQAooCedh8kHgAwko?= =?us-ascii?Q?nH2RJicJjj7AHqNkOjXTzN7FlupSnc4sZEtApL8+vtRlOso0pDbodGxyAXRX?= =?us-ascii?Q?03myCuVAVNwLmByVCo0mGFMoE+qxKWVEpicbP9a/zv/LRPy9NlMQOAymoRxh?= =?us-ascii?Q?RwSA9zKQbBiWMbms1vQ9uTomLvl5XTsO7SrPaAXT3iFRITxVY6dZGqv8qGLs?= =?us-ascii?Q?pLoESGimxDvx4ORei01mHYvGSSxMtmlwlEAz9c3wHS1rtjT8G4AjHD6rzLh1?= =?us-ascii?Q?rWMQgRwMVB0bqFe9qVqOARAnUzCwJti2RtnCyG3IrCk0lx9kXc5yUTEErQmD?= =?us-ascii?Q?SzOHw+efA1bgPz4lFntfdqI7UZkPnJmzxy14/6hX5I/vMXLf9SmuACZ2rBJW?= =?us-ascii?Q?uJ3iss+EsE2KQEAm2+cbbCvEHsHk87PLEyTRBJKm5oDnuRJq17C0IOmtxfty?= =?us-ascii?Q?hOijNYbV0QsVKAZs8sq10Iih9pMSbGxu02Co6O9Azq9A/yGoHswwAzaMGoYf?= =?us-ascii?Q?ToTNF4lDmbZTQdKBpjz41LfJa3pEqx/BsFIasyfFOTqFgsjLXfoZxtFuTnfI?= =?us-ascii?Q?PuKqJOOMJeq0vovhrureLKsvjhbyS/6crfpHVIr2zdn21QDV6eJLAcjT7tUf?= =?us-ascii?Q?BNpMGBS7yzgjK7mLnO8LpFNNMzka7DOv+DR3PqdFZ6ymcxOTxniuONxz8f7O?= =?us-ascii?Q?SCP59RxxIjoy0YWaty1Xa/0qAioGHqUewRvkUEZakPYcXYCPwqL+BrRmIXhx?= =?us-ascii?Q?v5t4DUD0pnjNTh6JsjQ3xZV29+VTcPVFk2mapCPbaiBZx5U9/sxLejRktHbZ?= =?us-ascii?Q?J4nZDxVgGuX8XVh5Zy3wInDI53ldtbN6iHVkWn6LG4ol2n2Kpft3w3tWAPt4?= =?us-ascii?B?QT09?= X-Microsoft-Antispam-Message-Info: /fPVewVL83ZqERs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vPwDJR25/eO5KYG4Pd1H1YL9OxpDjIxQwMwMG8rRml4bbz1DJYaUmq2IjBkaPHDJ1RaIhYrZGKivGL+Bn1byFoDc4fWT4lW7m3xIhD5PrTvB/iQWilGwpBgsjPkYKxEVYr15gC+KyTThia5pEe7QLDTm9nJN148Vh67d2uarV2TviyqXQA0QCMF4WrVSLl8hiGbuy6u9sCecQkgGbYSQQObcmTw4qjWA4jaBXA1Hal/qdJBk090Tj21m9nR; 20:qcKN2gaKljIIaFKV+EQY+Mw6bld7+WsSQjA9xsMRIumTI5zfsX2/PaDMkrQQdM1MQFuINFW+1oPhyCJx0INcZxq5yUNqbVX6UZjikmpUpgcnMXOCIJ13WDJDZkMK2mb4/ShwAYdTTadNU9RSKkQ4Xb/epJUUPsxgGfQBlQbnT5CBL3HTRteNDVuirC1YInXIyQYZmaS4nK+gVZ/GZwSJOn0YSgT9XRnLRAZUPsqAM96uDqiN9kCzck7k/eBv6GYa X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jun 2018 01:18:40.2922 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9334d472-2747-4fd1-8d0b-08d5d194c364 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB2480 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Enabling TOPOEXT feature might cause compatibility issues if older kernels does not set this feature. Lets set this feature unconditionally. Signed-off-by: Babu Moger --- target/i386/kvm.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/target/i386/kvm.c b/target/i386/kvm.c index 445e0e0..6f2cca7 100644 --- a/target/i386/kvm.c +++ b/target/i386/kvm.c @@ -372,6 +372,12 @@ uint32_t kvm_arch_get_supported_cpuid(KVMState *s, uint32_t function, if (host_tsx_blacklisted()) { ret &= ~(CPUID_7_0_EBX_RTM | CPUID_7_0_EBX_HLE); } + } else if (function == 0x80000001 && reg == R_ECX) { + /* Enabling topoext feature might cause compatibility issues if + * older kernel does not set this feature. Lets set this feature + * unconditionally. + */ + ret |= CPUID_EXT3_TOPOEXT; } else if (function == 0x80000001 && reg == R_EDX) { /* On Intel, kvm returns cpuid according to the Intel spec, * so add missing bits according to the AMD spec: