Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1E867C02192 for ; Mon, 3 Feb 2025 14:32:05 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.880659.1290737 (Exim 4.92) (envelope-from ) id 1texUM-0000n0-Cc; Mon, 03 Feb 2025 14:31:50 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 880659.1290737; Mon, 03 Feb 2025 14:31:50 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1texUM-0000mt-A3; Mon, 03 Feb 2025 14:31:50 +0000 Received: by outflank-mailman (input) for mailman id 880659; Mon, 03 Feb 2025 14:31:49 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1texUL-0000mn-Ed for xen-devel@lists.xenproject.org; Mon, 03 Feb 2025 14:31:49 +0000 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [2a00:1450:4864:20::335]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 99ac1e77-e23b-11ef-a0e7-8be0dac302b0; Mon, 03 Feb 2025 15:31:48 +0100 (CET) Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-43690d4605dso30593455e9.0 for ; Mon, 03 Feb 2025 06:31:48 -0800 (PST) Received: from [192.168.100.192] (lfbn-gre-1-190-108.w90-112.abo.wanadoo.fr. [90.112.153.108]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c5c0ec7e6sm13110181f8f.19.2025.02.03.06.31.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 03 Feb 2025 06:31:46 -0800 (PST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 99ac1e77-e23b-11ef-a0e7-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738593108; x=1739197908; darn=lists.xenproject.org; h=in-reply-to:from:content-language:references:cc:to:subject :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=k7t3BSSjcrxejb2puSOiWGTMZiXldn1JUwo60pdwC2k=; b=nC9HDfJ+ZzptMlMZ7LwEN8fuZXifu9WSD/bfiQqtEdRwNsTZ1YQ9Sb7TbhgK8jOvZJ iDd/X2r6ZMMGrXcL2khFePG49FYKnkTyf6LcWcw+KCBG1UH65OzZJBtCszFNbHPXPeRI CO0dOPytjmgwsuLovkt7iVXRQRLCAJtDLATtWjWzlISwHUReaO1Zl1fY+pw1bMwynhNW DFWWFgO2ruKhOcbBBt0jPwBeD6koWg30V25t6UWFM5TffQsvBaoJTT6RS9JQBZSRVSQK 5a/x+4PoWtj96k2YZ+VIbvDLyJAVQbcrtwN/TH/E9HBwDPDBGMPmnBVoICGbJJCnXu// NHJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738593108; x=1739197908; h=in-reply-to:from:content-language:references:cc:to:subject :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=k7t3BSSjcrxejb2puSOiWGTMZiXldn1JUwo60pdwC2k=; b=lt7QgHOzwqiWfz6Kehgb7qNAdn60Om4LyxHDnKCGb1g0XRRUoo5mPb4sFtEBDYoJnK sL06G9fJYQbtzjVrG6DER2w0N3+lK8VwuVi0QvGyYd/xORdHZnE6dmOdjXYDW8axEj91 fGJPlPgiIeDI7MTuJJYiasTBmwsuww/h1gPD2/8X8yfrXMwi7R98XUOmUzxZlycDXnBT vD+aBbKotWg2JLyumP8trHClMG59H/28vbxB+Cwh++yh0B5IwLUOFGBtfftcBMyT99zD MQ8d9kAeEGrUTPn4mgqonA9zf5zF1wc0jueOOQwNPgKJjE4zRgqXKrtTOnd6j+/Thw0Y Pukw== X-Forwarded-Encrypted: i=1; AJvYcCXA+z7WyUFSqOMp7XYlDUtHxqjDRh8BLKnMRNg4BpWRqSsVuI7TcZ8u4/HynSzBTCIoC5IDRBAy9Xk=@lists.xenproject.org X-Gm-Message-State: AOJu0YwqZkKg9TreBBt15+GpLHoG3MzOX7i43wcextGqDIDZDJ3CSq2E 5n9kwyETaQYyzGTsTElkhIp0lbz88bX9T1OehU50zIGEWCkndbt0 X-Gm-Gg: ASbGncvyV+fil1YyaRcgPB4Ykw1u+EdoD2CpWNT/3bHuSaoPfJ/VyM2kWZDo4S0hGw3 cFSSh5ZVfmEjF6C4dl9mBw9m/vWq5lIF/ftCR1ZgmUDm3MYfh2sUzErqenWdPsRm7ouop0KwrqB M28TxWhpFvHYBEi7JM4DJtx0hNI30cbEXhJAwgRJJGKm21ino2vrSQYs+JXPT1+YlXkag5ZHhSd dlSsHWOsy42u8qyvV34uB2g0jVlfAX6Q+4jOcvQ8x4bAizQSYqafPtGBEeSvZ2ocWijFB8fgwQ7 dS3gcxF+aOaoBH3lnzqH/zp1o1aaTEMjHgwsMMkHE6stQT8n2DTjx3bPubSNlAZ+T32KONWTt86 mvgs= X-Google-Smtp-Source: AGHT+IFp0oH5+6tMoz60Mj/fnyQfMkvPuk7hF7UfclkPQVtlpM//Q1B6gRkJoaADEIgN5CUqpH2D0A== X-Received: by 2002:a05:600c:1d07:b0:434:f219:6b28 with SMTP id 5b1f17b1804b1-438dc40ff6fmr173782485e9.24.1738593107087; Mon, 03 Feb 2025 06:31:47 -0800 (PST) Content-Type: multipart/alternative; boundary="------------P5TN0BHlsPahZbI0XV4qJ94N" Message-ID: <027c2603-1a2a-4a76-975f-b227a3adef5a@gmail.com> Date: Mon, 3 Feb 2025 15:31:46 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH for-4.20] x86/intel: Fix PERF_GLOBAL fixup when virtualised To: "Katz, Jonathan" , Andrew Cooper , Xen-devel Cc: Jan Beulich , =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= References: <20250121142510.358996-1-andrew.cooper3@citrix.com> <76b3b208-a576-48f2-820b-e213722fe229@citrix.com> Content-Language: en-US From: Oleksii Kurochko In-Reply-To: This is a multi-part message in MIME format. --------------P5TN0BHlsPahZbI0XV4qJ94N Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 1/27/25 7:56 PM, Katz, Jonathan wrote: > Tested on xcp-ng vm on esx 8 that previously failed to boot when > performance counters were not enabled. > > - patched host > - rebooted host > - host still came up normally > - shut host down > - turned off performance counters on vm > - booted host > - host still came up normally and no issues running vms > > Thanks! > jonathan > > Jonathan​​​​ > > > > > > Katz > > > > > > IS Senior Specialist, Infrastructure Operations Engineer > > AptarGroup > > 265 Exchange Drive, Suite 100 > > > > , > > > > Crystal Lake > > > > , > > > > Illinois > > > > > > 60014 > > > > , > > > > United States > > (phone) +1 779 220 4484 > > > > | > > > > (mobile) +1 847 525 8441 > > jonathan.katz@aptar.com > > > > | > > > > www.aptar.com > > AptarOnlineSignature > > -----Original Message----- > From: Andrew Cooper > Sent: Monday, January 27, 2025 6:42 AM > To: Oleksii Kurochko ; Xen-devel > > Cc: Katz, Jonathan ; Jan Beulich > ; Roger Pau Monné > Subject: Re: [PATCH for-4.20] x86/intel: Fix PERF_GLOBAL fixup when > virtualised > > > EXTERNAL MAIL: Do not click any links or open any attachments unless > you trust the sender and know the content is safe. > > > On 21/01/2025 4:57 pm, Oleksii Kurochko wrote: > > > > On 1/21/25 3:25 PM, Andrew Cooper wrote: > >> Logic using performance counters needs to look at > >> MSR_MISC_ENABLE.PERF_AVAILABLE before touching any other resources. > >> > >> When virtualised under ESX, Xen dies with a #GP fault trying to read > >> MSR_CORE_PERF_GLOBAL_CTRL. > >> > >> Factor this logic out into a separate function (it's already too > >> squashed to the RHS), and insert a check of > >> MSR_MISC_ENABLE.PERF_AVAILABLE. > >> > >> This also limits setting X86_FEATURE_ARCH_PERFMON, although oprofile > >> (the only consumer of this flag) cross-checks too. > >> > >> Reported-by: Jonathan Katz > >> Link: > >> https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fxcp > >> -ng.org%2Fforum%2Ftopic%2F10286%2Fnesting-xcp-ng-on-esx-8&data=05%7C0 > >> 2%7Cjonathan.katz%40aptar.com%7Cc036df18462d402eda5608dd3ed01147%7C5f > >> d74a3ed57a410e8d7c02c4df062234%7C0%7C0%7C638735785584484308%7CUnknown > >> %7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW > >> 4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=jG5dfAjyXvB > >> JRrtNklKp8MjGOUoYGntpD14eRP5GCcI%3D&reserved=0 > >> Signed-off-by: Andrew Cooper > >> --- > >> CC: Jan Beulich > >> CC: Roger Pau Monné > >> CC: Oleksii Kurochko > >> > >> Untested, but this is the same pattern used by oprofile and watchdog > >> setup. > > > > Probably it will make sense to wait for a response on the forum (you > > mentioned in the Link:) that the current one patch works? > > It's been a week. At this point it needs to go in for the release. As > I said, this is exactly the same pattern as used elsewhere in Xen, so > I'm confident it's a good fix, and Roger agrees too. Based on the test results, it seems everything is okay, so: R-Acked-by: Oleksii Kurochko Thanks. ~ Oleksii > > ~Andrew > This e-mail may contain confidential information. If you are not the > intended recipient, please notify the sender immediately and destroy > this e-mail. Any unauthorized copying, disclosure or distribution of > the material in this e-mail is strictly forbidden. > > /Aptar’s//Privacy Policy > > //explains how Aptar may use your personal information or data and any > personal information or data provided or made available to us./ > --------------P5TN0BHlsPahZbI0XV4qJ94N Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit


On 1/27/25 7:56 PM, Katz, Jonathan wrote:
Tested on xcp-ng vm on esx 8 that previously failed to boot when performance counters were not enabled.

- patched host
- rebooted host
- host still came up normally
- shut host down
- turned off performance counters on vm
- booted host
- host still came up normally and no issues running vms

Thanks!
jonathan

Jonathan​​​​

 

Katz

  

IS Senior Specialist, Infrastructure Operations Engineer

AptarGroup

265 Exchange Drive, Suite 100

, 

Crystal Lake

, 

Illinois

 

60014

, 

United States

(phone) +1 779 220 4484

 | 

(mobile) +1 847 525 8441

jonathan.katz@aptar.com

 | 

www.aptar.com

AptarOnlineSignature

-----Original Message-----
From: Andrew Cooper <andrew.cooper3@citrix.com>
Sent: Monday, January 27, 2025 6:42 AM
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>; Xen-devel <xen-devel@lists.xenproject.org>
Cc: Katz, Jonathan <jonathan.katz@aptar.com>; Jan Beulich <JBeulich@suse.com>; Roger Pau Monné <roger.pau@citrix.com>
Subject: Re: [PATCH for-4.20] x86/intel: Fix PERF_GLOBAL fixup when virtualised


EXTERNAL MAIL: Do not click any links or open any attachments unless you trust the sender and know the content is safe.


On 21/01/2025 4:57 pm, Oleksii Kurochko wrote:
>
> On 1/21/25 3:25 PM, Andrew Cooper wrote:
>> Logic using performance counters needs to look at
>> MSR_MISC_ENABLE.PERF_AVAILABLE before touching any other resources.
>>
>> When virtualised under ESX, Xen dies with a #GP fault trying to read
>> MSR_CORE_PERF_GLOBAL_CTRL.
>>
>> Factor this logic out into a separate function (it's already too
>> squashed to the RHS), and insert a check of
>> MSR_MISC_ENABLE.PERF_AVAILABLE.
>>
>> This also limits setting X86_FEATURE_ARCH_PERFMON, although oprofile
>> (the only consumer of this flag) cross-checks too.
>>
>> Reported-by: Jonathan Katz <jonathan.katz@aptar.com>
>> Link:
>> https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fxcp
>> -ng.org%2Fforum%2Ftopic%2F10286%2Fnesting-xcp-ng-on-esx-8&data=05%7C0
>> 2%7Cjonathan.katz%40aptar.com%7Cc036df18462d402eda5608dd3ed01147%7C5f
>> d74a3ed57a410e8d7c02c4df062234%7C0%7C0%7C638735785584484308%7CUnknown
>> %7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW
>> 4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=jG5dfAjyXvB
>> JRrtNklKp8MjGOUoYGntpD14eRP5GCcI%3D&reserved=0
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>> ---
>> CC: Jan Beulich <JBeulich@suse.com>
>> CC: Roger Pau Monné <roger.pau@citrix.com>
>> CC: Oleksii Kurochko <oleksii.kurochko@gmail.com>
>>
>> Untested, but this is the same pattern used by oprofile and watchdog
>> setup.
>
> Probably it will make sense to wait for a response on the forum (you
> mentioned in the Link:) that the current one patch works?

It's been a week. At this point it needs to go in for the release. As I said, this is exactly the same pattern as used elsewhere in Xen, so I'm confident it's a good fix, and Roger agrees too.
Based on the test results, it seems everything is okay, so:
R-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Thanks.

~ Oleksii



~Andrew
This e-mail may contain confidential information. If you are not the intended recipient, please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.

Aptar’s Privacy Policy explains how Aptar may use your personal information or data and any personal information or data provided or made available to us.

--------------P5TN0BHlsPahZbI0XV4qJ94N--