All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Preliminary cleanups for HPT resizing
@ 2016-11-23  5:14 David Gibson
  2016-11-23  5:14 ` [PATCH 1/2] kvm: Move KVM_PPC_PVINFO_FLAGS_EV_IDLE definition next to its structure David Gibson
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: David Gibson @ 2016-11-23  5:14 UTC (permalink / raw)
  To: paulus; +Cc: linux-kernel, linuxppc-dev, kvm, benh, aik, David Gibson

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] kvm: Move KVM_PPC_PVINFO_FLAGS_EV_IDLE definition next to its structure
  2016-11-23  5:14 [PATCH 0/2] Preliminary cleanups for HPT resizing David Gibson
@ 2016-11-23  5:14 ` David Gibson
  2016-11-23  5:14 ` [PATCH 2/2] powerpc/kvm: Corectly report KVM_CAP_PPC_ALLOC_HTAB David Gibson
  2016-11-24  3:37 ` [PATCH 0/2] Preliminary cleanups for HPT resizing Paul Mackerras
  2 siblings, 0 replies; 4+ messages in thread
From: David Gibson @ 2016-11-23  5:14 UTC (permalink / raw)
  To: paulus; +Cc: linux-kernel, linuxppc-dev, kvm, benh, aik, David Gibson

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 <david@gibson.dropbear.id.au>
---
 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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] powerpc/kvm: Corectly report KVM_CAP_PPC_ALLOC_HTAB
  2016-11-23  5:14 [PATCH 0/2] Preliminary cleanups for HPT resizing David Gibson
  2016-11-23  5:14 ` [PATCH 1/2] kvm: Move KVM_PPC_PVINFO_FLAGS_EV_IDLE definition next to its structure David Gibson
@ 2016-11-23  5:14 ` David Gibson
  2016-11-24  3:37 ` [PATCH 0/2] Preliminary cleanups for HPT resizing Paul Mackerras
  2 siblings, 0 replies; 4+ messages in thread
From: David Gibson @ 2016-11-23  5:14 UTC (permalink / raw)
  To: paulus; +Cc: linux-kernel, linuxppc-dev, kvm, benh, aik, David Gibson

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 <david@gibson.dropbear.id.au>
---
 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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/2] Preliminary cleanups for HPT resizing
  2016-11-23  5:14 [PATCH 0/2] Preliminary cleanups for HPT resizing David Gibson
  2016-11-23  5:14 ` [PATCH 1/2] kvm: Move KVM_PPC_PVINFO_FLAGS_EV_IDLE definition next to its structure David Gibson
  2016-11-23  5:14 ` [PATCH 2/2] powerpc/kvm: Corectly report KVM_CAP_PPC_ALLOC_HTAB David Gibson
@ 2016-11-24  3:37 ` Paul Mackerras
  2 siblings, 0 replies; 4+ messages in thread
From: Paul Mackerras @ 2016-11-24  3:37 UTC (permalink / raw)
  To: David Gibson; +Cc: linux-kernel, linuxppc-dev, kvm, benh, aik

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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-11-24  3:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-23  5:14 [PATCH 0/2] Preliminary cleanups for HPT resizing David Gibson
2016-11-23  5:14 ` [PATCH 1/2] kvm: Move KVM_PPC_PVINFO_FLAGS_EV_IDLE definition next to its structure David Gibson
2016-11-23  5:14 ` [PATCH 2/2] powerpc/kvm: Corectly report KVM_CAP_PPC_ALLOC_HTAB David Gibson
2016-11-24  3:37 ` [PATCH 0/2] Preliminary cleanups for HPT resizing Paul Mackerras

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.