Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752276AbeAJV0K (ORCPT + 1 other); Wed, 10 Jan 2018 16:26:10 -0500 Received: from mail-cys01nam02on0046.outbound.protection.outlook.com ([104.47.37.46]:35664 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750768AbeAJV0I (ORCPT ); Wed, 10 Jan 2018 16:26:08 -0500 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Thomas.Lendacky@amd.com; Subject: Re: [PATCH v3 0/5] x86: SME: BSP/SME microcode update fix To: Gabriel C , x86@kernel.org Cc: Brijesh Singh , linux-kernel@vger.kernel.org, Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Thomas Gleixner References: <20180110192544.6026.17285.stgit@tlendack-t1.amdoffice.net> From: Tom Lendacky Message-ID: <39709df3-fd62-28d6-9e78-94681b393ac9@amd.com> Date: Wed, 10 Jan 2018 15:26:03 -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: 8bit X-Originating-IP: [165.204.78.1] X-ClientProxiedBy: DM5PR19CA0003.namprd19.prod.outlook.com (10.175.226.141) To CY4PR12MB1144.namprd12.prod.outlook.com (10.168.164.136) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 218e77bc-2147-451f-3ea3-08d55870c261 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(48565401081)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060)(7193020);SRVR:CY4PR12MB1144; X-Microsoft-Exchange-Diagnostics: 1;CY4PR12MB1144;3:sNuk7+n/npa64NJXbHY+JQgn+nz9k9ivGMO2CCUIxERILh1a7Z/Vr8Tky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CJAGdJst9gUvgqKLuf66wKD9kUNmkutk7URqTpFhXPXNaY7NwhxlTIlMslZIVuW+mmDtMpmkLka/nWxJwFYq2BjYIzaOqHOtQbwiQBD/Iu9xZELS8YRPvxqCr7YLyAQBnh2H3d96h7GJBubBO0iuGm4sHbmhAOgzDXI7j1eTEhMDaVXOUYI59cfirV0KrvvcIVGr+AzUOl8OIVemR/XTWxyUDd4ID0jsIUZRP7YhYk8nXr/bmW8NYZcIQWDjA5BNqHg+yKFf/IhAoUKdM5qiiZKNHp1Suetz4zsrqlj;4:0C2j/JNp9l63SZAr7NgX+gsajGE32Q7xvhIfI2O+eFPSiuCUTpVRisXDO/uDG47L4lxKjF4uEqjupIMLa3D8qF0O3RXLvMqCdMAnpjLi7L4++YyJkc3adT7gBoNEjNxFOw7j8MU2eC7Ys8qvHZBHoK640/XERNqAkjRGAg6lt+2tejd1CrM8WrsHUbPCKwJhH2bFXAWA8CiU6gamqPe8cIU6ldz6xUr+0PmcdxgXO+X3+2FjP9AeutPSdhA+yx6dLTdEvFHsuBgyr0Th3fPR2g== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040470)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(3231023)(944501075)(6055026)(6041268)(20161123560045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011);SRVR:CY4PR12MB1144;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:CY4PR12MB1144; X-Forefront-PRVS: 0548586081 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6049001)(376002)(366004)(396003)(346002)(39380400002)(39860400002)(24454002)(189003)(199004)(23676004)(47776003)(68736007)(106356001)(54906003)(6306002)(478600001)(31686004)(2906002)(81166006)(2870700001)(229853002)(386003)(53546011)(77096006)(6486002)(81156014)(76176011)(58126008)(90366009)(52146003)(66066001)(8936002)(36756003)(966005)(52116002)(305945005)(83506002)(64126003)(65806001)(2486003)(97736004)(53936002)(3260700006)(25786009)(72206003)(50466002)(316002)(65956001)(86362001)(2950100002)(39060400002)(3846002)(105586002)(16526018)(6246003)(16576012)(4326008)(65826007)(31696002)(6116002)(7736002)(5660300001)(8676002);DIR:OUT;SFP:1101;SCL:1;SRVR:CY4PR12MB1144;H:[10.236.65.116];FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTRQUjEyTUIxMTQ0OzIzOnJETXQ0Zkd2THhna0xCeWhJOVMxb0tqYjND?= =?utf-8?B?YzFrTnpBK2NkT1F4RnIwVzk5NkxXcDQraVNjTWhYQ1hOOEVhenBCSW1oSDRU?= =?utf-8?B?K1lobDdwNy84elJia0tVNmRTZVRZc1lMWkxmV3BGaFFUd3F3djQyeHFvNTV5?= =?utf-8?B?UkZDSGJPLzcrZElGNlRyWm5TajhWL1NjNE9NSmhjSFZkc2xsUUhRNjNPdXNq?= =?utf-8?B?QzY0L1p4R0lSTlhUYmh6UmhkQW9YZndWRGE1cURKRExENDBkdHJSSDg3dncr?= =?utf-8?B?MWRDb2NkQm9LQVZQaW1XWldxQmErNm9NdTdQWnA5ZXZTdUR4Vys0RUZwQlRs?= =?utf-8?B?SklQZWNGeU85OFNFYUpoeFhyTTlVaUVFSkI2QTkzNUtjZ3NyUEVNeVVDcnd1?= =?utf-8?B?QVJxT084QUd6M1hLelNVanhTemd4RGtNd3FIU0RtRGIrbEJTZEFhQ0hWQzdS?= =?utf-8?B?SFRkN0pUdXJGR2c1bHhjRExvd000bmxoakNpN3VKbFFBdElvYmloWHo0bXc2?= =?utf-8?B?Ynd0UTNKcWl1alQwdU40blQwKy9MWjFXRkx4KzlNc1pmRkRJTW9COXZ5cSsy?= =?utf-8?B?TmQrTXVFNHo5dHpuT0dZUzVrd2UzdkgvVXBFVzVsWGo0dUZhY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cAlrEbOzpgIyB5Rv5ypOhKE03NiEalRvsJKukAzn7Tm0+qm+TwEZLxbS6MOkWELm8=;24:POuKv27jxlyOn5iiLYP9Tf8vbFVLTkx9eigcSz3Mg10BLblOxS5oCZa0ljjVwAQMChewQvvNdMT8v34+BVIijMBC/bRKd5UP7H5L/rKHRtw=;7:3//JticmGZPDdhCp0n3b9wYXwAeJ3a1YQh1mfdsi+Or827OozNFCJZAhrkGMFaoy5v4ZmkshkEchN8qepi+uDGlS1n9Pz1o/Bl96H7VDMSlCGvNF+MPVtU1cUW4aUorn2KjerR7eBCSCPbRqGLq6PZx2g3j1w8Og5E9jPIXGVqhuK9vGAltK2YqErs27/F1vH6E8oEnfh9zDDmI3IWJN/Brk/AsogoJAsNw8Ft81SCiuGlxRnrp0QXY432NQf8Fx SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;CY4PR12MB1144;20:TdlW5gbJuVEZP9BVMTyAOSm3/aLIiWoaPuw30P03OHVJlrBB5XOoGv4mbblFgpsj3w6wCjGzEhVVJGrfjhgRO6TvB8APf4dfnMEAuP+pwDrqDR+BiySdofRR4yXGAdIuPPC/Gpkr4VZWkDOkjgEGTpzWlwSKLpd7ZP3rMkUrUn8Fa+BVRM2kS9t7wh8k6XUhmqNeKUL8cKcjvIZoRmrEgUsAQEpMhsGO5/cx5VLZffxGYzF6eND/B/KdUBlcAQZs X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2018 21:26:05.7433 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 218e77bc-2147-451f-3ea3-08d55870c261 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1144 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On 1/10/2018 3:14 PM, Gabriel C wrote: > On 10.01.2018 20:25, Tom Lendacky wrote: > > Hi Tom , > >> This patch series addresses an issue when SME is active and the BSP >> is attempting to check for and load microcode during load_ucode_bsp(). >> Since the initrd has not been decrypted (yet) and the virtual address >> of the initrd treats the memory as encrypted, the CPIO archive parsing >> fails to locate the microcode. >> >> This series moves the encryption of the initrd into the early boot code >> and encrypts it at the same time that the kernel is encrypted.  Since >> the initrd is now encrypted, the CPIO archive parsing succeeds in >> properly locating the microcode. >> >> The following patches are included in this fix: >> - Cleanup register saving in arch/x86/mm/mem_encrypt_boot.S >> - Reduce parameters and complexity for creating the SME PGD mappings >> - Centralize the use of the PMD flags used in sme_encrypt_kernel() in >>    preparation for using PTE flags also. >> - Prepare sme_encrypt_kernel() to handle PAGE aligned encryption, not >>    just 2MB large page aligned encryption. >> - Encrypt the initrd in sme_encrypt_kernel() when the kernel is being >>    encrypted. >> >> This patch series is based on tip/master. > > Is something in tip/master the patch serie need ? That's just how I have to submit the patches. You could try applying them onto whatever tree you like, I don't imagine any conflicts would be too difficult to resolve if you encounter any. Thanks, Tom > > I would like to test the serie however tip/master > breaks my box.. On tip/master there is no way to boot > with mem_crypt=on with or without your patches. > > With mem_crypt=off the box at least boots to a point , seems APCI breaks > on tip/master. > > If someone want to take a look , a dmesg of the broken boot can be found > there: > > http://sigsegv.24-7.ro/~crazy/tip-master/dmesg-tip-master.txt > > Regards, > > Gabriel C > >