From: Gleb Natapov <gleb@redhat.com>
To: Avi Kivity <avi@redhat.com>
Cc: Jan Kiszka <jan.kiszka@siemens.com>,
mtosatti@redhat.com, kvm@vger.kernel.org
Subject: Re: [PATCHv3 0/4] Add support for some HYPER-V PV features
Date: Tue, 19 Jan 2010 15:06:38 +0200 [thread overview]
Message-ID: <20100119130638.GO14345@redhat.com> (raw)
In-Reply-To: <4B55AB48.60900@redhat.com>
On Tue, Jan 19, 2010 at 02:53:28PM +0200, Avi Kivity wrote:
> On 01/19/2010 02:50 PM, Gleb Natapov wrote:
> >
> >This should fix it:
>
> Unrelated, but important:
>
> >diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> >index 47c6e23..147bda7 100644
> >--- a/arch/x86/kvm/x86.c
> >+++ b/arch/x86/kvm/x86.c
> >@@ -3807,11 +3807,11 @@ int kvm_hv_hypercall(struct kvm_vcpu *vcpu)
> > longmode = is_long_mode(vcpu)&& cs_l == 1;
> >
> > if (!longmode) {
> >- param = (kvm_register_read(vcpu, VCPU_REGS_RDX)<< 32) |
> >+ param = ((u64)kvm_register_read(vcpu, VCPU_REGS_RDX)<< 32) |
> > (kvm_register_read(vcpu, VCPU_REGS_RAX)& 0xffffff);
>
> This seems to be written for a 24-bit machine...
>
I have plenty of those around.
---
Fix compilation warnings and wrong mask value.
Signed-off-by: Gleb Natapov<gleb@redhat.com>
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 47c6e23..a311751 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -3807,12 +3807,12 @@ int kvm_hv_hypercall(struct kvm_vcpu *vcpu)
longmode = is_long_mode(vcpu) && cs_l == 1;
if (!longmode) {
- param = (kvm_register_read(vcpu, VCPU_REGS_RDX) << 32) |
- (kvm_register_read(vcpu, VCPU_REGS_RAX) & 0xffffff);
- ingpa = (kvm_register_read(vcpu, VCPU_REGS_RBX) << 32) |
- (kvm_register_read(vcpu, VCPU_REGS_RCX) & 0xffffff);
- outgpa = (kvm_register_read(vcpu, VCPU_REGS_RDI) << 32) |
- (kvm_register_read(vcpu, VCPU_REGS_RSI) & 0xffffff);
+ param = ((u64)kvm_register_read(vcpu, VCPU_REGS_RDX) << 32) |
+ (kvm_register_read(vcpu, VCPU_REGS_RAX) & 0xffffffff);
+ ingpa = ((u64)kvm_register_read(vcpu, VCPU_REGS_RBX) << 32) |
+ (kvm_register_read(vcpu, VCPU_REGS_RCX) & 0xffffffff);
+ outgpa = ((u64)kvm_register_read(vcpu, VCPU_REGS_RDI) << 32) |
+ (kvm_register_read(vcpu, VCPU_REGS_RSI) & 0xffffffff);
}
#ifdef CONFIG_X86_64
else {
--
Gleb.
next prev parent reply other threads:[~2010-01-19 13:06 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-17 13:51 [PATCHv3 0/4] Add support for some HYPER-V PV features Gleb Natapov
2010-01-17 13:51 ` [PATCHv3 1/4] Add HYPER-V header file Gleb Natapov
2010-01-17 13:51 ` [PATCHv3 2/4] Implement bare minimum of HYPER-V MSRs Gleb Natapov
2010-01-17 13:51 ` [PATCHv3 3/4] Add HYPER-V apic access MSRs Gleb Natapov
2010-01-17 13:51 ` [PATCHv3 4/4] Implement NotifyLongSpinWait HYPER-V hypercall Gleb Natapov
2010-01-17 13:59 ` [PATCHv3 0/4] Add support for some HYPER-V PV features Avi Kivity
2010-01-19 11:41 ` Jan Kiszka
2010-01-19 12:50 ` Gleb Natapov
2010-01-19 12:53 ` Avi Kivity
2010-01-19 13:06 ` Gleb Natapov [this message]
2010-01-19 14:54 ` 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=20100119130638.GO14345@redhat.com \
--to=gleb@redhat.com \
--cc=avi@redhat.com \
--cc=jan.kiszka@siemens.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@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