All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@qumranet.com>
To: Arjan van de Ven <arjan@infradead.org>
Cc: kvm-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org,
	akpm@osdl.org
Subject: Re: [PATCH 1/14] KVM: userspace interface
Date: Mon, 06 Nov 2006 12:28:26 +0200	[thread overview]
Message-ID: <454F0E4A.7030001@qumranet.com> (raw)
In-Reply-To: <1162807420.3160.186.camel@laptopd505.fenrus.org>

Arjan van de Ven wrote:
> Hi,
>
> some nitpicks about the ioctl interfaces while it still can be done ;)
>
>   

There are some changes still planned (to streamline smp support).

>   
>> Signed-off-by: Yaniv Kamay <yaniv@qumranet.com>
>> Signed-off-by: Avi Kivity <avi@qumranet.com>
>>
>> --- /dev/null	2006-10-25 17:42:42.376631750 +0200
>> +++ linux-2.6/include/linux/kvm.h	2006-10-26 15:22:01.000000000 +0200
>> @@ -0,0 +1,198 @@
>> +#ifndef __LINUX_KVM_H
>> +#define __LINUX_KVM_H
>> +
>> +/*
>> + * Userspace interface for /dev/kvm - kernel based virtual machine
>> + *
>> + * Note: this interface is considered experimental and may change without
>> + *       notice.
>> + */
>> +
>> +#include <asm/types.h>
>> +#include <linux/ioctl.h>
>> +
>> +/* for KVM_CREATE_MEMORY_REGION */
>> +struct kvm_memory_region {
>> +	__u32 slot;
>> +	__u32 flags;
>> +	__u64 guest_phys_addr;
>> +	__u64 memory_size; /* bytes */
>> +};
>>     
>
> as a general rule, it's a lot better to sort structures big-to-small, to
> make sure alignments inside the struct are minimized and don't suck too
> much. This is especially important to get right for 32/64 bit
> compatibility. This comment is true for most structures in this header
> file; please consider this at least
>   

Doesn't that cause an unnatural field order? for example, in some 
structures I separated in and out variables.  Sorting by size is a bit 
like sorting alphabetically.

Anyway I observed 32/64 bit compatibility religiously.

>   
>> +
>> +enum kvm_exit_reason {
>> +	KVM_EXIT_UNKNOWN,
>> +	KVM_EXIT_EXCEPTION,
>> +	KVM_EXIT_IO,
>> +	KVM_EXIT_CPUID,
>> +	KVM_EXIT_DEBUG,
>> +	KVM_EXIT_HLT,
>> +	KVM_EXIT_MMIO,
>> +};
>>     
>
> it's probably nicer to use explicit enum values for the interface, just
> as documentation if nothing else
>
>   

Will do.


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


WARNING: multiple messages have this Message-ID (diff)
From: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
To: Arjan van de Ven <arjan-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
	akpm-3NddpPZAyC0@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 1/14] KVM: userspace interface
Date: Mon, 06 Nov 2006 12:28:26 +0200	[thread overview]
Message-ID: <454F0E4A.7030001@qumranet.com> (raw)
In-Reply-To: <1162807420.3160.186.camel-NIQFrBLA1CpScpXdPBN83iCwEArCW2h5@public.gmane.org>

Arjan van de Ven wrote:
> Hi,
>
> some nitpicks about the ioctl interfaces while it still can be done ;)
>
>   

There are some changes still planned (to streamline smp support).

>   
>> Signed-off-by: Yaniv Kamay <yaniv-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
>> Signed-off-by: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
>>
>> --- /dev/null	2006-10-25 17:42:42.376631750 +0200
>> +++ linux-2.6/include/linux/kvm.h	2006-10-26 15:22:01.000000000 +0200
>> @@ -0,0 +1,198 @@
>> +#ifndef __LINUX_KVM_H
>> +#define __LINUX_KVM_H
>> +
>> +/*
>> + * Userspace interface for /dev/kvm - kernel based virtual machine
>> + *
>> + * Note: this interface is considered experimental and may change without
>> + *       notice.
>> + */
>> +
>> +#include <asm/types.h>
>> +#include <linux/ioctl.h>
>> +
>> +/* for KVM_CREATE_MEMORY_REGION */
>> +struct kvm_memory_region {
>> +	__u32 slot;
>> +	__u32 flags;
>> +	__u64 guest_phys_addr;
>> +	__u64 memory_size; /* bytes */
>> +};
>>     
>
> as a general rule, it's a lot better to sort structures big-to-small, to
> make sure alignments inside the struct are minimized and don't suck too
> much. This is especially important to get right for 32/64 bit
> compatibility. This comment is true for most structures in this header
> file; please consider this at least
>   

Doesn't that cause an unnatural field order? for example, in some 
structures I separated in and out variables.  Sorting by size is a bit 
like sorting alphabetically.

Anyway I observed 32/64 bit compatibility religiously.

>   
>> +
>> +enum kvm_exit_reason {
>> +	KVM_EXIT_UNKNOWN,
>> +	KVM_EXIT_EXCEPTION,
>> +	KVM_EXIT_IO,
>> +	KVM_EXIT_CPUID,
>> +	KVM_EXIT_DEBUG,
>> +	KVM_EXIT_HLT,
>> +	KVM_EXIT_MMIO,
>> +};
>>     
>
> it's probably nicer to use explicit enum values for the interface, just
> as documentation if nothing else
>
>   

Will do.


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


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

  reply	other threads:[~2006-11-06 10:28 UTC|newest]

Thread overview: 75+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-05 20:27 [PATCH 0/14] KVM: Kernel-based Virtual Machine (v4) Avi Kivity
2006-11-05 20:27 ` Avi Kivity
2006-11-05 20:29 ` [PATCH 1/14] KVM: userspace interface Avi Kivity
2006-11-05 20:29   ` Avi Kivity
2006-11-06 10:03   ` Arjan van de Ven
2006-11-06 10:03     ` Arjan van de Ven
2006-11-06 10:28     ` Avi Kivity [this message]
2006-11-06 10:28       ` Avi Kivity
2006-11-06 10:32       ` Arjan van de Ven
2006-11-06 10:32         ` Arjan van de Ven
2006-11-06 10:47         ` Avi Kivity
2006-11-06 10:47           ` Avi Kivity
2006-11-05 20:30 ` [PATCH 2/14] KVM: Intel virtual mode extensions definitions Avi Kivity
2006-11-05 20:31 ` [PATCH 3/14] KVM: kvm data structures Avi Kivity
2006-11-05 20:31   ` Avi Kivity
2006-11-05 20:32 ` [PATCH 4/14] KVM: random accessors and constants Avi Kivity
2006-11-05 20:32   ` Avi Kivity
2006-11-05 20:33 ` [PATCH 5/14] KVM: virtualization infrastructure Avi Kivity
2006-11-05 20:33   ` Avi Kivity
2006-11-05 20:34 ` [PATCH 6/14] KVM: memory slot management Avi Kivity
2006-11-05 20:34   ` Avi Kivity
2006-11-05 20:35 ` [PATCH 7/14] KVM: vcpu creation and maintenance Avi Kivity
2006-11-05 20:35   ` Avi Kivity
2006-11-05 20:36 ` [PATCH 8/14] KVM: vcpu execution loop Avi Kivity
2006-11-05 20:36   ` Avi Kivity
2006-11-05 20:37 ` [PATCH 9/14] KVM: define exit handlers Avi Kivity
2006-11-05 20:37   ` Avi Kivity
2006-11-05 20:38 ` [PATCH 10/14] KVM: less common " Avi Kivity
2006-11-05 20:38   ` Avi Kivity
2006-11-05 20:39 ` [PATCH 11/14] KVM: mmu Avi Kivity
2006-11-05 20:39   ` Avi Kivity
2006-11-05 20:40 ` [PATCH 12/14] KVM: x86 emulator Avi Kivity
2006-11-05 20:40   ` Avi Kivity
2006-11-07 12:49   ` Pavel Machek
2006-11-07 12:49     ` Pavel Machek
2006-11-07 12:55     ` Avi Kivity
2006-11-07 13:00       ` Arjan van de Ven
2006-11-07 13:00         ` Arjan van de Ven
2006-11-07 13:22         ` Avi Kivity
2006-11-07 13:22           ` Avi Kivity
2006-11-07 13:35           ` Miguel Ojeda
2006-11-07 13:35             ` Miguel Ojeda
2006-11-07 13:44           ` Arjan van de Ven
2006-11-07 13:44             ` Arjan van de Ven
2006-11-07 13:12       ` Hesse, Christian
2006-11-08 16:54         ` David Bristow
2006-11-08 16:54           ` David Bristow
2006-11-05 20:41 ` [PATCH 13/14] KVM: plumbing Avi Kivity
2006-11-05 20:41   ` Avi Kivity
2006-11-05 20:42 ` [PATCH 14/14] KVM: Dynamically determine which msrs to load and save Avi Kivity
2006-11-05 20:42   ` Avi Kivity
2006-11-07 16:59 ` [PATCH 0/14] KVM: Kernel-based Virtual Machine (v4) Yinghai Lu
2006-11-07 16:59   ` Yinghai Lu
2006-11-07 19:56   ` Avi Kivity
2006-11-07 19:56     ` Avi Kivity
2006-11-08  4:44 ` Andrew Morton
2006-11-08  4:44   ` Andrew Morton
2006-11-08  4:51   ` Roland Dreier
2006-11-08  4:51     ` Roland Dreier
2006-11-08  7:14     ` Avi Kivity
2006-11-08  7:14       ` Avi Kivity
2006-11-08  7:33       ` Andrew Morton
2006-11-08  7:33         ` Andrew Morton
2006-11-08  8:07         ` Avi Kivity
2006-11-08  8:07           ` Avi Kivity
2006-11-08  8:30           ` Andrew Morton
2006-11-08  8:30             ` Andrew Morton
2006-11-08  9:39           ` Arjan van de Ven
2006-11-08  9:39             ` Arjan van de Ven
2006-11-08  9:54             ` Avi Kivity
2006-11-08  9:54               ` Avi Kivity
2006-11-08 10:01               ` Arjan van de Ven
2006-11-08 10:10                 ` Avi Kivity
2006-11-08 10:10                   ` Avi Kivity
2006-11-08 18:26       ` Roland Dreier

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=454F0E4A.7030001@qumranet.com \
    --to=avi@qumranet.com \
    --cc=akpm@osdl.org \
    --cc=arjan@infradead.org \
    --cc=kvm-devel@lists.sourceforge.net \
    --cc=linux-kernel@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 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.