[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH for-4.14] x86/rtc: provide mediated access to RTC for PVH dom0


  • To: <paul@xxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Fri, 5 Jun 2020 10:54:10 +0200
  • Authentication-results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, 'Wei Liu' <wl@xxxxxxx>, 'Jan Beulich' <jbeulich@xxxxxxxx>, 'Andrew Cooper' <andrew.cooper3@xxxxxxxxxx>
  • Delivery-date: Fri, 05 Jun 2020 08:54:24 +0000
  • Ironport-sdr: aZMt2FD1IV9QWwNk8SKVGu61Py02cuLTD6W6fo2h9CuTR5FocdgXdWUusNyxbIQs/DsB14qbk8 QA6FxinrgLmRrz2Two4GCQIKfSxqHwkBnQ/awUvEecH14I199y/QgFaiRrzXA8vXFY8mcZ8WTt fozyh9FktrIDSLF3gI6zY1zeUGAzutcNqoM+8MH+/d6HNXCPZpXoAJnNGBB1FyjmkbaAMHJX6H y2yDIZKqe0XzT5XNe0+9d666EUMyYVRvR1AmsWXRgEFsu1u4g5g3sYBwT+sT7m4FhnhcPQngKZ D84=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Fri, Jun 05, 2020 at 09:03:11AM +0100, Paul Durrant wrote:
> > -----Original Message-----
> > From: Roger Pau Monne <roger.pau@xxxxxxxxxx>
> > Sent: 05 June 2020 08:50
> > To: xen-devel@xxxxxxxxxxxxxxxxxxxx
> > Cc: paul@xxxxxxx; Roger Pau Monne <roger.pau@xxxxxxxxxx>; Jan Beulich 
> > <jbeulich@xxxxxxxx>; Andrew
> > Cooper <andrew.cooper3@xxxxxxxxxx>; Wei Liu <wl@xxxxxxx>
> > Subject: [PATCH for-4.14] x86/rtc: provide mediated access to RTC for PVH 
> > dom0
> > 
> > At some point (maybe PVHv1?) mediated access to the RTC was provided
> > for PVH dom0 using the PV code paths (guest_io_{write/read}). At some
> > point this code has been made PV specific and unhooked from the
> > current PVH IO path. This patch provides such mediated access to the
> > RTC for PVH dom0, just like it's provided for a classic PV dom0.
> > 
> > Instead of re-using the PV paths implement such handler together with
> > the vRTC code for HVM, so that calling rtc_init will setup the
> > appropriate handlers for all HVM based guests.
> > 
> > Without this a Linux PVH dom0 will read garbage when trying to access
> > the RTC, and one vCPU will be constantly looping in
> > rtc_timer_do_work.
> > 
> > Note that such issue doesn't happen on domUs because the ACPI
> > NO_CMOS_RTC flag is set in FADT, which prevents the OS from accessing
> > the RTC.
> > 
> > Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
> > ---
> > for-4.14 reasoning: the fix is completely isolated to PVH dom0, and as
> > such the risk is very low of causing issues to other guests types, but
> > without this fix one vCPU when using a Linux dom0 will be constantly
> > looping over rtc_timer_do_work with 100% CPU usage, at least when
> > using Linux 4.19 or newer.
> > ---
> 
> I can't say I'm a big fan of the code duplication with emul-priv-op.c, but 
> it's not much code and it does keep this patch small. If the maintainers are 
> happy to ack then consider this...

Calling guest_io_{write/read} straight away is no acceptable IMO (and it
would have to be moved out of emul-priv-op.c), and splitting the RTC
accessors into separate helpers seemed like a lot of churn for the
actual code that such helpers would contain.

> Release-acked-by: Paul Durrant <paul@xxxxxxx>

Thanks.



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.