Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758023AbeAIWrm (ORCPT + 1 other); Tue, 9 Jan 2018 17:47:42 -0500 Received: from mail-bn3nam01on0048.outbound.protection.outlook.com ([104.47.33.48]:5968 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753774AbeAIWrk (ORCPT ); Tue, 9 Jan 2018 17:47:40 -0500 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Thomas.Lendacky@amd.com; Subject: Re: AMD EPYC microcode update bug? To: Gabriel C , LKML Cc: Borislav Petkov References: From: Tom Lendacky Message-ID: <997def1f-c8d6-15e3-3505-2a4a78b072ab@amd.com> Date: Tue, 9 Jan 2018 16:47:33 -0600 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [165.204.78.1] X-ClientProxiedBy: DM5PR21CA0059.namprd21.prod.outlook.com (10.175.112.149) To MWHPR12MB1152.namprd12.prod.outlook.com (10.169.204.16) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 319f820a-4245-48a9-0deb-08d557b2fb92 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(48565401081)(2017052603307)(7153060)(7193020);SRVR:MWHPR12MB1152; X-Microsoft-Exchange-Diagnostics: 1;MWHPR12MB1152;3:6I9YckSiPhhBiIj0D7Y179WuGttP4wQYVCh4BKe4piH4uZE5Tjx3eUoBiSLXCHA0DZjS8XVCpED0hTTCUFF2npqmGRItaqGYylNBUyz/DnEyUlNDsOn0LKiNtIX9c6z302/huqWBqpXhH1sxBAQB+8OIhZDAGOf1E1+d/zODp5QTy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qoQ8e+jkBRy1E22bkGIhEsGTrN3fUXJJqyltARjrRvTuO6Q2AXsihS1jmS4C9TNK4QeE1zPvf4jeS2sVHdgWHIScYSOlXzPUea1oloaJgnqWju2qiavxKFosD+ybs5rii8/DJSjeKbmrUZk/m5FCJTd5Iyk8J0xPKDGfDBWcftU;4:E7vduR7jxvyEogXPsm/3WRChVxGKrL2Ewxe+m/D7Yevwlzv7B06SrwUZDuGde1bgyEIXN2IuhdWQsjZK+ZMe7JXNaLllWpZjLfs23o8h079z0+TO03+i+RJ5A2HBuXjRd1FYOlLctJhiHDSGAb/Y3SH9gu2xDIJ87ebV+GuGTvhXg67qdqH9XhGN3g+g8y2V8/OQ3dV/5SMUV6pVwOrwEYfq93P8RFQBu3reKGL/sgP2sifReZ1M8G+du9a78XFuDaNgPZ5+2KH1jC9Z/++geSDvNM/9bSI5an1t4aObTZ57BlgPtNGeqmapXzQ4/zx1 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(166708455590820); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040470)(2401047)(8121501046)(5005006)(3231023)(944501075)(10201501046)(3002001)(93006095)(93001095)(6055026)(6041268)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123562045)(20161123564045)(6072148)(201708071742011);SRVR:MWHPR12MB1152;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:MWHPR12MB1152; X-Forefront-PRVS: 0547116B72 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6049001)(376002)(39380400002)(396003)(366004)(346002)(39860400002)(24454002)(189003)(55674003)(199004)(53546011)(6306002)(53936002)(316002)(6246003)(4326008)(39060400002)(25786009)(230700001)(110136005)(3260700006)(2906002)(83506002)(58126008)(16526018)(106356001)(16576012)(50466002)(5660300001)(105586002)(52146003)(2486003)(23676004)(59450400001)(76176011)(15650500001)(52116002)(65826007)(8676002)(81166006)(8936002)(229853002)(6486002)(47776003)(77096006)(90366009)(64126003)(6666003)(65956001)(31696002)(2950100002)(31686004)(68736007)(66066001)(65806001)(97736004)(305945005)(7736002)(966005)(575784001)(478600001)(86362001)(386003)(3846002)(81156014)(72206003)(36756003)(6116002)(217873001);DIR:OUT;SFP:1101;SCL:1;SRVR:MWHPR12MB1152;H:[10.236.65.116];FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtNV0hQUjEyTUIxMTUyOzIzOjliNHJsb09BZjlhSVV5STBia244WDhXVmky?= =?utf-8?B?MVZhRi9BL3dNSlpWUWlDUkdLNjFCNjk4U1NlcWVQUGVHVmUzVG5LenRGTmJI?= =?utf-8?B?S2VBOEZVNWNHN210bGdzT0t1TTBsTVluTkN3aGsrV0hwTkNUWnlRalNKY0J1?= =?utf-8?B?TUVvaUxydnlFaUc2clJXY0NkK3BmaFA5bDlETkJuVkk2NWtqWmFnVTVjRkJN?= =?utf-8?B?bExvcjVTVm8wb0dPdlVkUzFLdDBCV1l6ZjZaakYxK0dXcDZvazZjTmt1elBq?= =?utf-8?B?K2luMjl1UzNTTXNLMmllNWFoTFIwL2NNL3Q3MHlhOElzUXhXV09lUWorbHVm?= =?utf-8?B?d21MSUxTZnpNYTMvbUpGT0xQL2ZKTW5BUENxNmNTNFYyZHIzTm5QdndoNU1I?= =?utf-8?B?WDBVK01HZ2tHa3habStINmlQaGxlU1AwSEVzQzJDU2QrUkNDZ3hVbDhmYXNm?= =?utf-8?B?TjhRcGNnN01wc0sweDRudUFyRkVYQi8xNkhvN2t6SXd1eUU5b0ljQ21FTk9L?= =?utf-8?B?QjR3NldvR0kvd0dzSHl6WE1vZnh5czFMTTZFdHYwTlhZS3dla3BGejhhMXNq?= =?utf-8?B?VXo2Vis2Mjdla1hDeXJzcWFyMEhEdXcrN2JuUHB3UVp4b0VEaldKTHhLUENY?= =?utf-8?B?QzBHTjVKK01HZDhMUVpMc3hLZU5PNV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kZFw5nGsHwAJQBGfVgoF9S/ctwxHSNorHgZ0t2ZaQLI7puYE7HNsiC6LV8kjsXRv+9jHLyklyXqj+A8TdLa3ctu/Q5XMF+4JAaT7HA1hmsGKKeiMY64kEMRXy8JhJS4Qg/j8BjbGYjWrwvJ1i7TL9Z+WJfKOKrVZ5syezSg5w4=;24:dDjBC/vaP7V9y6YVn6K0oqPJQXAwKsq0Q+LTaJQ6nojKKfAi2yLENrlpjXmvMWIWkQJGB2TbXoy8H3uxp2sPmya4uVG2LD2DvkpOZqOLkYI=;7:iZPofBPImqXCXKqsrMhF8zn/PfuKWwb7xf/i/znYnmib4x33jBrbcTVxZjnomXpRsFs2wXyHyhfKXCfW7nTl1mbjaAAXVZuGColT/VG+eddRryYT2H5OgmD+1JZME/mF5Mt8660sW0/DE+PYl9HAdj2s4Qintr0p7xYURY1Y1AfOwxuYXkFu3TApaZBaZa8AKDLp/7LwKgp7mYTPnAzUFmRFtWV7O034VDG2WKwyC98wW14tl0flw29ijdD9ZcPW SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;MWHPR12MB1152;20:WSQOkQJV0jM9dhbxlG8lh3Yv/8sTUgM79yi6iVW1voWaVpXnce8rXpVZR3nnKXkVnZvRoUtp2OjdUaQPEsMwgGZWG6fJxL+xE4Lp4bRj4bGUfYWmHXLSFnFr8w5UwaBBb6+5pRMx8+/RbvRIYZIhvaASijZYmaDSk75alodx/ZpE8ffLdr8a38/5lKJEYht7c5IoCgVHQY7jtYBgO8q+r9slbbJFwsqwJdICLkHnTpYAlJHrkDw0+680GDNcnEk/ X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jan 2018 22:47:37.5178 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 319f820a-4245-48a9-0deb-08d557b2fb92 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1152 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On 1/9/2018 4:28 PM, Gabriel C wrote: > Hello , > > I'm testing an EPYC system right now with 2 EPYC 7281 16-Core Processors. > > I'm on 4.15.0-rc7 and tested an update to microcode_amd_fam17h.bin. > > First run was made by using the early microcode option with dracut[1] > so loading from a initrd. the driver reported 63 updated CPUs while CPU0 > got still old microcode. I'm guessing that memory encryption is enabled, correct? I've submitted a patch series to perform early initrd decryption for just this problem. I'm incorporating some minor feedback and getting ready to submit the next version. In the meantime, if you specify mem_encrypt=off on the kernel command line it should show CPU0 updated properly (with mem_encrypt=on and SMT enabled, I believe it really does get updated when the sibling hread is updated - do a rdmsr of 0x0000008b to verify). Thanks, Tom > > > snip > > crazy@ant:~/fw$ dmesg | grep microcode > [ 2.615876] microcode: microcode updated early to new patch_level=0x08001213 > [ 2.615906] microcode: CPU0: patch_level=0x08001207 > [ 2.615920] microcode: CPU1: patch_level=0x08001213 > > ... > > crazy@ant:~/fw$ cat /proc/cpuinfo | head -n 30 > processor : 0 > vendor_id : AuthenticAMD > cpu family : 23 > model : 1 > model name : AMD EPYC 7281 16-Core Processor > stepping : 2 > microcode : 0x8001207 > > .... > > After reloading the microcode with > > echo 1 > /sys/devices/system/cpu/microcode/reload > > > CPU0 got new microcode too. > > Now I tested the same but without initrd early microcode loading > and CONFIG_EXTRA_FIRMWARE set like this: > > CONFIG_EXTRA_FIRMWARE="amd-ucode/microcode_amd.bin > amd-ucode/microcode_amd_fam15h.bin amd-ucode/microcode_amd_fam16h.bin > amd-ucode/microcode_amd_fam17h.bin" > > > This time all CPUs got update fine without the need of reloading the microcode. > > Is that some sort timing problem ? > > > Also I notice on a Intel system the 'early updating' means that , is > the first I see on dmesg > while on AMD system it seems to fire up much later. Why is that ? > > > Regards, > > Gabriel C > > 1. Fix for Fam17 micrcode : > https://github.com/dracutdevs/dracut/commit/19453dc8744e6a59725c43b61b2e3db01cb4c57c#diff-bf0c6db1d4aaaa22a88b2649ddbfcd2a >