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

Re: [PATCH] tools/ocaml/xc: Fix xc_physinfo() bindings


  • To: Christian Lindig <christian.lindig@xxxxxxxxx>
  • From: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
  • Date: Fri, 9 Jun 2023 10:37:43 +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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=MTIR5zHV5J2M3URXNiR1BWBtKeuimdMt5LWSJcWJM+k=; b=MYb4JpHrJKrxVIJ9M39WNiR3Qb/zd63BzQbymzNFONqsXZJABmptR5iK1hdUF6AuxuHFaIitkJjWkkruNFzysSKLNqlvu55eC+uKoa/aK4vkSCW8JkDwDd9E+4AZ5m0F9qNQ1iw7X+asYjkEwTy1Jo97wJ722KcdFMdcV86aJBSH4smWS73drf6uD0TPi0NDSC55g/uq4v2uzocuYwFbQSpzaLyQEY9dk1RsJPVkfqd4C48WTGP6ZlWosoazs4CV2KKDqw4/mrZeW/keEGutH+yT6iZ389SM5v3L7VEbOLu9hAHQGIxbORR1ONjrTrQPMKnmN7QnyZMcevtHLUC1PQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mx1JK8/p+//FI4BCWZC1AMRbjyM9R3cLLi94ZleI+/E0idx2aP59Z+JpDFn4qirj71iX6cN4STUj9nGKZky1602mtkzfCl9lkTq+yNVI5JAqe/oDBq0Ut2q9+bbZgRXaRJjURqz383JJ/kjs52wtntUz1C+tJI8FpCXl2KdFb9isX+VHjQ369t3PaDU7/ZrtIlB1699ifyALKi8PSYIzlXWw+jFqRMNPB/2eetb1J3MZoL+TowtB61wLqRv1ZezsM1jPlSDEBwLF8zeE098ByQwt2rXwNFJCnWbU9Vd35kQ0KAITFCSGDCrr5RnW39OEENB0XV0JyfOYmnK3M2aEJA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Edwin Török <edwin.torok@xxxxxxxxx>, Rob Hoes <Rob.Hoes@xxxxxxxxxx>, Luca Fancellu <luca.fancellu@xxxxxxx>
  • Delivery-date: Fri, 09 Jun 2023 09:38:11 +0000
  • Ironport-data: A9a23:KnStnaO254prH4jvrR1zlsFynXyQoLVcMsEvi/4bfWQNrUoh02AOy jAcXGmHPvvbZWT8edp2bYy180MP6sLcnIVjHQto+SlhQUwRpJueD7x1DKtS0wC6dZSfER09v 63yTvGacajYm1eF/k/F3oDJ9CU6jufQAOKnUoYoAwgpLSd8UiAtlBl/rOAwh49skLCRDhiE/ Nj/uKUzAnf8s9JPGjxSs/rrRC9H5qyo42tG5gxmPpingXeF/5UrJMNHTU2OByOQrrl8RoaSW +vFxbelyWLVlz9F5gSNy+uTnuUiG9Y+DCDW4pZkc/HKbitq/0Te5p0TJvsEAXq7vh3S9zxHJ HehgrTrIeshFvWkdO3wyHC0GQkmVUFN0OevzXRSLaV/ZqAJGpfh66wGMa04AWEX0sZHO2h/y O01FD0qX1Onq9ik++2DG/Y506zPLOGzVG8ekldJ6GiASNoDH9XESaiM4sJE1jAtgMwIBezZe 8cSdTtoalLHfgFLPVAUTpk5mY9EhFGmK2Ee9A3T+PVxujeKpOBy+OGF3N79U9qGX8hK2G2fo XrL5T/RCRAGLt2PjzGC9xpAg8eWxHmlAN1PROfQGvhComWQ6i8aDAEqfwHlncT6qGuMf80GE hlBksYphe1onKCxdfH2Xwe5u2KFtxhaX9tWH+w1wAqJzbfYpQ2eAwAsXjNHLdArqsIybTgrz UOS2cPkAyR1t7+YQm7b8a2bxRu/NTcUKykeYjUDTiMO597+rMc4iRenZtJ+G6fzgNTzEjz0x y2ipTI7wb4UiKY2O76T+FnGh3ego8bPRwtsvwHPBDv6t0V+eZKvYJGu5R7D9/FcIY2FT16H+ n8Zh8yZ6+NIBpaI/MCQfNgw8HiSz67tGFXhbZRHRfHNKxzFF6afQL1t
  • Ironport-hdrordr: A9a23:e80o96gcjFcACbYUd/lxOv6OHnBQXuUji2hC6mlwRA09TyVXrb HWoB17726NtN91YhsdcL+7Scy9qB/nhPxICMwqTNSftWrd2VdATrsSibcKqgeIc0bDH6xmtZ uIGJIOb+EYY2IK6/oSIzPVLz/j+rS6GWyT6ts2Bk0CcT1X
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 09/06/2023 9:17 am, Christian Lindig wrote:
>> On 8 Jun 2023, at 20:33, Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx> wrote:
>>
>> +type arm_physinfo_caps =
>> +  {
>> +    sve_vl: int;
>> +  }
>> +
>
> Does the OCaml side need to know about the structure of this value or is it 
> enough to pass it around as an abstract value because all logic is on the C 
> side? I assume the OCaml side needs at least a way to persist the value and 
> hence needs to know some representation.

Yes, Ocaml does need to know about the structure.

info->arch_capabilities is a collection of misc info.  It was intended
to be just a bitmap of things, hence why it's a list on the x86 side (We
added fields, then had to revert and I haven't got back around to
reworking that yet).

But now ARM have put a non-bit field field into it, where a toolstack
needs to select a domain_create sve_vl setting between min(0,
physinfo.sve_vl)

The Ocaml code doesn't have an #include <public/sysctl.h> so doesn't
have the masks/constants required to decompose the integer into it's
constitute parts.

>
>>      Store_field(arch_obj, 0,
>> +                Val_int(MASK_EXTR(info->arch_capabilities,
>> +                                  XEN_SYSCTL_PHYSCAP_ARM_SVE_MASK) * 128));
>> +
> What is the “* 128” achieving as part of this encoding?

No functional change from before...  except it was previously hidden in
a different header file which I'm in the process of deleting.

The vector length is a multiple of 128.  This value is more amenable to
being understood in a log file by a human.

~Andrew



 


Rackspace

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