qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Jones <drjones@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "Maxim Uvarov" <maxim.uvarov@linaro.org>,
	Jose.Marinho@arm.com, "QEMU Developers" <qemu-devel@nongnu.org>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	tf-a@lists.trustedfirmware.org, qemu-arm <qemu-arm@nongnu.org>
Subject: Re: [PATCHv4 2/2] arm-virt: add secure pl061 for reset/power down
Date: Tue, 12 Jan 2021 11:25:26 -0500	[thread overview]
Message-ID: <20210112162526.ob7eroamrdlowfyr@kamzik.brq.redhat.com> (raw)
In-Reply-To: <CAFEAcA9O2kHpcvoofo0v3ahXNOQtw8cxaVC2hn+AjpH6A9RciA@mail.gmail.com>

On Tue, Jan 12, 2021 at 04:00:23PM +0000, Peter Maydell wrote:
> On Tue, 12 Jan 2021 at 15:35, Andrew Jones <drjones@redhat.com> wrote:
> >
> > On Tue, Jan 12, 2021 at 05:30:58PM +0300, Maxim Uvarov wrote:
> > > Add secure pl061 for reset/power down machine from
> > > the secure world (Arm Trusted Firmware). Connect it
> > > with gpio-pwr driver.
> 
> > > +    /* connect secure pl061 to gpio-pwr */
> > > +    qdev_connect_gpio_out(pl061_dev, ATF_GPIO_POWEROFF,
> > > +                          qdev_get_gpio_in_named(gpio_pwr_dev, "reset", 0));
> > > +    qdev_connect_gpio_out(pl061_dev, ATF_GPIO_REBOOT,
> > > +                          qdev_get_gpio_in_named(gpio_pwr_dev, "shutdown", 0));
> >
> > I don't know anything about secure world, but it seems odd that we don't
> > need to add anything to the DTB.
> 
> We should be adding something to the DTB, yes. Look at
> how create_uart() does this -- you set the 'status' and
> 'secure-status' properties to indicate that the device is
> secure-world only.
> 
> 
> 
> > > +    if (vmc->no_secure_gpio) {
> > > +        vms->secure_gpio = false;
> > > +    }  else {
> > > +        vms->secure_gpio = true;
> > > +    }
> >
> > nit: vms->secure_gpio = !vmc->no_secure_gpio
> >
> > But do we even need vms->secure_gpio? Why not just do
> >
> >  if (vms->secure && !vmc->no_secure_gpio) {
> >      create_gpio_secure(vms, secure_sysmem);
> >  }
> >
> > in machvirt_init() ?
> 
> We're just following the same pattern as vmc->no_its/vms->its,
> aren't we ?
>

'its' is a property that can be changed on the command line. Unless
we want to be able to manage 'secure-gpio' separately from 'secure',
then I think vmc->its plus 'secure' should be sufficient. We don't
always need both vmc and vms state, see 'no_ged'.

Thanks,
drew



  reply	other threads:[~2021-01-12 16:26 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-12 14:30 [PATCHv4 0/2] arm-virt: add secure pl061 for reset/power down Maxim Uvarov
2021-01-12 14:30 ` [PATCHv4 1/2] hw: gpio: implement gpio-pwr driver for qemu reset/poweroff Maxim Uvarov
2021-01-12 17:56   ` Hao Wu via
2021-01-12 14:30 ` [PATCHv4 2/2] arm-virt: add secure pl061 for reset/power down Maxim Uvarov
2021-01-12 15:35   ` Andrew Jones
2021-01-12 16:00     ` Peter Maydell
2021-01-12 16:25       ` Andrew Jones [this message]
2021-01-12 16:28         ` Andrew Jones
2021-01-13  7:30           ` Maxim Uvarov
2021-01-14  0:04             ` Andrew Jones
2021-01-14  9:50               ` Peter Maydell
2021-01-14 11:22                 ` Maxim Uvarov
2021-01-14 11:24                   ` Maxim Uvarov
2021-01-14 11:48                     ` Peter Maydell
2021-01-14 12:15                       ` Maxim Uvarov

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=20210112162526.ob7eroamrdlowfyr@kamzik.brq.redhat.com \
    --to=drjones@redhat.com \
    --cc=Jose.Marinho@arm.com \
    --cc=f4bug@amsat.org \
    --cc=maxim.uvarov@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=tf-a@lists.trustedfirmware.org \
    /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).