From patchwork Tue Aug 15 17:00:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brijesh Singh X-Patchwork-Id: 9902205 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 4004C60230 for ; Tue, 15 Aug 2017 17:02:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2EC7828396 for ; Tue, 15 Aug 2017 17:02:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 23BA6288B9; Tue, 15 Aug 2017 17:02:45 +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=-6.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 49177288B4 for ; Tue, 15 Aug 2017 17:02:43 +0000 (UTC) Received: from localhost ([::1]:48441 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dhfEo-0002kh-1f for patchwork-qemu-devel@patchwork.kernel.org; Tue, 15 Aug 2017 13:02:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44205) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dhfDw-0002iD-Qw for qemu-devel@nongnu.org; Tue, 15 Aug 2017 13:01:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dhfDt-0007qK-Nj for qemu-devel@nongnu.org; Tue, 15 Aug 2017 13:01:48 -0400 Received: from mail-dm3nam03on0075.outbound.protection.outlook.com ([104.47.41.75]:26092 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 1dhfDt-0007q0-E2 for qemu-devel@nongnu.org; Tue, 15 Aug 2017 13:01:45 -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=DchewyfdwX4ZZGJ3rnzMtWHZJMpE18VAAdijdm9Ra+8=; b=I4uuAdeDVDXzoVwofiS1A2vvpQOUSJYUAZb6+iRTuXBRK2pZIVqOlO6npmUouRuIC3Ikd4bbUPEiJZvldgQms6WSby2GR7K51NcFz+4ssmB3BIe29afqQ2BDXdb6NwucA5nQE24OjFvaD5ZEbirwRlbTbej3jGvmxsBMNdblMJw= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=brijesh.singh@amd.com; Received: from ubuntu-010236106000.amd.com (165.204.78.1) by CY1PR12MB0152.namprd12.prod.outlook.com (10.161.173.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1341.21; Tue, 15 Aug 2017 17:01:42 +0000 From: Brijesh Singh To: qemu-devel@nongnu.org Date: Tue, 15 Aug 2017 12:00:51 -0500 Message-Id: <20170815170051.127257-1-brijesh.singh@amd.com> X-Mailer: git-send-email 2.9.4 MIME-Version: 1.0 X-Originating-IP: [165.204.78.1] X-ClientProxiedBy: DM5PR1401CA0024.namprd14.prod.outlook.com (10.174.245.34) To CY1PR12MB0152.namprd12.prod.outlook.com (10.161.173.22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e6ef4777-48dc-45d1-b4fb-08d4e3ff4da8 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(2017030254152)(300000503095)(300135400095)(48565401081)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:CY1PR12MB0152; X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0152; 3:AaKe4hq+Ya1zlE3xHNEJ0TMZ0bnNV22J39m2ZvOwerergYSslQv8SOuJogBhgXXsUKL2197azhqbQgc+/W7DMXz6pxUNk+InLt5jxOo5Tc78HUHQ+5WGbT6rcw5AaUzai2Vz9YpvigkBlzkRwZtQyy2VDIhuNXOj3B83cMxQaGcIScG796LbWIoPutDFPcVwoyrmF/iqwQ6uRC8lVqd8gCjBA1nMNDiryMgX1UOtVyDJkRXxkkMrGrbb+h8/PJZa; 25:7F0Cg4KKpDWFGRpQc0qGRBEX5NXKlLAQ2rYAdDpBDDiatlDvVEtEZ0C4jEtLvukPW8zzddG7C+Nm4orS2OPYQvyTYtofd/3lluB7Tz2TD0iAw0OjRLnTkaOLK3aBHR7FgLO7loNLA/msTlo1Y33oS+rOfnOtk2PaAf9D2cYq/ezZeA3E8DLeOTvjtUdoQnCX48Dz0jzfYyzmjBohtMHNDU82PB+EjaA2ruMhrfrC7erKyDlbJ9tn0B4VnriWEO3oZtrxV2sDFcMhUEojK2HstByxL6Plw8H18S1kJ9CqXrYCGN+kcQ/FloBAiseZJO+H/QTOrS55mlSS6HWZ2AUoog==; 31:ppDsCdO+GbcHAkVbiAxnsyqsNk04HxpALmMbIWleKmFBDiTaIaA+XYj7s1dZrpGeA/DKc/g2y6/FDrpEax0aSn303QbRcynOfygz3xkYLwE6Z9QooflUN0EdflPnJzM29Xf1oZfBtFb/PNUfK7w72qeGbGSTtVvTyF6ZgjG25CroyQN7VXsog8vgKWsmWdTa6PbKHlrgTcvVsBJQuuQcDI4boETLEnQoNAcoQunln6k= X-MS-TrafficTypeDiagnostic: CY1PR12MB0152: X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0152; 20:DWg+CWfNeslhtiGObMacOB5Lj34szlAo20LYciC+ZqVDdMlh0KEI1SeQv2N6BBNHRbTi0P9oNvt6EX6sPsJjKz5NWP49buRklabIOLDVGDBIWmUzx7yjtyUW2XL0RtogpVrpuJbsZqEIGVrIb1Ih8JnpuyqxiWBLPrXcJCQu9jZKSvuLZa6T6hWo6A87B7ke3g52SEBB5pjbTKBI91TWor8SymLLTk1PTBJp4rO5Pw2dhJ5YEsoc5Rhf9CQfF/VJHXBt4oD0qUo0fzQw5XVuDV8gJtzMbIciMGhQVVsc2oTPLYNJRuEwSF8M17T6pCTzlRvlI/3EOiid8/ncviOgH4sNof+oKPIj3+0cDuEChLeduCyPZIr1VqXTK/cx7a+Bgi7Wrsr56PA4nIn8If1Ilf1YbG/hclfHF5kSiqt+J/Y62SXrkuuuoTfbJ+tKwIPbLS1J6uy6UI6uQPjpgNQFCntiWaUNRiZSmIYO6NqLuxSjQ5fF4NHl4np5K/Uq7wG7; 4:HnDm62TNtXYmvneh763Z0EQ9RfgqHopbNdWb1n4HxuxDo77b8UBPU/SQ0l/Yh1pT7FqPl6J7WnaJ8jThc4qbh2/rzLwmyUJpkXqIGe5B8cPfXlU1XhBX60JzvnfNeyQvepv1J9DePta5jNH8YNrWiGPsQdeVHuk5RKB7/HGQOjBDz/4CCgbzp2+qlZUR6835bqyPrFrvWhLHih0OS9bJSQYIilQQqitXVvrEk2MHJ3YwS0P8eJ4jUYM+tP1punXuPuf5ZjV0MIGP+ly8qHSY+Z/0aXshZQiNJqHAdvqibRY= X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(3002001)(6055026)(6041248)(20161123564025)(20161123558100)(20161123560025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY1PR12MB0152; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY1PR12MB0152; X-Forefront-PRVS: 04004D94E2 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(7370300001)(4630300001)(6009001)(39860400002)(199003)(189002)(7350300001)(53936002)(25786009)(6666003)(6486002)(6916009)(5660300001)(2906002)(5003940100001)(47776003)(66066001)(101416001)(50986999)(36756003)(81156014)(81166006)(8676002)(54906002)(50226002)(86362001)(1076002)(189998001)(4326008)(6116002)(3846002)(97736004)(2361001)(53416004)(33646002)(42186005)(478600001)(48376002)(2351001)(7736002)(50466002)(106356001)(110136004)(68736007)(305945005)(105586002)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR12MB0152; H:ubuntu-010236106000.amd.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR12MB0152; 23:RVoh1bdim59wjKKh1vvHj4A45Vr1FV/eYx74j0Y5B?= =?us-ascii?Q?5OtTycDz1WQ4RXawH4o33DqI17PwYcPbvWtijCLL/PHJj3Cpf/IMxk55CoqM?= =?us-ascii?Q?mQsLBq/LFnj/yXoulY68G2IGN/N+qykxlA7W23hwihDOsC8NTZ0SW/OCsiQR?= =?us-ascii?Q?BRNQX0/2l1XE7kDqPR16ArdjDmP6/jnZggBM5sl0Vz50yY2KQtyguweV34yz?= =?us-ascii?Q?1pgmQwK7UCpwVpC+5Z55iq2R2GW/V93m/DnoukG6GpSkzrqU/sA32XhH9qI+?= =?us-ascii?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yPJnNU4SKGql77T2oP4l8A5fd3EGYuUZH/Gxh/FZCVAzOhxXRVfZnU4X/aK/ZZ1e/qrL7Cle8P0nGr61h+3cxOjEeBVVpo7F+3pcnD0pOabFwuj9THOcK8vvybE4gGdz/faAS1MMbJNcrTnwFkIkDRrMRmSLfJr61 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Aug 2017 17:01:42.0306 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR12MB0152 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.41.75 Subject: [Qemu-devel] [PATCH v3] target-i386/cpu: Add new EPYC CPU model X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Tom Lendacky , Brijesh Singh , Eduardo Habkost , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Add a new base CPU model called 'EPYC' to model processors from AMD EPYC family (which includes EPYC 76xx,75xx,74xx, 73xx and 72xx). The following features bits have been added/removed compare to Opteron_G5 Added: monitor, movbe, rdrand, mmxext, ffxsr, rdtscp, cr8legacy, osvw, fsgsbase, bmi1, avx2, smep, bmi2, rdseed, adx, smap, clfshopt, sha xsaveopt, xsavec, xgetbv1, arat Removed: xop, fma4, tbm Cc: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Cc: Tom Lendacky Signed-off-by: Brijesh Singh Reviewed-by: Eduardo Habkost --- Changes since v2: * limit the xlevel to 0x8000000a Changes since v1: * fix typo EYPC -> EPYC to reflect the correct branding name target/i386/cpu.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index ddc45ab..6617e01 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -1522,6 +1522,50 @@ static X86CPUDefinition builtin_x86_defs[] = { .xlevel = 0x8000001A, .model_id = "AMD Opteron 63xx class CPU", }, + { + .name = "EPYC", + .level = 0xd, + .vendor = CPUID_VENDOR_AMD, + .family = 23, + .model = 1, + .stepping = 2, + .features[FEAT_1_EDX] = + CPUID_SSE2 | CPUID_SSE | CPUID_FXSR | CPUID_MMX | CPUID_CLFLUSH | + 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] = + 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] = + 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] = + 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, + .features[FEAT_7_0_EBX] = + CPUID_7_0_EBX_FSGSBASE | CPUID_7_0_EBX_BMI1 | CPUID_7_0_EBX_AVX2 | + 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_CLFLUSHOPT | + 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] = + CPUID_XSAVE_XSAVEOPT | CPUID_XSAVE_XSAVEC | + CPUID_XSAVE_XGETBV1, + .features[FEAT_6_EAX] = + CPUID_6_EAX_ARAT, + .xlevel = 0x8000000A, + .model_id = "AMD EPYC Processor", + }, }; typedef struct PropValue {