From nobody Fri Mar 29 08:02:09 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1dmarc=pass fromdomain=amd.com) ARC-Seal: i=2; a=rsa-sha256; t=1573150125; cv=pass; d=zoho.com; s=zohoarc; b=nFJDoOgKUQEA5k7mKKuQpe3dnUzkKlJuEWC/YBGhzvRyCeMl0O+ZrRPq+JorlKHCzoOBwwhNPQZ0kCATPAarXTX8WlWmpb4VyygJ8ybtxhkDK80VpPnP31ioVURTLq6wzHMI8nTxpjMoqXY4ixGHDKId608O/kq32/b/UAzyk3M= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573150125; h=Content-ID:Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=pJHVJRkH0L6faA6B4hVpMbpLi34iYQc5VQfEpFC44/A=; b=HpgZ7vIYEntIE9Q9wEgJMgarfIFlHRlt0NXgbG+LOQbB6C7qxJdrhyezptEIVcp5rCPyD6PtssFt7b1xdx72xiydtDuCkuyvRCP245J4ozKr6n99EtfYfAUHQm6uiVn9VrKWk5bNV9PCBXV3RIRr2yq5MyjVQFBS5x7owSEEnfw= ARC-Authentication-Results: i=2; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1dmarc=pass fromdomain=amd.com) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1573150125372165.70463146970405; Thu, 7 Nov 2019 10:08:45 -0800 (PST) Received: from localhost ([::1]:46822 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSmD6-0002lR-4t for importer@patchew.org; Thu, 07 Nov 2019 13:08:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57055) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSm5n-00031E-71 for qemu-devel@nongnu.org; Thu, 07 Nov 2019 13:01:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iSm5e-0005nM-Vk for qemu-devel@nongnu.org; Thu, 07 Nov 2019 13:01:09 -0500 Received: from mail-dm3nam03on0603.outbound.protection.outlook.com ([2a01:111:f400:fe49::603]:21216 helo=NAM03-DM3-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iSm5e-0005gc-O0 for qemu-devel@nongnu.org; Thu, 07 Nov 2019 13:01:02 -0500 Received: from DM5PR12MB2471.namprd12.prod.outlook.com (52.132.141.138) by DM5PR12MB1196.namprd12.prod.outlook.com (10.168.237.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2408.24; Thu, 7 Nov 2019 18:00:58 +0000 Received: from DM5PR12MB2471.namprd12.prod.outlook.com ([fe80::d0f5:b875:7b5c:46c3]) by DM5PR12MB2471.namprd12.prod.outlook.com ([fe80::d0f5:b875:7b5c:46c3%6]) with mapi id 15.20.2430.023; Thu, 7 Nov 2019 18:00:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Qd/fz+s183BGpD141j869uclWRvlVInhWtedariZQ9qvmi8bXau7Ct/+b6LoO922M+bE59GZ2lQfeQoNLlYSPe3EXSW/L22NT90FSBcZ22nu4JSv9ceRW66O3SDt9Rz9wvTCy37ae7FeDBMWcD8o6QAqsv2z4dTGO3LLfpTiLAlKcgoi1U0KSdVogZImGg5OC2EaAjSgm6k9vd9JZYkRftk1kBn4eIH/rXgc706YzN96Jf14iModJSUATZJO8Zv2K3Mtyn/Wa9InGJ40TkJ/4La0/+KE6z5rSky6UTHLszltb6dnKQ6DKQLjBjgDyhftQl/rFL8O1NGV6zozQzlVfg== 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=pJHVJRkH0L6faA6B4hVpMbpLi34iYQc5VQfEpFC44/A=; b=InfSFH68BtjV7/KLvQksrMNVVUCZqdqnZ5dOeE7ZGNhTyqCDSjzWuY85lz1pTd8iFUs9hVuTtuhHItRGkotZ+2DFjji5+lAQhfme2bPlDCCHu8uAB1MIYcGvNVCNlHcg2pJAlO29bApy9AD02iYMItUG2HhrK2VGT8k5x1wMOJHQ+KZDun9+USJ6ENLQ7ty8VeGvpwhFnAgS0vO6c7fVqyNNgp4P6qpI36KAIiDgmUTWvWedIMy4Sr17ppyv7LOT1C4e/ZNRW6BwuNvCLOFzIckPvTz+n0ugiZrq9FD2eZQakpwm8tPCD0/5lfsfBpVOdZMxcHuvVIEg9n7y/mVPAQ== 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=pJHVJRkH0L6faA6B4hVpMbpLi34iYQc5VQfEpFC44/A=; b=GSGpz4Me8RSFWlIUVhPOi1A6eL7GKHvsLs7RsXEdvpO5zLB+iLWuMkMdlDOayPWY6650OGnOOzbcNKFTPBNZGzUXDbdzIYoR+qf3jpwlIjYzYUBa+BW7D3M/Detu21Ngi9sxKgwXmILOahQI6sao9GNDvqKml1aX0ypFezFQoNI= From: "Moger, Babu" To: "mst@redhat.com" , "marcel.apfelbaum@gmail.com" , "pbonzini@redhat.com" , "rth@twiddle.net" , "ehabkost@redhat.com" Subject: [PATCH v2 1/2] i386: Add missing cpu feature bits in EPYC model Thread-Topic: [PATCH v2 1/2] i386: Add missing cpu feature bits in EPYC model Thread-Index: AQHVlZVOB38a0NQpEUCbl1A7MIyayA== Date: Thu, 7 Nov 2019 18:00:57 +0000 Message-ID: <157314965662.23828.3063243729449408327.stgit@naples-babu.amd.com> References: <157314957337.23828.3860599077487615762.stgit@naples-babu.amd.com> In-Reply-To: <157314957337.23828.3860599077487615762.stgit@naples-babu.amd.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: SN4PR0501CA0008.namprd05.prod.outlook.com (2603:10b6:803:40::21) To DM5PR12MB2471.namprd12.prod.outlook.com (2603:10b6:4:b5::10) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Babu.Moger@amd.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [165.204.78.2] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 1fa8e694-af66-4e4d-b62e-08d763ac7112 x-ms-traffictypediagnostic: DM5PR12MB1196: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-forefront-prvs: 0214EB3F68 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(396003)(366004)(39860400002)(346002)(376002)(136003)(189003)(199004)(66946007)(86362001)(66476007)(7736002)(66446008)(64756008)(66556008)(386003)(26005)(102836004)(52116002)(76176011)(71190400001)(103116003)(25786009)(3846002)(2201001)(6116002)(6506007)(71200400001)(478600001)(256004)(14444005)(14454004)(66066001)(8936002)(110136005)(81166006)(81156014)(6512007)(305945005)(2501003)(8676002)(5660300002)(186003)(99286004)(11346002)(6486002)(476003)(446003)(4326008)(316002)(6436002)(486006)(2906002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR12MB1196; H:DM5PR12MB2471.namprd12.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: pass (zoho.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 (protection.outlook.com: amd.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: TKHfUhMwCEvJRe5Y6CshxCDv/QkVXWe4ayOjxmTX8Ggdohhz6FBK+9LFMvpF5SyBAE/MbyVnNwGmszz4IVTKqJXqB/0wsFRUgMA5iSI7e7cljPEAefJU9w4WNkXjd4MsZDWgj9X29n3DKWzZkx6ksWXLRwQYefIbIhezl1cYRNLO2WdzvK1nSacPIl59jcFbOhs1bHcPwYu8K7m+Iis9h2Pg0NB8LypqkU901yfQ5DLUO5V1k0hVaDJG974tc3cnHnuAAv0H7+CfFa8Eeu6vkDlev61kH64JIN0k3L0GuEFif5NGP/40ThYupohW7OF8j6odhw9nTTJXcBKN8JqMjXoqR8zCznH/4kgPk0GeHNUJP6lDW0hFlKPwUjlpfw7yXSiqkQwjF/Tjlc6b+H++Pl6CRxYRmBlOP7u5mSz/dJcL1BoANupR6ejyRZ1hlx8P Content-Type: text/plain; charset="utf-8" Content-ID: <4144E5BE16C1E2469B73FA84A66B1112@namprd12.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1fa8e694-af66-4e4d-b62e-08d763ac7112 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Nov 2019 18:00:57.9790 (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: eVL8/WviUIVvO0UnnT2NnQo1twatUCwvUuSa+mIyMMdOFjYdbc2u8VCdvyiStQxl X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1196 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 2a01:111:f400:fe49::603 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: "qemu-devel@nongnu.org" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @amdcloud.onmicrosoft.com) Adds the following missing CPUID bits: perfctr-core : core performance counter extensions support. Enables the VM to use extended performance counter support. It enables six programmable counters instead of 4 counters. clzero : instruction zeroes out the 64 byte cache line specified in R= AX. xsaveerptr : XSAVE, XSAVE, FXSAVEOPT, XSAVEC, XSAVES always save error pointers and FXRSTOR, XRSTOR, XRSTORS always restore error pointers. ibpb : Indirect Branch Prediction Barrie. xsaves : XSAVES, XRSTORS and IA32_XSS supported. Depends on following kernel commits: 40bc47b08b6e ("kvm: x86: Enumerate support for CLZERO instruction") 504ce1954fba ("KVM: x86: Expose XSAVEERPTR to the guest") 52297436199d ("kvm: svm: Update svm_xsaves_supported") These new features will be added in EPYC-v3. The -cpu help output after the= change. x86 EPYC-v1 AMD EPYC Processor x86 EPYC-v2 AMD EPYC Processor (with IBPB) x86 EPYC-v3 AMD EPYC Processor Signed-off-by: Babu Moger --- target/i386/cpu.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 07cf562d89..6b7b0f8a4b 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -3116,10 +3116,6 @@ static X86CPUDefinition builtin_x86_defs[] =3D { CPUID_7_0_EBX_SMEP | CPUID_7_0_EBX_BMI2 | CPUID_7_0_EBX_RDSEED= | CPUID_7_0_EBX_ADX | CPUID_7_0_EBX_SMAP | CPUID_7_0_EBX_CLFLUSH= OPT | CPUID_7_0_EBX_SHA_NI, - /* Missing: XSAVES (not supported by some Linux versions, - * including v4.1 to v4.12). - * KVM doesn't yet expose any XSAVES state save component. - */ .features[FEAT_XSAVE] =3D CPUID_XSAVE_XSAVEOPT | CPUID_XSAVE_XSAVEC | CPUID_XSAVE_XGETBV1, @@ -3142,6 +3138,19 @@ static X86CPUDefinition builtin_x86_defs[] =3D { { /* end of list */ } } }, + { + .version =3D 3, + .props =3D (PropValue[]) { + { "ibpb", "on" }, + { "perfctr-core", "on" }, + { "clzero", "on" }, + { "xsaveerptr", "on" }, + { "xsaves", "on" }, + { "model-id", + "AMD EPYC Processor" }, + { /* end of list */ } + } + }, { /* end of list */ } } }, From nobody Fri Mar 29 08:02:09 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1dmarc=pass fromdomain=amd.com) ARC-Seal: i=2; a=rsa-sha256; t=1573150132; cv=pass; d=zoho.com; s=zohoarc; b=UBDH7hO2W/WZYx1frwBc7e0mUmnXMVgKO8cCWnHRGucFRR/ysPbUOFKOatmos3a5dY9gh+Zq+6OVaik2iP/eTuuHqBLqYx54kTiP374nJ3xdxGmZ+FCBSl/SiiO0aHIk8LCRBER31kzJ2eT/ECpdnpZNeKZCWHflr2nK/8+BRMw= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573150132; h=Content-ID:Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=98fltHSMUlgMxxPkwLuzDOjkUvyi2lCKEHSuuov+DX0=; b=H1PFXd+labY+O2RHefwku1CnHxBCxP47fWH21mfXmXvmOD+LDMOUuqE1lFTqPoYtABEOuyuR1DNqslzfjmyxpQ9eR0CnH2BlXTXNyGseZ/hvSAe7mLBBIoG8FYboN/yjFAHUBtlgQJUOoweWkRO7NnXn2Xo7JrEnfN/DSH7lqSs= ARC-Authentication-Results: i=2; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1dmarc=pass fromdomain=amd.com) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1573150132797120.34931080304841; Thu, 7 Nov 2019 10:08:52 -0800 (PST) Received: from localhost ([::1]:46828 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSmDD-0002yx-Fs for importer@patchew.org; Thu, 07 Nov 2019 13:08:51 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57098) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSm5v-00032w-5r for qemu-devel@nongnu.org; Thu, 07 Nov 2019 13:01:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iSm5r-0005u4-1D for qemu-devel@nongnu.org; Thu, 07 Nov 2019 13:01:18 -0500 Received: from mail-dm3nam03on0607.outbound.protection.outlook.com ([2a01:111:f400:fe49::607]:52688 helo=NAM03-DM3-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iSm5n-0005oa-CR for qemu-devel@nongnu.org; Thu, 07 Nov 2019 13:01:12 -0500 Received: from DM5PR12MB2471.namprd12.prod.outlook.com (52.132.141.138) by DM5PR12MB1196.namprd12.prod.outlook.com (10.168.237.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2408.24; Thu, 7 Nov 2019 18:01:04 +0000 Received: from DM5PR12MB2471.namprd12.prod.outlook.com ([fe80::d0f5:b875:7b5c:46c3]) by DM5PR12MB2471.namprd12.prod.outlook.com ([fe80::d0f5:b875:7b5c:46c3%6]) with mapi id 15.20.2430.023; Thu, 7 Nov 2019 18:01:04 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=L29VemOUj71m/hfClDK8+gcYBg5dtChVMBN89XNLJWY8wY92JeIGok/TJxW+NLM/W0VIjQpze+dKkBwBi4YUmkJWROTGhxxWKeQdFkc5t8jK9AwAMcXpObIkhlBbl530jKt1x5k9q6ipBkTWGljnACSRSQ2WeB8vkfGobJDE2lW5gY32HqksadQ1S8hNGOln+4QOX1TQoqiLbZUGnWj2dcdSZ4HqRSr5804yW6qe/CpdLamZBfWY6Bw7RSNAHkprKv0zz5Hlr+/xDKO0MMkHOjksF2phdUqmLz2/xHvcpMZnxlZIaJamcHysTojDYbt+E/XYMzJTUzSKHBk/xulZBg== 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=98fltHSMUlgMxxPkwLuzDOjkUvyi2lCKEHSuuov+DX0=; b=V2/tyfGAc9YEIEKp/zpcbYxags3ynYNVkpR4mf+Uwqp25+fgOtB22FCulCzZQaO8bSGJzzUxG23Ray6iKFARKulY9tyhM0jYanejO6YBGXISPelCExalsOcbt/5NGB8Y2C7wr+ea/JpfEMMQnU8/Kc1VY7GcXS6fixYu5LdjJHKif6Xe3O7fFauSwFARdUThug3VbuTJ3sbSdmaSJ5L8y+DO0jGeXaxDy1d6Fb/zmloNcKVZdGZgKpK0u0C1xvzNQvawSUx9VKcJsgXzrXYfWqXg7j/l2YDXKcZYjTr/m+HmKsxTRKiGMYNP9C6i31nphCIu6uMKAC8Bl2Nq9U6uug== 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=98fltHSMUlgMxxPkwLuzDOjkUvyi2lCKEHSuuov+DX0=; b=ZP+NyScsqjtzMOG7nh/PvzUlV5Bh611FLNaYxFzEWcE0FW7zwm25hmGBA744JHSFg+BA4G7vaY/foALw5UixQu9S+MbYWpELkxNF2hnMT2FsmodJl/aYJ4sikYaa9d10ei9GvlceQruALd3VB2Vpow0fN2Mh8ABkAi8NgsfR3Cs= From: "Moger, Babu" To: "mst@redhat.com" , "marcel.apfelbaum@gmail.com" , "pbonzini@redhat.com" , "rth@twiddle.net" , "ehabkost@redhat.com" Subject: [PATCH v2 2/2] i386: Add 2nd Generation AMD EPYC processors Thread-Topic: [PATCH v2 2/2] i386: Add 2nd Generation AMD EPYC processors Thread-Index: AQHVlZVSw3Vob8vlJk6JmRRrnkU1pw== Date: Thu, 7 Nov 2019 18:01:04 +0000 Message-ID: <157314966312.23828.17684821666338093910.stgit@naples-babu.amd.com> References: <157314957337.23828.3860599077487615762.stgit@naples-babu.amd.com> In-Reply-To: <157314957337.23828.3860599077487615762.stgit@naples-babu.amd.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: DM5PR19CA0017.namprd19.prod.outlook.com (2603:10b6:3:151::27) To DM5PR12MB2471.namprd12.prod.outlook.com (2603:10b6:4:b5::10) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Babu.Moger@amd.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [165.204.78.2] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: dee21ec8-3245-4596-1230-08d763ac74ed x-ms-traffictypediagnostic: DM5PR12MB1196: x-ms-exchange-purlcount: 2 x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6108; x-forefront-prvs: 0214EB3F68 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(396003)(366004)(39860400002)(346002)(376002)(136003)(189003)(199004)(66946007)(86362001)(66476007)(7736002)(66446008)(64756008)(66556008)(386003)(26005)(102836004)(52116002)(76176011)(71190400001)(103116003)(25786009)(3846002)(2201001)(6116002)(6506007)(71200400001)(478600001)(256004)(14444005)(14454004)(66066001)(966005)(8936002)(110136005)(81166006)(81156014)(6306002)(6512007)(305945005)(2501003)(8676002)(5660300002)(186003)(99286004)(11346002)(6486002)(476003)(446003)(4326008)(316002)(6436002)(486006)(2906002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR12MB1196; H:DM5PR12MB2471.namprd12.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: pass (zoho.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 (protection.outlook.com: amd.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ZELjlM+4NxNZ+kG4pJ43AmabHgdQEA0d7Bc+SaTT7macZ7j0vORYklopbEDsouyGzcx1rUdsSf4Hl/mHFaivf2ru8YilctJsaA/MgMMdvadx4ncMs82LEGrT4GOCR5T2xkzbzWGB102fe0yUmTDTq+oCecdEw2OQv5cDbPBnB3pQXmd7hmN/14aPCKvPXvGYfg3BvIE1n27Pazu/zj2SM4tQAX/tDVGEwUuZqMadJOR1dYKkV2WZzjW2fPkIoJdaYzlKwChbqx61bH8OiKQScCoZD8V/ZyxsiODiJnjCpSLeEmiSBHaoaRiARDuT4kIhHFP75DN948DvRYJHL94oO6a60tz5CoJi0dpH9wi/W6U3u885MosVDO8CreQA4b5YGqCvfXTYF94+7oZKoPcln2QC3PACPQHg+5jb60oY+h8sNyZfuGtJb3170grQ5wWo0VTtWHHUjd9QQnlaUgdnY8ObijR81uVkeRQfqZ3PHA4= Content-Type: text/plain; charset="utf-8" Content-ID: <017525199DA7A34DB4056B52A7435DBC@namprd12.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: dee21ec8-3245-4596-1230-08d763ac74ed X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Nov 2019 18:01:04.4412 (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: r18EjX23aaNnOVh9GFm59Q3ywvR477i8OrEeoqaNH2QegbMr7VlhTKBS1ErHYBxx X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1196 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 2a01:111:f400:fe49::607 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: "qemu-devel@nongnu.org" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @amdcloud.onmicrosoft.com) Adds the support for 2nd Gen AMD EPYC Processors. The model display name will be EPYC-Rome. Adds the following new feature bits on top of the feature bits from the first generation EPYC models. perfctr-core : core performance counter extensions support. Enables the VM = to use extended performance counter support. It enables six programmable counters instead of four counters. clzero : instruction zeroes out the 64 byte cache line specified in R= AX. xsaveerptr : XSAVE, XSAVE, FXSAVEOPT, XSAVEC, XSAVES always save error pointers and FXRSTOR, XRSTOR, XRSTORS always restore error pointers. wbnoinvd : Write back and do not invalidate cache ibpb : Indirect Branch Prediction Barrier amd-stibp : Single Thread Indirect Branch Predictor clwb : Cache Line Write Back and Retain xsaves : XSAVES, XRSTORS and IA32_XSS support rdpid : Read Processor ID instruction support umip : User-Mode Instruction Prevention support The Reference documents are available at https://developer.amd.com/wp-content/resources/55803_0.54-PUB.pdf https://www.amd.com/system/files/TechDocs/24594.pdf Depends on following kernel commits: 40bc47b08b6e ("kvm: x86: Enumerate support for CLZERO instruction") 504ce1954fba ("KVM: x86: Expose XSAVEERPTR to the guest") 6d61e3c32248 ("kvm: x86: Expose RDPID in KVM_GET_SUPPORTED_CPUID") 52297436199d ("kvm: svm: Update svm_xsaves_supported") Signed-off-by: Babu Moger --- target/i386/cpu.c | 102 +++++++++++++++++++++++++++++++++++++++++++++++++= +++- target/i386/cpu.h | 2 + 2 files changed, 103 insertions(+), 1 deletion(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 6b7b0f8a4b..70afc3fb30 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -1133,7 +1133,7 @@ static FeatureWordInfo feature_word_info[FEATURE_WORD= S] =3D { "clzero", NULL, "xsaveerptr", NULL, NULL, NULL, NULL, NULL, NULL, "wbnoinvd", NULL, NULL, - "ibpb", NULL, NULL, NULL, + "ibpb", NULL, NULL, "amd-stibp", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "amd-ssbd", "virt-ssbd", "amd-no-ssb", NULL, @@ -1796,6 +1796,56 @@ static CPUCaches epyc_cache_info =3D { }, }; =20 +static CPUCaches epyc_rome_cache_info =3D { + .l1d_cache =3D &(CPUCacheInfo) { + .type =3D DATA_CACHE, + .level =3D 1, + .size =3D 32 * KiB, + .line_size =3D 64, + .associativity =3D 8, + .partitions =3D 1, + .sets =3D 64, + .lines_per_tag =3D 1, + .self_init =3D 1, + .no_invd_sharing =3D true, + }, + .l1i_cache =3D &(CPUCacheInfo) { + .type =3D INSTRUCTION_CACHE, + .level =3D 1, + .size =3D 32 * KiB, + .line_size =3D 64, + .associativity =3D 8, + .partitions =3D 1, + .sets =3D 64, + .lines_per_tag =3D 1, + .self_init =3D 1, + .no_invd_sharing =3D true, + }, + .l2_cache =3D &(CPUCacheInfo) { + .type =3D UNIFIED_CACHE, + .level =3D 2, + .size =3D 512 * KiB, + .line_size =3D 64, + .associativity =3D 8, + .partitions =3D 1, + .sets =3D 1024, + .lines_per_tag =3D 1, + }, + .l3_cache =3D &(CPUCacheInfo) { + .type =3D UNIFIED_CACHE, + .level =3D 3, + .size =3D 16 * MiB, + .line_size =3D 64, + .associativity =3D 16, + .partitions =3D 1, + .sets =3D 16384, + .lines_per_tag =3D 1, + .self_init =3D true, + .inclusive =3D true, + .complex_indexing =3D true, + }, +}; + static X86CPUDefinition builtin_x86_defs[] =3D { { .name =3D "qemu64", @@ -3204,6 +3254,56 @@ static X86CPUDefinition builtin_x86_defs[] =3D { .model_id =3D "Hygon Dhyana Processor", .cache_info =3D &epyc_cache_info, }, + { + .name =3D "EPYC-Rome", + .level =3D 0xd, + .vendor =3D CPUID_VENDOR_AMD, + .family =3D 23, + .model =3D 49, + .stepping =3D 0, + .features[FEAT_1_EDX] =3D + CPUID_SSE2 | CPUID_SSE | CPUID_FXSR | CPUID_MMX | CPUID_CLFLUS= H | + CPUID_PSE36 | CPUID_PAT | CPUID_CMOV | CPUID_MCA | CPUID_PGE | + CPUID_MTRR | CPUID_SEP | CPUID_APIC | CPUID_CX8 | CPUID_MCE | + CPUID_PAE | CPUID_MSR | CPUID_TSC | CPUID_PSE | CPUID_DE | + CPUID_VME | CPUID_FP87, + .features[FEAT_1_ECX] =3D + CPUID_EXT_RDRAND | CPUID_EXT_F16C | CPUID_EXT_AVX | + CPUID_EXT_XSAVE | CPUID_EXT_AES | CPUID_EXT_POPCNT | + CPUID_EXT_MOVBE | CPUID_EXT_SSE42 | CPUID_EXT_SSE41 | + CPUID_EXT_CX16 | CPUID_EXT_FMA | CPUID_EXT_SSSE3 | + CPUID_EXT_MONITOR | CPUID_EXT_PCLMULQDQ | CPUID_EXT_SSE3, + .features[FEAT_8000_0001_EDX] =3D + CPUID_EXT2_LM | CPUID_EXT2_RDTSCP | CPUID_EXT2_PDPE1GB | + CPUID_EXT2_FFXSR | CPUID_EXT2_MMXEXT | CPUID_EXT2_NX | + CPUID_EXT2_SYSCALL, + .features[FEAT_8000_0001_ECX] =3D + CPUID_EXT3_OSVW | CPUID_EXT3_3DNOWPREFETCH | + CPUID_EXT3_MISALIGNSSE | CPUID_EXT3_SSE4A | CPUID_EXT3_ABM | + CPUID_EXT3_CR8LEG | CPUID_EXT3_SVM | CPUID_EXT3_LAHF_LM | + CPUID_EXT3_TOPOEXT | CPUID_EXT3_PERFCORE, + .features[FEAT_8000_0008_EBX] =3D + CPUID_8000_0008_EBX_CLZERO | CPUID_8000_0008_EBX_XSAVEERPTR | + CPUID_8000_0008_EBX_WBNOINVD | CPUID_8000_0008_EBX_IBPB | + CPUID_8000_0008_EBX_STIBP, + .features[FEAT_7_0_EBX] =3D + CPUID_7_0_EBX_FSGSBASE | CPUID_7_0_EBX_BMI1 | CPUID_7_0_EBX_AV= X2 | + CPUID_7_0_EBX_SMEP | CPUID_7_0_EBX_BMI2 | CPUID_7_0_EBX_RDSEED= | + CPUID_7_0_EBX_ADX | CPUID_7_0_EBX_SMAP | CPUID_7_0_EBX_CLFLUSH= OPT | + CPUID_7_0_EBX_SHA_NI | CPUID_7_0_EBX_CLWB, + .features[FEAT_7_0_ECX] =3D + CPUID_7_0_ECX_UMIP | CPUID_7_0_ECX_RDPID, + .features[FEAT_XSAVE] =3D + CPUID_XSAVE_XSAVEOPT | CPUID_XSAVE_XSAVEC | + CPUID_XSAVE_XGETBV1 | CPUID_XSAVE_XSAVES, + .features[FEAT_6_EAX] =3D + CPUID_6_EAX_ARAT, + .features[FEAT_SVM] =3D + CPUID_SVM_NPT | CPUID_SVM_NRIPSAVE, + .xlevel =3D 0x8000001E, + .model_id =3D "AMD EPYC-Rome Processor", + .cache_info =3D &epyc_rome_cache_info, + }, }; =20 /* KVM-specific features that are automatically added/removed diff --git a/target/i386/cpu.h b/target/i386/cpu.h index af57fda8e5..24cdca5d3f 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -781,6 +781,8 @@ typedef uint64_t FeatureWordArray[FEATURE_WORDS]; #define CPUID_8000_0008_EBX_WBNOINVD (1U << 9) /* Indirect Branch Prediction Barrier */ #define CPUID_8000_0008_EBX_IBPB (1U << 12) +/* Single Thread Indirect Branch Predictors */ +#define CPUID_8000_0008_EBX_STIBP (1U << 15) =20 #define CPUID_XSAVE_XSAVEOPT (1U << 0) #define CPUID_XSAVE_XSAVEC (1U << 1)