public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Gleb Natapov <gleb@redhat.com>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH 2/3] Add HYPER-V apic access MSRs.
Date: Wed, 13 Jan 2010 16:57:50 +0200	[thread overview]
Message-ID: <4B4DDF6E.7030103@redhat.com> (raw)
In-Reply-To: <20100113144059.GC7549@redhat.com>

On 01/13/2010 04:40 PM, Gleb Natapov wrote:
>
>>> +int kvm_hv_vapic_msr_read(struct kvm_vcpu *vcpu, u32 msr, u64 *data)
>>> +{
>>> +	struct kvm_lapic *apic = vcpu->arch.apic;
>>> +	u32 reg = kvm_hv_vapic_msr2reg(msr), low, high = 0;
>>> +
>>> +	if (!irqchip_in_kernel(vcpu->kvm))
>>> +		return 1;
>>> +
>>> +	if (apic_reg_read(apic, reg, 4,&low))
>>> +		return 1;
>>> +	if (reg == APIC_ICR)
>>> +		apic_reg_read(apic, APIC_ICR2, 4,&high);
>>> +
>>> +	*data = (((u64)high)<<   32) | low;
>>> +
>>> +	return 0;
>>> +}
>>>        
>> I think it's cleaner to put all this into the (set_msr and get_msr).
>> You're just converting register numbers back and forth, while they
>> are known at the call site.
>>
>>      
> I thought about it. It will bring apic internals into x86.c. If you are
> OK with that I'll do it like you say.
>    

I think it's better than that tangle.
>> Space after if.
>>      
> Forgot about checkpatch again :(
>
>    

Should be hardwired into your neurons by now...

>>> +		addr = gfn_to_hva(vcpu->kvm, data>>
>>> +				  HV_X64_MSR_APIC_ASSIST_PAGE_ADDRESS_SHIFT);
>>> +		if (kvm_is_error_hva(addr))
>>> +			return 1;
>>>        
>> But the spec actually permits addresses outside RAM?
>>      
> Is says "in GPA space". Not sure how to interpret it. The guest I run
> uses address in real RAM.
>    

My interpretation is that it can be anywhere.  But that will be 
difficult, let's stick with this and hope we don't run into trouble.

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


  reply	other threads:[~2010-01-13 14:57 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-13 13:59 [PATCH 0/3] Add support for some HYPER-V PV features Gleb Natapov
2010-01-13 13:59 ` [PATCH 1/3] Implement bare minimum of HYPER-V MSRs Gleb Natapov
2010-01-13 14:21   ` Avi Kivity
2010-01-13 14:26     ` Gleb Natapov
2010-01-13 14:28       ` Avi Kivity
2010-01-13 14:31         ` Gleb Natapov
2010-01-13 13:59 ` [PATCH 2/3] Add HYPER-V apic access MSRs Gleb Natapov
2010-01-13 14:27   ` Anthony Liguori
2010-01-13 14:30     ` Gleb Natapov
2010-01-13 14:27   ` Avi Kivity
2010-01-13 14:40     ` Gleb Natapov
2010-01-13 14:57       ` Avi Kivity [this message]
2010-01-13 13:59 ` [PATCH 3/3] Implement NotifyLongSpinWait HYPER-V hypercall Gleb Natapov

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=4B4DDF6E.7030103@redhat.com \
    --to=avi@redhat.com \
    --cc=gleb@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