[PATCH 0/2] Preliminary cleanups for HPT resizing

STALE3577d

4 messages, 2 authors, 2016-11-24 · open the first message on its own page

[PATCH 0/2] Preliminary cleanups for HPT resizing

From: David Gibson <hidden>
Date: 2016-11-23 05:14:17

Hi Paul,

I'm still chasing this confusion about the CAS bit to send the real
HPT resizing patches.  However, in the meantime, here are some
preliminary cleanups.

These cleanups stand on their own, although I wrote them in the
context of writing the HPT resizing code, and are prerequisites for
those patches.

David Gibson (2):
  kvm: Move KVM_PPC_PVINFO_FLAGS_EV_IDLE definition next to its
    structure
  powerpc/kvm: Corectly report KVM_CAP_PPC_ALLOC_HTAB

 arch/powerpc/kvm/powerpc.c | 5 ++++-
 include/uapi/linux/kvm.h   | 5 +++--
 2 files changed, 7 insertions(+), 3 deletions(-)

-- 
2.7.4

[PATCH 1/2] kvm: Move KVM_PPC_PVINFO_FLAGS_EV_IDLE definition next to its structure

From: David Gibson <hidden>
Date: 2016-11-23 05:14:18

The KVM_PPC_PVINFO_FLAGS_EV_IDLE macro defines a bit for use in the flags
field of struct kvm_ppc_pvinfo.  However, changes since that was introduced
have moved it away from that structure definition, which is confusing.

Move it back next to the structure it belongs with.

Signed-off-by: David Gibson <redacted>
---
 include/uapi/linux/kvm.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h
index 4ee67cb..cac48ed 100644
--- a/include/uapi/linux/kvm.h
+++ b/include/uapi/linux/kvm.h
@@ -651,6 +651,9 @@ struct kvm_enable_cap {
 };
 
 /* for KVM_PPC_GET_PVINFO */
+
+#define KVM_PPC_PVINFO_FLAGS_EV_IDLE   (1<<0)
+
 struct kvm_ppc_pvinfo {
 	/* out */
 	__u32 flags;
@@ -682,8 +685,6 @@ struct kvm_ppc_smmu_info {
 	struct kvm_ppc_one_seg_page_size sps[KVM_PPC_PAGE_SIZES_MAX_SZ];
 };
 
-#define KVM_PPC_PVINFO_FLAGS_EV_IDLE   (1<<0)
-
 #define KVMIO 0xAE
 
 /* machine type bits, to be used as argument to KVM_CREATE_VM */
-- 
2.7.4

[PATCH 2/2] powerpc/kvm: Corectly report KVM_CAP_PPC_ALLOC_HTAB

From: David Gibson <hidden>
Date: 2016-11-23 05:14:20

At present KVM on powerpc always reports KVM_CAP_PPC_ALLOC_HTAB as enabled.
However, the ioctl() it advertises (KVM_PPC_ALLOCATE_HTAB) only actually
works on KVM HV.  On KVM PR it will fail with ENOTTY.

qemu already has a workaround for this, so it's not breaking things in
practice, but it would be better to advertise this correctly.

Signed-off-by: David Gibson <redacted>
---
 arch/powerpc/kvm/powerpc.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
index 70963c8..7b6b9eb 100644
--- a/arch/powerpc/kvm/powerpc.c
+++ b/arch/powerpc/kvm/powerpc.c
@@ -536,7 +536,6 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
 #ifdef CONFIG_PPC_BOOK3S_64
 	case KVM_CAP_SPAPR_TCE:
 	case KVM_CAP_SPAPR_TCE_64:
-	case KVM_CAP_PPC_ALLOC_HTAB:
 	case KVM_CAP_PPC_RTAS:
 	case KVM_CAP_PPC_FIXUP_HCALL:
 	case KVM_CAP_PPC_ENABLE_HCALL:
@@ -545,6 +544,10 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
 #endif
 		r = 1;
 		break;
+
+	case KVM_CAP_PPC_ALLOC_HTAB:
+		r = hv_enabled;
+		break;
 #endif /* CONFIG_PPC_BOOK3S_64 */
 #ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE
 	case KVM_CAP_PPC_SMT:
-- 
2.7.4

Re: [PATCH 0/2] Preliminary cleanups for HPT resizing

From: Paul Mackerras <hidden>
Date: 2016-11-24 03:38:01

On Wed, Nov 23, 2016 at 04:14:05PM +1100, David Gibson wrote:
Hi Paul,

I'm still chasing this confusion about the CAS bit to send the real
HPT resizing patches.  However, in the meantime, here are some
preliminary cleanups.

These cleanups stand on their own, although I wrote them in the
context of writing the HPT resizing code, and are prerequisites for
those patches.

David Gibson (2):
  kvm: Move KVM_PPC_PVINFO_FLAGS_EV_IDLE definition next to its
    structure
  powerpc/kvm: Corectly report KVM_CAP_PPC_ALLOC_HTAB

 arch/powerpc/kvm/powerpc.c | 5 ++++-
 include/uapi/linux/kvm.h   | 5 +++--
 2 files changed, 7 insertions(+), 3 deletions(-)
Thanks, series applied to my kvm-ppc-next branch.

Paul.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help