[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK8P3a2fzFdXoMKz_-Bryq0HUar=Tgs7SwJL4JFw2_KjzpOPdg@mail.gmail.com>
Date: Wed, 18 Mar 2020 10:44:16 +0100
From: Arnd Bergmann <arnd@...db.de>
To: Michael Kelley <mikelley@...rosoft.com>
Cc: Will Deacon <will@...nel.org>, Ard Biesheuvel <ardb@...nel.org>,
Catalin Marinas <catalin.marinas@....com>,
Mark Rutland <mark.rutland@....com>,
Marc Zyngier <maz@...nel.org>,
Linux ARM <linux-arm-kernel@...ts.infradead.org>,
gregkh <gregkh@...uxfoundation.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-hyperv@...r.kernel.org" <linux-hyperv@...r.kernel.org>,
linux-efi <linux-efi@...r.kernel.org>,
linux-arch <linux-arch@...r.kernel.org>,
"olaf@...fle.de" <olaf@...fle.de>,
Andy Whitcroft <apw@...onical.com>,
vkuznets <vkuznets@...hat.com>, Jason Wang <jasowang@...hat.com>,
"marcelo.cerri@...onical.com" <marcelo.cerri@...onical.com>,
KY Srinivasan <kys@...rosoft.com>,
Sunil Muthuswamy <sunilmut@...rosoft.com>,
Boqun Feng <boqun.feng@...il.com>,
John Stultz <john.stultz@...aro.org>,
Thomas Gleixner <tglx@...utronix.de>,
Stephen Boyd <sboyd@...nel.org>
Subject: Re: [PATCH v6 07/10] arm64: hyperv: Initialize hypervisor on boot
On Wed, Mar 18, 2020 at 1:18 AM Michael Kelley <mikelley@...rosoft.com> wrote:
>
> From: Arnd Bergmann <arnd@...db.de> Sent: Monday, March 16, 2020 1:30 AM
> >
> > As you are effectively adding a new clocksource driver here, please move the
> > code to drivers/clocksource and send the patch to the respective maintainers
> > (added to Cc here), splitting it out from the rest of the patch.
> >
> > You should also describe why your platform doesn't just use the normal
> > architected timer interface.
> >
> > > +TIMER_ACPI_DECLARE(hyperv, ACPI_SIG_GTDT, hyperv_init);
> >
> > This looks like it registers a driver for the same device as the normal
> > arch timer. Won't that clash?
>
> There is a Hyper-V clocksource driver in drivers/clocksource/hyperv_timer.c.
> It is architecture independent and works for both x86 and ARM64.
>
> The requirement here is really for a place to hang the general Hyper-V
> initialization code. On the x86 side, there's infrastructure already in place
> to do hypervisor initialization, but nothing corresponding on the ARM64 side.
> The TIMER_ACPI_DECLARE hook is admittedly a temporary approach, and I'm
> happy to hear if someone has a better way to handle this.
>
> FWIW, Hyper-V doesn't currently virtualize the ARM arch counter/timer for
> guest VMs. The Hyper-V synthetic counter/timer in the Hyper-V clocksource
> driver is used on both ARM64 and x86. But this Hyper-V init code doesn't actually
> touch the GTDT device, so it won't interfere with the ARM arch counter/timer
> when a future Hyper-V version does virtualize it.
I don't have a good idea to solve it, just a few more thoughts:
- if your platform does not actually provide the generic timer, then the
ACPI tables should not list one either. Instead, create a separate
description for your custom timer, and have that added to the ACPI
spec.
- To treat the timer more like a normal driver, better have the
TIMER_ACPI_DECLARE() function live only in the driver itself,
and use an early initcall (arch_initcall, subsys_initcall, etc)
it initialize the rest as late as you can.
- Some of the other code added to arch/arm64/ might be able to
live in drivers/virt/hyperv in order to be shared between x86 and
arm64. (No idea how much of it there is).
Arnd
Powered by blists - more mailing lists