Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751348AbdIOQ2F (ORCPT ); Fri, 15 Sep 2017 12:28:05 -0400 Received: from mail-by2nam01on0040.outbound.protection.outlook.com ([104.47.34.40]:20256 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750871AbdIOQ2C (ORCPT ); Fri, 15 Sep 2017 12:28:02 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=brijesh.singh@amd.com; Cc: brijesh.singh@amd.com, Tom Lendacky , "H. Peter Anvin" , Arnd Bergmann , David Laight , "linux-kernel@vger.kernel.org" , "x86@kernel.org" , "linux-efi@vger.kernel.org" , "linuxppc-dev@lists.ozlabs.org" , "kvm@vger.kernel.org" , Fenghua Yu , Matt Fleming , David Howells , Paul Mackerras , Christoph Lameter , Jonathan Corbet , =?UTF-8?Q?Radim_Krcm=c3=a1r?= , Piotr Luc , Ingo Molnar , Dave Airlie , Kees Cook , Konrad Rzeszutek Wilk , Reza Arbab , Andy Lutomirski , Thomas Gleixner , Laura Abbott , Tony Luck , Ard.Biesheuvel@zytor.com Subject: Re: [RFC Part1 PATCH v3 13/17] x86/io: Unroll string I/O when SEV is active To: Borislav Petkov References: <063D6719AE5E284EB5DD2968C1650D6DD003FB85@AcuExch.aculab.com> <201707261927.v6QJR228008075@mail.zytor.com> <589d65a4-eb09-bae9-e8b4-a2d78ca6b509@amd.com> <20170822165248.rkbluikdgduu7ucy@pd.tnic> <20170915122430.pnroy6vsg53warel@pd.tnic> <95314c89-2620-8bb7-cbe8-cd9bc3adabb0@amd.com> <20170915143935.6vtfp5rtj5h324fi@pd.tnic> <20170915162256.7l4vyy4ee5zeqbir@pd.tnic> From: Brijesh Singh Message-ID: <100e9186-c28e-1caa-4bd5-1a2624cc5c01@amd.com> Date: Fri, 15 Sep 2017 11:27:48 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170915162256.7l4vyy4ee5zeqbir@pd.tnic> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: MWHPR2201CA0047.namprd22.prod.outlook.com (2603:10b6:301:16::21) To DM2PR12MB0155.namprd12.prod.outlook.com (2a01:111:e400:50ce::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ecdb2872-5da6-48b9-75f1-08d4fc56b973 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(48565401081)(300000503095)(300135400095)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:DM2PR12MB0155; X-Microsoft-Exchange-Diagnostics: 1;DM2PR12MB0155;3:uEPSFoBhbRLawH+H9KJDrrOE+VpqHHCeAVkWZtjbvAqmgt6fnXyA7Gb/1haD/ExkldgIV02JjmVThFUEyQJRG1XonZDQ9yHjK7vIhWXmTXPah/j0OrcX3I/O1uGCyvQlgVdf8kheeP6+Nv/p33pA57nePQSOse4nOqCaUwFphZZsWAvNQC45M1I5nUf7o4djvKhS2x9VUjUF31Aq9d7Mybt69XP1D2rLA76N0jz2b6W0oGVon8d3yT/iJ5/gwoeN;25:FvWabOEoRsWica/cfaSUOrWaN77eTents9m44AKA+n/9y9naT8Ezw9I6q1aXP0sORSxpjRoSpiaz9ngp3AhqS1rwpL0MhD9las+h9BoxdXDCyMCuxjsGwsQHm/2vcbAazcW3M20Sduxb6b/A4WjaHVxAX1uN1Q3Bap8G2DKzokfOVnjPSw5vZwNVBQwKDXRoxd/dAdtKFM/lmSLaC1MzE1m9HVEKbtDIlvGxUmKFT9uRyJrrx8pe19bFIn/l1TFS9YRCM7ofw3W5pM+CSILkmAHm3Cp9FxXE7A1LVbKE8J0DxluhHpmK/vnmvN4ECkawAWnqL9EY2gjgOWxhuE8WtQ==;31:p0XK2KY672mLIzr/MPKSGErMuCjx95iC8IFgnlb8s9EKHuVp3WqJC9oDCMZaFzkE8NdcTI5yqEAhJzyRXunrXhMLUzVuP81UvzIrjoPUiT7O/nh5Sk1gzy5nz6i8YzG6Vf5cU5DsRnQms6rzZLf2am2OSn+uF9WhYrRxd5DVUYKf3p8trNBesZRMWC963U93w+XjkL/bcuFMWyhekeTsQkeF0uVXtcQxhDvkY/23464= X-MS-TrafficTypeDiagnostic: DM2PR12MB0155: X-Microsoft-Exchange-Diagnostics: 1;DM2PR12MB0155;20:yERKhHuyhon9y9iP8bsnnXMvfJITVmi8aq8j1gnBe6hgymReydIdkBn+6OeDZjZEW8iK/dbA+FMu4v32DeMOmbTaLDDtWgH7fmbObeJCWo7/2ojEQGNkqklBth95nsatBuCOuxEeaHznArnqQ5GB3N/NNpWJMVRSW34Q599zhT7McS+pjr/NWfgYQNhxqJogmCWjayq8OMj5dYZ/2zAqpKScpn/aTk0JiwjCxKb8y/bkQ6U208TbUjm54HTJzc/zK0dJDOxUpFlHLHBpecpTebRrHDqA9t3776eDxJQGBW+cINLG2tCxBA9LAtgS0etIMJjSSPGmdwLNssQjF0USPizihMg0WJXJvCmh5TUpJuOyHH1Z2ys2SHMhS7pOZPEf2zFjylr9NM/+mezJHgd7syjcBPXPKdDyDt+V9phax6GhEx2WPOMHfjFNdcD0DAu8g5pKeFynzAq1pxsUWozkxheW9cwI6quvDHYmxFNW5DE9ey0ykYohCubc464kjZVA;4:5dnQd8sH/PJkuzMxFUa53DTux1qT+CNa7lqRjWr2wFvPx80v5uveDUtT5crHTg6JbyXgpNoD1o3sF60ystdhww/pAyF1xuKkjnne1jrz24hGpXi6H3aJkGADPmYXugze9YJVn2t+Rj0c5pgUFMxBt4t3373dJWptWNiNf1P/D18ggrOi2mylsyESTdwNZWEH+qcXnChuArzMD5KLuoRfHiuwms3TIRcLSXYsk+kCxNWO4CZT9ClHPH63eGx2vOFz X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(10201501046)(100000703101)(100105400095)(93006095)(93001095)(3002001)(6055026)(6041248)(20161123562025)(20161123560025)(20161123564025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:DM2PR12MB0155;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:DM2PR12MB0155; X-Forefront-PRVS: 0431F981D8 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6049001)(6009001)(39860400002)(346002)(376002)(24454002)(377454003)(199003)(189002)(50466002)(53936002)(81166006)(81156014)(68736007)(54906002)(6246003)(65806001)(64126003)(65956001)(4326008)(110136004)(8676002)(66066001)(2950100002)(33646002)(36756003)(83506001)(6916009)(105586002)(93886005)(229853002)(106356001)(8936002)(23676002)(25786009)(47776003)(77096006)(6486002)(97736004)(65826007)(5660300001)(16576012)(7736002)(16526017)(305945005)(2906002)(101416001)(558084003)(6116002)(3846002)(58126008)(6666003)(230700001)(316002)(31696002)(54356999)(86362001)(7416002)(76176999)(50986999)(478600001)(189998001)(53546010)(31686004);DIR:OUT;SFP:1101;SCL:1;SRVR:DM2PR12MB0155;H:[10.236.136.62];FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtETTJQUjEyTUIwMTU1OzIzOi8vRFpNTzFPNVMwQWhUVFQ1L040RTBadGtL?= =?utf-8?B?WlYzdTN2TFJSb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g= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;DM2PR12MB0155;20:LIi4/SMjr1VAXGUeiTR0rZcO44vXg90FRl7YWpFEPYPIa61CpjlIDmeRyc2AokIdTzTJ0HsITbw7rzohP+21zFSuc1K5Jwk4LA0p0OYi9Gg9BRfcdIiYqsjrk1sIN6Whgg8KP/PWIqlSgqtNbUV6MMFEtcCcptrZZTnu9htpt8VuuHMEJDb46bk78DQ9hlAFKSKC054dxH9DaBSbtCFfjeyfD1BTAFYShgvPyXNyhW2Kcuc06/bh4m+v4xrVzLyG X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Sep 2017 16:27:53.9509 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR12MB0155 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 287 Lines: 9 On 09/15/2017 11:22 AM, Borislav Petkov wrote: > mem_encrypt_init() where everything should be set up already. Yep, its safe to derefs the static key in mem_encrypt_init(). I've tried the approach and it seems to be work fine. I will include the required changes in next rev. thanks