public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/4] [HYPERCALL] Enable userspace too include kvm_para.
@ 2007-08-24 23:58 Dor Laor
       [not found] ` <64F9B87B6B770947A9F8391472E032160D59004D-yEcIvxbTEBqsx+V+t5oei8rau4O3wl8o3fe8/T/H7NteoWH0uzbU5w@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Dor Laor @ 2007-08-24 23:58 UTC (permalink / raw)
  To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Since some hypercalls can be handled in userspace, it needs
to include kvm_para too. Chande kernel types into user and
add includes for them and for page_size.

Signed-off-by: Dor Laor <dor.laor-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
---
 include/linux/kvm_para.h |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/include/linux/kvm_para.h b/include/linux/kvm_para.h
index 3b29256..754e29d 100644
--- a/include/linux/kvm_para.h
+++ b/include/linux/kvm_para.h
@@ -8,6 +8,9 @@
  *       as we make progress.
  */
 
+#include <asm/types.h>
+#include <asm/page.h>
+
 /*
  * Per-VCPU descriptor area shared between guest and host. Writable to
  * both guest and host. Registered with the host by the guest when
@@ -25,17 +28,17 @@ struct kvm_vcpu_para_state {
 	 * is supposed to work - new host versions will support all old
 	 * guest API versions.
 	 */
-	u32 guest_version;
-	u32 host_version;
-	u32 size;
-	u32 ret;
+	__u32 guest_version;
+	__u32 host_version;
+	__u32 size;
+	__u32 ret;
 
 	/*
 	 * The address of the vm exit instruction (VMCALL or VMMCALL),
 	 * which the host will patch according to the CPU model the
 	 * VM runs on:
 	 */
-	u64 hypercall_gpa;
+	__u64 hypercall_gpa;
 
 } __attribute__ ((aligned(PAGE_SIZE)));


-----
In simplicity there is elegance.
Dor Laor ;)


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/4] [HYPERCALL] Enable userspace too include kvm_para.
       [not found] ` <64F9B87B6B770947A9F8391472E032160D59004D-yEcIvxbTEBqsx+V+t5oei8rau4O3wl8o3fe8/T/H7NteoWH0uzbU5w@public.gmane.org>
@ 2007-08-25  8:10   ` Avi Kivity
       [not found]     ` <46CFE401.2010206-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
  2007-08-27 22:17   ` Anthony Liguori
  1 sibling, 1 reply; 4+ messages in thread
From: Avi Kivity @ 2007-08-25  8:10 UTC (permalink / raw)
  To: Dor Laor; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Dor Laor wrote:
> Since some hypercalls can be handled in userspace, it needs
> to include kvm_para too. Chande kernel types into user and
> add includes for them and for page_size.
> @@ -25,17 +28,17 @@ struct kvm_vcpu_para_state {
>  	 * is supposed to work - new host versions will support all old
>  	 * guest API versions.
>  	 */
> -	u32 guest_version;
> -	u32 host_version;
> -	u32 size;
> -	u32 ret;
> +	__u32 guest_version;
> +	__u32 host_version;
> +	__u32 size;
> +	__u32 ret;
>  
>  	/*
>  	 * The address of the vm exit instruction (VMCALL or VMMCALL),
>  	 * which the host will patch according to the CPU model the
>  	 * VM runs on:
>  	 */
> -	u64 hypercall_gpa;
> +	__u64 hypercall_gpa;
>  
>  } __attribute__ ((aligned(PAGE_SIZE)));
>
>
>   

But userspace isn't really interested in kvm_para_state, right?  You can
just wrap it in #ifdef __KERNEL__.

-- 
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/4] [HYPERCALL] Enable userspace too include kvm_para.
       [not found]     ` <46CFE401.2010206-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
@ 2007-08-25  9:40       ` Dor Laor
  0 siblings, 0 replies; 4+ messages in thread
From: Dor Laor @ 2007-08-25  9:40 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

>> Since some hypercalls can be handled in userspace, it needs
>> to include kvm_para too. Chande kernel types into user and
>> add includes for them and for page_size.
>> @@ -25,17 +28,17 @@ struct kvm_vcpu_para_state {
>>  	 * is supposed to work - new host versions will support all old
>>  	 * guest API versions.
>>  	 */
>> -	u32 guest_version;
>> -	u32 host_version;
>> -	u32 size;
>> -	u32 ret;
>> +	__u32 guest_version;
>> +	__u32 host_version;
>> +	__u32 size;
>> +	__u32 ret;
>>
>>  	/*
>>  	 * The address of the vm exit instruction (VMCALL or VMMCALL),
>>  	 * which the host will patch according to the CPU model the
>>  	 * VM runs on:
>>  	 */
>> -	u64 hypercall_gpa;
>> +	__u64 hypercall_gpa;
>>
>>  } __attribute__ ((aligned(PAGE_SIZE)));
>>
>>
>>
>
>But userspace isn't really interested in kvm_para_state, right?  You
can
>just wrap it in #ifdef __KERNEL__.
>

Currently userspace is not interested by it might.
A nice thing would be to enable PV drivers with qemu only, so qemu will
catch the
wrmsr to the shared page.
Until then I'll add the __KERNEL__.
Thanks,
Dor.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/4] [HYPERCALL] Enable userspace too include kvm_para.
       [not found] ` <64F9B87B6B770947A9F8391472E032160D59004D-yEcIvxbTEBqsx+V+t5oei8rau4O3wl8o3fe8/T/H7NteoWH0uzbU5w@public.gmane.org>
  2007-08-25  8:10   ` Avi Kivity
@ 2007-08-27 22:17   ` Anthony Liguori
  1 sibling, 0 replies; 4+ messages in thread
From: Anthony Liguori @ 2007-08-27 22:17 UTC (permalink / raw)
  To: Dor Laor; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Ignore my last email about this patch not existing :-)

Regards,

Anthony Liguori


On Fri, 2007-08-24 at 16:58 -0700, Dor Laor wrote:
> Since some hypercalls can be handled in userspace, it needs
> to include kvm_para too. Chande kernel types into user and
> add includes for them and for page_size.
> 
> Signed-off-by: Dor Laor <dor.laor-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
> ---
>  include/linux/kvm_para.h |   13 ++++++++-----
>  1 files changed, 8 insertions(+), 5 deletions(-)
> 
> diff --git a/include/linux/kvm_para.h b/include/linux/kvm_para.h
> index 3b29256..754e29d 100644
> --- a/include/linux/kvm_para.h
> +++ b/include/linux/kvm_para.h
> @@ -8,6 +8,9 @@
>   *       as we make progress.
>   */
>  
> +#include <asm/types.h>
> +#include <asm/page.h>
> +
>  /*
>   * Per-VCPU descriptor area shared between guest and host. Writable to
>   * both guest and host. Registered with the host by the guest when
> @@ -25,17 +28,17 @@ struct kvm_vcpu_para_state {
>  	 * is supposed to work - new host versions will support all old
>  	 * guest API versions.
>  	 */
> -	u32 guest_version;
> -	u32 host_version;
> -	u32 size;
> -	u32 ret;
> +	__u32 guest_version;
> +	__u32 host_version;
> +	__u32 size;
> +	__u32 ret;
>  
>  	/*
>  	 * The address of the vm exit instruction (VMCALL or VMMCALL),
>  	 * which the host will patch according to the CPU model the
>  	 * VM runs on:
>  	 */
> -	u64 hypercall_gpa;
> +	__u64 hypercall_gpa;
>  
>  } __attribute__ ((aligned(PAGE_SIZE)));
> 
> 
> -----
> In simplicity there is elegance.
> Dor Laor ;)
> 
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems?  Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >>  http://get.splunk.com/
> _______________________________________________
> kvm-devel mailing list
> kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/kvm-devel


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-08-27 22:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-24 23:58 [PATCH 2/4] [HYPERCALL] Enable userspace too include kvm_para Dor Laor
     [not found] ` <64F9B87B6B770947A9F8391472E032160D59004D-yEcIvxbTEBqsx+V+t5oei8rau4O3wl8o3fe8/T/H7NteoWH0uzbU5w@public.gmane.org>
2007-08-25  8:10   ` Avi Kivity
     [not found]     ` <46CFE401.2010206-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-08-25  9:40       ` Dor Laor
2007-08-27 22:17   ` Anthony Liguori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox