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 009D9106B533 for ; Wed, 25 Mar 2026 13:05:31 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.1262282.1554844 (Exim 4.92) (envelope-from ) id 1w5NvB-0005dc-UR; Wed, 25 Mar 2026 13:05:17 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 1262282.1554844; Wed, 25 Mar 2026 13:05:17 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1w5NvB-0005dV-Rd; Wed, 25 Mar 2026 13:05:17 +0000 Received: by outflank-mailman (input) for mailman id 1262282; Wed, 25 Mar 2026 13:05:16 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1w5NvA-0005dO-2P for xen-devel@lists.xenproject.org; Wed, 25 Mar 2026 13:05:16 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1w5Nv9-005suX-Cb for xen-devel@lists.xenproject.org; Wed, 25 Mar 2026 14:05:15 +0100 Received: from [10.42.69.11] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 69c3dd82-e002-0a2a0a5209dd-0a2a450be136-26 for ; Wed, 25 Mar 2026 14:05:15 +0100 Received: from [198.2.132.30] (helo=mail132-30.atl131.mandrillapp.com) by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.55.2) (envelope-from ) id 69c3dd8a-ef63-0a2a450b0019-c602841e782a-3 for ; Wed, 25 Mar 2026 14:05:15 +0100 Received: from pmta09.mandrill.prod.atl01.rsglab.com (localhost [127.0.0.1]) by mail132-30.atl131.mandrillapp.com (Mailchimp) with ESMTP id 4fgnFP2N3CzP0KGQF for ; Wed, 25 Mar 2026 13:05:13 +0000 (GMT) Received: from [37.26.189.201] by mandrillapp.com id 690d33c367e14505967812fda87fbdd9; Wed, 25 Mar 2026 13:05:13 +0000 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" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mte1 header.d=mandrillapp.com header.i="@mandrillapp.com" header.h="From:Subject:Message-Id:To:Cc:References:In-Reply-To:Feedback-ID:Date:MIME-Version:Content-Type:Content-Transfer-Encoding"; dkim=pass header.s=mte1 header.d=vates.tech header.i="teddy.astie@vates.tech" header.h="From:Subject:Message-Id:To:Cc:References:In-Reply-To:Feedback-ID:Date:MIME-Version:Content-Type:Content-Transfer-Encoding" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com; s=mte1; t=1774443913; x=1774713913; bh=EmYNPxd/fkrYVjGGg/zcCsWJR8I68XdbR6a/tSj2C3Y=; h=From:Subject:Message-Id:To:Cc:References:In-Reply-To:Feedback-ID: Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date: Subject:From; b=FieBcGnmz9LWXS04t7K1fu3K1npiHiemUkl0agl0JsJEMhsn9sJQy7OhqisUsO+U7 lkhkL4eDrb+eyVBFcopImkKzFK6mzI8nuvgtYpNBjgXgSO/CmxKM0v52SvXobhf9OF 3XLvQX6VXmqAoTZR1Rtv92USJlJkH7kKLe607kd+5zG8VvEdQ//MoOZ2esTOxU8xE4 vEynyHteIdkwjK19QPoNpV0v+ZyJq6+qlGC+5mMhAhM9kCAZnTNOqV8RDcwwHgsE9C 64M9gZg1aI/udqH3aL2d92J1m+aIwxAWlg2iohr20D24IoLlLwMufrdOrVVr0WoBoI 0HqXfr5q7CFcw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1; t=1774443913; x=1774704413; i=teddy.astie@vates.tech; bh=EmYNPxd/fkrYVjGGg/zcCsWJR8I68XdbR6a/tSj2C3Y=; h=From:Subject:Message-Id:To:Cc:References:In-Reply-To:Feedback-ID: Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date: Subject:From; b=DWcR3dGeYuq2dVXGAi8pSsBukKDPWPSZGt3P0+9X0U0j/IB4rgZm2lZ1d+HrTNqfA 4XpUr76fnjjG4dpPRkhlZXgf0fLfAWV5LX470n6uryyjrPRDt4vCKNgBySc4s2/WfE fRaio4A3nQiu5BJfTJVbNkv2x3PpgQ22LQF6m7hEFv7LI1EOHLKOWGZsJmw9d5p02X 6P0KUe5yYq/qrECpGV32b76+r01wijC77IUFdVBsrmlA4i+V27oL371HBhe1Pv7bEB gYHfnpmXdSyEkXYIeD3b3o1x2AJ6Gev8QE1uW1mvDkoRqh7dQ1ua4+MjLkKaknFw5X GZ9QLd728bvIw== From: "Teddy Astie" Subject: =?utf-8?Q?Re:=20[PATCH=203/6]=20x86:=20Define=20some=20Intel=20vPMU=20leafs?= X-Bm-Disclaimer: Yes X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2 X-Bm-Transport-Timestamp: 1774443912148 Message-Id: To: "Jan Beulich" Cc: "Andrew Cooper" , "=?utf-8?Q?Roger=20Pau=20Monn=C3=A9?=" , xen-devel@lists.xenproject.org References: <83a573dcb365761c0f089325365090b6f963fb03.1773160025.git.teddy.astie@vates.tech> <690ad4c0-d9b1-45ec-8634-f8c002c0282a@vates.tech> In-Reply-To: X-Native-Encoded: 1 X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.690d33c367e14505967812fda87fbdd9?= X-Mandrill-User: md_30504962 Feedback-ID: 30504962:30504962.20260325:md Date: Wed, 25 Mar 2026 13:05:13 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-42698a/1774443915-9A6AE112-FDCC507E/0/0 X-purgate-type: clean X-purgate-size: 3336 Le 25/03/2026 =C3=A0 12:43, Jan Beulich a =C3=A9crit=C2=A0: > On 25.03.2026 10:48, Teddy Astie wrote: >> Le 24/03/2026 =C3=A0 10:25, Jan Beulich a =C3=A9crit=C2=A0: >>> On 10.03.2026 17:44, Teddy Astie wrote: >>>> --- a/xen/include/xen/lib/x86/cpu-policy.h >>>> +++ b/xen/include/xen/lib/x86/cpu-policy.h >>>> @@ -162,7 +162,15 @@ struct cpu_policy >>>> uint64_t :64, :64; /* Leaf 0x9 - DCA */ >>>> >>>> /* Leaf 0xa - Intel PMU. */ >>>> - uint8_t pmu_version, _pmu[15]; >>>> + struct { >>>> + uint8_t /* a */ version, num_gp_ctrs, gp_ctr_width, >>>> + event_enum_length; >>>> + uint32_t /* b */:32; >>>> + uint32_t /* c */ fixed_ctr_mask; >>>> + uint32_t /* d */ num_fixed_ctr:5, fixed_ctr_width:8, = :1, >>>> + anythread_depreciation:1, slots_per_= cyc:4, >>>> + :13; >>>> + } pmu; >>> >>> Style-wise this looks to follow e.g. the cache leaf, so perhaps okay, e= ven >>> if I would have preferred you to follow what we did for leaf 6. >> >> My idea was to put all that as .pmu.*, so I wouldn't need to prefix >> everything with "pmu_". I'm not sure if you're talking about a different >> approach. > > The "pmu" is fine. I'm talking of what's inside the struct {}. > Is it regarding having union and _aa, _ab, (...) fields or prefixing fields with pmu_ ? >> > The named> boolean field, however, wants to be of type bool. >> >> Which fields ? > > There's only one named 1-bit field: anythread_depreciation. > >> > And then the unnamed 1-bit> field really wants to be 2 bits, for >> anythread_depreciation to be bit 15 >>> (etc). >>> >> >> Ah yes thanks, I got confused with the fields size for a second. >> I also found that slots_per_cyc is 3 bits instead of 4. > > Not as far as I can see. > >> I think this diff fixes it overall. >> >> --- a/xen/include/xen/lib/x86/cpu-policy.h >> +++ b/xen/include/xen/lib/x86/cpu-policy.h >> @@ -167,9 +167,9 @@ struct cpu_policy >> event_enum_length; >> uint32_t /* b */:32; >> uint32_t /* c */ fixed_ctr_mask; >> - uint32_t /* d */ num_fixed_ctr:5, fixed_ctr_width:8, :1= , >> - anythread_depreciation:1, slots_per_cy= c:4, >> - :13; >> + uint32_t /* d */ num_fixed_ctr:5, fixed_ctr_width:8, :2= , >> + anythread_depreciation:1, slots_per_cy= c:3, >> + :11; > > Why 11 all of the sudden? > Okay, I think I finally figured out field sizes (5-bit field confuses me). struct { uint8_t /* a */ version, num_gp_ctrs, gp_ctr_width, event_enum_length; uint32_t /* b */:32; uint32_t /* c */ fixed_ctr_mask; uint32_t /* d */ num_fixed_ctr:5, fixed_ctr_width:8, :2; bool anythread_depreciation:1; uint32_t slots_per_cyc:4, :12; } pmu; > Jan > Teddy -- Teddy Astie | Vates XCP-ng Developer XCP-ng & Xen Orchestra - Vates solutions web: https://vates.tech