Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755545AbdLTQ1C (ORCPT ); Wed, 20 Dec 2017 11:27:02 -0500 Received: from mail-eopbgr10093.outbound.protection.outlook.com ([40.107.1.93]:25515 "EHLO EUR02-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754377AbdLTQ06 (ORCPT ); Wed, 20 Dec 2017 11:26:58 -0500 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=jan.dakinevich@virtuozzo.com; Date: Wed, 20 Dec 2017 19:26:51 +0300 From: Jan Dakinevich To: Cc: "Denis V . Lunev" , Roman Kagan , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Thomas Gleixner , "H. Peter Anvin" , , Paolo Bonzini , Radim =?UTF-8?B?S3LEjW3DocWZ?= , Andi Kleen , Kan Liang , Colin King , Stephane Eranian , Sebastian Andrzej Siewior , Greg Kroah-Hartman , Jin Yao , Subject: Re: [PATCH RFC 0/2] ignore LBR-related MSRs Message-ID: <20171220192651.6063461a@virtuozzo.com> In-Reply-To: <1512560585-27263-1-git-send-email-jan.dakinevich@virtuozzo.com> References: <1512560585-27263-1-git-send-email-jan.dakinevich@virtuozzo.com> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: VI1PR0501CA0016.eurprd05.prod.outlook.com (2603:10a6:800:92::26) To AM4PR0801MB2739.eurprd08.prod.outlook.com (2603:10a6:200:18::27) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6e64a44e-5779-47c1-49f3-08d547c67bc4 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(4534020)(4602075)(7168020)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060);SRVR:AM4PR0801MB2739; X-Microsoft-Exchange-Diagnostics: 1;AM4PR0801MB2739;3:MmImSH6Wu0Jt/9KfiVA6BRrYJoUYKKLO5kylF/F8WsYJ09xlWul2bCgEhF8mfrkbqiMgP9EhHjTlcbzC1mVdTCMaJ0gz5BiAZYWJjE7vdplJydODIDthqNRqm7BmdJO6AwCU+Y8W9t1RlD7vyZJrJenHwD91xSZu9Vlp0nrQxZGD+Uwn49OJLb/rQWH27XvJ364aaOgD1pvzU8/KqkOHz1rsx1uF1wtlc5efTx4wIzW40Kb2SBShUJpx5k9D6t9a;25:hHC5CCE+rBYWuos1NGtX6qDqSt+T6BC8uo+BSlwWv24s/6sWcwZdEJRH6LXF6ncqB8bBK7DsFlnIUndI4so2FBDhf3ziFOzBX98xSvSnXs5US5H/tMrUKqIUPhquCnk2auE6tjo6Zr9Zw5oIlWoirzqF38KQkLEHJOlrBeGsrbui58R8msC1Ua0JSWZSVshW8gkjwk4Ag0CqEPkexNShbQOaMn1d1Sxou1Qyr/f4ieE2lGpdNFK5XkZMATtA4YHuXGJLxAkpsWyDDLuA3czWIQPpXwFTML0dx4ds+sX6/5H2Vgc4sMQnP50Q1apsgP9PpYxqJ1CxxnCUVbHThVM54Q==;31:pV/9myGahjUY/mFRAIsyoG3onE5j9z1XJ9bgs034Kwo0iqMrakpt1tgFHDJnleBFpBcejnKVFyU3AbjvifWYKF4khjFKrprxX6qU54cF9UYzvrThixsUGgbVi1q1hc9W0h/RYsm73o1teTZgJOBae3FbRqPqFvXtkRlwyVyRDs33HAXj1WW82vCvymcPqTxj754cADVaTmiv0P0C9EGeNZnHIw7ZGKl4YuD9i8+bcTE= X-MS-TrafficTypeDiagnostic: AM4PR0801MB2739: X-Microsoft-Exchange-Diagnostics: 1;AM4PR0801MB2739;20:QeLsk/Ev6sPOF0PRsm9UFB2npambTt3Nns0FAArGxG5FDLtjeMiA6ZiAmYyFq4YDP5OsHh1FTxNlNkqw8NfyieT4KLIURjAyqn6k2m9QwipT3HHxxKBs0bAN2GH7PVsuBlw0EDlIVGSsXBuROT+MZ+SSdE7qX3IPqLqvsqYFG8RQNjcuN2nN8fPFNzg9FXgrezi7OVumyR5/Sdkkbkq1/f9YXpfjy3zAaseetTk/PIQytIkGet61AQqOelixQk9Au7ZeQQmALJYwDU6EofyRs1LdGX3uTDn458FL0m7gkqQr27+M3gE7YKE0Wh6ZFdaXoJNwfBZs1ue8aV09TQImC6tJlk+LvU7VzLiXTNvdCH10Z2fxmhxoUb6kfZ52PS7+rxJQ6cqAJIfUkUuVXZHtVSKok8KR6XvG4xvcg+X5XZo=;4:6nowroS23ag11sM0umcAV0IewxwcSBeQQA7mq6s3ksYDMb33xJU1dE50/33PaTYvbtV/AeHSkhrTl9Mh4U0tIpt8HLILFg4eWUu57u3DsB+2IT5APxWPNRqFYH26TpgXwonyG9Pg6ImIkpPDtSFLge21vMiWvu3s64BtFaFts2mY+YSdsCWKopD+Uk4p7P+rMdBtXfuSAr3CwzgDsiSJ2yL2GsdsVR7+a3l5k7srWe9pHQVmW+3YlaKKI2f5QV6v2yc5jyRDqiafXqEHq655Dw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040470)(2401047)(8121501046)(5005006)(3002001)(3231023)(93006095)(93001095)(10201501046)(6041268)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:AM4PR0801MB2739;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:AM4PR0801MB2739; X-Forefront-PRVS: 0527DFA348 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6069001)(346002)(376002)(396003)(366004)(39850400004)(39380400002)(24454002)(199004)(189003)(16526018)(66066001)(6486002)(25786009)(229853002)(50466002)(47776003)(6496006)(7416002)(59450400001)(7736002)(386003)(55236004)(8676002)(81166006)(81156014)(6246003)(305945005)(1076002)(23726003)(3846002)(6116002)(54906003)(316002)(2906002)(50226002)(105586002)(6916009)(2950100002)(97736004)(2351001)(230700001)(5660300001)(76176011)(478600001)(8936002)(106356001)(4326008)(52116002)(36756003)(68736007)(76506005)(86362001)(53936002)(39210200001)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:AM4PR0801MB2739;H:localhost;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;AM4PR0801MB2739;23:vjP9f/gucj2urz+0fARns7vOb9+WOpYTILdhOzp?= =?us-ascii?Q?ZUl1bxZpT5b47q+8gH5rjhc2Z31DrVkslOzyzZeeADYWVTn/6huH2ZVhhNW0?= =?us-ascii?Q?07SCMQR+3yfy7jvLYCsx7uoLxEQT1ccDxdNDBreEqAHr99MSt8f8iHa3SSwX?= =?us-ascii?Q?Wc0CztTKN1f3Vk9I9WkRW/dPDzGl6tYZxByw73kZE7wXcJ+IDHG4zYUAwaPh?= =?us-ascii?Q?T0AUkm4H54eUqWlCmJBCfZChlWoIeZbFVFVV+OphVstZtxio+HIU0vHrfwiZ?= =?us-ascii?Q?N+OZ8Tt+a2hS+ZOhEexowVjEuzhNbxhvMEr/oL3rmOpOHra4q5cUcQnDN4RT?= =?us-ascii?Q?NS5xJwKd2X1XVSQGhDLpq0waGMegGZw2j1eTXLHAqi+jFLedNYE/s3t9ByDM?= =?us-ascii?Q?FDZ0ciLCggXqVecHZ45u7/a3JzjM+1fDu3h9ADgXzooMdFTlChlu4C0IjG00?= =?us-ascii?Q?sebKnkeuXDmkixq/ezLRzGD0y6jsIFrQPKU0GTaR7Jtwm0q9UYEbd0JdrzmE?= =?us-ascii?Q?nRv2oO75FZp00nPZakCmb+I/1iYOz798OcuDoceY6wC+jkURx1eok/jAy2qn?= =?us-ascii?Q?lx99f7aOjFKaZ56GWPRB6Nvtz/lxvz26CufyqlijYfEF8Kem77J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+GfFNlub/krZ4veroiQx2zOrhUgebud1s7lmCKiyp7x+w0ArmHVYpNctbM7ZokfKDK9wp6ru1vWn+9xR8+ZKeQmQ6oaY7jCgkJM/Hf7erIjktFwuFDkbbMUyGFi0L7EYiwHgpxu+f/NMcvUngLdSndDma+lsaD5AVJeI=;5:Hd2rVulqE3DpDmgnEhGS1EnIBve3TOnju5djebicBf9Ru5xsUalMalgX1vhGCNi0tYftjCG9ctBPCRhvuKXax9ZrpfvcwF9dSHrpDJVnSYwrufV3pi+quEf+0PajtyYe6Th/sP2VQ/cFc+l3B1arM16MSQGIB6yUauHpwgJrp9I=;24:JG7+jF+eJ86LluNlzry2tFXRWSqA6UWzM1AkAl5MkH2lrpIKtBj+X4CYwE8CG9ck77TGnSQVIEFysvfVqE0yIH0zc3RmWz7bPj0sXjqGbVI=;7:X5OcjP4H2RYSxbozz/xPTiiTbfvNrELgkprgPe+CTFownS9Qp53TneM8f76+fU+OK4fAlpjVON65yYh8mU3FnGQYq5w0/KugsslAzCiIhulyQacHmdSO0hHzEZ+wxTbFc7NIlNVTuJ1G4Xf1EQfKn2ZO8HrcbGhAmYn1/gs9hz3SuJZA6rPkOVvwayYUePSnCQnfmjXm2R2hJlMfCtZiXIuoM2jj7y+22Y0xpAPunbRSlVW3+2TlisQ+uQ6huzUR SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;AM4PR0801MB2739;20:99ojbcBj+sbyC/W+67xo8KI7qYzD8dycb42GkjglubaTN+Bl5eJLTtzQ5y62scizL7/t7BOrwNuPQum4n4GdnUvLo5tvIWs0aDlfllMU0zCkWvBjvwbUMTMzoLUjaNY3iJ9mYNXNzGCluAWbuL/vRfsg7prViKAZnUf7GfGMK+Q= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Dec 2017 16:26:52.9288 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6e64a44e-5779-47c1-49f3-08d547c67bc4 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR0801MB2739 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1291 Lines: 37 On Wed, 6 Dec 2017 14:43:01 +0300 Jan Dakinevich wrote: > w2k16 essentials fails to boot if underlying hypervisor lacks of > support for LBR MSRs. To workaround the issue, it suggessted to > ignore these MSRs (but not all). > > The information, which MSRs are supported for specific platform is > taken from perf, it is the subject of the first patch. The second > patch adds ignoring for these MSRs to pmu_intel code of KVM. > > TODO: use MSR load/store areas to make full support of LBR debug. > > Jan Dakinevich (2): > perf/x86/intel: make reusable LBR initialization code > KVM: x86/vPMU: ignore access to LBR-related MSRs > > arch/x86/events/core.c | 8 +- > arch/x86/events/intel/core.c | 59 +++------ > arch/x86/events/intel/lbr.c | 272 > +++++++++++++++++++++++++------------- > arch/x86/events/perf_event.h | 27 +--- > arch/x86/include/asm/kvm_host.h | 2 + > arch/x86/include/asm/perf_event.h | 11 ++ > arch/x86/kvm/pmu_intel.c | 33 +++++ 7 files changed, 250 > insertions(+), 162 deletions(-) > ping Please, tell me whether these patches are applicable (as KVM workaround) or it is assumed they should be reworked following to recommendation by Andi Kleen? -- Best regards Jan Dakinevich