linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Wolf <mjw@linux.vnet.ibm.com>
To: linux-kernel@vger.kernel.org
Cc: riel@redhat.com, kvm@vger.kernel.org, peterz@infradead.org,
	mtosatti@redhat.com, glommer@parallels.com, mingo@redhat.com
Subject: [PATCH 5/5] Add an ioctl to communicate the consign limit to the host.
Date: Mon, 26 Nov 2012 14:37:17 -0600	[thread overview]
Message-ID: <20121126203717.28840.77239.stgit@lambeau> (raw)
In-Reply-To: <20121126203603.28840.38736.stgit@lambeau>

Add an ioctl to communicate the consign limit to the host.

Signed-off-by: Michael Wolf <mjw@linux.vnet.ibm.com>
---
 arch/x86/kvm/x86.c       |    6 ++++++
 include/linux/kvm_host.h |    2 ++
 include/uapi/linux/kvm.h |    2 ++
 virt/kvm/kvm_main.c      |    7 +++++++
 4 files changed, 17 insertions(+)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index c91f4c9..5d57469 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -5938,6 +5938,12 @@ int kvm_arch_vcpu_ioctl_translate(struct kvm_vcpu *vcpu,
 	return 0;
 }
 
+int kvm_arch_vcpu_ioctl_set_entitlement(struct kvm_vcpu *vcpu, long entitlement)
+{
+	vcpu->arch.consigned_limit = entitlement;
+	return 0;
+}
+
 int kvm_arch_vcpu_ioctl_get_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu)
 {
 	struct i387_fxsave_struct *fxsave =
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index 0e2212f..de13648 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -590,6 +590,8 @@ void kvm_arch_hardware_unsetup(void);
 void kvm_arch_check_processor_compat(void *rtn);
 int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu);
 int kvm_arch_vcpu_should_kick(struct kvm_vcpu *vcpu);
+int kvm_arch_vcpu_ioctl_set_entitlement(struct kvm_vcpu *vcpu,
+					long entitlement);
 
 void kvm_free_physmem(struct kvm *kvm);
 
diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h
index 0a6d6ba..86f24bb 100644
--- a/include/uapi/linux/kvm.h
+++ b/include/uapi/linux/kvm.h
@@ -921,6 +921,8 @@ struct kvm_s390_ucas_mapping {
 #define KVM_SET_ONE_REG		  _IOW(KVMIO,  0xac, struct kvm_one_reg)
 /* VM is being stopped by host */
 #define KVM_KVMCLOCK_CTRL	  _IO(KVMIO,   0xad)
+/* Set the consignment limit which will be used to separete steal time */
+#define KVM_SET_ENTITLEMENT	  _IOW(KVMIO, 0xae, unsigned long)
 
 #define KVM_DEV_ASSIGN_ENABLE_IOMMU	(1 << 0)
 #define KVM_DEV_ASSIGN_PCI_2_3		(1 << 1)
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index be70035..c712fe5 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -2062,6 +2062,13 @@ out_free2:
 		r = 0;
 		break;
 	}
+	case KVM_SET_ENTITLEMENT: {
+		r = kvm_arch_vcpu_ioctl_set_entitlement(vcpu, arg);
+		if (r)
+			goto out;
+		r = 0;
+		break;
+	}
 	default:
 		r = kvm_arch_vcpu_ioctl(filp, ioctl, arg);
 	}


  parent reply	other threads:[~2012-11-26 20:37 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-26 20:36 [PATCH 0/5] Alter steal time reporting in KVM Michael Wolf
2012-11-26 20:36 ` [PATCH 1/5] Alter the amount of steal time reported by the guest Michael Wolf
2012-11-26 20:36 ` [PATCH 2/5] Expand the steal time msr to also contain the consigned time Michael Wolf
2012-11-27 21:03   ` Konrad Rzeszutek Wilk
2012-11-28 15:23     ` Michael Wolf
2012-11-26 20:36 ` [PATCH 3/5] Add the code to send the consigned time from the host to the guest Michael Wolf
2012-11-26 20:37 ` [PATCH 4/5] Add a timer to allow the separation of consigned from steal time Michael Wolf
2012-11-26 20:37 ` Michael Wolf [this message]
2012-11-27  8:48 ` [PATCH 0/5] Alter steal time reporting in KVM Glauber Costa
2012-11-27 15:10   ` Michael Wolf
2012-11-28  8:45     ` Glauber Costa
2012-11-28 18:44       ` Michael Wolf
2012-11-28 19:16   ` Anthony Liguori
2012-11-27 23:24 ` Marcelo Tosatti
2012-11-28  0:32   ` Marcelo Tosatti
2012-11-28 18:43   ` Michael Wolf
2012-11-28 20:55     ` Glauber Costa
2012-11-29 17:43       ` Michael Wolf
2012-12-05 12:46         ` Glauber Costa
2012-12-07 15:50           ` Michael Wolf
  -- strict thread matches above, loose matches on Subject: below --
2012-11-26 21:05 [PATCH 0/5] Alter stealtime " Michael Wolf
2012-11-26 21:06 ` [PATCH 5/5] Add an ioctl to communicate the consign limit to the host Michael Wolf
2012-11-27  6:35   ` Gleb Natapov
2012-11-27 14:29     ` Michael Wolf

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=20121126203717.28840.77239.stgit@lambeau \
    --to=mjw@linux.vnet.ibm.com \
    --cc=glommer@parallels.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=mtosatti@redhat.com \
    --cc=peterz@infradead.org \
    --cc=riel@redhat.com \
    /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: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).