From: Mihai =?UTF-8?Q?Don=C8=9Bu?= Subject: Re: [RFC 00/12] KVM/X86: Introduce a new guest mapping API Date: Mon, 05 Feb 2018 21:26:30 +0200 Message-ID: <1517858790.22345.62.camel@bitdefender.com> References: <1517856451-2932-1-git-send-email-karahmed@amazon.de> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Cc: Paolo Bonzini , Radim =?UTF-8?Q?Kr=C4=8Dm=C3=A1=C5=99?= , linux-kernel@vger.kernel.org, kvm@vger.kernel.org To: KarimAllah Ahmed Return-path: Received: from mx01.bbu.dsd.mx.bitdefender.com ([91.199.104.161]:57818 "EHLO mx01.bbu.dsd.mx.bitdefender.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750827AbeBET0e (ORCPT ); Mon, 5 Feb 2018 14:26:34 -0500 Received: from smtp02.buh.bitdefender.net (smtp.bitdefender.biz [10.17.80.76]) by mx-sr.buh.bitdefender.com (Postfix) with ESMTP id 92B327FC00 for ; Mon, 5 Feb 2018 21:26:32 +0200 (EET) In-Reply-To: <1517856451-2932-1-git-send-email-karahmed@amazon.de> Sender: kvm-owner@vger.kernel.org List-ID: On Mon, 2018-02-05 at 19:47 +0100, KarimAllah Ahmed wrote: > Guest memory can either be directly managed by the kernel (i.e. have a "struct > page") or they can simply live outside kernel control (i.e. do not have a > "struct page"). KVM mostly support these two modes, except in a few places > where the code seems to assume that guest memory must have a "struct page". In cases where there is no 'struct page', would it be possible to get two VM-s to share memory (in the way Xen's grant tables do)? We are working on a page sharing mechanism and would like to know if this use case can be accommodated. Thank you, > This patchset introduces a new mapping function to map guest memory into host > kernel memory. Ideally I should also get rid of all guest mapping functions > that end up converting a guest address to a page, but I decided to get feedback > on this first and see if this is an acceptable API. > > Most of the offending code paths that has been updated are in the nested code > base. Mostly because I stumbled upon this code while looking at the nested MSR > bitmap handling for the IBRS patches. There are also offending code paths in > SVM code, but I will do that once the interface is accepted. > > KarimAllah Ahmed (12): > KVM: Introduce helper functions to map/unmap guest memory > KVM/VMX: Use the new host mapping API for apic_access_page > KVM/VMX: Use the new host mapping API for virtual_apic_page > KVM/VMX: Use the new host mapping API for pi_desc_page > KVM/VMX: Use the new host mapping API for mapping nested vmptr > KVM/VMX: Use the new host mapping API for handle_vmptrld > KVM/VMX: Use the new host mapping API for mapping L12 MSR bitmap > KVM/VMX: Use the new host mapping API for mapping nested PML > KVM/VMX: Use the new host mapping API for cmpxchg_emulated > KVM/VMX: Use the new host mapping API for synic_clear_sint_msg_pending > KVM/VMX: Use the new host mapping API for synic_deliver_msg > KVM/VMX: Remove kvm_vcpu_gpa_to_page as it is now unused > > arch/x86/kvm/hyperv.c | 24 +++---- > arch/x86/kvm/vmx.c | 159 ++++++++++++++++++++--------------------------- > arch/x86/kvm/x86.c | 12 ++-- > include/linux/kvm_host.h | 18 +++++- > virt/kvm/kvm_main.c | 62 ++++++++++++++++++ > 5 files changed, 161 insertions(+), 114 deletions(-) > > Cc: Paolo Bonzini > Cc: Radim Krčmář > Cc: kvm@vger.kernel.org > Cc: linux-kernel@vger.kernel.org -- Mihai Donțu