qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Jérôme Forissier" <jerome.forissier@linaro.org>
To: xiaoqiang zhao <zxq_yx_007@163.com>,
	qemu-devel@nongnu.org, peter.maydell@linaro.org
Cc: qemu-discuss@nongnu.org, pbonzini@redhat.com
Subject: Re: [Qemu-devel] [PATCH] hw/arm: virt uart fix
Date: Wed, 8 Jun 2016 08:23:48 +0200	[thread overview]
Message-ID: <5757B9F4.5090406@linaro.org> (raw)
In-Reply-To: <1465353045-26323-1-git-send-email-zxq_yx_007@163.com>



On 06/08/2016 04:30 AM, xiaoqiang zhao wrote:
> commit f0d1d2c115dffc1fbaf954d0b449db05c5eb79b1
> ("hw/char: QOM'ify pl011 model") break qemu-system-arm virt machine
> if option '-machine secure=on' is provided.
> 
> The function create_uart is called twice. So make CharDriverState pointer
> a parameter to create_uart instead of hardcoded.
> 
> Signed-off-by: xiaoqiang zhao <zxq_yx_007@163.com>
> ---
>  hw/arm/virt.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

FWIW,

Tested-by: Jerome Forissier <jerome.forissier@linaro.org>

Thanks!

> 
> diff --git a/hw/arm/virt.c b/hw/arm/virt.c
> index 8e46137..73113cf 100644
> --- a/hw/arm/virt.c
> +++ b/hw/arm/virt.c
> @@ -525,7 +525,7 @@ static void create_gic(VirtBoardInfo *vbi, qemu_irq *pic, int type, bool secure)
>  }
>  
>  static void create_uart(const VirtBoardInfo *vbi, qemu_irq *pic, int uart,
> -                        MemoryRegion *mem)
> +                        MemoryRegion *mem, CharDriverState *chr)
>  {
>      char *nodename;
>      hwaddr base = vbi->memmap[uart].base;
> @@ -536,7 +536,7 @@ static void create_uart(const VirtBoardInfo *vbi, qemu_irq *pic, int uart,
>      DeviceState *dev = qdev_create(NULL, "pl011");
>      SysBusDevice *s = SYS_BUS_DEVICE(dev);
>  
> -    qdev_prop_set_chr(dev, "chardev", serial_hds[0]);
> +    qdev_prop_set_chr(dev, "chardev", chr);
>      qdev_init_nofail(dev);
>      memory_region_add_subregion(mem, base,
>                                  sysbus_mmio_get_region(s, 0));
> @@ -1259,11 +1259,11 @@ static void machvirt_init(MachineState *machine)
>  
>      create_gic(vbi, pic, gic_version, vms->secure);
>  
> -    create_uart(vbi, pic, VIRT_UART, sysmem);
> +    create_uart(vbi, pic, VIRT_UART, sysmem, serial_hds[0]);
>  
>      if (vms->secure) {
>          create_secure_ram(vbi, secure_sysmem);
> -        create_uart(vbi, pic, VIRT_SECURE_UART, secure_sysmem);
> +        create_uart(vbi, pic, VIRT_SECURE_UART, secure_sysmem, serial_hds[1]);
>      }
>  
>      create_rtc(vbi, pic);
> 

  reply	other threads:[~2016-06-08  6:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-08  2:30 [Qemu-devel] [PATCH] hw/arm: virt uart fix xiaoqiang zhao
2016-06-08  6:23 ` Jérôme Forissier [this message]
2016-06-08 19:05   ` Peter Maydell

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=5757B9F4.5090406@linaro.org \
    --to=jerome.forissier@linaro.org \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-discuss@nongnu.org \
    --cc=zxq_yx_007@163.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 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).