Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753719AbdGXUMZ (ORCPT ); Mon, 24 Jul 2017 16:12:25 -0400 Received: from mail-by2nam01on0071.outbound.protection.outlook.com ([104.47.34.71]:28576 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754478AbdGXUJJ (ORCPT ); Mon, 24 Jul 2017 16:09:09 -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, kvm@vger.kernel.org Cc: Thomas Gleixner , Borislav Petkov , Joerg Roedel , "Michael S . Tsirkin" , Paolo Bonzini , =?UTF-8?q?=5C=22Radim=20Kr=C4=8Dm=C3=A1=C5=99=5C=22?= , Tom Lendacky , Brijesh Singh Subject: [RFC Part2 PATCH v3 26/26] KVM: X86: Restart the guest when insn_len is zero and SEV is enabled Date: Mon, 24 Jul 2017 15:03:03 -0500 Message-Id: <20170724200303.12197-27-brijesh.singh@amd.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170724200303.12197-1-brijesh.singh@amd.com> References: <20170724200303.12197-1-brijesh.singh@amd.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [165.204.78.1] X-ClientProxiedBy: DM3PR12CA0049.namprd12.prod.outlook.com (10.161.151.17) To BY2PR12MB0145.namprd12.prod.outlook.com (10.162.82.18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 275aebfb-aa48-47c9-dc03-08d4d2cf1c4b 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:BY2PR12MB0145; X-Microsoft-Exchange-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JPiZOgkscJ1DEV1MqUz/AGItj5k3IS648VMI8zl5Ak8t8LTDnDEFl219kmrFcQJXjxmpAFtS/kUcll1igBMnaUZR/ZZvC05BAGNCIUO33U+p117s6oRYL4M/52CY6CuzwZoQgvje1sHUvK1kxrLDMTvcrw4k3Yt4wQCJLAD730BpstuPSR18Ny4GAsONM3U9YVTe36eiuvp5UUDz3gcKvleZJ8BsNlbFCOYdPgxd4OknFfMI0udoengySaaAve3Nr0PQ4AN59mt7losdEOBxS1JFEn085SFioYr5pIXhpIHCSlBmmNOxSb41TSYYILnhweV49zuncJWbvR311lpueCjm14sZHu3BPTgi1bwO/SAH8WkPWO/juYTF20HJpBsfj0psNWGCg= X-Microsoft-Exchange-Diagnostics: 1;BY2PR12MB0145;20:RsTTvu4fFMT8zzG1XkIz89Zb8jiexHh61dnbZ1hz4h2Qm//DO3WIBBlVooe6XBBF7rp/vVBI+DzNUqOUGc+Z+c1mGRoJTJBDBGALf4z1qrvO/8dDXyLDjeSxe3jDRTUDoWfvu+zeaEWljiJS2ashITwJIhnbWl2aHq+lk9+AQI1VH8yc9t39D1hRC0Jg1PYViCo/eEsZrrKIAq97L87CDClDyV8AYL+gkGHU5UxjzkBY6D2Rb4fhlRJbgMu6tU9Mjm0WYO3VCnTzxCpZD45E0R/Mx79c6g5Qw2ddvdLeddJhwMROjmdwmlhLRFk9yds7p9IfTPAfLtLmEbvZ38SQ0BnIffffi26KinGgH6GjVStWmLZg8MRMMN8H4iT6NNER2H7STCwEQlZcW3wRZvDAUf/CnUgXgpi9ZfNrwNm/z9D2fgkhHvEp+9cFf8Rlcp/wDg8Ag+xasx5X33XfEeWXEUczAIs6f5QXcX5QucoGCFLj0vnGiLFZYyfWaKFALhdn X-Exchange-Antispam-Report-Test: UriScan:(767451399110)(17755550239193); 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)(3002001)(93006095)(93001095)(100000703101)(100105400095)(10201501046)(6055026)(6041248)(20161123562025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123564025)(20161123555025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:BY2PR12MB0145;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:BY2PR12MB0145; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BY2PR12MB0145;4:37Nos7DH1LESHA9orAeqrC20IBpTxqHMdsokOVMOXZ?= =?us-ascii?Q?Uw/zOi4M3EaiGW/vGLgQQ8zurVkiMIx7DKBMlH8w7EDho2wsHaLM7xG5I3dE?= =?us-ascii?Q?sjEJw5hVPo/jZaoPc5IASyLcISk1Ky4NtuAIKnZYAv3MQY0TUZDYWo+8Kf9I?= =?us-ascii?Q?8beSiXKtV1JkCGDUjgIDbNQ3PuK9tiL/GOaRcSW8Gj4gaAfh9ya9c10MyboF?= =?us-ascii?Q?DBjlebtbMavyCYKfLnP+u5J/2MVYSB7vuzQfx1GFvfYBza7fjNtKALvDOaQb?= =?us-ascii?Q?6L2CnfbY9YKSzrcUnZNHMNZtpjoGsoaQMlXjY8luy60A+66up5EDy8FtNyJR?= =?us-ascii?Q?fQX+tsnESaa0P4ba8RZUSLauP+Jan/SFE4LN1czkvV15kbP5TtdiTEiEXFdI?= =?us-ascii?Q?61Us1G96szrJRoAQUZH3WGmVa3L3AL+3GZzAj1ViPC2EGeFzzjnLapVOfBzX?= =?us-ascii?Q?q+jadujT7EwyptPvBqkqMNy58sGJ6ySKNjBn2GFq8pNi8fuIZyTyhmuDWVrR?= =?us-ascii?Q?d2e5xmgwZ1R+c+YJa4DvlkyPwL5IDWfcVEiKLbAbBxNRin1ijJI6MUpW/UXx?= =?us-ascii?Q?aNzHc/9ytdrxAiH8P9aNtvdQMYYdF7r5Fk0A07BWNOIjTKmdxkAzVyGOAk2R?= =?us-ascii?Q?C0nOMW88WAhex+oPSRfJKbvx8HIBilvdNxH+eaxHsL8EI4UNW2ndfCL3I1Jm?= =?us-ascii?Q?efRS2t7KJNygaxZK1ngss4qcRrBjEMakNSVcdJvEtsCpQS6PQ9OICPoEYTvP?= =?us-ascii?Q?K8z7anKYPL4yEgNpGH+chbKMW1U6VPxRq6cT1wjVEPm+gpX+4c1m98FhN1s1?= =?us-ascii?Q?tkcSmN/Rg+AACbhRpE2oXClrf0OFN+mE0pibQyH5Aa19VMjAUeXDZUVQ/i/g?= =?us-ascii?Q?IbZQJShF9N4nIRUZCKiWnq0DJuM2BOoCcvHXncw0pm4yQ2d/lwc3o8Jm0hY4?= =?us-ascii?Q?xBkQqMhSnmZDD9o4nkBTn/AVh/pbS5tCqgyyqBOgxcAJ6WVq+qedilA4ie4J?= =?us-ascii?Q?PORu83q9pLD7r0ISnFpnt0lY9lIOmNITh+6jmAYuCScc4m2fMYqnNqD/lHkb?= =?us-ascii?Q?EfTkJ3YXxr6+QF8pTnD02hM82lUIFr71uFDjs7af+Jgixw3IhN6jkNgJQboO?= =?us-ascii?Q?AUGCaFrc//c9i9qWa6onKNr520B5wtsYPUZkcalED2KKjL6DvgZOhYwGjwQM?= =?us-ascii?Q?wwX1tRmIkn8D6Sv5B04wNOdWN/Hbkgib0eaYbLpap6By0sTaSsgn4TxE3jUD?= =?us-ascii?Q?08nj9NCoIsch49b5c=3D?= X-Forefront-PRVS: 0378F1E47A X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(7370300001)(6009001)(39450400003)(39410400002)(39400400002)(39850400002)(39860400002)(39840400002)(189002)(199003)(7350300001)(68736007)(53416004)(105586002)(54906002)(97736004)(50466002)(6486002)(48376002)(2906002)(106356001)(33646002)(6116002)(1076002)(53936002)(3846002)(189998001)(101416001)(6666003)(2950100002)(478600001)(50986999)(76176999)(81156014)(50226002)(38730400002)(47776003)(5003940100001)(86362001)(25786009)(4326008)(36756003)(42186005)(8676002)(81166006)(110136004)(5660300001)(66066001)(7736002)(305945005);DIR:OUT;SFP:1101;SCL:1;SRVR:BY2PR12MB0145;H:ubuntu-010236106000.amd.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BY2PR12MB0145;23:/GR6r1thBzHqlaogT2Xm6kUTgDWzdH6AmfPG9jVcw?= =?us-ascii?Q?TxPn6YYPNGJdrkQ2I/LGjEtSgjJL5LNalj7w1ThrWYXqU62gpXOnqgseHmhS?= =?us-ascii?Q?nDhAvFSr94QGWYjQXqy0tDbTI+y7mGqDDX2ReYYYJa6pLtJxMedcPbfflF5l?= =?us-ascii?Q?pORnH1N8dGMGO4rZIq9kbPxnIqyh0SDchCmV/Xr94KpyYBlSmugJ6zFWVRcn?= =?us-ascii?Q?8YAR+T4XkTCZGNIPSFO8g0GQ/7FWOwAoIeuz9XkL8Jvg2vXEfP6YTk6VxEfW?= =?us-ascii?Q?ST3owVkGcKzWW0K2Lgoko+h1HY+9n+LXDTocJjRSVOpdsUgmqan0D8nzgOxG?= =?us-ascii?Q?OYH1HfcQ1eSX4AGB1muOfL7xkj0bRYf98xflJ6Gk7sJsgQ/cbaZjhB8Gg9H4?= =?us-ascii?Q?t2mscQ3uus5ZeCNH8zeGE9HhJprV6gJJE3pjxwLLOye6mBE+sRtKhfFeZ2iK?= =?us-ascii?Q?Hi5QqqVSLM7l0fVtpPjxHe7v0xYXDpO5jxErGJU3EKHlIqWW7GVA60FOZ3ow?= =?us-ascii?Q?VhFQoxoVVpBmqZpkMoRmmJu/A2JzkRfMSIJ08/x9DC4/K+KCKi6bRGWrtonb?= =?us-ascii?Q?XUq/qTgNJl1nBcOho4y3IwghFm4VQKaHB32DjyjJuN9XpV2OD0ZYdR47/3Ze?= =?us-ascii?Q?vGBct+ydOp0K2Bap//p2EUMabmbS5f78yedXRzbl6BhTa198T6M1fCjFDYpB?= =?us-ascii?Q?hpCLg962+ODIyxWhmMA5EFSZMfcP1c/SWaepsg3z7ujBVmLiIv/PRpmoMDqN?= =?us-ascii?Q?G0/0UBCPaum8lELgNUnpXosC8tS4bYqT3/TxTNPGZPCMlHoXF+/Ax8yBV0ma?= =?us-ascii?Q?67ZI8rwUcSKC410EOav8oPArOzPhFv9CT9YMdmPqXWgjVElsIp2S/YOOCDJ3?= =?us-ascii?Q?lYPiiHNEds+w9KlqEzihOOphBgJ0DOYZFvWgnkRJ4FWMWzpiSS4BhZm9TEOf?= =?us-ascii?Q?4gKvPMFBpaBiLDAnUxz9lFiOksMTd2++U9BL6yp+QQBlcT5gP6fu6Zrxdmhv?= =?us-ascii?Q?GPpCLI9wZPW/qr1xhXTXY6u4PowW8pUjgMu7KYJSyvHjM7UJvKxjcs+AEKLb?= =?us-ascii?Q?dexvMSWX4y9qbhmAPyJeOevlUcAnPvumGa9UoKhjqZXn8P8zoV2U6h5c1PA0?= =?us-ascii?Q?+OoH/iSucE5KkqM9hP0xSLBcoHSfyie+zUQIOYVoDZaQPHw6MwUjPXoYoEJE?= =?us-ascii?Q?rYFG3wEmYFULFllPJsXb7eTyoPUL30K6xdq5bkYAEDUlC6V/GAeXkvPNAyOm?= =?us-ascii?Q?cK+9oGsAPanqsMHeYXmisloe8Wf7I2XZx+zcJfO?= X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BY2PR12MB0145;6:Zvst0WD8uPsJuEaLTiBxBfz8SBqWNEUtD5ELOb1bBM?= =?us-ascii?Q?e2qyIvDZLwykDYox14PnUw2CjiGLHUZHCZXpA1p1riWxiIpIGFWP+XuL9vUh?= =?us-ascii?Q?pul8supeSs8D4WMhveQj55yBZEy/OmBIzVGjeoysEDcobDk0czDm6K/WGVh5?= =?us-ascii?Q?zdyt2z76fOHZ4bxo6sJ0mV5fbIedeHzvBYmWMVirdGDGplaVnMereq8+SwQZ?= =?us-ascii?Q?FIOshXJAWY480i3zK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a5LIQyt1IdK0iRcyGPdILjdo8fF9GFoqFD9BoEOvM4nHBZmwZv/KRANptPsusSQL4nQDKw8PY0f26N5m7uDU7c6+fTRIw8+xNpi66hPTzdr9qKLHGLqoJ+v4NFr1012vrGQxsQqHzV3+sPt39nR4KUwm1/09y8wsr4K1z8xKyMknG3z1ftXQRyQ8s9mVsVO7Y7urKUoxhD8+jLF48SwWHQq/YCZBYF4nyCBLcxymkmuFUolT7cu4HdwDu2nsDFv//GGOQSApF3P5n0D6bWTOoxZ8CHrl4NUOQZ7RCvkDdbqXYTOiPnPqa1NRIPTW+TOWJhzQqeAUYSMHBC7+LLMiREA= X-Microsoft-Exchange-Diagnostics: 1;BY2PR12MB0145;20:XkIB6QFrDMfY+42mekM6N1n3oceFGHl9nlXn3HyI65aBaKKgcMkpOJX6WocnKSVcj1Bmt7TTyE48bMLC5G7feLS391t8txXfzSenEYjbUa5wn425z7zwkcKLNFH9AFasLPrp3Fuu+Veyqc9oWXEcuSjllk8f+2gPzzXU0bwvmdjf6YZdJFFUFXWao7utPdHMIyQN+GzV7NngjkNFtS6PkBM/h/vKTOymbKn5EXqll3tKsG3rTgAl7sIVjM7vCDJ5 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2017 20:03:53.1191 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR12MB0145 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1901 Lines: 48 On AMD platform, under certain conditions insn_len may be zero on #NPF. This can happen if guest gets a page-fault on data access, but HW table walker is not able to read the instruction page (e.g instuction page is not present in memory). Typically, when insn_len is zero, x86_emulate_instruction() walks the guest page table and fetches the instruction bytes from guest memory. When SEV is enabled, the guest memory is encrypted with guest-specific key hence hypervisor will not able to fetch the instruction bytes. In those cases we simply restart the guest. I have encountered this issue when running kernbench inside the guest. Signed-off-by: Brijesh Singh --- arch/x86/kvm/mmu.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index ccb70b8..be41ad0 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c @@ -4850,6 +4850,23 @@ int kvm_mmu_page_fault(struct kvm_vcpu *vcpu, gva_t cr2, u64 error_code, if (mmio_info_in_cache(vcpu, cr2, direct)) emulation_type = 0; emulate: + /* + * On AMD platform, under certain conditions insn_len may be zero on #NPF. + * This can happen if guest gets a page-fault on data access, but HW table + * walker is not able to read the instruction page (e.g instuction page + * is not present). + * + * Typically, when insn_len is zero, x86_emulate_instruction() walks the + * guest page table and fetches the instruction bytes. When SEV is active, + * the guest memory is encrypted with guest key hence we will not able to + * fetch the instruction bytes. In those cases we simply restart the guest. + */ + if (unlikely(!insn_len)) { + if (kvm_x86_ops->memory_encryption_enabled && + kvm_x86_ops->memory_encryption_enabled(vcpu)) + return 1; + } + er = x86_emulate_instruction(vcpu, cr2, emulation_type, insn, insn_len); switch (er) { -- 2.9.4