All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@citrix.com>
To: Avi Kivity <avi@redhat.com>
Cc: Julian Pidancet <julian.pidancet@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Jan Kiszka <jan.kiszka@web.de>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Qemu-devel] [QEMU][RFC PATCH 3/6] memory: Add xen memory hook
Date: Mon, 26 Mar 2012 12:24:43 +0100	[thread overview]
Message-ID: <4F7051FB.8040501@citrix.com> (raw)
In-Reply-To: <4F704CAB.6080309@redhat.com>

On 03/26/2012 12:02 PM, Avi Kivity wrote:
> On 03/26/2012 01:01 PM, Stefano Stabellini wrote:
>    
>> On Sun, 25 Mar 2012, Avi Kivity wrote:
>>      
>>> On 03/23/2012 06:37 PM, Jan Kiszka wrote:
>>>        
>>>> On 2012-03-23 16:08, Julien Grall wrote:
>>>>          
>>>>> On 03/22/2012 05:44 PM, Jan Kiszka wrote:
>>>>>            
>>>>>>>    static void core_region_nop(MemoryListener *listener,
>>>>>>> diff --git a/ioport.c b/ioport.c
>>>>>>> index 78a3b89..073ed75 100644
>>>>>>> --- a/ioport.c
>>>>>>> +++ b/ioport.c
>>>>>>> @@ -28,6 +28,7 @@
>>>>>>>    #include "ioport.h"
>>>>>>>    #include "trace.h"
>>>>>>>    #include "memory.h"
>>>>>>> +#include "hw/xen.h"
>>>>>>>
>>>>>>>    /***********************************************************/
>>>>>>>    /* IO Port */
>>>>>>> @@ -155,6 +156,11 @@ int register_ioport_read(pio_addr_t start, int
>>>>>>> length, int size,
>>>>>>>                         i);
>>>>>>>            ioport_opaque[i] = opaque;
>>>>>>>        }
>>>>>>> +
>>>>>>> +    if (xen_enabled()) {
>>>>>>> +        xen_map_iorange(start, length, 0);
>>>>>>> +    }
>>>>>>> +
>>>>>>>        return 0;
>>>>>>>    }
>>>>>>>
>>>>>>> @@ -175,7 +181,13 @@ int register_ioport_write(pio_addr_t start, int
>>>>>>> length, int size,
>>>>>>>                         i);
>>>>>>>            ioport_opaque[i] = opaque;
>>>>>>>        }
>>>>>>> +
>>>>>>> +    if (xen_enabled()) {
>>>>>>> +        xen_map_iorange(start, length, 0);
>>>>>>> +    }
>>>>>>> +
>>>>>>>        return 0;
>>>>>>> +
>>>>>>>    }
>>>>>>>
>>>>>>>    static uint32_t ioport_readb_thunk(void *opaque, uint32_t addr)
>>>>>>> @@ -260,6 +272,11 @@ void isa_unassign_ioport(pio_addr_t start, int
>>>>>>> length)
>>>>>>>            ioport_destructor_table[start](ioport_opaque[start]);
>>>>>>>            ioport_destructor_table[start] = NULL;
>>>>>>>        }
>>>>>>> +
>>>>>>> +    if (xen_enabled()) {
>>>>>>> +        xen_unmap_iorange(start, length, 0);
>>>>>>> +    }
>>>>>>> +
>>>>>>>        for(i = start; i<   start + length; i++) {
>>>>>>>            ioport_read_table[0][i] = NULL;
>>>>>>>            ioport_read_table[1][i] = NULL;
>>>>>>>
>>>>>>>                
>>>>>> memory_listener_register(xen_hooks, system_io)?
>>>>>>
>>>>>>              
>>>>> QEMU doesn't seem to call region_add/region_del for ioport.
>>>>> Moreover, some of ioport are directly register without
>>>>> using memory hook (for example cirrus vga).
>>>>>
>>>>> What is the best way to do it ?
>>>>>            
>>>> I haven't looked at details. Maybe it is just a combination of "use case
>>>> not yet considered, but can easily be added" and "need to switch legacy
>>>> code to new scheme". Then this still remains the better option than this
>>>> hook. Avi?
>>>>          
>>> Just the second - region_add/del will be called, but only for ioports
>>> registered via the MemoryRegion APIs.
>>>        
>> It looks like there are quite a few register_ioport_read/write left
>> around, especially in the following files:
>>
>> hw/acpi_piix4.c
>> hw/cirrus_vga.c
>> hw/serial.c
>> hw/pckbd.c
>> hw/pc.c
>>
>> I guess they should all be converted to memory_region_init_io, right?
>>      
> Right
I will modify theses files and send a different patch series.

WARNING: multiple messages have this Message-ID (diff)
From: Julien Grall <julien.grall@citrix.com>
To: Avi Kivity <avi@redhat.com>
Cc: Julian Pidancet <julian.pidancet@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Jan Kiszka <jan.kiszka@web.de>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [QEMU][RFC PATCH 3/6] memory: Add xen memory hook
Date: Mon, 26 Mar 2012 12:24:43 +0100	[thread overview]
Message-ID: <4F7051FB.8040501@citrix.com> (raw)
In-Reply-To: <4F704CAB.6080309@redhat.com>

On 03/26/2012 12:02 PM, Avi Kivity wrote:
> On 03/26/2012 01:01 PM, Stefano Stabellini wrote:
>    
>> On Sun, 25 Mar 2012, Avi Kivity wrote:
>>      
>>> On 03/23/2012 06:37 PM, Jan Kiszka wrote:
>>>        
>>>> On 2012-03-23 16:08, Julien Grall wrote:
>>>>          
>>>>> On 03/22/2012 05:44 PM, Jan Kiszka wrote:
>>>>>            
>>>>>>>    static void core_region_nop(MemoryListener *listener,
>>>>>>> diff --git a/ioport.c b/ioport.c
>>>>>>> index 78a3b89..073ed75 100644
>>>>>>> --- a/ioport.c
>>>>>>> +++ b/ioport.c
>>>>>>> @@ -28,6 +28,7 @@
>>>>>>>    #include "ioport.h"
>>>>>>>    #include "trace.h"
>>>>>>>    #include "memory.h"
>>>>>>> +#include "hw/xen.h"
>>>>>>>
>>>>>>>    /***********************************************************/
>>>>>>>    /* IO Port */
>>>>>>> @@ -155,6 +156,11 @@ int register_ioport_read(pio_addr_t start, int
>>>>>>> length, int size,
>>>>>>>                         i);
>>>>>>>            ioport_opaque[i] = opaque;
>>>>>>>        }
>>>>>>> +
>>>>>>> +    if (xen_enabled()) {
>>>>>>> +        xen_map_iorange(start, length, 0);
>>>>>>> +    }
>>>>>>> +
>>>>>>>        return 0;
>>>>>>>    }
>>>>>>>
>>>>>>> @@ -175,7 +181,13 @@ int register_ioport_write(pio_addr_t start, int
>>>>>>> length, int size,
>>>>>>>                         i);
>>>>>>>            ioport_opaque[i] = opaque;
>>>>>>>        }
>>>>>>> +
>>>>>>> +    if (xen_enabled()) {
>>>>>>> +        xen_map_iorange(start, length, 0);
>>>>>>> +    }
>>>>>>> +
>>>>>>>        return 0;
>>>>>>> +
>>>>>>>    }
>>>>>>>
>>>>>>>    static uint32_t ioport_readb_thunk(void *opaque, uint32_t addr)
>>>>>>> @@ -260,6 +272,11 @@ void isa_unassign_ioport(pio_addr_t start, int
>>>>>>> length)
>>>>>>>            ioport_destructor_table[start](ioport_opaque[start]);
>>>>>>>            ioport_destructor_table[start] = NULL;
>>>>>>>        }
>>>>>>> +
>>>>>>> +    if (xen_enabled()) {
>>>>>>> +        xen_unmap_iorange(start, length, 0);
>>>>>>> +    }
>>>>>>> +
>>>>>>>        for(i = start; i<   start + length; i++) {
>>>>>>>            ioport_read_table[0][i] = NULL;
>>>>>>>            ioport_read_table[1][i] = NULL;
>>>>>>>
>>>>>>>                
>>>>>> memory_listener_register(xen_hooks, system_io)?
>>>>>>
>>>>>>              
>>>>> QEMU doesn't seem to call region_add/region_del for ioport.
>>>>> Moreover, some of ioport are directly register without
>>>>> using memory hook (for example cirrus vga).
>>>>>
>>>>> What is the best way to do it ?
>>>>>            
>>>> I haven't looked at details. Maybe it is just a combination of "use case
>>>> not yet considered, but can easily be added" and "need to switch legacy
>>>> code to new scheme". Then this still remains the better option than this
>>>> hook. Avi?
>>>>          
>>> Just the second - region_add/del will be called, but only for ioports
>>> registered via the MemoryRegion APIs.
>>>        
>> It looks like there are quite a few register_ioport_read/write left
>> around, especially in the following files:
>>
>> hw/acpi_piix4.c
>> hw/cirrus_vga.c
>> hw/serial.c
>> hw/pckbd.c
>> hw/pc.c
>>
>> I guess they should all be converted to memory_region_init_io, right?
>>      
> Right
I will modify theses files and send a different patch series.

  reply	other threads:[~2012-03-26 11:24 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-22 16:01 [Qemu-devel] [QEMU][RFC PATCH 0/6] QEMU disaggregation Julien Grall
2012-03-22 16:01 ` Julien Grall
2012-03-22 16:01 ` [Qemu-devel] [QEMU][RFC PATCH 1/6] option: Add -xen-dmid Julien Grall
2012-03-22 16:01   ` Julien Grall
2012-03-22 17:36   ` [Qemu-devel] " Jan Kiszka
2012-03-22 17:36     ` Jan Kiszka
2012-03-23 10:42     ` [Qemu-devel] " Stefano Stabellini
2012-03-23 10:42       ` Stefano Stabellini
2012-03-22 16:01 ` [Qemu-devel] [QEMU][RFC PATCH 2/6] xen: Add functions to register PCI and IO in Xen Julien Grall
2012-03-22 16:01   ` Julien Grall
2012-03-23 10:44   ` [Qemu-devel] " Stefano Stabellini
2012-03-23 10:44     ` Stefano Stabellini
2012-03-22 16:01 ` [Qemu-devel] [QEMU][RFC PATCH 3/6] memory: Add xen memory hook Julien Grall
2012-03-22 16:01   ` Julien Grall
2012-03-22 17:44   ` [Qemu-devel] " Jan Kiszka
2012-03-22 17:44     ` Jan Kiszka
2012-03-23 15:08     ` [Qemu-devel] " Julien Grall
2012-03-23 15:08       ` Julien Grall
2012-03-23 16:37       ` [Qemu-devel] " Jan Kiszka
2012-03-23 16:37         ` Jan Kiszka
2012-03-25 10:44         ` [Qemu-devel] " Avi Kivity
2012-03-25 10:44           ` Avi Kivity
2012-03-26 11:01           ` [Qemu-devel] " Stefano Stabellini
2012-03-26 11:01             ` Stefano Stabellini
2012-03-26 11:02             ` [Qemu-devel] " Avi Kivity
2012-03-26 11:02               ` Avi Kivity
2012-03-26 11:24               ` Julien Grall [this message]
2012-03-26 11:24                 ` Julien Grall
2012-03-26 13:13                 ` [Qemu-devel] " Avi Kivity
2012-03-26 13:13                   ` Avi Kivity
2012-03-23 16:47   ` [Qemu-devel] " Anthony Liguori
2012-03-23 16:47     ` Anthony Liguori
2012-03-22 16:01 ` [Qemu-devel] [QEMU][RFC PATCH 4/6] xen-pci: Register PCI in Xen Julien Grall
2012-03-22 16:01   ` Julien Grall
2012-03-22 17:47   ` [Qemu-devel] " Jan Kiszka
2012-03-22 17:47     ` Jan Kiszka
2012-03-22 19:58   ` [Qemu-devel] " Anthony Liguori
2012-03-22 19:58     ` Anthony Liguori
2012-03-23 11:02     ` [Qemu-devel] " Stefano Stabellini
2012-03-23 11:02       ` Stefano Stabellini
2012-03-25 12:09       ` [Qemu-devel] " Avi Kivity
2012-03-25 12:09         ` Avi Kivity
2012-03-26 11:45         ` [Qemu-devel] " Stefano Stabellini
2012-03-26 11:45           ` Stefano Stabellini
2012-03-26 11:57           ` [Qemu-devel] " Avi Kivity
2012-03-26 11:57             ` Avi Kivity
2012-03-26 12:20             ` [Qemu-devel] " Stefano Stabellini
2012-03-26 12:20               ` Stefano Stabellini
2012-03-26 12:33               ` [Qemu-devel] " Avi Kivity
2012-03-26 12:33                 ` Avi Kivity
2012-03-26 13:56                 ` [Qemu-devel] " Stefano Stabellini
2012-03-26 13:56                   ` Stefano Stabellini
2012-03-22 16:01 ` [Qemu-devel] [QEMU][RFC PATCH 5/6] xen-io: Handle the new ioreq type IOREQ_TYPE_PCI_CONFIG Julien Grall
2012-03-22 16:01   ` Julien Grall
2012-03-22 16:01 ` [Qemu-devel] [QEMU][RFC PATCH 6/6] xen: handle qemu disaggregation Julien Grall
2012-03-22 16:01   ` Julien Grall
2012-03-23 11:07   ` [Qemu-devel] " Stefano Stabellini
2012-03-23 11:07     ` Stefano Stabellini

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=4F7051FB.8040501@citrix.com \
    --to=julien.grall@citrix.com \
    --cc=Stefano.Stabellini@eu.citrix.com \
    --cc=avi@redhat.com \
    --cc=jan.kiszka@web.de \
    --cc=julian.pidancet@citrix.com \
    --cc=qemu-devel@nongnu.org \
    --cc=xen-devel@lists.xensource.com \
    /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.