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

Remaining MSR wrinkles


  • To: <committers@xxxxxxxxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Wed, 10 Mar 2021 17:46:46 +0100
  • 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-SenderADCheck; bh=gmGLIOoT+DiOsrVphlt5lw1sE8UbvBvcFWORl/tmDbE=; b=E6v98V1lQbpVTZDqTVkCgaDWkCZOrKRmQTQ/aQ8ydE3ELKfnT2Hf0a+ZQ5TWyOeVSonSJeEDf4lEVdbg3HyZinC1XWG8dCcLbd9gFwVQ1ydp0ZcEyzxQdJ0THjL3vOclBVWWzPoPldSdUOYPULcDJB3nucMJIS7opcmLNJxF6p2ZU49a7NOTRfAWXnKqHqk/ZVPQjYBffYOf8QD00vdf3eXcjPBHj6Rlp8X39PkRFnGRc+sR56WRGxL15z7v5tSkxmvQNuy0p7oo/QwIw6QJH+4ATDFgjegUB6H0kdKaToW4yLSJEfyIXC4XIA40IkU8Sw2mk7T01bGi0d1IdRflmw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RqaZc2eWDMIJc5pvts9t0QJ6eoHU8dYK5Qdo25jVxfvtCsO3ozUVuyBdnnS2Keo1jyCLDFqs0OltaX2IINrPdWljGax5UXMRgEgQJPGkC0z3rGkyijyEbe5dJarN8/YcXeePvp+D7tDTE3VhsLImPT3QvJGzdG7QouILJrdU0KrNZo00Ktl9xPMBYcuvOGUt80M1qeK1JT5WN/1fCEGMk/Pu6fXqQ4Ovot6wso8zYsX4DXOYPA8ZWgL+f6E2ePpHOJYzil54H5sKLWKuQXlqwCh0+RQo3veUoX9CMmabqW+W16XLSMvN2uZwzbu9BYioWW3L96lR2Gk6/t1M9P12xQ==
  • Authentication-results: esa4.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>
  • Delivery-date: Wed, 10 Mar 2021 19:02:33 +0000
  • Ironport-hdrordr: A9a23:fS6H7a949CvUsfT34W9uk+EocL1zdoIgy1knxilNYDRvWIixi9 2ukPMH1RX9lTYWXzUalcqdPbSbKEmyybdc2qNUGbu5RgHptC+TLI9k5Zb/2DGIIUHD38Zn/+ Nbf6B6YeecMXFTkdv67A6kE9wp3dmA9+SSif3Dymp2JDsKV4hLxW5Ce2GmO2dxQxRLAod8OZ qH/8xcpyehf3N/VLXBOlAuWe/fq9rX0K/3eBJuPW9e1CCirxONrIT7HR+RwwsEX1p0r4sK3G DZn2XCl8eemt6hzBu07R63071zuP/MjuROH9aNjM99EESSti+NaJ56U7OP+BAZydvfkWoCq9 XHrxc+M8kb0Rq4FQvU0HidqjXI6zoy92TkjWaRnHqLm72EeBsBF8FDiYhFGyGpjXYIgdcU6t Mu40up87BTDR/GgR3n4cnJWxxAhiOP0AcfuN9WoHpFXYQEbrhN6aQZ4UNOCZ8FWBn38YY9DY BVfYrhzccTVWnfQ2HSv2FpztDpdnMvHi2eSkxHnsCOyTBZkF1w0kNw/r1Uol4wsLYGD7VU7e XNNapl0JtUSNUNUK57DOAdBeOqF23kW3v3QS2vCGWiMJtCF2PGqpbx7rlwzvqtYoY0wJw7n4 mEeE9EtFQ1Z1nlBaS1rdF22yGIZF/4cSXmy8lY6ZQ8kKb7XqDXPSqKT01rvNCnp9kZH83HS9 e+MJ9bGJbYXCrTMLcM+ze7d4hZKHEYXsFQkM08QUiyrsXCLZCvluGzSoeSGJPdVRIfHk/vCH oKWzb+YO9a6FqwZ3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He6wUKj4XSl842QROXBbCQ+xtPntgmj27BEUOghPgT3KYaas0GhYtx/3gheoi8I7 mME=
  • Ironport-sdr: eq+k6QL/pN5/H6Qtg8hcNXGSxza6pH21qQBzNwYmfe9CT5QOweDHhPWH46BNM1sY9vVzb7LU+1 rdY4suQG0AVw++AxdrBSv6b1mrmahAdOYhvFPVoxGraT3sgCxeTaFVyuoPslREgpYs/DCvaLT4 5gqa/fI6j+K0TtQNxP1OLY2KQcQruEg3eoaxADdU4665ghR1CvnIysLz/VtuINU1KWeqGUvsRX Ada7sk6vRG/2zsFbxZtO2IqKSfd36FsCqiA6GhTRFwOq6Ub+r8eZEUuWnx459MHH9KLSh6LQmT S6g=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Resent-date: Wed, 10 Mar 2021 19:02:10 +0000
  • Resent-from: Ian Jackson <iwj@xxxxxxxxxxxxxx>
  • Resent-message-id: <24649.6066.185913.382873@xxxxxxxxxxxxxxxxxxxxxxxx>
  • Resent-to: <xen-devel@xxxxxxxxxxxxxxxxxxxx>

Hello,

There are a couple of remaining wrinkles related to MSR that I think we need to
solve before the release, or agree that it's fine to leave them as-is and
document in the release notes. I've tried to summarize the different views
below, sorry if I haven't done this properly or missed some arguments.

I'm sending to committers to see if we can find consensus on the path going
forward, or else to trigger a voting on the possible solutions, because
discussion on xen-devel seems to get stuck.

1. MSR behavior for PV guests without a #GP handler set: PV Linux versions <
   4.14 will use rdmsr_safe (and likely wrmsr_safe?) without having a #GP
   handler setup, which results in a crash. This bug was hidden in previous
   Xen releases by allowing unlimited read access to the MSR space.

   Jan has posted several proposals to address this:

   
https://lore.kernel.org/xen-devel/7e69db81-cee7-3c7b-be64-4f5ff50fbe9c@xxxxxxxx/
   
https://lore.kernel.org/xen-devel/d794bbee-a5e5-6632-3d1f-acd8164b7171@xxxxxxxx/

   Which all rely on the fact that for PV guests Xen knows whether there's a
   #GP handler setup and can hence prevent injection of a #GP fault if no
   handler is present.

   Andrew opinion is that we should instead try to figure out which MSRs the
   buggy Linux versions try to access and special case them. Andrew also raised
   the point that continue running with a 'fake' (ie: 0) MSR value might be
   worse than crashing.

   Part of the discussion has also happened here:

   
https://lore.kernel.org/xen-devel/4da62f0b-8a08-dd84-2040-fd55d74fd85a@xxxxxxxxxx/

   Look for the last quote.

   Another option is to document that PV Linux < 4.14 will require msr_relaxed=1
   in order to run. That as Jan pointed out will also imply PV Linux to run with
   a faked (0) MSR value instead of crashing.

2. RAPL_POWER_LIMIT: handle the MSR explicitly to make Solaris happy.
   Alternatively we can list in the release notes that Solaris guests require
   msr_relaxed=1. Andrew is working on a patch for this.

3. MSR_K8_HWCR: Linux will complain about a missing bit (TscFreqSel). Jan
   posted a patch to handle the MSR and unconditionally set the bit:

   
https://lore.kernel.org/xen-devel/c91b190a-aaa1-d3b8-10eb-d8da7ad1f834@xxxxxxxx/

   There are concerns from Andrew about missing bits in ACPI tables and Pstate
   MSRs if this bit is reported as set.

For 1. I do agree with Jan than this workaround is likely the best option we
have, sort of resorting to request enabling msr_relaxed for all Linux PV guests
< 4.14. Whether we want to limit this workaround to the read side only I'm not
fully convinced. There's something nice about having symmetry in the read and
write paths, but if all the calls we have identified are rdmsr only I prefer to
leave the write path unaltered and request users to use msr_relaxed if write
issues are found later.

For 3. I think I at least need more details about the relation with TscFreqSel
and ACPI or other MSRs, and I haven't been able to find it on the PPRs I
looked.

Thanks, Roger.



 


Rackspace

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