From: Avi Kivity <avi@qumranet.com>
To: Jeff Dike <jdike@addtoit.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
KVM devel <kvm-devel@lists.sourceforge.net>
Subject: Re: [PATCH 1/3] KVM - Add missing kvm_run initializations
Date: Tue, 17 Jul 2007 11:12:53 +0300 [thread overview]
Message-ID: <469C7A05.2070205@qumranet.com> (raw)
In-Reply-To: <20070716192446.GA16243@c2.user-mode-linux.org>
Jeff Dike wrote:
> There are a bunch of missing initializations of run->exit_reason and
> associated data.
>
> kvm_hypercall wasn't setting exit_reason at all.
>
> When exit_reason is KVM_EXIT_MMIO, the mmio data isn't initialized. I
> don't know what it should be, so I just stuck a FIXME in there.
>
> There were some missing initializations of hardware_exit_reason with
> KVM_EXIT_UNKNOWN, so I added those. One case had exit_reason = 0,
> which I changed to KVM_EXIT_UNKNOWN.
>
> I did a pass over all of the return 0 paths in the exit handler
> callbacks, so this should cover everything.
>
> Signed-off-by: Jeff Dike <jdike@linux.intel.com>
> --
> drivers/kvm/kvm_main.c | 3 +++
> drivers/kvm/svm.c | 3 +++
> drivers/kvm/vmx.c | 4 +++-
> 3 files changed, 9 insertions(+), 1 deletion(-)
>
> Index: kvm/drivers/kvm/kvm_main.c
> ===================================================================
> --- kvm.orig/drivers/kvm/kvm_main.c
> +++ kvm/drivers/kvm/kvm_main.c
> @@ -1370,6 +1370,7 @@ int kvm_hypercall(struct kvm_vcpu *vcpu,
> run->hypercall.ret = ret;
> run->hypercall.longmode = is_long_mode(vcpu);
> kvm_arch_ops->decache_regs(vcpu);
> + run->exit_reason = KVM_EXIT_HYPERCALL;
> return 0;
> }
>
Aye. (And: aiiieee)
> vcpu->regs[VCPU_REGS_RAX] = ret;
> @@ -1928,6 +1929,8 @@ static int kvm_vcpu_ioctl_run(struct kvm
> if (r == EMULATE_DO_MMIO) {
> /*
> * Read-modify-write. Back to userspace.
> + *
> + * FIXME - kvm_run->mmio not initialized
> */
> kvm_run->exit_reason = KVM_EXIT_MMIO;
> r = 0;
>
I believe that emulate_instruction will set run->mmio if it returns
EMULATE_DO_MMIO.
> Index: kvm/drivers/kvm/svm.c
> ===================================================================
> --- kvm.orig/drivers/kvm/svm.c
> +++ kvm/drivers/kvm/svm.c
> @@ -929,6 +929,7 @@ static int pf_interception(struct kvm_vc
> return 1;
> case EMULATE_DO_MMIO:
> ++vcpu->stat.mmio_exits;
> + /* FIXME - kvm_run->mmio not initialized */
> kvm_run->exit_reason = KVM_EXIT_MMIO;
>
Ditto.
The rest are all good.
--
error compiling committee.c: too many arguments to function
WARNING: multiple messages have this Message-ID (diff)
From: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
To: Jeff Dike <jdike-OPE4K8JWMJJBDgjK7y7TUQ@public.gmane.org>
Cc: KVM devel
<kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>,
LKML <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH 1/3] KVM - Add missing kvm_run initializations
Date: Tue, 17 Jul 2007 11:12:53 +0300 [thread overview]
Message-ID: <469C7A05.2070205@qumranet.com> (raw)
In-Reply-To: <20070716192446.GA16243-1LLyehjZOUUZWFFyALql+T+iFHGzDt/a@public.gmane.org>
Jeff Dike wrote:
> There are a bunch of missing initializations of run->exit_reason and
> associated data.
>
> kvm_hypercall wasn't setting exit_reason at all.
>
> When exit_reason is KVM_EXIT_MMIO, the mmio data isn't initialized. I
> don't know what it should be, so I just stuck a FIXME in there.
>
> There were some missing initializations of hardware_exit_reason with
> KVM_EXIT_UNKNOWN, so I added those. One case had exit_reason = 0,
> which I changed to KVM_EXIT_UNKNOWN.
>
> I did a pass over all of the return 0 paths in the exit handler
> callbacks, so this should cover everything.
>
> Signed-off-by: Jeff Dike <jdike-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
> --
> drivers/kvm/kvm_main.c | 3 +++
> drivers/kvm/svm.c | 3 +++
> drivers/kvm/vmx.c | 4 +++-
> 3 files changed, 9 insertions(+), 1 deletion(-)
>
> Index: kvm/drivers/kvm/kvm_main.c
> ===================================================================
> --- kvm.orig/drivers/kvm/kvm_main.c
> +++ kvm/drivers/kvm/kvm_main.c
> @@ -1370,6 +1370,7 @@ int kvm_hypercall(struct kvm_vcpu *vcpu,
> run->hypercall.ret = ret;
> run->hypercall.longmode = is_long_mode(vcpu);
> kvm_arch_ops->decache_regs(vcpu);
> + run->exit_reason = KVM_EXIT_HYPERCALL;
> return 0;
> }
>
Aye. (And: aiiieee)
> vcpu->regs[VCPU_REGS_RAX] = ret;
> @@ -1928,6 +1929,8 @@ static int kvm_vcpu_ioctl_run(struct kvm
> if (r == EMULATE_DO_MMIO) {
> /*
> * Read-modify-write. Back to userspace.
> + *
> + * FIXME - kvm_run->mmio not initialized
> */
> kvm_run->exit_reason = KVM_EXIT_MMIO;
> r = 0;
>
I believe that emulate_instruction will set run->mmio if it returns
EMULATE_DO_MMIO.
> Index: kvm/drivers/kvm/svm.c
> ===================================================================
> --- kvm.orig/drivers/kvm/svm.c
> +++ kvm/drivers/kvm/svm.c
> @@ -929,6 +929,7 @@ static int pf_interception(struct kvm_vc
> return 1;
> case EMULATE_DO_MMIO:
> ++vcpu->stat.mmio_exits;
> + /* FIXME - kvm_run->mmio not initialized */
> kvm_run->exit_reason = KVM_EXIT_MMIO;
>
Ditto.
The rest are all good.
--
error compiling committee.c: too many arguments to function
-------------------------------------------------------------------------
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/
next prev parent reply other threads:[~2007-07-17 8:13 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-16 19:24 [PATCH 1/3] KVM - Add missing kvm_run initializations Jeff Dike
2007-07-16 19:24 ` Jeff Dike
2007-07-17 8:12 ` Avi Kivity [this message]
2007-07-17 8:12 ` Avi Kivity
2007-07-17 16:26 ` Jeff Dike
2007-07-18 10:39 ` Avi Kivity
2007-07-18 10:39 ` Avi Kivity
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=469C7A05.2070205@qumranet.com \
--to=avi@qumranet.com \
--cc=jdike@addtoit.com \
--cc=kvm-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.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: link
Be 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.