xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 05/10] xen_platform: do not use old_portio-style callbacks
       [not found] <1357334986-13941-1-git-send-email-hpoussin@reactos.org>
@ 2013-01-04 21:29 ` Hervé Poussineau
  2013-01-12 16:06   ` Andreas Färber
  0 siblings, 1 reply; 4+ messages in thread
From: Hervé Poussineau @ 2013-01-04 21:29 UTC (permalink / raw)
  To: qemu-devel; +Cc: Andreas Färber, open list:X86, Hervé Poussineau

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
---
 hw/xen_platform.c |   21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/hw/xen_platform.c b/hw/xen_platform.c
index e7611bb..02e0146 100644
--- a/hw/xen_platform.c
+++ b/hw/xen_platform.c
@@ -279,7 +279,8 @@ static void platform_fixed_ioport_init(PCIXenPlatformState* s)
 
 /* Xen Platform PCI Device */
 
-static uint32_t xen_platform_ioport_readb(void *opaque, uint32_t addr)
+static uint64_t xen_platform_ioport_readb(void *opaque, hwaddr addr,
+                                          unsigned int size)
 {
     if (addr == 0) {
         return platform_fixed_ioport_readb(opaque, 0);
@@ -288,30 +289,28 @@ static uint32_t xen_platform_ioport_readb(void *opaque, uint32_t addr)
     }
 }
 
-static void xen_platform_ioport_writeb(void *opaque, uint32_t addr, uint32_t val)
+static void xen_platform_ioport_writeb(void *opaque, hwaddr addr,
+                                       uint64_t val, unsigned int size)
 {
     PCIXenPlatformState *s = opaque;
 
     switch (addr) {
     case 0: /* Platform flags */
-        platform_fixed_ioport_writeb(opaque, 0, val);
+        platform_fixed_ioport_writeb(opaque, 0, (uint32_t)val);
         break;
     case 8:
-        log_writeb(s, val);
+        log_writeb(s, (uint32_t)val);
         break;
     default:
         break;
     }
 }
 
-static MemoryRegionPortio xen_pci_portio[] = {
-    { 0, 0x100, 1, .read = xen_platform_ioport_readb, },
-    { 0, 0x100, 1, .write = xen_platform_ioport_writeb, },
-    PORTIO_END_OF_LIST()
-};
-
 static const MemoryRegionOps xen_pci_io_ops = {
-    .old_portio = xen_pci_portio,
+    .read  = xen_platform_ioport_readb,
+    .write = xen_platform_ioport_writeb,
+    .impl.min_access_size = 1,
+    .impl.max_access_size = 1,
 };
 
 static void platform_ioport_bar_setup(PCIXenPlatformState *d)
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

* Re: [PATCH 05/10] xen_platform: do not use old_portio-style callbacks
  2013-01-04 21:29 ` [PATCH 05/10] xen_platform: do not use old_portio-style callbacks Hervé Poussineau
@ 2013-01-12 16:06   ` Andreas Färber
  2013-01-15 17:09     ` Andreas Färber
  0 siblings, 1 reply; 4+ messages in thread
From: Andreas Färber @ 2013-01-12 16:06 UTC (permalink / raw)
  To: Hervé Poussineau; +Cc: xen-devel, Stefano Stabellini, qemu-devel

Am 04.01.2013 22:29, schrieb Hervé Poussineau:
> Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
> ---
>  hw/xen_platform.c |   21 ++++++++++-----------
>  1 file changed, 10 insertions(+), 11 deletions(-)
> 
> diff --git a/hw/xen_platform.c b/hw/xen_platform.c
> index e7611bb..02e0146 100644
> --- a/hw/xen_platform.c
> +++ b/hw/xen_platform.c
> @@ -279,7 +279,8 @@ static void platform_fixed_ioport_init(PCIXenPlatformState* s)
>  
>  /* Xen Platform PCI Device */
>  
> -static uint32_t xen_platform_ioport_readb(void *opaque, uint32_t addr)
> +static uint64_t xen_platform_ioport_readb(void *opaque, hwaddr addr,
> +                                          unsigned int size)
>  {
>      if (addr == 0) {
>          return platform_fixed_ioport_readb(opaque, 0);
> @@ -288,30 +289,28 @@ static uint32_t xen_platform_ioport_readb(void *opaque, uint32_t addr)
>      }
>  }
>  
> -static void xen_platform_ioport_writeb(void *opaque, uint32_t addr, uint32_t val)
> +static void xen_platform_ioport_writeb(void *opaque, hwaddr addr,
> +                                       uint64_t val, unsigned int size)
>  {
>      PCIXenPlatformState *s = opaque;
>  
>      switch (addr) {
>      case 0: /* Platform flags */
> -        platform_fixed_ioport_writeb(opaque, 0, val);
> +        platform_fixed_ioport_writeb(opaque, 0, (uint32_t)val);
>          break;
>      case 8:
> -        log_writeb(s, val);
> +        log_writeb(s, (uint32_t)val);
>          break;
>      default:
>          break;
>      }
>  }
>  
> -static MemoryRegionPortio xen_pci_portio[] = {
> -    { 0, 0x100, 1, .read = xen_platform_ioport_readb, },
> -    { 0, 0x100, 1, .write = xen_platform_ioport_writeb, },
> -    PORTIO_END_OF_LIST()
> -};
> -
>  static const MemoryRegionOps xen_pci_io_ops = {
> -    .old_portio = xen_pci_portio,
> +    .read  = xen_platform_ioport_readb,
> +    .write = xen_platform_ioport_writeb,
> +    .impl.min_access_size = 1,
> +    .impl.max_access_size = 1,
>  };
>  
>  static void platform_ioport_bar_setup(PCIXenPlatformState *d)

Thanks, applied to memory-ioport queue:
https://github.com/afaerber/qemu-cpu/commits/memory-ioport

Is there some kind of guidance in which cases to use .impl vs. .valid
for the access sizes in these conversions?

Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

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

* Re: [PATCH 05/10] xen_platform: do not use old_portio-style callbacks
  2013-01-12 16:06   ` Andreas Färber
@ 2013-01-15 17:09     ` Andreas Färber
  2013-01-15 17:43       ` Stefano Stabellini
  0 siblings, 1 reply; 4+ messages in thread
From: Andreas Färber @ 2013-01-15 17:09 UTC (permalink / raw)
  To: Stefano Stabellini; +Cc: xen-devel, Hervé Poussineau, qemu-devel

Stefano,

Am 12.01.2013 17:06, schrieb Andreas Färber:
> Am 04.01.2013 22:29, schrieb Hervé Poussineau:
>> Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
>> ---
>>  hw/xen_platform.c |   21 ++++++++++-----------
>>  1 file changed, 10 insertions(+), 11 deletions(-)
>>
>> diff --git a/hw/xen_platform.c b/hw/xen_platform.c
>> index e7611bb..02e0146 100644
>> --- a/hw/xen_platform.c
>> +++ b/hw/xen_platform.c
>> @@ -279,7 +279,8 @@ static void platform_fixed_ioport_init(PCIXenPlatformState* s)
>>  
>>  /* Xen Platform PCI Device */
>>  
>> -static uint32_t xen_platform_ioport_readb(void *opaque, uint32_t addr)
>> +static uint64_t xen_platform_ioport_readb(void *opaque, hwaddr addr,
>> +                                          unsigned int size)
>>  {
>>      if (addr == 0) {
>>          return platform_fixed_ioport_readb(opaque, 0);
>> @@ -288,30 +289,28 @@ static uint32_t xen_platform_ioport_readb(void *opaque, uint32_t addr)
>>      }
>>  }
>>  
>> -static void xen_platform_ioport_writeb(void *opaque, uint32_t addr, uint32_t val)
>> +static void xen_platform_ioport_writeb(void *opaque, hwaddr addr,
>> +                                       uint64_t val, unsigned int size)
>>  {
>>      PCIXenPlatformState *s = opaque;
>>  
>>      switch (addr) {
>>      case 0: /* Platform flags */
>> -        platform_fixed_ioport_writeb(opaque, 0, val);
>> +        platform_fixed_ioport_writeb(opaque, 0, (uint32_t)val);
>>          break;
>>      case 8:
>> -        log_writeb(s, val);
>> +        log_writeb(s, (uint32_t)val);
>>          break;
>>      default:
>>          break;
>>      }
>>  }
>>  
>> -static MemoryRegionPortio xen_pci_portio[] = {
>> -    { 0, 0x100, 1, .read = xen_platform_ioport_readb, },
>> -    { 0, 0x100, 1, .write = xen_platform_ioport_writeb, },
>> -    PORTIO_END_OF_LIST()
>> -};
>> -
>>  static const MemoryRegionOps xen_pci_io_ops = {
>> -    .old_portio = xen_pci_portio,
>> +    .read  = xen_platform_ioport_readb,
>> +    .write = xen_platform_ioport_writeb,
>> +    .impl.min_access_size = 1,
>> +    .impl.max_access_size = 1,
>>  };
>>  
>>  static void platform_ioport_bar_setup(PCIXenPlatformState *d)
> 
> Thanks, applied to memory-ioport queue:
> https://github.com/afaerber/qemu-cpu/commits/memory-ioport

If you want to ack or object, now would be the time. :)
https://github.com/afaerber/qemu-cpu/commit/016861a22283da3931c4b343e6d2df0dc123b6ef

Cheers,
Andreas

> 
> Is there some kind of guidance in which cases to use .impl vs. .valid
> for the access sizes in these conversions?
> 
> Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

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

* Re: [PATCH 05/10] xen_platform: do not use old_portio-style callbacks
  2013-01-15 17:09     ` Andreas Färber
@ 2013-01-15 17:43       ` Stefano Stabellini
  0 siblings, 0 replies; 4+ messages in thread
From: Stefano Stabellini @ 2013-01-15 17:43 UTC (permalink / raw)
  To: Andreas Färber
  Cc: xen-devel, Hervé Poussineau, qemu-devel@nongnu.org,
	Stefano Stabellini

[-- Attachment #1: Type: text/plain, Size: 2724 bytes --]

On Tue, 15 Jan 2013, Andreas Färber wrote:
> Stefano,
> 
> Am 12.01.2013 17:06, schrieb Andreas Färber:
> > Am 04.01.2013 22:29, schrieb Hervé Poussineau:
> >> Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
> >> ---
> >>  hw/xen_platform.c |   21 ++++++++++-----------
> >>  1 file changed, 10 insertions(+), 11 deletions(-)
> >>
> >> diff --git a/hw/xen_platform.c b/hw/xen_platform.c
> >> index e7611bb..02e0146 100644
> >> --- a/hw/xen_platform.c
> >> +++ b/hw/xen_platform.c
> >> @@ -279,7 +279,8 @@ static void platform_fixed_ioport_init(PCIXenPlatformState* s)
> >>  
> >>  /* Xen Platform PCI Device */
> >>  
> >> -static uint32_t xen_platform_ioport_readb(void *opaque, uint32_t addr)
> >> +static uint64_t xen_platform_ioport_readb(void *opaque, hwaddr addr,
> >> +                                          unsigned int size)
> >>  {
> >>      if (addr == 0) {
> >>          return platform_fixed_ioport_readb(opaque, 0);
> >> @@ -288,30 +289,28 @@ static uint32_t xen_platform_ioport_readb(void *opaque, uint32_t addr)
> >>      }
> >>  }
> >>  
> >> -static void xen_platform_ioport_writeb(void *opaque, uint32_t addr, uint32_t val)
> >> +static void xen_platform_ioport_writeb(void *opaque, hwaddr addr,
> >> +                                       uint64_t val, unsigned int size)
> >>  {
> >>      PCIXenPlatformState *s = opaque;
> >>  
> >>      switch (addr) {
> >>      case 0: /* Platform flags */
> >> -        platform_fixed_ioport_writeb(opaque, 0, val);
> >> +        platform_fixed_ioport_writeb(opaque, 0, (uint32_t)val);
> >>          break;
> >>      case 8:
> >> -        log_writeb(s, val);
> >> +        log_writeb(s, (uint32_t)val);
> >>          break;
> >>      default:
> >>          break;
> >>      }
> >>  }
> >>  
> >> -static MemoryRegionPortio xen_pci_portio[] = {
> >> -    { 0, 0x100, 1, .read = xen_platform_ioport_readb, },
> >> -    { 0, 0x100, 1, .write = xen_platform_ioport_writeb, },
> >> -    PORTIO_END_OF_LIST()
> >> -};
> >> -
> >>  static const MemoryRegionOps xen_pci_io_ops = {
> >> -    .old_portio = xen_pci_portio,
> >> +    .read  = xen_platform_ioport_readb,
> >> +    .write = xen_platform_ioport_writeb,
> >> +    .impl.min_access_size = 1,
> >> +    .impl.max_access_size = 1,
> >>  };
> >>  
> >>  static void platform_ioport_bar_setup(PCIXenPlatformState *d)
> > 
> > Thanks, applied to memory-ioport queue:
> > https://github.com/afaerber/qemu-cpu/commits/memory-ioport
> 
> If you want to ack or object, now would be the time. :)
> https://github.com/afaerber/qemu-cpu/commit/016861a22283da3931c4b343e6d2df0dc123b6ef

That patch is also fine by me. Thanks for the heads up!

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

end of thread, other threads:[~2013-01-15 17:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1357334986-13941-1-git-send-email-hpoussin@reactos.org>
2013-01-04 21:29 ` [PATCH 05/10] xen_platform: do not use old_portio-style callbacks Hervé Poussineau
2013-01-12 16:06   ` Andreas Färber
2013-01-15 17:09     ` Andreas Färber
2013-01-15 17:43       ` Stefano Stabellini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).