From: Andre Przywara <andre.przywara@amd.com>
To: Alexander Graf <agraf@suse.de>
Cc: Avi Kivity <avi@redhat.com>, kvm-devel list <kvm@vger.kernel.org>
Subject: Re: [PATCH] svm: implement NEXTRIPsave SVM feature
Date: Sun, 11 Apr 2010 23:51:52 +0200 [thread overview]
Message-ID: <4BC24478.5060803@amd.com> (raw)
In-Reply-To: <B34A41EC-F20D-47D5-B565-9B3FD9775C90@suse.de>
Alexander Graf wrote:
> On 11.04.2010, at 23:40, Alexander Graf wrote:
>
>> /* Either adds offset n to the instruction counter or takes the next
>> instruction pointer from the vmcb if the CPU supports it */
>>
>> static u64 svm_next_rip(struct kvm_vcpu *vcpu, int add)
>> {
>> if (svm->vmcb->control.next_rip != 0)
>
> In fact, that if should probably be:
>
> if (svm_has(SVM_FEATURE_NRIP))
This is not sufficient. The next RIP is only provided for some
intercepts (namely instruction intercepts), so one would need to check
the validity of this field anyway. By definition reserved VMCB fields
are 0, and as 0 is never a valid _next_ RIP, this is a quick and correct
check.
Regards,
Andre.
P.S. I don't have a strong opinion about your proposed refactoring, if
Avi agrees I will rework it. I only found the current fix small and
easy, and the mentioned patch for older CPUs removed the add line
anyway, so the concerns you rose did not apply to the original version
of the patch.
--
Andre Przywara
AMD-Operating System Research Center (OSRC), Dresden, Germany
Tel: +49 351 488-3567-12
next prev parent reply other threads:[~2010-04-11 21:52 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-11 21:07 [PATCH] svm: implement NEXTRIPsave SVM feature Andre Przywara
2010-04-11 21:40 ` Alexander Graf
2010-04-11 21:43 ` Alexander Graf
2010-04-11 21:51 ` Andre Przywara [this message]
2010-04-11 21:57 ` Alexander Graf
2010-04-11 22:13 ` Andre Przywara
2010-04-11 22:18 ` Alexander Graf
2010-04-12 10:20 ` Avi Kivity
2010-04-12 10:29 ` Alexander Graf
2010-04-12 10:34 ` Avi Kivity
2010-04-13 16:31 ` Marcelo Tosatti
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=4BC24478.5060803@amd.com \
--to=andre.przywara@amd.com \
--cc=agraf@suse.de \
--cc=avi@redhat.com \
--cc=kvm@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox