From: Bandan Das <bsd@redhat.com> To: kvm@vger.kernel.org Cc: Paolo Bonzini <pbonzini@redhat.com>, Laszlo Ersek <lersek@redhat.com>, linux-kernel@vger.kernel.org, qemu-devel@nongnu.org Subject: [PATCH] KVM: x86: Add host physical address width capability Date: Wed, 08 Jul 2015 18:36:43 -0400 [thread overview] Message-ID: <jpg615ul1j8.fsf@linux.bootlegged.copy> (raw) Let userspace inquire the maximum physical address width of the host processors; this can be used to identify maximum memory that can be assigned to the guest. Reported-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Bandan Das <bsd@redhat.com> --- arch/x86/kvm/x86.c | 3 +++ include/uapi/linux/kvm.h | 1 + 2 files changed, 4 insertions(+) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index bbaf44e..97d6746 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -2683,6 +2683,9 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) case KVM_CAP_NR_MEMSLOTS: r = KVM_USER_MEM_SLOTS; break; + case KVM_CAP_PHY_ADDR_WIDTH: + r = boot_cpu_data.x86_phys_bits; + break; case KVM_CAP_PV_MMU: /* obsolete */ r = 0; break; diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h index 716ad4a..e7949a1 100644 --- a/include/uapi/linux/kvm.h +++ b/include/uapi/linux/kvm.h @@ -817,6 +817,7 @@ struct kvm_ppc_smmu_info { #define KVM_CAP_DISABLE_QUIRKS 116 #define KVM_CAP_X86_SMM 117 #define KVM_CAP_MULTI_ADDRESS_SPACE 118 +#define KVM_CAP_PHY_ADDR_WIDTH 119 #ifdef KVM_CAP_IRQ_ROUTING -- 2.4.3
WARNING: multiple messages have this Message-ID (diff)
From: Bandan Das <bsd@redhat.com> To: kvm@vger.kernel.org Cc: Paolo Bonzini <pbonzini@redhat.com>, Laszlo Ersek <lersek@redhat.com>, linux-kernel@vger.kernel.org, qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH] KVM: x86: Add host physical address width capability Date: Wed, 08 Jul 2015 18:36:43 -0400 [thread overview] Message-ID: <jpg615ul1j8.fsf@linux.bootlegged.copy> (raw) Let userspace inquire the maximum physical address width of the host processors; this can be used to identify maximum memory that can be assigned to the guest. Reported-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Bandan Das <bsd@redhat.com> --- arch/x86/kvm/x86.c | 3 +++ include/uapi/linux/kvm.h | 1 + 2 files changed, 4 insertions(+) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index bbaf44e..97d6746 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -2683,6 +2683,9 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) case KVM_CAP_NR_MEMSLOTS: r = KVM_USER_MEM_SLOTS; break; + case KVM_CAP_PHY_ADDR_WIDTH: + r = boot_cpu_data.x86_phys_bits; + break; case KVM_CAP_PV_MMU: /* obsolete */ r = 0; break; diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h index 716ad4a..e7949a1 100644 --- a/include/uapi/linux/kvm.h +++ b/include/uapi/linux/kvm.h @@ -817,6 +817,7 @@ struct kvm_ppc_smmu_info { #define KVM_CAP_DISABLE_QUIRKS 116 #define KVM_CAP_X86_SMM 117 #define KVM_CAP_MULTI_ADDRESS_SPACE 118 +#define KVM_CAP_PHY_ADDR_WIDTH 119 #ifdef KVM_CAP_IRQ_ROUTING -- 2.4.3
next reply other threads:[~2015-07-08 22:36 UTC|newest] Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top 2015-07-08 22:36 Bandan Das [this message] 2015-07-08 22:36 ` [Qemu-devel] [PATCH] KVM: x86: Add host physical address width capability Bandan Das 2015-07-09 6:09 ` Paolo Bonzini 2015-07-09 6:09 ` [Qemu-devel] " Paolo Bonzini 2015-07-09 6:43 ` Laszlo Ersek 2015-07-09 6:43 ` [Qemu-devel] " Laszlo Ersek 2015-07-09 12:41 ` Paolo Bonzini 2015-07-09 12:41 ` [Qemu-devel] " Paolo Bonzini 2015-07-09 18:32 ` Bandan Das 2015-07-09 18:32 ` [Qemu-devel] " Bandan Das 2015-07-09 18:57 ` Laszlo Ersek 2015-07-09 18:57 ` [Qemu-devel] " Laszlo Ersek 2015-07-09 18:57 ` Laszlo Ersek 2015-07-09 20:02 ` Bandan Das 2015-07-09 20:02 ` [Qemu-devel] " Bandan Das 2015-07-09 20:02 ` Bandan Das 2015-07-09 20:15 ` Laszlo Ersek 2015-07-09 20:15 ` [Qemu-devel] " Laszlo Ersek 2015-07-10 3:37 ` Bandan Das 2015-07-10 3:37 ` [Qemu-devel] " Bandan Das 2015-07-10 3:37 ` Bandan Das 2015-07-10 14:13 ` Paolo Bonzini 2015-07-10 14:13 ` [Qemu-devel] " Paolo Bonzini 2015-07-10 14:57 ` Laszlo Ersek 2015-07-10 14:57 ` [Qemu-devel] " Laszlo Ersek 2015-07-10 14:59 ` Paolo Bonzini 2015-07-10 14:59 ` [Qemu-devel] " Paolo Bonzini 2015-07-10 15:06 ` Laszlo Ersek 2015-07-10 15:06 ` [Qemu-devel] " Laszlo Ersek 2015-07-10 15:06 ` Laszlo Ersek 2015-07-10 15:45 ` Bandan Das 2015-07-10 15:45 ` [Qemu-devel] " Bandan Das
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=jpg615ul1j8.fsf@linux.bootlegged.copy \ --to=bsd@redhat.com \ --cc=kvm@vger.kernel.org \ --cc=lersek@redhat.com \ --cc=linux-kernel@vger.kernel.org \ --cc=pbonzini@redhat.com \ --cc=qemu-devel@nongnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.