All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@qumranet.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: linux-kernel@vger.kernel.org, kvm-devel@lists.sourceforge.net
Subject: Re: [PATCH 1/13] KVM: userspace interface
Date: Fri, 27 Oct 2006 07:51:59 +0200	[thread overview]
Message-ID: <45419E7F.6040201@qumranet.com> (raw)
In-Reply-To: <200610270051.43477.arnd@arndb.de>

Arnd Bergmann wrote:
> On Thursday 26 October 2006 19:22, Avi Kivity wrote:
>   
>> +
>> +/* for KVM_RUN */
>> +struct kvm_run {
>> +       /* in */
>> +       __u32 vcpu;
>> +       __u32 emulated;  /* skip current instruction */
>> +       __u32 mmio_completed; /* mmio request completed */
>> +
>> +       /* out */
>> +       __u32 exit_type;
>> +       __u32 exit_reason;
>> +       __u32 instruction_length;
>> +       union {
>> +               /* KVM_EXIT_UNKNOWN */
>> +               struct {
>> +                       __u32 hardware_exit_reason;
>> +               } hw;
>> +               /* KVM_EXIT_EXCEPTION */
>> +               struct {
>> +                       __u32 exception;
>> +                       __u32 error_code;
>> +               } ex;
>> +               /* KVM_EXIT_IO */
>> +               struct {
>> +#define KVM_EXIT_IO_IN  0
>> +#define KVM_EXIT_IO_OUT 1
>> +                       __u8 direction;
>> +                       __u8 size; /* bytes */
>> +                       __u8 string;
>> +                       __u8 string_down;
>> +                       __u8 rep;
>> +                       __u8 pad;
>> +                       __u16 port;
>> +                       __u64 count;
>> +                       union {
>> +                               __u64 address;
>> +                               __u32 value;
>> +                       };
>> +               } io;
>> +               struct {
>> +               } debug;
>> +               /* KVM_EXIT_MMIO */
>> +               struct {
>> +                       __u64 phys_addr;
>> +                       __u8  data[8];
>> +                       __u32 len;
>> +                       __u8  is_write;
>> +               } mmio;
>> +       };
>> +};
>>     
>
> This data structure looks like it can become maintenance problem. It's
> already sufficiently complex that I would assume that you need to extend
> it in the future even further, which is hard to do in a compatible
> way. How confident are you that, for a given exit reason, you don't need
> to add or extend the existing fields further, thereby breaking the ABI?
> Do you have a plan how to deal with such breakage?
>
>   

I guess we can reserve some extra space, and if we need even more space 
a new exit reason can specify a pointer to receive the exit data.

Of course, userspace should not get an unexpected exit reason.  I'm not 
worried about the short term, since it's likely there will only be a 
single user (modified qemu), long term we'll have userspace enable new 
features explicitly.

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


  parent reply	other threads:[~2006-10-27  5:52 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-26 17:19 [PATCH 0/13] KVM: Kernel-based Virtual Machine (v3) Avi Kivity
2006-10-26 17:22 ` [PATCH 1/13] KVM: userspace interface Avi Kivity
     [not found]   ` <200610270051.43477.arnd@arndb.de>
2006-10-27  5:51     ` Avi Kivity [this message]
2006-10-26 17:23 ` [PATCH 2/13] KVM: Intel virtual mode extensions definitions Avi Kivity
2006-10-26 17:24 ` [PATCH 3/13] KVM: kvm data structures Avi Kivity
2006-10-26 22:55   ` Arnd Bergmann
2006-10-27  5:53     ` Avi Kivity
2006-10-27  7:39       ` Arnd Bergmann
2006-10-26 17:25 ` [PATCH 4/13] KVM: random accessors and constants Avi Kivity
2006-10-26 17:26 ` [PATCH 5/13] KVM: virtualization infrastructure Avi Kivity
2006-10-26 17:27 ` [PATCH 6/13] KVM: memory slot management Avi Kivity
2006-10-26 22:44   ` Arnd Bergmann
2006-10-27  5:47     ` Avi Kivity
2006-10-27  7:37       ` Arnd Bergmann
2006-10-27 13:26         ` Avi Kivity
2006-10-27 14:05           ` Arnd Bergmann
2006-10-29  9:10             ` Avi Kivity
2006-10-29  9:10               ` Avi Kivity
2006-10-27 15:43           ` [kvm-devel] " Anthony Liguori
2006-10-29  9:15             ` Avi Kivity
2006-10-29  9:15               ` Avi Kivity
2006-10-26 17:28 ` [PATCH 7/13] KVM: vcpu creation and maintenance Avi Kivity
2006-10-26 17:29 ` [PATCH 8/13] KVM: vcpu execution loop Avi Kivity
2006-10-26 17:30 ` [PATCH 9/13] KVM: define exit handlers Avi Kivity
2006-10-26 17:31 ` [PATCH 10/13] KVM: less common " Avi Kivity
2006-10-26 17:32 ` [PATCH 11/13] KVM: mmu Avi Kivity
2006-10-26 17:33 ` [PATCH 12/13] KVM: x86 emulator Avi Kivity
2006-10-26 17:34 ` [PATCH 13/13] KVM: plumbing Avi Kivity
  -- strict thread matches above, loose matches on Subject: below --
2006-10-23 13:28 [PATCH 0/7] KVM: Kernel-based Virtual Machine (v2) Avi Kivity
2006-10-23 13:29 ` [PATCH 1/13] KVM: userspace interface Avi Kivity
2006-10-24 12:51   ` Muli Ben-Yehuda
2006-10-24 12:56     ` Avi Kivity
2006-10-24 12:59       ` Muli Ben-Yehuda

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=45419E7F.6040201@qumranet.com \
    --to=avi@qumranet.com \
    --cc=arnd@arndb.de \
    --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.