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

Re: [PATCH] x86/xstate: reset cached register values on resume


  • To: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 18 Aug 2021 14:05:05 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qUy51wxRUL5/HbiqqtwHK7WCzXUv5fi32Kx+BsuxSHk=; b=WVFSsASJ+a+X4PZjV3ZXooJ+R1Da1ZHxxZxphzA0ekQevou8qwPviwbc8WfVExLxhyHQj5pFv3iQ6bCEa3f9h6dwLhd3rEcLt3mSuOyXJMjNQO6M4ZA1X+HlxjdGoqe/Lko+cRFscKgAGV5wOMDlND+TM12P7uKgLt8X18dFm8qvh6/NyUW4VlzRS/kxoHV9ciwhJganGtdlt7M016kZr0EnHbtv7q76WtYq71ISjWCSfMGraFcqNfaLO1iwE6U/8VVvprKOwbLY8UHZheWIAJMFk4nBwdtoHl+tZYCl8Owrinhk22q43L7B7CBr7UBazNpI8ytedFBvLdgh+DH8nQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k/XMvCt+00qFiKG6+K+YkuiN6EdipRYLGJSxsRf48jDBTBdx14wsSJFLxn9SlHnavZQN6GQ9Dtnp30O9Uy4skslq1hgfUFk+7sq5KNxnuBBk9+NCJoIoYkLkovUwVP/JVijJeC+kHsnPBQ5KactMKrgTZKZs3vkuePcznTR9iIMhNW5iruNaHsFaTXpHEN6xFX2zXmUKpg7uDR6gaae1aej708RIzIjBuCKjvrtjQWTmswE3tT1D2LSU29E+4NC/zyQtHtzC2AS0RyW4KIit9L5ax0n2hQ1W3iL22plAmU36vwSDkC8/4pWYDj+MZ6el70IVA33MZLNKcrBnFzZwaQ==
  • Authentication-results: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Wed, 18 Aug 2021 12:05:15 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 18.08.2021 13:30, Marek Marczykowski-Górecki wrote:
> --- a/xen/arch/x86/xstate.c
> +++ b/xen/arch/x86/xstate.c
> @@ -642,6 +642,13 @@ void xstate_init(struct cpuinfo_x86 *c)
>          return;
>      }
>  
> +    /*
> +     * Clear the cached value to make set_xcr0() and set_msr_xss() really
> +     * write it.
> +     */
> +    this_cpu(xcr0) = 0;

While XCR0 cannot be successfully written with 0, ...

> +    this_cpu(xss) = 0;

... XSS can. XSS can't be written with various other values; I'd
suggest using ~0 here. Then

Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

and I'd be happy to make the adjustment while committing, so long
as you agree.

Jan




 


Rackspace

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