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

Re: [PATCH 3/8] x86/pv: handle writes to the EFER MSR


  • To: Roger Pau Monne <roger.pau@xxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Tue, 18 Aug 2020 14:46:06 +0100
  • Authentication-results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Jan Beulich <jbeulich@xxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Tue, 18 Aug 2020 13:46:15 +0000
  • Ironport-sdr: AZDZoy4j5Jo38m000PgNkaGgPv2mKyvGyz8xGp5Ugdn5WLVbBf9suWO4TopTGCm5AtrLS20Xd9 Msyt1gJgsfjducr0cNavOe8NVI/R65qb0UfNC7kAwKhSiszDbLvVLT9BIaDFJNG9WH+wKonbvx uveVvs8xJWWRO3rnDLBLOeFK7N/J0cenILXNmanAvneM+ds4msiuaLocYNUjILqG5Kdw63Dtue AdS+hPYuT9tPjSKLC/O0KspP41uqQYlCIRfU2HsQ7/ax130jhS/yAC1WUn8kqo9KcYei4Pf1+S rDs=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 17/08/2020 16:57, Roger Pau Monne wrote:
> @@ -1005,6 +1013,13 @@ static int write_msr(unsigned int reg, uint64_t val,
>          curr->arch.pv.gs_base_user = val;
>          return X86EMUL_OKAY;
>  
> +    case MSR_EFER:
> +        /* Silently drop writes that don't change the reported value. */
> +        temp = guest_efer(currd);
> +        if ( val != temp )
> +            goto invalid;

break.

The invalid label does write-discard, rather than injecting #GP.

The comment would be clearer as "Reject writes which change the value,
but tolerate no-op writes", seeing as that is the compatibility
behaviour we're adding.

~Andrew



 


Rackspace

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