Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932429AbdDRINC (ORCPT ); Tue, 18 Apr 2017 04:13:02 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:32782 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755754AbdDRIMh (ORCPT ); Tue, 18 Apr 2017 04:12:37 -0400 Subject: Re: [PATCH] x86, kvm: Handle PFNs outside of kernel reach when touching GPTEs To: Xiao Guangrong , "Sironi, Filippo" , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= References: <1491397622-16665-1-git-send-email-sironi@amazon.de> <20170406142201.GA2817@potion> <0C489207-F1C0-4D54-A55D-0983229F79E1@amazon.de> <1b77a9a3-6fc0-1258-026e-5977a6e9dba6@gmail.com> Cc: "Liguori, Anthony" , "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" From: Paolo Bonzini Message-ID: Date: Tue, 18 Apr 2017 10:12:34 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <1b77a9a3-6fc0-1258-026e-5977a6e9dba6@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 569 Lines: 19 On 17/04/2017 13:26, Xiao Guangrong wrote: >> > > Sounds reasonable, however it is incomplete so far as there are some > code paths still do not support non-page backend memory, e.g, > emulator_cmpxchg_emulated(). > > I would suggest to unify the code introduced in this patch with existing > hva_to_pfn(), also we can introduce a common API, maybe named > kvm_map_hva(), to improve the caller sides. I agree with Guangrong's suggestion. Paolo > BTW, i do not know why we used kmap_atomic() rather than kmap(), the > path of cmpxchg_gpte() is sleep-able anyway.