From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paul Mackerras Subject: [PATCH 00/23] Allow PR and HV KVM to coexist in one kernel Date: Tue, 6 Aug 2013 14:12:59 +1000 Message-ID: <20130806041259.GF19254@iris.ozlabs.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm-ppc@vger.kernel.org, kvm@vger.kernel.org To: Alexander Graf , Benjamin Herrenschmidt Return-path: Received: from ozlabs.org ([203.10.76.45]:34410 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751752Ab3HFE2u (ORCPT ); Tue, 6 Aug 2013 00:28:50 -0400 Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: This series aims at making it possible to have one kernel image with both PR and HV KVM code included, so that guests can be run under HV KVM using hypervisor mode if available, or under PR KVM if hypervisor mode is not available or the guest is not a PAPR guest. One of the difficulties in doing this is that the userspace may, and if the userspace is QEMU, does call the KVM_PPC_GET_SMMU_INFO ioctl before we have enough information to decide whether the guest should use PR or HV KVM. To overcome this, the series first enhances PR KVM to have the same set of MMU features as current real hardware, i.e. support for 64kB pages and 1TB segments. Thus it's possible to construct a result for KVM_PPC_GET_SMMU_INFO that it suitable for either PR or HV KVM. With this series, guests start out as PR guests. At the time when the KVM_CAP_PPC_PAPR capability is enabled, the guest gets converted into a HV guest if possible. This way, a non-PAPR guest will naturally run using PR KVM. The series also makes quite a lot of other improvements to PR KVM, notably to run SMP guests and to work better with KSM. For best results my patch "powerpc: Implement __get_user_pages_fast()" is also needed to allow the generic KVM code to detect correctly when pages for which we have only requested read access are actually writable. Paul.