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

[PATCH 0/5] x86/lbr: handle lack of model-specific LBRs


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • Date: Fri, 20 May 2022 15:37:41 +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=1KcoChvovYQDsK3p29jg9hzF+dhhtG/SSZ4U6GNOE7U=; b=bLxWTbpGMJo8j154yQXOt/afBZIslcdsqzCkehZeNGELWQU7gC0VdrEBm946lwAnH0TKM9uWUGYlVDsdWVqxQGoc07M2EhtC9Ts2O698kuMvtHiencOp/zdkzSaif/pctpNlyZuh99rsTB5NCdAylfMjadrYQn/oo4lU3mmlK4dNzME1DJUEHZm+ZcyVyh/5Qgy9C4onueVXiiUWx9MwXehUC5mC+Gwax4T94PxAUjT5+JurrWSSqpxUO/YxOyXJiSQcQfo7dGssYJ1Y+UhNzgQvmE8s2wbIl9wUU0NnUpH2+IN65QLY/suwVR3wPn8MEu+xS3ZJu/vUcQ5DRKEl+Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=an+8CZ/RgZtkbOaReBB+a99Cr0AnHIDUqCSuFQ4J+OTAqGTBXYu97AVrPUOFFq3VuN2twMk9GZjFmSqbaDqGi4FWGI6AAZmBtoej4BiHrb6wAwLWMv6Mv7ej6Lrm/ErzC3Q3UWZagyzTqCrOH/Y/zMEJzj83CfVfIapBB45OM56DDfE0g5lvVSepWKMftOYlWhjf/uojNjyoki1gY2Wxv4eN5ssPsi1UJO02ROavQFPAhJsmtcuPr0T3RIupoF77j0tAloHMln02Hjzn1IhPvIvpELnQpJPQDnSkOsc1RfyGe92IkmusbZ9bWhv2H7ZLYqCY7LhA6AIzd7FhDsONgQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Roger Pau Monne <roger.pau@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Jun Nakajima <jun.nakajima@xxxxxxxxx>, Kevin Tian <kevin.tian@xxxxxxxxx>
  • Delivery-date: Fri, 20 May 2022 13:38:17 +0000
  • Ironport-data: A9a23:vbAiuqnmbid3PJ4c44GMCEHo5gykJ0RdPkR7XQ2eYbSJt1+Wr1Gzt xJMCmCEOv6Ja2SmeI0iOoqxp04G6JbRy99nGQJt+3o0QyMWpZLJC+rCIxarNUt+DCFioGGLT Sk6QoOdRCzhZiaE/n9BCpC48T8kk/vgqoPUUIYoAAgoLeNfYHpn2EsLd9IR2NYy24DkWVvV4 LsenuWEULOb828sWo4rw/rrRCNH5JwebxtB4zTSzdgS1LPvvyF94KA3fMldHFOhKmVgJcaoR v6r8V2M1jixEyHBqD+Suu2TnkUiGtY+NOUV45Zcc/DKbhNq/kTe3kunXRa1hIg+ZzihxrhMJ NtxWZOYWV0WP4yTkcAkWggBHiBGAYdg57/tLi3q2SCT5xWun3rE5dxLVRlzF6tHv+F9DCdJ6 OASLy0LYlabneWqzbmnS+5qwMM+MM3sO4BZsXZlpd3bJa9+HdafHOOVvZkBhGpYasNmRJ4yY +IDbjVidlLYagBnMVYLEpMu2uyvgxETdhUH8Q3E9fRuuQA/yiR32ZOuNeLqSuW1RJ1fsHeFu D/ozmDAV0Ry2Nu3jGDtHmiXrv/Cm2b3VZwfEJW89+V2mxuDy2oLEhoUWFCn5/6jhSaWWdhSN kgV8SoGtrUp+QqgSdyVdwK8iG6JuFgbQdU4O+8n7keLw6nd4QecD0AFSCJMbJots8pebT8ny F6P2c/oDDpHsbuJRHbb/bCRxQ5eIgAQJG4GICUCEg0M5oC7pJlp10qSCNF+DKSyk9v5Xynqx CyHpzQ/gLNVitMX06K8/hbMhDfESoX1czPZLz7/BgqNhj6Vrqb8O+RENXCzAS58Ebuk
  • Ironport-hdrordr: A9a23:NoRwcq0IlZ5RWydaffYQ2AqjBS9yeYIsimQD101hICG9Lfb0qy n+pp4mPEHP4wr5OEtOpTlPAtjjfZq6z+8M3WBxB8baYOCCggeVxe5ZnO/fKlHbexEWldQtqJ uIDZIOb+EYZGIS5aia3ODRKadb/DDtytHMuQ6x9QYPcek8AJsQlDuRRzzrZHGfA2J9dOsEPa vZwvACiyureHwRYMj+Ln4ZX9Lbr9mOsJ79exYJCzMu9QHL1FqTmfbHOind+i1bfyJEwL8k/2 SAuwvl5p+7u/X+7hPHzWfc47lfhdOk4NpeA86njNQTN1zX+0+VTbUkf4fHkCE+oemp5lpvuN 7Qoy04N8A20H/VdnHdm2qZ5yDQlBIVr1Pyw16RhnXu5ebjQighNsZHjYVFNjPE9ksJprhHoe 529lPck6ASIQLLnSz76dSNfQptjFCIrX0rlvNWp2BDULEZdKRaoeUkjQ5o+a87bWzHAb0cYa hT5Jm23ocXTbraVQGSgoBX+q3iYpxpdS32AXTruaSuokprdT5CvgklLfck7wg9HaIGOuV5Dt v/Q9pVfcl1P6krhIJGdZM8qJiMexvwqSylChPjHX3XUIc6Blnql7nbpJ0I2cDCQu168HJ1ou WLbG9l
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hello,

Intel Sapphire Rapids CPUs doesn't have model-specific MSRs, and hence
only architectural LBRs are available.

Firstly implement some changes so Xen knows how to enable arch LBRs so
that the ler option can also work in such scenario (first two patches).

The lack of model-specific LBRs also affects guests, as setting
DEBUGCTLMSR.LBR is now ignored (value hardwired to 0, writes ignored) by
the hardware due to the lack of model-specific LBRs.  The LBR format
reported in PERF_CAPABILITIES also need to be exposed, as that's a way
for guests to detect lack of model-specific LBRs presence (patches 3
and 4).

Patch 5 is an indentation fix that can be merged into patch 4: done
separately to help readability of patch 4.

Thanks, Roger.

Roger Pau Monne (5):
  x86/ler: use feature flag to check if option is enabled
  x86/lbr: enable hypervisor LER with arch LBR
  x86/perf: expose LBR format in PERF_CAPABILITIES
  x86/vmx: handle no model-specific LBR presence
  x86/vmx: fix indentation of LBR

 xen/arch/x86/hvm/vmx/vmx.c                  | 59 ++++++++++++++-------
 xen/arch/x86/include/asm/msr-index.h        | 18 +++++++
 xen/arch/x86/msr.c                          |  9 ++++
 xen/arch/x86/traps.c                        | 29 ++++++++--
 xen/arch/x86/x86_64/traps.c                 |  2 +-
 xen/include/public/arch-x86/cpufeatureset.h |  3 +-
 6 files changed, 97 insertions(+), 23 deletions(-)

-- 
2.36.0




 


Rackspace

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