Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755523AbdGXTPr (ORCPT ); Mon, 24 Jul 2017 15:15:47 -0400 Received: from mail-sn1nam01on0086.outbound.protection.outlook.com ([104.47.32.86]:3454 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753431AbdGXTKx (ORCPT ); Mon, 24 Jul 2017 15:10:53 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=brijesh.singh@amd.com; From: Brijesh Singh To: linux-kernel@vger.kernel.org, x86@kernel.org, linux-efi@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kvm@vger.kernel.org Cc: Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , Borislav Petkov , Andy Lutomirski , Tony Luck , Piotr Luc , Tom Lendacky , Fenghua Yu , Lu Baolu , Reza Arbab , David Howells , Matt Fleming , "Kirill A . Shutemov" , Laura Abbott , Ard Biesheuvel , Andrew Morton , Eric Biederman , Benjamin Herrenschmidt , Paul Mackerras , Konrad Rzeszutek Wilk , Jonathan Corbet , Dave Airlie , Kees Cook , Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , Arnd Bergmann , Tejun Heo , Christoph Lameter , Brijesh Singh Subject: [RFC Part1 PATCH v3 13/17] x86/io: Unroll string I/O when SEV is active Date: Mon, 24 Jul 2017 14:07:53 -0500 Message-Id: <20170724190757.11278-14-brijesh.singh@amd.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170724190757.11278-1-brijesh.singh@amd.com> References: <20170724190757.11278-1-brijesh.singh@amd.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [165.204.78.1] X-ClientProxiedBy: CY4PR04CA0049.namprd04.prod.outlook.com (10.171.243.142) To CY1PR12MB0150.namprd12.prod.outlook.com (10.161.173.20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c4720816-4b73-4e19-fe5b-08d4d2c76432 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(48565401081)(300000503095)(300135400095)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:CY1PR12MB0150; X-Microsoft-Exchange-Diagnostics: 1;CY1PR12MB0150;3:YBL1P8YYZFRK7tlEsjbMjzIo+LF7slD9TqlIPHchJPUriIACukoKm+KYZ9zBci53RsQAk6hW1MRs0XZJ4NSsjDbeFerRLEXb1cB01dT9bBrQNIJNlAZz3A2zPM+kcYaKi6p6Qf346paJnN65Rs4ttll1UcQMaAF3jKCr4ySJA41w8ebAznwkiJNbWBHmGe3/oWvLhfXQDevlMbNKMq3EBMbXFQIgWSu28GvzQ9x8QucdrncxFxvdHuahSObJnyKpFIIGGc5W4t+zIV/cPRWNW2tq4pxTxKG6HSXlow9I8xO66RyV0y2zIFQfkpe1OhmNAgIiBnOUrIzpcZvdGkw6DhszfpTeKRzMJgfISD1fAKAsafGL+v6bZYe0u+Rg9JBZf5nJfjJ7IQJaRQMgkejbWtb2Q6+y2Nn4SZ1uETCW7PvbzSJhbzoJQb88v4ugv9rHtBD35McFLha715vjvf7f5wbg8a9iB0a+J0Ib0e79hFSbpaNPfKNKWz6JqT5k6uGj+fe0ae88NH6Ny+7Aeqw0oVXUtt8Z94UjYoIomJyVzNyqmjbW3IPSU2bKkHadvxWgGGCwCEgUUcLj20ay01dQgANMQPmALNOiqkpDeEYkI9O8VpK7dxzYRT3diiMrIvFKMG7oaEA9DNAZW9jdBXxZv/cSEnv0S3tt7g+V2wGLaTcyExoUPfI+HZC55wPffMoYKhSSFL6+Tibc624TdUM1zWmd3D9YtqEvUIERkQ8BGdBjGM2jqTanWctJgjXbKKT8qDTyTCfOM+LIthJ1kPgn9g== X-MS-TrafficTypeDiagnostic: CY1PR12MB0150: X-Microsoft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4jgcPQ45QQuZOwfGSJbVAZofDecXwBq3JJ9Inp8TfA/xUOf4N1vAm2ygzv8klSMUBjoHF5GYJIJktmq4sgP 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)(8121501046)(5005006)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(3002001)(6055026)(6041248)(20161123564025)(20161123555025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123562025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:CY1PR12MB0150;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:CY1PR12MB0150; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY1PR12MB0150;4:jUidRxOpAhD0rD7cs2wabUpqCqjYWt3mOEEv1T5V+N?= =?us-ascii?Q?ajOyL58uCpBlVL4e372XP6lfc5Kg4H47qEHaMpZ3qiW8MtwD2OzdIvzRIvCW?= =?us-ascii?Q?IIL2kJrogFaDupWpNLysS4RDfekv1qEp0VIpIUDwQtPLjspyaGt6ZHjTuwKK?= =?us-ascii?Q?C87xQ2Ua8MFWjfzjzmS8bBKzk4uiREoO4BChpH/T3O1LBcNAK9kAdjCYExFO?= =?us-ascii?Q?FeRAIGR1Xl2gUS3B7FzIpGG9kUkQJ57JRaxmiutw87QxrPzWQ4cpnZHg34pn?= =?us-ascii?Q?ED7d/oGkQuOl789gBp5ABt3dj8VqyLcK4MzJOCD+RbhI51gmPAuQtZh8bBov?= =?us-ascii?Q?k3oQgSuwUnSNOxZdFaV3bshaXF0TKBsI8do6Cy5J5WYuI3EZxFZ1Ivt3sf6M?= =?us-ascii?Q?xxWYnrJhhUTU0KvZIC0+ntnN3Ro37BkKAL351KRW9SrnTpbrKCdU1ox7CtAs?= =?us-ascii?Q?8PkwoDY/hiwWROIiTFcjrwSgIBphmG1sa8re6NNTewzHF5SUH2npujMdxLkd?= =?us-ascii?Q?E/1rsSwt5uHSRwJvSoNU6zw4pXA9xv01TqwrpAKGvQlErOghzXvirwUmG/ZA?= =?us-ascii?Q?q9j2GOAVH2seUf4aAMVGm+T/pSfMmKnmP9xS16aRnjS8Ve7yIp/z9qVY9Gqy?= =?us-ascii?Q?ADgj62voSgBT7kIY//zXQtln5+kXF2bvi24s1kMj+MiS+fp3KGqh1uZUAX3e?= =?us-ascii?Q?jOUS6TgaCNcBKcyQcTBox5uUkm1Wa4s84wM3IoIHSeMAcXGvsvu3Wnwkg9UR?= =?us-ascii?Q?7x0MYYpWhgtmOQh1GBza/XrYjvjdz8v1ZqjPGNeYBzNAWO/a8tYcELUzIn9x?= =?us-ascii?Q?7Lk0x+ZnxQJ/XDB82xPNoXNCl2RNqyBq/SJKnQ2l0QNcH/w2I8zLwA9SF30I?= =?us-ascii?Q?9AAE8mA+aMDbA7MKas01OPNI8h832P+o2N1pqfd43rxtqgxd9NS3Ua97RqCP?= =?us-ascii?Q?Q37NPn1aAEUorpRBV+AqRWp4zoZHfuzXDLcEwp3DqIcPbWPvF89MxlmhwYwa?= =?us-ascii?Q?KYTRcyAhPlAdf4zLKAK42Pg38ljZMG2ssUdvAwnc0dne4vLlKzV6doPcxGNM?= =?us-ascii?Q?edvC/fcdjoAjSAS3/9tqHtU/t+cb6/PzM19QwR5504xoj4aOsOWkiDlV56r0?= =?us-ascii?Q?VXHrEP7bySvyTGiApDxR2vJ3qhOiR3jAP92jQBxffac1Byh22/6Qs3WE2Tkk?= =?us-ascii?Q?AGtdPHP3iU760gdGiE+dTDevd2OyP+U2gF?= X-Forefront-PRVS: 0378F1E47A X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(7370300001)(6009001)(39840400002)(39850400002)(39450400003)(39400400002)(39410400002)(39860400002)(199003)(189002)(4326008)(81156014)(7350300001)(81166006)(50226002)(50466002)(68736007)(36756003)(38730400002)(1076002)(110136004)(53936002)(6116002)(25786009)(48376002)(8676002)(86362001)(305945005)(54906002)(7736002)(2950100002)(6666003)(50986999)(101416001)(47776003)(105586002)(5660300001)(5003940100001)(7416002)(33646002)(106356001)(66066001)(6486002)(7406005)(97736004)(189998001)(3846002)(76176999)(2906002)(53416004)(42186005)(478600001);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR12MB0150;H:ubuntu-010236106000.amd.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY1PR12MB0150;23:eRl1C0t8h9xcxq0iUu4gEGdi2rXG8WBG98Bs2b/ND?= =?us-ascii?Q?FXQyry82O1Xvbb+vAaG4ASKGuXYCJi/+s0ROQXXDDQ72G8WufjGTXbggJiaA?= =?us-ascii?Q?c0UHjOQosfclcgydlBbuxsX/9ernMJeRfWvJSSefd1wfM6p1n4FODDaN/xw5?= =?us-ascii?Q?qjDF5l47MIoKt1BzTicPD4J2UFWbi6dF8wxkx6fncjPjTT6O0OPWaFA8Zgl+?= =?us-ascii?Q?WwzR4UdTIyP8vtiPvpyapkF5IsJg3KKJ60RY38ZHfG3KfJrprysNg9GpcCMC?= =?us-ascii?Q?vT0KFMX4/NzEY00kEmEVhrnNvOE6VkwxZWKmiwm7mzTLe0Nl8oic+u3K86jU?= =?us-ascii?Q?8vvShX/MOjE1nhbnWDs+eF8cqQxr25gbWbpH2UMxhBElwLCcjYZIbuYt9dAm?= =?us-ascii?Q?KpOZ57fyzoMgkGvKE/OnM+DTS4rAqX9F8n8JxkHzjVI69SZVYRAffQ6rpntZ?= =?us-ascii?Q?s96Ua15rGkJ+Zm19Yunj5q5z0P0A/jX2b4n098+ZzBLKS/ZxFzfq/81S4q0+?= =?us-ascii?Q?H9KXUZhcrCaU5SH0JEV4OgN6vNmK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JX4IfGmYrxEjPkA6+DG8UO?= =?us-ascii?Q?5aBInXyA3tNLV+Pi7T3p7gHxmUpzIViB8u8GW2bz1TuYODnMLRQugW7lwN+G?= =?us-ascii?Q?b1GqbdNfqKYEm7Ao1/oxnS?= X-Microsoft-Exchange-Diagnostics: 1;CY1PR12MB0150;5:g9Bg2wRGHZ6gmqeshkLDxIzgFn5g9CW4s2jiMbOv6bSKLKFFxw9ROFafBSpPIruPrI9bn3rtmzhgbFDs8bsGDbrrGZFR8NtxgA4MM3fd9KtIAf44Q29AnkgYTZqKGhggFcyuRHZKq+LYFd2JD0qWc1ilOWj+l3zZNh4HIZioQ5WStSEPht8Hq9I/T4T3qwdPSa61WTTPC3ZedVuGYBnmViU6+jXYwdDbHHCh+FetMjPBaz+cFqqYGYAdBFpFX5toR4l64p1t/dAFAGI/84mXLwckgpVM8g4BcDhimN4KzDY+grXmhv2s8ZfQPG8tkdPgGF9qweiFI82urfRq5o97KomTdyTXax49dFsUjjh0xKUMnKMRpOVwCCQdQJYsC3haisGEMXHogUIAbGtpi5fOxsBY4fB9Z2zKg+uGmOh84uhxKaqeYznYJxzvOp9Z5IXHWDVK0jqE20WSZpQHbqrMECXqFf6i5XPxlKptC/BUDiuxiXwJlYidRpSyusDhnh3r;24:ylbjDEzBpdyadgjerTKsFV8dXmUjnEAixrerfOYLaSGnUxeINNDkMGomxsARekIqeQI5lNC1koiHzVLy3rnyeDy52+nBsJiySrtyW2Thp3o= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;CY1PR12MB0150;7:0KSSL4PnDoeyDgpeMQHmYA2vZP0+eVhSuE0QqrgRqhRopBZJe4f8w+ovlSZLBRyrYrOSQf7B3pGmIuMFSf2n/ECU6v91CNvDPJkHIeIHKPcVL96TGydSTrb++LzFJi9UwVKDACyaOsJCclQ2zUvmMfZD633a87lbHab2R4bozim6R9J8KrI3CM2aBtcbLRoCoV+PcYLUQApOmeoV+abzrsJpAJBi859XlD9cIdHYXbSzOv2LwjG8QLOZra0/U1CA8ZDOXrAc7U0enpvu7CJvAEilkP4cnY0kiuezBZ0tDNBp3uLzR++K9mksfBNvE6HEgBN58G0Nwm2HTuX/h8Ujl5KB3Yxf/xSX5rilzV21ATlsO9A4XqIyOEwro3gBSdLI1RDh0Gwk1jZh2kAM1SAJt10NNuIMgGTY3lmCkOtzWCkN51WNyiygERbhXnbWTBJyefdwUXOYqfq+6dVOq/4iIvgxnqibIm88fQvETX9zJk+Fmp3yG32oPZbaPzZi2LGXNGLtuYjRZ98fq2Jrxs5yXYlaeR0fgRCd7i9dwowtqfADIo2CoSAVic2OyYbQyy//Dfx6T8nouBQHNDPIGzu4+Pg2Ls76kKAxkXASkVJapGx0Kl0MjHcY5BEpoezSdIxU248Mcarc/rDJY0/xjYatfe/Q/QiWa8v6qJnaT2sa4UBUVZd/aC4Bt9nW8pKBbDiFbciG1NdOuc4cxunIo4BDyz+J40GPmmzNvXBox0yHanTXpuHNdU6JWhihy1+DdB+cUAPFxGYHbzzrceT9IfGTEGIvxP2xzTRlveiS4q+Lyz8= X-Microsoft-Exchange-Diagnostics: 1;CY1PR12MB0150;20:1UNI1kHFpRZPyxnrEjYDfiXiEfOvhGEqKT3rZL3YvRhCyYGVzxVPg5eVjQ8nSZoX/f4AJ4fxHBI9cgkWS928gcvfHkFZqAyJg5U+R5LgI6sgCr6L5MQyu5n+XPe+Sv+faDZx4RijUN25DjqEGzyMG2Jc2HpQ/qCmyLCso7UhzK31wMpRPFljiR9o16lTlzv0kC+2Rh3Ytp4Nwe8BIIE1tkgssq6/4gS0wFUt2yMlR0qt+9OJKstpjTt0T723IK7p X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2017 19:08:37.2783 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR12MB0150 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1709 Lines: 55 From: Tom Lendacky Secure Encrypted Virtualization (SEV) does not support string I/O, so unroll the string I/O operation into a loop operating on one element at a time. Signed-off-by: Tom Lendacky Signed-off-by: Brijesh Singh --- arch/x86/include/asm/io.h | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h index e080a39..2f3c002 100644 --- a/arch/x86/include/asm/io.h +++ b/arch/x86/include/asm/io.h @@ -327,14 +327,32 @@ static inline unsigned type in##bwl##_p(int port) \ \ static inline void outs##bwl(int port, const void *addr, unsigned long count) \ { \ - asm volatile("rep; outs" #bwl \ - : "+S"(addr), "+c"(count) : "d"(port)); \ + if (sev_active()) { \ + unsigned type *value = (unsigned type *)addr; \ + while (count) { \ + out##bwl(*value, port); \ + value++; \ + count--; \ + } \ + } else { \ + asm volatile("rep; outs" #bwl \ + : "+S"(addr), "+c"(count) : "d"(port)); \ + } \ } \ \ static inline void ins##bwl(int port, void *addr, unsigned long count) \ { \ - asm volatile("rep; ins" #bwl \ - : "+D"(addr), "+c"(count) : "d"(port)); \ + if (sev_active()) { \ + unsigned type *value = (unsigned type *)addr; \ + while (count) { \ + *value = in##bwl(port); \ + value++; \ + count--; \ + } \ + } else { \ + asm volatile("rep; ins" #bwl \ + : "+D"(addr), "+c"(count) : "d"(port)); \ + } \ } BUILDIO(b, b, char) -- 2.9.4