From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: [PATCH 3/3] KVM - add hypercall nr to kvm_run Date: Tue, 17 Jul 2007 09:15:51 -0500 Message-ID: <469CCF17.3020709@codemonkey.ws> References: <20070716192447.GA16253@c2.user-mode-linux.org> <469C7C8D.1020600@qumranet.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: KVM devel , Jeff Dike , LKML To: Avi Kivity Return-path: In-Reply-To: <469C7C8D.1020600-atKUWr5tajBWk0Htik3J/w@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org Avi Kivity wrote: > Jeff Dike wrote: > >> Add the hypercall number to kvm_run and initialize it. This might be >> considered API-changing, so I kept it separate. >> >> Signed-off-by: Jeff Dike >> -- >> drivers/kvm/kvm_main.c | 1 + >> include/linux/kvm.h | 1 + >> 2 files changed, 2 insertions(+) >> >> Index: kvm/drivers/kvm/kvm_main.c >> =================================================================== >> --- kvm.orig/drivers/kvm/kvm_main.c >> +++ kvm/drivers/kvm/kvm_main.c >> @@ -1361,6 +1361,7 @@ int kvm_hypercall(struct kvm_vcpu *vcpu, >> } >> switch (nr) { >> default: >> + run->hypercall.nr = nr; >> run->hypercall.args[0] = a0; >> run->hypercall.args[1] = a1; >> run->hypercall.args[2] = a2; >> Index: kvm/include/linux/kvm.h >> =================================================================== >> --- kvm.orig/include/linux/kvm.h >> +++ kvm/include/linux/kvm.h >> @@ -106,6 +106,7 @@ struct kvm_run { >> } mmio; >> /* KVM_EXIT_HYPERCALL */ >> struct { >> + __u64 nr; >> __u64 args[6]; >> __u64 ret; >> __u32 longmode; >> >> > > It isn't API changing as the API could not be (and has not been) used. > We do need to add a padding element to the union to make sure additional > union members don't cause its size to change. > > Quite sad that we got this far with such brokenness. > I'm planning on breaking this interface again since the new hypercall API only takes 4 arguments instead of 6. Regards, Anthony Liguori ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/