Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751651AbdGaQyv (ORCPT ); Mon, 31 Jul 2017 12:54:51 -0400 Received: from mail-dm3nam03on0069.outbound.protection.outlook.com ([104.47.41.69]:52640 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750953AbdGaQys (ORCPT ); Mon, 31 Jul 2017 12:54:48 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=brijesh.singh@amd.com; Cc: brijesh.singh@amd.com, thomas.lendacky@amd.com, rkrcmar@redhat.com, joro@8bytes.org, x86@kernel.org, linux-kernel@vger.kernel.org, mingo@redhat.com, hpa@zytor.com, tglx@linutronix.de, bp@suse.de Subject: Re: [PATCH v2 1/3] kvm: svm: Add support for additional SVM NPF error codes To: Paolo Bonzini , kvm@vger.kernel.org References: <147992048887.27638.17559991037474542240.stgit@brijesh-build-machine> <147992049856.27638.17076562184960611399.stgit@brijesh-build-machine> <21b9f4db-f929-80f6-6ad2-6fa3b77f82c0@redhat.com> From: Brijesh Singh Message-ID: Date: Mon, 31 Jul 2017 11:54:42 -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: <21b9f4db-f929-80f6-6ad2-6fa3b77f82c0@redhat.com> 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: CY1PR07CA0033.namprd07.prod.outlook.com (10.166.202.43) To CY1PR12MB0152.namprd12.prod.outlook.com (10.161.173.22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 11f4b0c9-e45f-40c7-f648-08d4d834d8d1 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)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:CY1PR12MB0152; X-Microsoft-Exchange-Diagnostics: 1;CY1PR12MB0152;3:G2XleuPQ0gl+onYgoUWkY6veXX63gRjsjD7SiFtC5nUcj0cIdlbToE/dbkiFLT+q9Tr/DNA2N/yQbOgg3uwrMyAISzHizWoFRlLZh6pihE39tTJvD7KwcYGo24Zv4WjrSntTqbLT5Hp7o4OM40dMMsgCNE+r2WowI7P5N+UtOcKy/1xey26hnbPauHP5aJBRMIywY+087ov23UG6cRlxVSBZPuIVTW3lXUQ95HC891rSq0ZSi9Py/YhdtGt16tjMuyA9HXuPkwe+Jc+QP1+fYKNu/UfKIksHtLTqTlclellzRnPlXgldCSVqeVgPrx25utR9hXfqlfYGZ7OUUFwi1NISosBW00NhQAS0t611dotf87PEq1gosY2mQsTmhLQwpurO+fbdXjeCg347d7tPjFGQ7p335PiJMZsipUAehlNvgOmKNEVugHe2ztJXbzccbgRMyEd7M8/fSabjXYfvucU1O/060uI+dbNZdPiMVg1DHOlFl+UnwAbylmCO75UzybygmDFt/gI1nWh3i6Gh4If4pi5C112unh+rKJxv57KJGx8Sv4bWDjy59D8n0q8z6AVtaEnDJv4I8p6vdA05RdAF2wi9gD+iPlC5hZTuUqfT3URRNhmAUzEVArCaTdPBx3xRcovhlOAxZkdUOhvBYrIbHJZdAOaL+l/vzaeiEFjq7boIwdQ3GoW4y4v0rg92mrOLVhmahoeeNC3HqS2ia12eiKUwESbCXbmgMiiadhhZPBDLyhcf2pl1UTXAsKRwUQ2v++ndnbIZ7K1jXeWW2yBT5R2vGybYRZSL8U7ARon1Yz+JkI/YNZUjFFxt/MgAFT5to3uZnc5y8uEKu3XBiA== X-MS-TrafficTypeDiagnostic: CY1PR12MB0152: X-Microsoft-Exchange-Diagnostics: 1;CY1PR12MB0152;25:cXS8HuFp8vF+H3rZo28oxc2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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)(601004)(2401047)(5005006)(8121501046)(100000703101)(100105400095)(10201501046)(93006095)(93001095)(3002001)(6055026)(6041248)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123560025)(20161123564025)(20161123562025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:CY1PR12MB0152;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:CY1PR12MB0152; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTFQUjEyTUIwMTUyOzQ6YWRTTXJlTDliVG53NEZzZHZXanFINkJoZVhn?= =?utf-8?B?UTJyQVA0a3BBNThmNmF3MEFYenRJT2lSVEM2QS91TTVwRndvcDU5NWIzMit3?= =?utf-8?B?R1U2TjZKWE9LVmlQZURuTzJ1ZTA4UzJWQis4OVdCYW1vRTlDdHVXWWhJdVNr?= =?utf-8?B?b0RTOCtJSTROSzRKdW1KK1NYQjdmdk5FVkJVUDg4c2RKRFpLem9TVXphbGVC?= =?utf-8?B?UmZocnlONG9kTThzcjd4bUMwS2xuS0tzTFQyOVp2VUhuZ0R0KzRkZURxRnFG?= =?utf-8?B?ZXIwTmJMVzBhLzdjRldRelZJMmNWZWxrYitSajNOQWNaWmZ1bEIyQ1NnQ0Rr?= =?utf-8?B?cGF1NUJ0ZUhydTJDVzhQNGZPUTJ3Ny93Qk5zZ1hQZ0lrdC9NMVpXNGtNVy8y?= =?utf-8?B?alc0Y3REYXRJbFhQQWxOL21kLytMVHZYNFByVmZjU1h5ME80ZzBlYXJtamEx?= =?utf-8?B?cTFIZDl5b0lmRHZBY1ozdEl1MGRvQ0FpdlBYa2Npc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TSzJTVTdMSDNhTFN3ZWNqVjROZHdVdHl5L250?= =?utf-8?B?REQ4U2hhUGtkMENFT3dvcEQ0M1c2U1pxYXZaTTJ1VWF2aEFqdEo5VU9DU0da?= =?utf-8?B?RHEvdTZHR013WFVsMGJJUXRFZGhlZUhROXJBRHJkcDUvbWtYdHIwV2F4anJv?= =?utf-8?B?eFllWWFnZDlkZFh0OVhMR2JRcEFCQT09?= X-Forefront-PRVS: 03853D523D X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(7370300001)(6009001)(6049001)(39450400003)(39410400002)(39400400002)(39850400002)(39860400002)(39840400002)(199003)(24454002)(377454003)(189002)(31696002)(229853002)(6486002)(77096006)(38730400002)(6246003)(7736002)(4326008)(90366009)(2950100002)(110136004)(23676002)(8676002)(101416001)(86362001)(106356001)(81166006)(81156014)(76176999)(50986999)(105586002)(54356999)(93886004)(47776003)(65806001)(66066001)(53936002)(42186005)(65956001)(50466002)(478600001)(36756003)(25786009)(64126003)(68736007)(305945005)(6116002)(97736004)(33646002)(3846002)(230700001)(189998001)(83506001)(7416002)(53546010)(65826007)(2906002)(5660300001)(7350300001)(4001350100001)(31686004)(217873001);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR12MB0152;H:[10.236.136.62];FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTFQUjEyTUIwMTUyOzIzOlhmQkU5dk43YTVMdTBzYnlIVGY4QU85L1lv?= =?utf-8?B?bkU1Slh0MUdIa1M2SGZQUzJsUzhSWWFNS2lwSldWOVRxbXJzZWtDdEtRbWVu?= =?utf-8?B?a0lxT3RuT2tJM2RNSDlBai9vblJvZkljQUFRN21YNVlDTFdUSmhlK0Y1NnRz?= =?utf-8?B?Mi93alZQeUhRcitqbXNrN0k4MUR3dS9HN2E1WUJ5ZCtCekd6QlVDVFRZR2M0?= =?utf-8?B?T3pZRWhYOTB1M0hlUHZ1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o1W8u4bGyubpg5UUBg/ZPmBb+mk1uZzgfOtyufNlGbmCnoqY6xUaGtPU8pxHJx/hE7m2HMDI0YWhuEfvx51Vtb58oxm4IS/K1FZ1cFEz+GAvx514vNxJzKKRPfJQGXpUdIxjIOXvIhYt2V5EhMnzWLiUZoe2gcpSsDuvZFNn0vQuFPuMcP4w= X-Microsoft-Exchange-Diagnostics: 1;CY1PR12MB0152;20:2vj3+E3jmdZeoddsswhipP5n+MOe1yXzWumWvw0tBODdsZNSLcxRhCaAGOR2y1sur2LEcjHoB30VO2pvrS7J9nGJOJG3ciEUUvHo/CR7LDOo3BJjxdbBAlBAe/JEj+jTze73RVIWgiH/B9J7ZpM+U8CshO3sQXI2MWC46x5vQs/IMt+B6WK9VFlKoE/9JkftjwdbHE8ZKcEO+MHGKiJGCznHVuKheesdzlf2v1IULtSs33Mqre6gvrGPqp3Ppfdz X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2017 16:54:44.8932 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR12MB0152 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2921 Lines: 66 On 07/31/2017 10:44 AM, Paolo Bonzini wrote: > On 31/07/2017 15:30, Brijesh Singh wrote: >> Hi Paolo, >> >> On 07/27/2017 11:27 AM, Paolo Bonzini wrote: >>> On 23/11/2016 18:01, Brijesh Singh wrote: >>>> + /* >>>> + * Before emulating the instruction, check if the error code >>>> + * was due to a RO violation while translating the guest page. >>>> + * This can occur when using nested virtualization with nested >>>> + * paging in both guests. If true, we simply unprotect the page >>>> + * and resume the guest. >>>> + * >>>> + * Note: AMD only (since it supports the PFERR_GUEST_PAGE_MASK used >>>> + * in PFERR_NEXT_GUEST_PAGE) >>>> + */ >>>> + if (error_code == PFERR_NESTED_GUEST_PAGE) { >>>> + kvm_mmu_unprotect_page(vcpu->kvm, gpa_to_gfn(cr2)); >>>> + return 1; >>>> + } >>> >>> >>> What happens if L1 is mapping some memory that is read only in L0? That >>> is, the L1 nested page tables make it read-write, but the L0 shadow >>> nested page tables make it read-only. >>> >>> Accessing it would cause an NPF, and then my guess is that the L1 guest >>> would loop on the failing instruction instead of just dropping the write. >>> >> >> >> Not sure if I am able to follow your use case. Could you please explain me >> in bit detail. >> >> The purpose of the code above was really for when we resume from the L2 guest >> back to the L1 guest. The L1 page tables are marked RO when in the L2 guest >> (for shadow paging) as I recall, so when we come back to the L1 guest, it can >> get a fault since its page tables are not marked writeable at L0 as they >> need to be. > > There can be different cases where an L0->L2 shadow nested page table is > marked read only, in particular when a page is read only in L1's nested > page tables. If such a page is accessed by L2 while walking page tables > it will cause a nested page fault (page table walks are write accesses). > However, after kvm_mmu_unprotect_page you will get another page fault, > and again in an endless stream. > > Instead, emulation would have caused a nested page fault vmexit, I think. > If possible could you please give me some pointer on how to create this use case so that we can get definitive answer. Looking at the code path is giving me indication that the new code (the kvm_mmu_unprotect_page call) only happens if vcpu->arch.mmu_page_fault() returns an indication that the instruction should be emulated. I would not expect that to be the case scenario you described above since L1 making a page read-only (this is a page table for L2) is an error and should result in #NPF being injected into L1. It's bit hard for me to visualize the code flow and figure out exactly how that would happen, but I just tried booting nested virtualization and it seem to be working okay. Is there a kvm-unit-test which I can run to trigger this scenario ? thanks -Brijesh