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

Re: [PATCH] xen: Use asm inline when available for alternatives


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>
  • Date: Tue, 22 Apr 2025 22:01:09 +0200
  • Arc-authentication-results: i=1; bugseng.com; arc=none smtp.remote-ip=162.55.131.47
  • Arc-message-signature: i=1; d=bugseng.com; s=openarc; a=rsa-sha256; c=relaxed/relaxed; t=1745352069; h=DKIM-Signature:MIME-Version:Date:From:To:Cc:Subject:In-Reply-To: References:Message-ID:X-Sender:Organization:Content-Type: Content-Transfer-Encoding; bh=Ezr7LE1ZKebIk4F/uzS1ggyeJ30f3cfbqylG5CaobAM=; b=hncIkLGXfO3pBvQguQKUedYaJ1NhfOfVsOJLN5exTW1AOYSerD9giT87dRRBmaE8Hwbb nUF6QQwFNMVx6D15bYCVLuaNK98/IxrWaZbc63qEqSV9jPf6gDObHx7v+wamDEX4ftqWl kGjbTGQOucj3Uf7nDayNUeS0QoU7AMBDQxdZzG8sNgb3dID83AC1fjl+Vjy2Chj4oDI3n EdMGIeWUgwAE1q+NkiTrhtL235CD2z+E1eWBGa00bQApfBTWr4A/tScXIUziEkXUgfGmJ p/6Fr1ylK+hFdMc5PGGeB63yE6s++sv2+mGtts2SNqSWD73v0r5AKM+SKm0V/SDgIa0Qo U1MBQMVtROb8wYZ8KzCMcQ35ngfyjEf+T0H4KDczYgUCDxLWFbSujB4h8Yw+rjRqcLI+5 gyqnFxMh/udFY+t5ClBOqpVLarsIYmDBEiXEBJlAlgBTKuoF1qC+ceDPfArpukBUme4wK 2DGSjPeIBOGIIKBBkPwVylDKQU3pOyV8Rgmj55UI83v1m6u1r0f9TwXRSb1qZFn5hz/cL VhhCUm9u8o1qX4U7jAeK4KoQJZ5R4TlZoYnH8wEC/Ri8s+BE7A9jGdRy5YLd0nFnVJ882 QQZeRYZgxhWoWaXrhkKgn7kmYRwG+dioaMTXgUQu4sUCMrLxUuuqcEqh6iy/A2U=
  • Arc-seal: i=1; d=bugseng.com; s=openarc; a=rsa-sha256; cv=none; t=1745352069; b=KEY4VHgwMLcp4QYqo6h79iYS5pAsuAn2Q7AAGgRfuLJz2R2xVaxgtQJ2s43ZhZVPwfri NYUajcxReU8lsD5lnjq3ovxp+Ez9hgaJU31hSQFn7TtqhKIp+MOoV2mNDdI0pRoja5eVv WwgdsDmKr98lWF7JXWn8Yi3GiADRPpR5cDRolM2Cu4//GG0kg+QU3LSPpYkgeqiP0oUBV 46nf07WdWrEIZQJxyy7QjvU5qfHFAuSA+m+rUyiFqq0lq/ltZcUoAb/Teqj59JD8ZU7KW keTrJfj0L/YzqSCWblJp/EKFlV2a9ta4uHN3liNvn5Cpi+2+rYj0ZI1Ha04wP++0XyS/D M94/W7MKpKPutbp/i5GWw8/0GPegK6CBrkt5/cevrYaF+xCV3fCSwGaoF4uUXStDaV3LG /cE6VJ2gKEWy3NqB/3J7QQkcOWKsbSR4O+7q0gwpac5pXG7B9CSAzGUn3uqsNH00watfl K1Q31NcV+sxJsWACkc5cOxew1cd31+iAmuIYsQGG4jWS8OnKi30DG+2Lbn/B2xv2ak/pp /I7sPX+GZRRU5Fzh55dltyZDDESS3uilIPSf1pgFBiskPnkrxaRMci504W59+StOqWd9B EuyGqC1kg92dnEmfeVguo3I2UpaJI2UO9eLOdseACiraiS/cUGjZlqUu+yE/3Og=
  • Authentication-results: bugseng.com; arc=none smtp.remote-ip=162.55.131.47
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Jan Beulich <JBeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>
  • Delivery-date: Tue, 22 Apr 2025 20:01:31 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 2025-04-22 21:58, Stefano Stabellini wrote:
On Tue, 22 Apr 2025, Andrew Cooper wrote:
On 22/04/2025 8:46 pm, Stefano Stabellini wrote:
> On Tue, 22 Apr 2025, Andrew Cooper wrote:
>> Compilers estimate the size of an asm() block for inlining purposes.
>>
>> Constructs such as ALTERNATIVE appear large due to the metadata, depsite 
often
>> only being a handful of instructions.  asm inline() overrides the estimation
>> to identify the block as being small.
>>
>> This has a substantial impact on inlining decisions, expected to be for the
>> better given that the compiler has a more accurate picture to work with.
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> Hi Andrew,
>
> If we are going to use asm_inline, please add a note to
> docs/misra/C-language-toolchain.rst where we keep record of all the
> language extensions we use.

It's just asm(), and that's already discussed.

I'm not sure what else you think is warranted.


If it is just asm() then there is nothing to do. We only need to
document extensions to the language, nothing else. Many of them are
already documented under docs/misra/C-language-toolchain.rst (see for
instance asm and __asm__).

I see the critical part of the patch for this question is:

+#if CONFIG_CC_HAS_ASM_INLINE
+# define asm_inline asm __inline
+#else
+# define asm_inline asm
+#endif

it looks like __inline is an extension ?

I see. It was added to the tool configuration, but not there in the rst (__inline__ as well), hence why there are no CI failures.

--
Nicola Vetrini, B.Sc.
Software Engineer
BUGSENG (https://bugseng.com)
LinkedIn: https://www.linkedin.com/in/nicola-vetrini-a42471253



 


Rackspace

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