All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
To: Ingo Molnar <mingo-X9Un+BFzKDI@public.gmane.org>
Cc: kvm-devel <kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
Subject: Re: [patch] KVM: add MSR based hypercall API
Date: Tue, 09 Jan 2007 13:24:42 +0200	[thread overview]
Message-ID: <45A37B7A.8020709@qumranet.com> (raw)
In-Reply-To: <20070109103809.GA24515-X9Un+BFzKDI@public.gmane.org>

Ingo Molnar wrote:
> * Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org> wrote:
>
>   
>>> @@ -237,6 +238,8 @@ struct kvm_vcpu {
>>> 	unsigned long cr0;
>>> 	unsigned long cr2;
>>> 	unsigned long cr3;
>>> +	struct kvm_vcpu_para_state *para_state;
>>>  
>>>       
>> Do we want this as part of kvm_vcpu or kvm?  I can see arguments for 
>> both views.
>>     
>
> definitely needs to be a property of the vcpu. For example the cr3 cache 
> is attached to the physical CPU. SMP scalability necessiates this too - 
> we want to use the para_state to pass information between the guest and 
> the host without any hypercall.
>
>   

Ok, agreed.

It makes guest-side registration a bit more icky (need execute the code 
on all vcpus).

>>> +struct kvm_cr3_cache {
>>> +	struct kvm_cr3_cache_entry entry[KVM_CR3_CACHE_SIZE];
>>> +	u32 max_idx;
>>> +};
>>>  
>>>       
>> This will require an api version bump whenever KVM_CR3_CACHE_SIZE 
>> changes.
>>
>> Better to advertise the gpa of the cache, so it can be unlimited.
>>     
>
> the gpa of the cache, and its guest-side size, right?
>
>   

Yes (can use max_idx, no?).

BTW, max_idx is ambiguous: is it the last valid entry or one past the 
end?  entry_count is more explicit IMO.

>>> +
>>> +	struct kvm_cr3_cache cr3_cache;
>>> +
>>> +} __attribute__ ((aligned(PAGE_SIZE)));
>>>  
>>>       
>> Perhaps packed too, to avoid 32/64 ambiguity.  Or even better, pad it 
>> explicitly to avoid unaligned fields.
>>     
>
> it should already be padded - i layed it out that way. (if it's not then 
> let me know where it's not padded)
>
>   

Right, I was confused by the cr3 cache, but it's the last field.

> +
> +	if (kvm_arch_ops->patch_hypercall) {
>   

It's safe to assume that the arch op exists.

> +EXPORT_SYMBOL_GPL(gpa_to_hpa);
>   

Is this needed now?  If so, it needs a kvm_ prefix.

> @@ -1448,6 +1448,17 @@ static int handle_io(struct kvm_vcpu *vc
>  	return 0;
>  }
>  
> +static void
> +vmx_patch_hypercall(struct kvm_vcpu *vcpu, unsigned char *hypercall)
> +{
> +	/*
> +	 * Patch in the VMCALL instruction:
> +	 */
> +	hypercall[0] = 0x0f;
> +	hypercall[1] = 0x01;
> +	hypercall[2] = 0xc1;
> +}
> +
>  static int handle_cr(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
>  {
>  	u64 exit_qualification;
> @@ -2042,6 +2053,7 @@ static struct kvm_arch_ops vmx_arch_ops 
>  	.run = vmx_vcpu_run,
>  	.skip_emulated_instruction = skip_emulated_instruction,
>  	.vcpu_setup = vmx_vcpu_setup,
> +	.patch_hypercall = vmx_patch_hypercall,
>  };
>   
Where is the vmcall exit handler?

Please add the svm code too.  I can test it if you lack amd hardware.

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


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

  parent reply	other threads:[~2007-01-09 11:24 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-09  9:27 [patch] KVM: add MSR based hypercall API Ingo Molnar
     [not found] ` <20070109092705.GA8300-X9Un+BFzKDI@public.gmane.org>
2007-01-09  9:58   ` Avi Kivity
     [not found]     ` <45A36758.1000808-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-01-09 10:38       ` Ingo Molnar
     [not found]         ` <20070109103809.GA24515-X9Un+BFzKDI@public.gmane.org>
2007-01-09 11:24           ` Avi Kivity [this message]
     [not found]             ` <45A37B7A.8020709-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-01-09 11:36               ` Ingo Molnar
     [not found]                 ` <20070109113628.GA4421-X9Un+BFzKDI@public.gmane.org>
2007-01-09 12:54                   ` Avi Kivity
     [not found]                     ` <45A39095.80005-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-01-09 13:17                       ` Ingo Molnar
     [not found]                         ` <20070109131733.GA28431-X9Un+BFzKDI@public.gmane.org>
2007-01-09 13:30                           ` Ingo Molnar
2007-01-09 13:41                           ` Avi Kivity
     [not found]                             ` <45A39B90.6070908-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-01-09 13:53                               ` Ingo Molnar
     [not found]                                 ` <20070109135318.GA3084-X9Un+BFzKDI@public.gmane.org>
2007-01-09 14:08                                   ` Avi Kivity
     [not found]                                     ` <45A3A1C6.201-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-01-09 14:22                                       ` Ingo Molnar
     [not found]                                         ` <20070109142203.GA6645-X9Un+BFzKDI@public.gmane.org>
2007-01-09 14:35                                           ` Avi Kivity
     [not found]                                             ` <45A3A816.6010308-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-01-09 14:38                                               ` Ingo Molnar
     [not found]                                                 ` <20070109143832.GA10735-X9Un+BFzKDI@public.gmane.org>
2007-01-09 14:44                                                   ` Ingo Molnar
     [not found]                                                     ` <20070109144434.GA12152-X9Un+BFzKDI@public.gmane.org>
2007-01-09 14:50                                                       ` Avi Kivity
     [not found]                                                         ` <45A3ABAF.90208-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-01-09 15:04                                                           ` Ingo Molnar
     [not found]                                                             ` <20070109150424.GA16535-X9Un+BFzKDI@public.gmane.org>
2007-01-09 16:20                                                               ` [patchset] KVM: paravirt/hypercall queue Ingo Molnar
     [not found]                                                                 ` <20070109162028.GA764-X9Un+BFzKDI@public.gmane.org>
2007-01-09 16:23                                                                   ` Ingo Molnar

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=45A37B7A.8020709@qumranet.com \
    --to=avi-atkuwr5tajbwk0htik3j/w@public.gmane.org \
    --cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=mingo-X9Un+BFzKDI@public.gmane.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 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.