From: Christoffer Dall <christoffer.dall@linaro.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Peter Maydell <peter.maydell@linaro.org>,
Paul Mundt <Paul.Mundt@huawei.com>,
linaro-acpi@lists.linaro.org,
Claudio Fontana <claudio.fontana@huawei.com>,
QEMU Developers <qemu-devel@nongnu.org>,
Jani Kokkonen <Jani.Kokkonen@huawei.com>,
"tech@virtualopensystems.com" <tech@virtualopensystems.com>
Subject: Re: [Qemu-devel] [Linaro-acpi] [RFC PATCH 0/7] hw/arm/virt: Dynamic ACPI v5.1 table generation
Date: Wed, 12 Nov 2014 14:35:01 +0100 [thread overview]
Message-ID: <20141112133501.GI19598@cbox> (raw)
In-Reply-To: <7232929.gJKyc68Ey4@wuerfel>
On Wed, Nov 12, 2014 at 02:03:01PM +0100, Arnd Bergmann wrote:
> On Wednesday 12 November 2014 12:34:01 Christoffer Dall wrote:
> > On Wed, Nov 12, 2014 at 12:15:08PM +0100, Arnd Bergmann wrote:
> > > On Wednesday 12 November 2014 10:56:40 Mark Rutland wrote:
> > > >
> > > > For the features which ACPI provides which device trees do not (e.g. the
> > > > dynamic addition and removal of memory and CPUs), there will need to be
> > > > some sort of interface between QEMU and the ACPI implementation. That's
> > > > already outside of the realm of DT, so as previously mentioned a simple
> > > > conversion doesn't cover the general case.
> > >
> > > I think we need to support the low-level interfaces in the kernel for
> > > this anyway, we should not have to use ACPI just to do memory and CPU
> > > hotplugging in KVM, that would be silly.
> >
> > I had that same intuitive feeling, but lacked good tecnical arguments
> > for it. Care to elaborate on that?
>
> ACPI always has to interface back to the hypervisor to do anything that
> changes the hardware configuration, so it essentially has to perform
> a hypercall or touch some virtual register.
>
> If we need to architect that interface in qemu anyway, we should make
> it sane enough for the kernel to use directly, without having to go
> through ACPI, as not everyone will want to run ACPI.
>
With the usual benefits of doing it in ACPI will not require updates on
both sides if we need to fix something, but also the usual downside of
having something obscure and pseduo-hidden, which may be broken
underneath, I suppose.
> > > If ACPI is present, it can
> > > provide a wrapper for the same interface, but KVM should not need to
> > > be aware of the fact that ACPI is used in the guest, after it has
> > > passed the initial ACPI blob to the kernel.
> >
> > That's where things begin to be a bit foggy for me. AFAIU ACPI already
> > has a method for doing this and I speculate that there is some IRQ
> > assigned to an ACPI event that causes some AML code to be interpreted by
> > your OS. Wouldn't it be a matter of QEMU putting the right AML table
> > fragments in place to wire this up then?
>
> Yes, that is what I meant with a wrapper. The two choices are:
>
> 1. have an interrupt and a hypercall or mmio interface. When the
> interrupt gets triggered, we ask the interface what happened and
> do something on the same interface depending on the state of the
> system.
>
> 2. have an interrupt that causes AML code to be run, that code will
> use the hypercall or mmio interface to find out what happened and
> create an ACPI event. This event is enqueued to the generic ACPI
> hotplug handler, which depending on the state of the system decides
> to do something by calling into AML code again, which will trigger
> the underlying interface.
>
> From qemu's point of view, the two are doing exactly the same thing,
> except that the MMIO access can be hidden in AML so the OS doesn't have
> to know the interface.
right, thanks for the explanation.
> Note that in case of Xen, the use of hypercalls
> means that the OS has to know the interface after all, so the second
> half of the process is handled by drivers/xen/xen-acpi-*hotplug.c.
>
> Note how the implementation that uses the ACPI wrapper is much
> more complex than the native one that does the same thing:
>
> -rw-r--r-- 1 arnd arnd 2119 Nov 10 16:43 drivers/xen/cpu_hotplug.c
> -rw-r--r-- 1 arnd arnd 10987 Nov 10 16:43 drivers/xen/xen-acpi-cpuhotplug.c
>
> -rw-r--r-- 1 arnd arnd 6894 Nov 10 16:43 drivers/xen/xen-balloon.c
> -rw-r--r-- 1 arnd arnd 12085 Nov 10 16:43 drivers/xen/xen-acpi-memhotplug.c
>
Interesting.
-Christoffer
next prev parent reply other threads:[~2014-11-12 13:35 UTC|newest]
Thread overview: 71+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-30 17:43 [Qemu-devel] [RFC PATCH 0/7] hw/arm/virt: Dynamic ACPI v5.1 table generation Alexander Spyridakis
2014-10-30 17:43 ` [Qemu-devel] [RFC PATCH 1/7] hw/i386: Move ACPI header definitions in an arch-independent location Alexander Spyridakis
2014-10-30 17:44 ` [Qemu-devel] [RFC PATCH 2/7] hw/arm/virt-acpi: Basic skeleton for dynamic generation of ACPI tables Alexander Spyridakis
2014-10-30 17:46 ` Peter Maydell
2014-10-30 17:52 ` [Qemu-devel] [RFC PATCH 0/7] hw/arm/virt: Dynamic ACPI v5.1 table generation Peter Maydell
2014-10-30 18:02 ` [Qemu-devel] [Linaro-acpi] " Mark Rutland
2014-11-05 9:58 ` Claudio Fontana
2014-11-06 12:44 ` Peter Maydell
2014-11-06 12:57 ` Igor Mammedov
2014-11-06 13:33 ` Alexander Spyridakis
2014-11-06 13:52 ` Peter Maydell
2014-11-11 15:29 ` Mark Rutland
2014-11-11 16:31 ` Christoffer Dall
2014-11-11 16:48 ` Mark Rutland
2014-11-11 21:33 ` Christoffer Dall
2014-11-12 10:38 ` Mark Rutland
2014-11-12 10:44 ` Christoffer Dall
2014-11-12 10:55 ` Julien Grall
2014-11-12 11:07 ` Mark Rutland
2014-11-12 11:38 ` Graeme Gregory
2014-11-12 11:52 ` Paolo Bonzini
2014-11-12 12:04 ` Mark Rutland
2014-11-12 12:12 ` Paolo Bonzini
2014-11-12 13:27 ` Peter Maydell
2014-11-12 13:32 ` Paolo Bonzini
2014-11-12 15:01 ` Claudio Fontana
2014-11-12 15:32 ` Arnd Bergmann
2014-11-12 15:39 ` Peter Maydell
2014-11-12 15:52 ` Paolo Bonzini
2014-11-12 15:57 ` Arnd Bergmann
2014-11-12 16:04 ` Paolo Bonzini
2014-11-12 16:13 ` Arnd Bergmann
2014-11-12 16:25 ` Paolo Bonzini
2014-11-12 17:33 ` Peter Maydell
2014-11-13 8:32 ` Gerd Hoffmann
2014-11-13 8:14 ` Gerd Hoffmann
2014-11-13 8:10 ` Gerd Hoffmann
2014-11-13 18:16 ` Al Stone
2014-11-13 19:22 ` Paolo Bonzini
2014-11-14 7:54 ` Gerd Hoffmann
2014-11-12 9:08 ` Claudio Fontana
2014-11-12 10:56 ` Mark Rutland
2014-11-12 11:15 ` Arnd Bergmann
2014-11-12 11:34 ` Christoffer Dall
2014-11-12 11:48 ` Paolo Bonzini
2014-11-12 12:18 ` Mark Rutland
2014-11-12 12:27 ` Paolo Bonzini
2014-11-12 12:40 ` Christoffer Dall
2014-11-12 13:08 ` Arnd Bergmann
2014-11-12 13:27 ` Paolo Bonzini
2014-11-12 13:41 ` Mark Rutland
2014-11-12 13:59 ` Paolo Bonzini
2014-11-12 14:10 ` Mark Rutland
2014-11-12 14:46 ` Paolo Bonzini
2014-11-12 13:03 ` Arnd Bergmann
2014-11-12 13:35 ` Christoffer Dall [this message]
2014-11-12 11:55 ` Mark Rutland
2014-11-12 18:10 ` Peter Maydell
2014-11-13 9:57 ` Claudio Fontana
2014-11-17 17:52 ` Peter Maydell
2014-11-06 6:53 ` Hanjun Guo
2014-11-06 13:30 ` Mark Rutland
2014-11-06 13:33 ` Arnd Bergmann
2014-11-06 15:57 ` Paolo Bonzini
2014-11-06 16:18 ` Igor Mammedov
2014-11-06 16:27 ` Paolo Bonzini
2014-11-07 8:31 ` Hanjun Guo
2015-03-09 12:12 ` Leif Lindholm
2015-03-09 12:28 ` Peter Maydell
2015-03-09 12:47 ` Shannon Zhao
2015-03-09 14:50 ` Leif Lindholm
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=20141112133501.GI19598@cbox \
--to=christoffer.dall@linaro.org \
--cc=Jani.Kokkonen@huawei.com \
--cc=Paul.Mundt@huawei.com \
--cc=arnd@arndb.de \
--cc=claudio.fontana@huawei.com \
--cc=linaro-acpi@lists.linaro.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=tech@virtualopensystems.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).