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

Re: x86/PV: (lack of) MTRR exposure


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Fri, 29 Apr 2022 10:00:57 +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=14SMqwalnV57Nv6T3dFcisW08hHEupf+aMwPQGT0INA=; b=HunJynxUEHxHoKtRt1sZavBrvqMAgAry6JvZPV5KR2D7YMw+kgTQ0fPC/6BHZXPKQpOkMbU9AqxeOfRg7576e9fwqJ1C2Ijyk7oj6u2nFH3YX3VPRYk+n4ASTm2ru+orMzqDv87LZGhcptWoaDLyZESopBHUnTBebCtGY3bwTS/ugQU9LePBjkx4j9GayRvttsV3JhIxklCuxfcTIlC+jhLTJEr7dFVL7+9FVtgejfl2iHbC3kggosYaqob+seif+6F8UD2qqrlrJtV4Nb3UOg6kTH6cOoryn6ounNoL1pNl3uSUVSV3LAlu9rGjKpoB2XuXxx1MG1CBJiSX1rezkA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=V5peLV+w86OqGW35mE9hkx7E/vIkZ+07RbKqx1/ESh3r7R4+JnU4K1mwPO5uZCgrgl+asqdxeAjHFD1PBI16JwT4DKfW5xI3cHdXRL8cScZXJZEcffwOT3nQhbatZHdTCgeu8h4wCVQYtPX2pNu9JXbG5t2H/WHTfiX3mlgr8xLeif5V1e1y3rq660+YJ7p91GAxLXb6bkOW+QUOS1gbwh36j0ZayrE0GIAtpg+Qmy/GaSO1mNX9wmgeY4nJOTeQ4v6z88YPMvPVhDQkOBJvroep/lbqwD4q5YCf7Wd6HyknRWSggQj1Iga14LxLQVTsd9Vm7O3UCuY7b6IsSJqgbw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
  • Delivery-date: Fri, 29 Apr 2022 08:01:58 +0000
  • Ironport-data: A9a23:FPY93aozmNirz/4KLtvYZe5z3NdeBmIOZBIvgKrLsJaIsI4StFCzt garIBnVbPaLNGb2et9/aoy18RtS7ZXRx9VgTgZkqHg2HnlB9puZCYyVIHmrMnLJJKUvbq7GA +byyDXkBJppJpMJjk71atANlVEliefQAOCU5NfsYkidfyc9IMsaoU8lyrdRbrJA24DjWVvR4 4Kq+qUzBXf+s9JKGjNMg068gEsHUMTa4Fv0aXRnOJinFHeH/5UkJMp3yZOZdhMUcaENdgKOf M7RzanRw4/s10xF5uVJMFrMWhZirrb6ZWBig5fNMkSoqkAqSicais7XOBeAAKv+Zvrgc91Zk b1wWZKMpQgBO5XigbwwaytjSn9ePq5d9b7HeCicrpnGp6HGWyOEL/RGKmgTZNdd0MAnRGZE+ LofNSwHaQ2Fi6Su2rWnR+Jwh8Mlas72IIcYvXImxjbcZRokacmbH+OWupkFgXFp2Zom8fX2P qL1bRJ1axvNeVtXM0o/A5Mihua4wHL4dlW0rXrK/fRuvTiDlWSd1pDtbdnTcOzaa/l2l2W8/ j38xUvULA0FYYn3JT2ttyjEavX0tSHxVZ8WFba43uV3m1DVzWsWYDUGWF3+rfSnh0qWX9NEN 1dS6icotbI19kGgUp/6RRLQiHyLpBkHQPJLDvY3rgqKz8L86QGDB3NCSSVdcts4r8wnbTsw3 1SNkpXiAjkHjVGOYXeU97PRpzXiPyEQdDUGfXVdElFD5MT/qoYuiB6JVsxkDKO+ktzyH3f33 iyOqy89wb4UiKbnypmGwLwOuBr0zrChc+L/zlyGNo55xmuVvLKYWrE=
  • Ironport-hdrordr: A9a23:sVLBDa0gvxEsEHb/nwkdnAqjBTRyeYIsimQD101hICG9Lfb0qy n+pp4mPEHP4wr5AEtQ4exoS5PwOk80kqQFq7X5XI3SFzUO3VHFEGgM1/qH/9SNIUzDH6tmpN 5dmstFeZDN5DpB/KHHCWCDer5OruVvsprY49s2pE0dLj2CHpsQijuRfTzrcHGeKjMnObMJUL 6nouZXrTupfnoaKu6hAGMeYuTFr9rX0Lr7fB8vHXccmUazpALtzIS/PwmT3x8YXT8K66wl63 L5nwvw4bjmm+2nyyXby3TY4/1t6ZXcI5p4dY2xY/ouW3bRYzWTFcZcsnq5zXUISdSUmRYXeR /30lMd1opImjTslyqO0GHQMkHboUsTAjnZuBOlaDLY0LPErD5WMbs8uatJNhTe8EYup9d6ze ZC2H+YrYNeCVfakD36/MWgbWAdqqOYmwtXrQcotQ0pbWLeUs4jkaUPuEdOVJsQFiPz744qVO FoEcHH/f5TNVeXdWrQsGVjyMGlGi1bJGbPfmES/siOlzRGlnFwyEUVgMQZg3cb7Zo4D51J/f 7NPKhknKxHCsUWcaV+DuEcRtbfMB2FfTvcdGaJZVj3HqAOPHzA75bx/bUu/emvPIcFyZMj8a 6xJW+wdVRCCX4GJff+raGjqCq9PllVdQ6duv1j2w==
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Thu, Apr 28, 2022 at 05:53:17PM +0200, Jan Beulich wrote:
> Hello,
> 
> in the course of analyzing the i915 driver causing boot to fail in
> Linux 5.18 I found that Linux, for all the years, has been running
> in PV mode as if PAT was (mostly) disabled. This is a result of
> them tying PAT initialization to MTRR initialization, while we
> offer PAT but not MTRR in CPUID output. This was different before
> our moving to CPU featuresets, and as such one could view this
> behavior as a regression from that change.
> 
> The first question here is whether not exposing MTRR as a feature
> was really intended, in particular also for PV Dom0. The XenoLinux
> kernel and its forward ports did make use of XENPF_*_memtype to
> deal with MTRRs. That's functionality which (maybe for a good
> reason) never made it into the pvops kernel. Note that PVH Dom0
> does have access to the original settings, as the host values are
> used as initial state there.
> 
> The next question would be how we could go about improving the
> situation. For the particular issue in 5.18 I've found a relatively
> simple solution [1] (which also looks to help graphics performance
> on other systems, according to my initial observations with using
> the change), albeit its simplicity likely means it either is wrong
> in some way, or might not be liked for looking hacky and/or abusive.

I wonder whether the patch needs to be limited to the CPUID Hypervisor
bit being present.  If the PAT MSR is readable and returns a value !=
0 then PAT should be available?

I guess we should instead check that the current PAT value matches
what Linux expects, before declaring PAT enabled?

Note there's already a comment in init_cache_modes that refers to Xen
in the check for PAT CPUID bit.  We might want to expand that comment
(or add one to the new check you are adding).

Thanks, Roger.



 


Rackspace

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