public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: kvm-devel <kvm@vger.kernel.org>
Subject: Re: BUG with Win7 and user-return-notifier
Date: Thu, 29 Oct 2009 18:05:24 +0200	[thread overview]
Message-ID: <4AE9BD44.4080708@redhat.com> (raw)
In-Reply-To: <4AE9B8AE.1000008@siemens.com>

On 10/29/2009 05:45 PM, Jan Kiszka wrote:
>
>> static int vmx_vcpu_setup(struct vcpu_vmx *vmx)
>> {
>> ...
>> 	for (i = 0; i<  NR_VMX_MSR; ++i) {
>> 		u32 index = vmx_msr_index[i];
>> 		u32 data_low, data_high;
>> 		u64 data;
>> 		int j = vmx->nmsrs;
>>
>> 		if (rdmsr_safe(index,&data_low,&data_high)<  0)
>> 			continue;
>> 		if (wrmsr_safe(index, data_low, data_high)<  0)
>> 			continue;
>> 		data = data_low | ((u64)data_high<<  32);
>> 		vmx->guest_msrs[j].index = i;
>> 		vmx->guest_msrs[j].data = 0;
>>      
>                                          ^^^^^
> Local 'data' drops on the floor. Is that correct (then it deserves a
> cleanup)? Previous version did a "guest = host".
>    

Arguably, it's more correct than what we used to have.  This code dates 
back to the day when kvm started in 64-bit mode and so we copied 
important MSRs from the host.

Shouldn't matter for our case.

>> static void vmx_set_efer(struct kvm_vcpu *vcpu, u64 efer)
>> {
>> 	struct vcpu_vmx *vmx = to_vmx(vcpu);
>> 	struct shared_msr_entry *msr = find_msr_entry(vmx, MSR_EFER);
>>
>> 	if (!msr)
>> 		return;
>> 	vcpu->arch.shadow_efer = efer;
>> 	if (!msr)
>> 		return;
>>      
> One "if (!msr)" too much - really the second one?
>    

Yes.  (Either really - if there is no host EFER, the only legal value 
for efer is 0, so whether we update it or not doesn't matter).

Likely introduced by a bad merge.  How code rots.

-- 
error compiling committee.c: too many arguments to function


  reply	other threads:[~2009-10-29 16:05 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-27 12:52 BUG with Win7 and user-return-notifier Jan Kiszka
2009-10-27 13:11 ` Avi Kivity
2009-10-27 13:13   ` Jan Kiszka
2009-10-27 13:24     ` Avi Kivity
2009-10-27 13:25       ` Avi Kivity
2009-10-28  8:18         ` Avi Kivity
2009-10-28 14:01           ` Jan Kiszka
2009-10-28 16:00             ` Avi Kivity
2009-10-28 19:55               ` Jan Kiszka
     [not found]               ` <4AE8AC20.50506@web.de>
2009-10-29  7:37                 ` Avi Kivity
2009-10-29  8:03                   ` Jan Kiszka
2009-10-29  8:06                     ` Jan Kiszka
2009-10-29  8:07                     ` Avi Kivity
2009-10-29  8:32                       ` Jan Kiszka
2009-10-29 15:45                         ` Jan Kiszka
2009-10-29 16:05                           ` Avi Kivity [this message]
2009-10-29 16:07                   ` Jan Kiszka
2009-10-29 16:14                     ` Jan Kiszka
2009-10-29 16:52                       ` Avi Kivity
2009-10-29 16:49                     ` 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=4AE9BD44.4080708@redhat.com \
    --to=avi@redhat.com \
    --cc=jan.kiszka@siemens.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