public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] Don't unregister unassigned PCI BAR
  2009-02-03 11:58 [PATCH] Don't unregister unassigned PCI BAR Gleb Natapov
@ 2009-02-03 11:26 ` Marcelo Tosatti
  2009-02-03 12:25 ` Avi Kivity
  2009-02-12  1:35 ` Chris Wright
  2 siblings, 0 replies; 4+ messages in thread
From: Marcelo Tosatti @ 2009-02-03 11:26 UTC (permalink / raw)
  To: Gleb Natapov; +Cc: avi, kvm

On Tue, Feb 03, 2009 at 01:58:19PM +0200, Gleb Natapov wrote:
> Signed-off-by: Gleb Natapov <gleb@redhat.com>
> diff --git a/qemu/hw/pci.c b/qemu/hw/pci.c
> index 04aecc2..a6d57e5 100644
> --- a/qemu/hw/pci.c
> +++ b/qemu/hw/pci.c
> @@ -213,7 +213,7 @@ static void pci_unregister_io_regions(PCIDevice *pci_dev)
>  
>      for(i = 0; i < PCI_NUM_REGIONS; i++) {
>          r = &pci_dev->io_regions[i];
> -        if (!r->size)
> +        if (!r->size || r->addr == -1)
>              continue;
>          if (r->type == PCI_ADDRESS_SPACE_IO) {
>              isa_unassign_ioport(r->addr, r->size);
> --
> 			Gleb.

ACK, please apply.


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

* [PATCH] Don't unregister unassigned PCI BAR
@ 2009-02-03 11:58 Gleb Natapov
  2009-02-03 11:26 ` Marcelo Tosatti
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Gleb Natapov @ 2009-02-03 11:58 UTC (permalink / raw)
  To: avi; +Cc: kvm

Signed-off-by: Gleb Natapov <gleb@redhat.com>
diff --git a/qemu/hw/pci.c b/qemu/hw/pci.c
index 04aecc2..a6d57e5 100644
--- a/qemu/hw/pci.c
+++ b/qemu/hw/pci.c
@@ -213,7 +213,7 @@ static void pci_unregister_io_regions(PCIDevice *pci_dev)
 
     for(i = 0; i < PCI_NUM_REGIONS; i++) {
         r = &pci_dev->io_regions[i];
-        if (!r->size)
+        if (!r->size || r->addr == -1)
             continue;
         if (r->type == PCI_ADDRESS_SPACE_IO) {
             isa_unassign_ioport(r->addr, r->size);
--
			Gleb.

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

* Re: [PATCH] Don't unregister unassigned PCI BAR
  2009-02-03 11:58 [PATCH] Don't unregister unassigned PCI BAR Gleb Natapov
  2009-02-03 11:26 ` Marcelo Tosatti
@ 2009-02-03 12:25 ` Avi Kivity
  2009-02-12  1:35 ` Chris Wright
  2 siblings, 0 replies; 4+ messages in thread
From: Avi Kivity @ 2009-02-03 12:25 UTC (permalink / raw)
  To: Gleb Natapov; +Cc: kvm

Gleb Natapov wrote:
> Signed-off-by: Gleb Natapov <gleb@redhat.com>
> diff --git a/qemu/hw/pci.c b/qemu/hw/pci.c
> index 04aecc2..a6d57e5 100644
> --- a/qemu/hw/pci.c
> +++ b/qemu/hw/pci.c
> @@ -213,7 +213,7 @@ static void pci_unregister_io_regions(PCIDevice *pci_dev)
>  
>      for(i = 0; i < PCI_NUM_REGIONS; i++) {
>          r = &pci_dev->io_regions[i];
> -        if (!r->size)
> +        if (!r->size || r->addr == -1)
>              continue;
>          if (r->type == PCI_ADDRESS_SPACE_IO) {
>              isa_unassign_ioport(r->addr, r->size);
>   

Applied, thanks.

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


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

* Re: [PATCH] Don't unregister unassigned PCI BAR
  2009-02-03 11:58 [PATCH] Don't unregister unassigned PCI BAR Gleb Natapov
  2009-02-03 11:26 ` Marcelo Tosatti
  2009-02-03 12:25 ` Avi Kivity
@ 2009-02-12  1:35 ` Chris Wright
  2 siblings, 0 replies; 4+ messages in thread
From: Chris Wright @ 2009-02-12  1:35 UTC (permalink / raw)
  To: Gleb Natapov; +Cc: avi, kvm

* Gleb Natapov (gleb@redhat.com) wrote:
> --- a/qemu/hw/pci.c
> +++ b/qemu/hw/pci.c
> @@ -213,7 +213,7 @@ static void pci_unregister_io_regions(PCIDevice *pci_dev)
>  
>      for(i = 0; i < PCI_NUM_REGIONS; i++) {
>          r = &pci_dev->io_regions[i];
> -        if (!r->size)
> +        if (!r->size || r->addr == -1)
>              continue;

Without this patch the error path for device assignment will segfault
(trying to unregister addr -1).  Please consider for maint/2.6.29.

thanks,
-chris

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

end of thread, other threads:[~2009-02-12  1:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-03 11:58 [PATCH] Don't unregister unassigned PCI BAR Gleb Natapov
2009-02-03 11:26 ` Marcelo Tosatti
2009-02-03 12:25 ` Avi Kivity
2009-02-12  1:35 ` Chris Wright

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox