All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Gleb Natapov <gleb@redhat.com>
Cc: mtosatti@redhat.com, kvm@vger.kernel.org
Subject: Re: [PATCHv2 2/4] Implement bare minimum of HYPER-V MSRs.
Date: Sun, 17 Jan 2010 14:49:30 +0200	[thread overview]
Message-ID: <4B53075A.4020209@redhat.com> (raw)
In-Reply-To: <20100117124433.GD31692@redhat.com>

On 01/17/2010 02:44 PM, Gleb Natapov wrote:
> On Sun, Jan 17, 2010 at 02:10:45PM +0200, Avi Kivity wrote:
>    
>> On 01/17/2010 11:03 AM, Gleb Natapov wrote:
>>      
>>> Minimum HYPER-V implementation should have GUEST_OS_ID, HYPERCALL and
>>> VP_INDEX MSRs.
>>>
>>>
>>>   TRACE_EVENT(kvm_pio,
>>> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
>>> index 4d835b6..db0b2b1 100644
>>> --- a/arch/x86/kvm/x86.c
>>> +++ b/arch/x86/kvm/x86.c
>>> @@ -630,7 +630,8 @@ static u32 msrs_to_save[] = {
>>>   #ifdef CONFIG_X86_64
>>>   	MSR_CSTAR, MSR_KERNEL_GS_BASE, MSR_SYSCALL_MASK, MSR_LSTAR,
>>>   #endif
>>> -	MSR_IA32_TSC, MSR_IA32_PERF_STATUS, MSR_IA32_CR_PAT, MSR_VM_HSAVE_PA
>>> +	MSR_IA32_TSC, MSR_IA32_PERF_STATUS, MSR_IA32_CR_PAT, MSR_VM_HSAVE_PA,
>>> +	HV_X64_MSR_GUEST_OS_ID, HV_X64_MSR_HYPERCALL,
>>>   };
>>>        
>> These will be disabled since the msrs don't exist on the host.  See
>> the comment above and KVM_SAVE_MSRS_BEGIN.
>>
>>      
> I see. Why not have two arrays?
>    

Clearly better.

>>> +	case HV_X64_MSR_HYPERCALL: {
>>> +		u64 gfn;
>>> +		unsigned long addr;
>>> +		/* if guest os id is not set hypercall should remain disabled */
>>> +		if (!kvm->arch.hv_guest_os_id&&   data)
>>> +			break;
>>> +		kvm->arch.hv_hypercall = data;
>>> +		if (!kvm_hv_hypercall_enabled(kvm))
>>> +			break;
>>> +		gfn = kvm->arch.hv_hypercall>>
>>> +			HV_X64_MSR_HYPERCALL_PAGE_ADDRESS_SHIFT;
>>> +		addr = gfn_to_hva(kvm, gfn);
>>> +		if (kvm_is_error_hva(addr))
>>> +			return 1;
>>>        
>> Should di the error check before assigning, perhaps.
>>
>>      
> Spec doesn't tell. And guest will get #GP and BSOD anyway.
>    

Well, all msrs I know of either #GP, or store the value and do what 
they're supposed to do, never both.


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


  reply	other threads:[~2010-01-17 12:49 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-17  9:03 [PATCHv2 0/4] Add support for some HYPER-V PV features Gleb Natapov
2010-01-17  9:03 ` [PATCHv2 1/4] Add HYPE-V header file Gleb Natapov
2010-01-17  9:03 ` [PATCHv2 2/4] Implement bare minimum of HYPER-V MSRs Gleb Natapov
2010-01-17 12:10   ` Avi Kivity
2010-01-17 12:44     ` Gleb Natapov
2010-01-17 12:49       ` Avi Kivity [this message]
2010-01-17 12:51         ` Gleb Natapov
2010-01-17  9:03 ` [PATCHv2 3/4] Add HYPER-V apic access MSRs Gleb Natapov
2010-01-17 12:20   ` Avi Kivity
2010-01-17 12:32     ` Christoph Hellwig
2010-01-17 12:41       ` Gleb Natapov
2010-01-17 12:44         ` Christoph Hellwig
2010-01-17 12:46           ` Gleb Natapov
2010-01-17 12:48             ` Avi Kivity
2010-01-17 12:34     ` Vadim Rozenfeld
2010-01-17 12:36     ` Gleb Natapov
2010-01-17 12:46       ` Avi Kivity
2010-01-17 12:50         ` Gleb Natapov
2010-01-17 12:53           ` Avi Kivity
2010-01-17  9:03 ` [PATCHv2 4/4] Implement NotifyLongSpinWait HYPER-V hypercall Gleb Natapov
2010-01-17 12:22   ` 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=4B53075A.4020209@redhat.com \
    --to=avi@redhat.com \
    --cc=gleb@redhat.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 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.