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

Re: [PATCH] x86/msr: Unify the real {rd,wr}msr() paths in guest_{rd,wr}msr()


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Thu, 23 Jul 2020 13:22:13 +0200
  • Authentication-results: esa4.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Jan Beulich <JBeulich@xxxxxxxx>
  • Delivery-date: Thu, 23 Jul 2020 11:22:26 +0000
  • Ironport-sdr: uM54ZEpV6NCrdOd4ejUXQ+6xfuOc/7tuvAbjurWE2maj1DZkXTZIvFA2aZBGqDgVe87KT4DAXL 0tbwioETkhdXmqJeKUc9pVUmJo8NCpCaRhE8lAV50xNHBzhkIeRYRpupbDgrkuHCxR07R0Eccm 9FG3K20vAaUTOu954/sROvEmhLY5w/zTCzLXRpZaDETa+3kVK9K4bWukR/WShEgCrGPxl0bJ8p sNtGbSJlfkIC/U2Si8n8/MYjgmqV1Bb8p+g3eJDp5uSsgdjt8NBuyxPSOjzP4tOItJKDoyYL0x aMQ=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Wed, Jul 22, 2020 at 11:55:29AM +0100, Andrew Cooper wrote:
> Both the read and write side have commonalities which can be abstracted away.
> This also allows for additional safety in release builds, and slightly more
> helpful diagnostics in debug builds.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>

> ---
> CC: Jan Beulich <JBeulich@xxxxxxxx>
> CC: Wei Liu <wl@xxxxxxx>
> CC: Roger Pau Monné <roger.pau@xxxxxxxxxx>
> 
> I'm not a massive fan of the global scope want_rdmsr_safe boolean, but I can't
> think of a reasonable way to fix it without starting to use other
> flexibiltiies offered to us by C99.  (And to preempt the other question, an
> extra set of braces makes extremely confusing to read logic.)

The logic could be moved to a helper that takes a expected_safe or
some such parameter, but I think I prefer this approach.

Thanks, Roger.



 


Rackspace

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