Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E45FCC432BE for ; Wed, 18 Aug 2021 12:07:30 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AB3C66103A for ; Wed, 18 Aug 2021 12:07:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org AB3C66103A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=invisiblethingslab.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.168225.307132 (Exim 4.92) (envelope-from ) id 1mGKLp-00027o-HF; Wed, 18 Aug 2021 12:07:21 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 168225.307132; Wed, 18 Aug 2021 12:07:21 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mGKLp-00027h-ED; Wed, 18 Aug 2021 12:07:21 +0000 Received: by outflank-mailman (input) for mailman id 168225; Wed, 18 Aug 2021 12:07:20 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mGKLo-00027Z-Dv for xen-devel@lists.xenproject.org; Wed, 18 Aug 2021 12:07:20 +0000 Received: from out1-smtp.messagingengine.com (unknown [66.111.4.25]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id c327e345-55a0-4359-b603-ed8104de5f8a; Wed, 18 Aug 2021 12:07:19 +0000 (UTC) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 385775C0166; Wed, 18 Aug 2021 08:07:19 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Wed, 18 Aug 2021 08:07:19 -0400 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 18 Aug 2021 08:07:17 -0400 (EDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: c327e345-55a0-4359-b603-ed8104de5f8a DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=oKowFU LHPXbYycTSY8Bupo1v97GqawWPmeZvxW+w1go=; b=E+juIwywF90keSvzg+4Q5K XQDhIy4NRNOqQ/bHS7bzJIZGmXtMvxgr3BAGBKgDijo1V6ZWiWyvPQ6wNh9bU1GT 3YZjt3BUxQenr2SaYQ+c4okYqzgeNdWm0PIhwQf6t2eCu5QYm6vtZeRgJY6KeiB2 sHv1v0sIcalquDcjb20Q66FaMbz99FefOHOStqLmLBcnVjwFYZ/5OuRxQtByrQnU VBjDRHfcsL46TO+URiczD/zCeic0faPmWDsBDk1UgsvlNgkXwdYC2HOrKLJKIprj sXJ143DGkLBmDQtwkL5MKHdieRqGRTz1FoXl4iNNjzbroNQnBrOEaXEeiMnn10yA == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrleehgdegkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggujgesghdtreertddtjeenucfhrhhomhepofgrrhgvkhcu ofgrrhgtiiihkhhofihskhhiqdfikphrvggtkhhiuceomhgrrhhmrghrvghksehinhhvih hsihgslhgvthhhihhnghhslhgrsgdrtghomheqnecuggftrfgrthhtvghrnhepteevffei gffhkefhgfegfeffhfegveeikeettdfhheevieehieeitddugeefteffnecuvehluhhsth gvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhgrrhhmrghrvghksehi nhhvihhsihgslhgvthhhihhnghhslhgrsgdrtghomh X-ME-Proxy: Date: Wed, 18 Aug 2021 14:07:14 +0200 From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= To: Jan Beulich Cc: Andrew Cooper , Roger Pau =?utf-8?B?TW9ubsOp?= , xen-devel@lists.xenproject.org, Wei Liu Subject: Re: [PATCH] x86/xstate: reset cached register values on resume Message-ID: References: <20210818113017.454251-1-marmarek@invisiblethingslab.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="k8l2YMpQcVkz8cJN" Content-Disposition: inline In-Reply-To: --k8l2YMpQcVkz8cJN Content-Type: text/plain; protected-headers=v1; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Date: Wed, 18 Aug 2021 14:07:14 +0200 From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= To: Jan Beulich Cc: Andrew Cooper , Roger Pau =?utf-8?B?TW9ubsOp?= , xen-devel@lists.xenproject.org, Wei Liu Subject: Re: [PATCH] x86/xstate: reset cached register values on resume On Wed, Aug 18, 2021 at 02:05:05PM +0200, Jan Beulich wrote: > On 18.08.2021 13:30, Marek Marczykowski-G=C3=B3recki 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; > > } > > =20 > > + /* > > + * Clear the cached value to make set_xcr0() and set_msr_xss() rea= lly > > + * write it. > > + */ > > + this_cpu(xcr0) =3D 0; >=20 > While XCR0 cannot be successfully written with 0, ... >=20 > > + this_cpu(xss) =3D 0; >=20 > ... XSS can. XSS can't be written with various other values; I'd > suggest using ~0 here. Then >=20 > Reviewed-by: Jan Beulich >=20 > and I'd be happy to make the adjustment while committing, so long > as you agree. Yes, makes sense. Thanks! --=20 Best Regards, Marek Marczykowski-G=C3=B3recki Invisible Things Lab --k8l2YMpQcVkz8cJN Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAmEc9/IACgkQ24/THMrX 1yzRpwgAgRDlRanRthkZVY5hffkzrUy5gUoo7W7B8sweSvfrFV3sTMyCTwEw5FQH kO3fswuIE4HEiXZ/geiGi9LVBPNYZxPp4MomydpRS6C6l6J4Nru9ad5JPCTLTkYe 8FYSwWVE15CBmu9fM4TssleU8rwqsu/FReP1irua5yGgdDV5ARzfdywrkdrI9xs5 lpt2pX3FN99q5C+s904qAOmrLWETKANjvwsmQtShZ0rEX3R4QfmGvwCOYrMV/cU/ mEWtuZoq5vr44r5LKeecVZ+DE2DCvURVcy+2mCGazCtAguow6Py9LpabDowbSf7D E98sYYvTSrMl0E9D+H92zABLPZbLIQ== =yhSV -----END PGP SIGNATURE----- --k8l2YMpQcVkz8cJN--