[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC] Next gen kvm api
From: |
Avi Kivity |
Subject: |
Re: [Qemu-devel] [RFC] Next gen kvm api |
Date: |
Wed, 15 Feb 2012 15:33:18 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111222 Thunderbird/9.0 |
On 02/07/2012 05:23 PM, Anthony Liguori wrote:
> On 02/07/2012 07:40 AM, Alexander Graf wrote:
>>
>> Why? For the HPET timer register for example, we could have a simple
>> MMIO hook that says
>>
>> on_read:
>> return read_current_time() - shared_page.offset;
>> on_write:
>> handle_in_user_space();
>>
>> For IDE, it would be as simple as
>>
>> register_pio_hook_ptr_r(PIO_IDE, SIZE_BYTE,&s->cmd[0]);
>> for (i = 1; i< 7; i++) {
>> register_pio_hook_ptr_r(PIO_IDE + i, SIZE_BYTE,&s->cmd[i]);
>> register_pio_hook_ptr_w(PIO_IDE + i, SIZE_BYTE,&s->cmd[i]);
>> }
>
> You can't easily serialize updates to that address with the kernel
> since two threads are likely going to be accessing it at the same
> time. That either means an expensive sync operation or a reliance on
> atomic instructions.
>
> But not all architectures offer non-word sized atomic instructions so
> it gets fairly nasty in practice.
>
I doubt that any guest accesses IDE registers from two threads in
parallel. The guest will have some lock, so we could have a lock as
well and be assured that there will never be contention.
--
error compiling committee.c: too many arguments to function
- Re: [Qemu-devel] [RFC] Next gen kvm api, (continued)
- Re: [Qemu-devel] [RFC] Next gen kvm api, Scott Wood, 2012/02/15
- Re: [Qemu-devel] [RFC] Next gen kvm api, Takuya Yoshikawa, 2012/02/12
- Re: [Qemu-devel] [RFC] Next gen kvm api, Avi Kivity, 2012/02/15
- Re: [Qemu-devel] [RFC] Next gen kvm api, Anthony Liguori, 2012/02/07
- Re: [Qemu-devel] [RFC] Next gen kvm api, Alexander Graf, 2012/02/07
- Re: [Qemu-devel] [RFC] Next gen kvm api, Alan Cox, 2012/02/08
- Re: [Qemu-devel] [RFC] Next gen kvm api,
Avi Kivity <=
- Re: [Qemu-devel] [RFC] Next gen kvm api, Arnd Bergmann, 2012/02/16
Re: [Qemu-devel] [RFC] Next gen kvm api, Jamie Lokier, 2012/02/09
Re: [Qemu-devel] [RFC] Next gen kvm api, Eric Northup, 2012/02/03
- Re: [Qemu-devel] [RFC] Next gen kvm api, Anthony Liguori, 2012/02/03
- Re: [Qemu-devel] [RFC] Next gen kvm api, Scott Wood, 2012/02/06
- Re: [Qemu-devel] [RFC] Next gen kvm api, Michael Ellerman, 2012/02/07
- Re: [Qemu-devel] [RFC] Next gen kvm api, Alexander Graf, 2012/02/07
- Re: [Qemu-devel] [RFC] Next gen kvm api, Arnd Bergmann, 2012/02/16
- Re: [Qemu-devel] [RFC] Next gen kvm api, Michael Ellerman, 2012/02/15
- Re: [Qemu-devel] [RFC] Next gen kvm api, Avi Kivity, 2012/02/16