WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Re: [PATCH] ioemu: Fix the segmentation fault on assigning d

To: Yuji Shimada <shimada-yxb@xxxxxxxxxxxxxxx>
Subject: [Xen-devel] Re: [PATCH] ioemu: Fix the segmentation fault on assigning device without PM cap.
From: Simon Horman <horms@xxxxxxxxxxxx>
Date: Thu, 19 Feb 2009 17:52:14 +1100
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Delivery-date: Wed, 18 Feb 2009 22:52:40 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20090219140037.074E.27C06F64@xxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20090219140037.074E.27C06F64@xxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.18 (2008-05-17)
On Thu, Feb 19, 2009 at 02:04:07PM +0900, Yuji Shimada wrote:
> This patch fixes the segmentation fault on assigning device without
> Power Management Capability Structure.
> 
> Please apply this patch after applying the following patch I have
> submitted.
> 
>     [PATCH] ioemu: Cleanup the code of PCI passthrough.

Hi Shimada-san,

thanks for the patch, I can confirm that it resolves the problem that
I was seeing.

Tested-by: Simon Horman <horms@xxxxxxxxxxxx>

> Signed-off-by: Yuji Shimada <shimada-yxb@xxxxxxxxxxxxxxx>
> 
> 
> diff --git a/hw/pass-through.c b/hw/pass-through.c
> index 855f69c..305ea59 100644
> --- a/hw/pass-through.c
> +++ b/hw/pass-through.c
> @@ -1165,7 +1165,7 @@ static void pt_pci_write_config(PCIDevice *d, uint32_t 
> address, uint32_t val,
>      }
>  
>      /* check power state transition flags */
> -    if (pm_state->flags & PT_FLAG_TRANSITING)
> +    if (pm_state != NULL && pm_state->flags & PT_FLAG_TRANSITING)
>          /* can't accept untill previous power state transition is completed.
>           * so finished previous request here.
>           */
> @@ -1280,7 +1280,7 @@ out:
>      if (!ret)
>          PT_LOG("Error: pci_write_block failed. return value[%d].\n", ret);
>  
> -    if (pm_state->flags & PT_FLAG_TRANSITING)
> +    if (pm_state != NULL && pm_state->flags & PT_FLAG_TRANSITING)
>          /* set QEMUTimer */
>          qemu_mod_timer(pm_state->pm_timer,
>              (qemu_get_clock(rt_clock) + pm_state->pm_delay));
> @@ -1337,7 +1337,7 @@ static uint32_t pt_pci_read_config(PCIDevice *d, 
> uint32_t address, int len)
>      }
>  
>      /* check power state transition flags */
> -    if (pm_state->flags & PT_FLAG_TRANSITING)
> +    if (pm_state != NULL && pm_state->flags & PT_FLAG_TRANSITING)
>          /* can't accept untill previous power state transition is completed.
>           * so finished previous request here.
>           */

-- 
Simon Horman
  VA Linux Systems Japan K.K., Sydney, Australia Satellite Office
  H: www.vergenet.net/~horms/             W: www.valinux.co.jp/en


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>