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

Re: [PATCH] x86/amd: do not expose HWCR.TscFreqSel to guests


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Wed, 13 Sep 2023 10:20:24 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=xbTlCQGtfirLcereGu77XLUfeIP1sO4pDHnx8mrxqoM=; b=QtgwtOJCg4ij8FmTS+O6rVvFJkbkHYHca6fdkki0SUmDu5wCizqdGUDmN8Pxvj2yhOGe9fR3iBLk2d8OCMcJf+GmgDvOH2aBWLq/m2c8GFgzW68NMGqISecGKdOmGtTwMyHuoPIznUBY1NnYZDmv/OL0sINpRDHJ+AOV6ql3wMsS7Z3eKZmdisssiiTv/YwuxjyZUEiAVFBqYHm67z8JXbws2ayzZEs/5i7B/0orDpLUHQIsbCxXkSI05Opv/0rbA4lzjZJWGAGMwOxWc75FWD5clIakaKDMGphsH84QZVqgcE3wX2RdJvq92dJajxJo41j4MrUL38VL3lL3rnX/yg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VJOaGqWbNdLLtio/P4zW5CfkxbCLU3PBB5jej7USnQWbdIQjl5n6RkupE+UgjkVX9HcQHsZ0A3n2tX9Hxw+H3IquvXJfA9klj0Scfybc+/0ISPwG8J1xclDLLmIAXGSAbXfbk/PaBmd5zzWbZ4IiTdHYmb7d9usrN4QhPKdX3D5XFnLu2lvSwdrQVYdeT6qLADzBbm2le5qUUSTRs1WSZpjRdjhNVtcqHm30Z47U5kK3Eevj+Ii7i6iKuhCz2CnHuwU55uDKtmOZHSptXpkywQ3t+s56N2hKFL/bLuC2thRfR9EwiSQBP5lOD0iRovWip5x3wyOSDCneO3C9jWhcKQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 13 Sep 2023 08:20:53 +0000
  • Ironport-data: A9a23:S/3E4Kv1bduVNI1Jok553tTYz+fnVHBfMUV32f8akzHdYApBsoF/q tZmKW7Xaf7famD8e4pzb4++8EJVu5fXn4JqGgBr+ylgEyxH+JbJXdiXEBz9bniYRiHhoOCLz O1FM4Wdc5pkJpP4jk3wWlQ0hSAkjclkfpKlVaicfHg3HFc4IMsYoUoLs/YjhYJ1isSODQqIu Nfjy+XSI1bg0DNvWo4uw/vrRChH4rKq4lv0gnRkPaoQ5A6HzCFMZH4iDfrZw0XQE9E88tGSH 44v/JnhlkvF8hEkDM+Sk7qTWiXmlZaLYGBiIlIPM0STqkAqSh4ai87XB9JFAatjsB2bnsgZ9 Tl4ncfYpTHFnEH7sL91vxFwS0mSNEDdkVPNCSDXXce7lyUqf5ZwqhnH4Y5f0YAwo45K7W9yG fMwdCsvPw+mtciM0uiHafNi28kZK/vUM9ZK0p1g5Wmx4fcOZ7nmGv2PwOACmTA6i4ZJAOrUY NcfZXx3dhPcbhZTO1ARTpUjgOOvgXq5eDpdwL6XjfNvvy6Pk0osjf60aIW9lt+iHK25mm6Co W3L5SLhCwwyP92D0zuVtHmrg4cjmAuiAthJSODjp6MCbFu7ymc+Ci00fgeHjKeSt2TiA9hEK nI39X97xUQ13AnxJjXnZDW6qnOZuh8XW/JLDvY3rgqKz8L8/AKxFmUCCDlbZ7QOpMIwADAny FKNt9foHiB09q2YT2qH8bWZpi/0PjIaRVLufgcBRAoBptz8+oc6i0uXSs45SfbqyNroBTv33 jaG6jAkgKkehtIK0KP9+k3bhzWrpd7CSQtdChjrY19JJzhRPOaND7FEI3CChRqcBO51lmW8g UU=
  • Ironport-hdrordr: A9a23:n4aGnKPBiyUacsBcTgWjsMiBIKoaSvp037BK7S1MoH1uA6mlfq WV9sjzuiWatN98Yh8dcLO7Scu9qBHnlaKdiLN5VduftWHd01dAR7sSjrcKrQeAJ8X/nNQtr5 uJccJFeaDN5Y4Rt7eH3OG6eexQv+Vu6MqT9IPjJ+8Gd3ATV0lnhT0JbTqzIwlNayRtI4E2L5 aY7tovnUvaRZxGBv7LYEXsRoL41qT2qK4=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Wed, Sep 13, 2023 at 08:14:46AM +0200, Jan Beulich wrote:
> On 12.09.2023 18:23, Roger Pau Monne wrote:
> > OpenBSD will attempt to unconditionally access PSTATE0 if HWCR.TscFreqSel is
> > set, and will also attempt to unconditionally access HWCR if the TSC is
> > reported as Invariant.
> > 
> > The reasoning for exposing HWCR.TscFreqSel was to avoid Linux from printing 
> > a
> > (bogus) warning message, but doing so at the cost of OpenBSD not booting is 
> > not
> > a suitable solution.
> 
> Why is the warning bogus? The PPR doesn't even state what the bit being
> clear means; it's a r/o one. On respective families it cannot possibly
> be correct to expose it clear.

There are other bits in the same MSR that only state the meaning of
one value and are not r/o, so my take is that being clear means "The
TSC doesn't increment at the P0 frequency".

Since it's model specific, it should be possible for some models to
have the bit clear.

> > In order to fix expose an empty HWCR.
> > 
> > Fixes: 14b95b3b8546 ('x86/AMD: expose HWCR.TscFreqSel to guests')
> > Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
> > ---
> > Not sure whether we want to expose something when is_cpufreq_controller() is
> > true, seeing as there's a special wrmsr handler for the same MSR in that 
> > case.
> > Likely should be done for PV only, but also likely quite bogus.
> 
> Well, keying to is_cpufreq_controller() is indeed questionable, but is
> there any reason to not minimally expose the bit correctly when a
> domain cannot migrate?

We would then also need to expose PSTATE0 at least to make OpenBSD
happy (and any otehr guest that makes the connection between
TscFreqSel and getting the P0 frequency from PSTATE0.

Thanks, Roger.



 


Rackspace

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