[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 1/2] x86/vtx: add LBR_SELECT to the list of LBR MSRs
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: Igor Druzhinin <igor.druzhinin@xxxxxxxxxx>
- Date: Thu, 15 Apr 2021 00:13:08 +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=3UGsZZOB/YkxY1+sk5Tn33PUXOo/nFfeTk9yWYl3k5g=; b=alucKAD5PJbcvX/O3c7YdOIXfdaeiwzw0xC7MArEOs12cgeTCYVwuDZ5H25s9jGyxKDuX/39V0umj4Q0ekADYYy2cfdRDVqeuA17AfhAvBcyj8wnIY9iHW+yT/uZBjhsHbJWvbFZMFJpfk/UnkqfhRByrVU5Ja2tlyEqD6wmUJpmeEZKlC0oqAaVzvcnxriURK/YXKqgbWYsyxQk9iCYamDBov1r00KlcvmbzZemZn8Y5S+QR9yFSYoagiAwmeNOw5TtCBIVbKYfeH8+5GpW6AYzUfGS4VApFMQ9K6x74rjckCkN8Or73m5HYLiIZzXivkWyHefpQau/dWTP7Unogg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QBSea5Jzpj3qThF1M2CfA+Vj4cqE5xToc4VonFDftZlVh8Kc7sqS4UstUH4BsIw4lkn1Q3/UrNFp8WkDjA9KRgQmTxhINIgOyKjz+vqecs99injWVHuHE+1+dnQdA/Vb/DNJE3PGb7ZUAJiWt6yeoFgMlOiBJqYAAzDdu7sXKD0ne3FA0aV25i5fcLazfMHK7lEYN9vDQPvtBj2jZ+DOGaNNys1SlLftrZr1cZ+r05JVmd8PDJF1LZS60c2mD7cD5Ky9Ex88u9DL3B48BdKZ4o1ZR4qj+0zyNfA4m3w8IxwAN8rniFBysCt185k2LqxhynXuaE5qfb0N6GVZ02rDqw==
- Authentication-results: esa5.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
- Cc: <andrew.cooper3@xxxxxxxxxx>, <roger.pau@xxxxxxxxxx>, <wl@xxxxxxx>, <jun.nakajima@xxxxxxxxx>, <kevin.tian@xxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Wed, 14 Apr 2021 23:13:36 +0000
- Ironport-hdrordr: A9a23:iJ0gA6Puy37AwcBcT5Dx55DYdL4zR+YMi2QD/3taDTRIb82VkN 2vlvwH1RnyzA0cQm0khMroAsa9aFvm39pQ7ZMKNbmvGDPntmyhMZ144eLZrwHIMxbVstRQ3a IIScVDIfXtEFl3itv76gGkE9AmhOKK6rysmP229RZQZCtBApsQiztRIACdD0FwWU1iDZ02CJ KT6qN81kadUF4Qadm2AWRAYvPKoMfFmImjTRkNARMm7wfmt0LW1JfRFR+E0hACFw5e2LtKyx m5ryXVxIWG98u6xBjVynPJ4/1t9ufJ59NfCKW3+7AoAxr2jALAXvUGZ5Sju3QPrPir+BIWlr D30m0dFuBSz1+UQW2vuxvq3GDboUUTwlvv00WRj3emgeGRfkNCN+N7iYhUcgTU5iMb1bkWus I7vBPti7NtARzNhyj77dTTPisa8XacmnY+jfUVy0VWTIp2Us4gkaUk4EhXHJ0cdRiKirwPLe 8GNrC42N9ra1+AK1jWsm5zqebcJUgbL1OtR0gPvdGtyD5GnHx15Ftw/r1vol4wsL06UJVK/O LCL+BBk6xPVNYfaeZHCP4GWtbfMB2CfTv8dEe+ZW39EqsKIWjApvfMkfwIzdDvXKZN4Io5mZ zHXl8dnWkue3j2AcnL+JFQ6BjCTEi0QDyF8LAe27FJ/pnHAJb7OyyKT14j1+G6pe8EP8HdU/ GvfLpLHv7KNwLVaMR09jy7f6MXBWgVUcUTtNp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DEgdAJ7tZV8HxGBv7E 0Fg68cAt1bsOYcUMlrtfQuuV63aHI/dlcf31UqkGkUpLTm2C+1te2SMPrnctjEZDH4Xy8pwJK0 BAMTMccWWlQIN25yB3ZZ/kGUuaRuVd4zSUpM5gd+la8i57DKtt6IzSW/EpEqdeAE6qc1uorw1k OvruIYNgkUbV7OIS2Sqg/VRl+HshkCJOoCNWphvPqFkyA6T4FFdojzG+l877Xg5AII9Ev1CcYx 22Q=
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 14/04/2021 12:41, Jan Beulich wrote:
On 14.04.2021 06:40, Igor Druzhinin wrote:
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -2915,14 +2915,16 @@ static const struct lbr_info {
}, nh_lbr[] = {
{ MSR_IA32_LASTINTFROMIP, 1 },
{ MSR_IA32_LASTINTTOIP, 1 },
- { MSR_C2_LASTBRANCH_TOS, 1 },
+ { MSR_NHL_LBR_SELECT, 1 },
+ { MSR_NHL_LASTBRANCH_TOS, 1 },
{ MSR_P4_LASTBRANCH_0_FROM_LIP, NUM_MSR_P4_LASTBRANCH_FROM_TO },
{ MSR_P4_LASTBRANCH_0_TO_LIP, NUM_MSR_P4_LASTBRANCH_FROM_TO },
{ 0, 0 }
}, sk_lbr[] = {
{ MSR_IA32_LASTINTFROMIP, 1 },
{ MSR_IA32_LASTINTTOIP, 1 },
- { MSR_SKL_LASTBRANCH_TOS, 1 },
+ { MSR_NHL_LBR_SELECT, 1 },
+ { MSR_NHL_LASTBRANCH_TOS, 1 },
{ MSR_SKL_LASTBRANCH_0_FROM_IP, NUM_MSR_SKL_LASTBRANCH },
{ MSR_SKL_LASTBRANCH_0_TO_IP, NUM_MSR_SKL_LASTBRANCH },
{ MSR_SKL_LASTBRANCH_0_INFO, NUM_MSR_SKL_LASTBRANCH },
@@ -2937,6 +2939,7 @@ static const struct lbr_info {
}, gm_lbr[] = {
{ MSR_IA32_LASTINTFROMIP, 1 },
{ MSR_IA32_LASTINTTOIP, 1 },
+ { MSR_GM_LBR_SELECT, 1 },
What about Xeon Phi, Silvermont, and Airmont?
Yes, you're right - forgot about those. Will need to shuffle arrays a
little.
--- a/xen/include/asm-x86/msr-index.h
+++ b/xen/include/asm-x86/msr-index.h
@@ -606,14 +606,18 @@
#define NUM_MSR_C2_LASTBRANCH_FROM_TO 4
#define NUM_MSR_ATOM_LASTBRANCH_FROM_TO 8
+/* Nehalem (and newer) last-branch recording */
+#define MSR_NHL_LBR_SELECT 0x000001c8
+#define MSR_NHL_LASTBRANCH_TOS 0x000001c9
+
/* Skylake (and newer) last-branch recording */
-#define MSR_SKL_LASTBRANCH_TOS 0x000001c9
#define MSR_SKL_LASTBRANCH_0_FROM_IP 0x00000680
#define MSR_SKL_LASTBRANCH_0_TO_IP 0x000006c0
#define MSR_SKL_LASTBRANCH_0_INFO 0x00000dc0
#define NUM_MSR_SKL_LASTBRANCH 32
/* Goldmont last-branch recording */
+#define MSR_GM_LBR_SELECT 0x000001c8
#define MSR_GM_LASTBRANCH_TOS 0x000001c9
Wouldn't it make sense to also re-use the NHL constants, like you
do for Skylake?
I didn't really see GM to be derived from NHL so decided to split those.
Looks cleaner to me that way otherwise might be a little confusing to
use NHL constants in GM definitions. Given the change above - I will
have to reshuffle those anyway in v5.
Igor
|