[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [XEN PATCH 1/2] xen: Fix check-endbr with mawk
- To: Anthony Perard <anthony.perard@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
- Date: Thu, 14 Jul 2022 15:12:42 +0000
- Accept-language: en-GB, en-US
- 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=ejx7DBOsXgOaWVhhUyyVAc+3MJQWQ8erEiFWaoGlSKA=; b=BdWg+8OKJvKlq748QbI0db6xOwK1qVMDl0pcdULa1Qz84JDYVQt9SebL+9w4gAbxWHWBAjoXfyAxSjnSHcCHYn0xVYfnfXb4UPo3b6y8b3a7FLw0k25nw7Awue6OG4/KZRPpgtYP7wCj5E76jEZq6BvUdBkHxCVfJJ3ltkUmP5L38SiUoAs+pArbj1J7W/hyKtyOf0GB7os6bkGASeFcYKYJMKbpW0I3UjlQ6DR5j28D5T4eSQaCBpPTFuDh6CqNbo46b4Z0oUTdCD6T6YODFP2tI/FzmNvGbw+LUMHnxZkSh36E8joa59xryodbo3Fp7tA5i2qXkXQEQw4BNfSw5A==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AX+Qp8bxuHBvrAEOBrFYfNDTG3bfkCW5PAym2T08d7xp5gFuk0/Sd6cXdYJxMeiHYfXpOnusVyDSUKo0WaBcdNI07XqeSs7noRrV927vBur5OmadAqtQlwsm3k9qxmbueHKCO6LCtS9Gb/kgh26KTDHQTGZhZ+YpSg+iVqabJGqzqdMLRy2CB4Kwkui5FgUv+qIox2reofIzkDSXVGpXmrlaGuM0Wue4hAPlzpykFiNmZRt4ahsXjaxjXWPF2Lli8gmn9ajJQtyHCCsklvJqFKxLM1wJFd8ZnxiTKlCPMujwhVIssMzMO5iLMndjG7W57i3xdUTKf0j3gseEME5HSA==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
- Cc: Luca Fancellu <Luca.Fancellu@xxxxxxx>, Mathieu Tarral <mathieu.tarral@xxxxxxxxxxxxxx>, George Dunlap <George.Dunlap@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Henry Wang <Henry.Wang@xxxxxxx>, "marc.ungeschikts@xxxxxxxx" <marc.ungeschikts@xxxxxxxx>
- Delivery-date: Thu, 14 Jul 2022 15:13:10 +0000
- Ironport-data: A9a23:KVFyq6vjBq3/6bnpKhlSOj9ZQ+fnVBdeMUV32f8akzHdYApBsoF/q tZmKTyPMqzcZjSjL98lO42yp0JUv5bSz95gG1Br/ChnQ35D+JbJXdiXEBz9bniYRiHhoOOLz Cm8hv3odp1coqr0/0/1WlTZhSAgk/vOHtIQMcacUghpXwhoVSw9vhxqnu89k+ZAjMOwRgiAo rsemeWGULOe82MyYzh8B56r8ks15qyt4W9A5DTSWNgQ1LPgvyhNZH4gDfnZw0vQGuF8AuO8T uDf+7C1lkuxE8AFU47Nfh7TKyXmc5aKVeS8oiM+t5uK23CukhcawKcjXMfwXG8M49m/c3Kd/ /0W3XC4YV9B0qQhA43xWTEAe811FfUuFLMqvRFTGCFcpqHLWyKE/hlgMK05FYoY9+FuAVBUz O4FDQ5QTgmOtcCJxr3uH4GAhux7RCXqFKU2nyg5iB38U7MhS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kIMIjgZJq3PsiFXluYeE9NTO/7JpiHP hlDcna6voTeVSGb2rBtm0qxNC3RHw8EhqPX0BH46WuonNrtWE8y1FdyN0Un38G+p54Q55Y5/ 7cOqAtkL1VVMcZYa90Ge9ES8qqDW7GRw7KLQupUBzaPbBCP2iIp4/84b0z6u3vcJsUzIEqkJ CES19cvX5aQTObNSRP5uw/zvngehTMYd228LAu23FQgMyOeJP7dSueVVspj8ys5/0CH8yzYY fABK5r
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHYl4+Dg7FHxwiGFEGkNOu8rM/Cw619+TQA
- Thread-topic: [XEN PATCH 1/2] xen: Fix check-endbr with mawk
On 14/07/2022 15:39, Anthony PERARD wrote:
> check-endbr.sh works well with gawk, but fails with mawk. The produced
> $ALL file is smaller, it is missing 0x$vma_lo on every line. On mawk,
> int(0x2A) just produce 0, instead of the expected value.
>
> The use of hexadecimal-constant in awk is an optional part of the
> posix spec, and mawk doesn't seems to implemented.
>
> There is a way to convert an hexadecimal to a number be putting it in
> a string, and awk as I understand is supposed to use strtod() to
> convert the string to a number when needed. The expression
> 'int("0x15") + 21' would produce the expected value in `mawk` but now
> `gawk` won't convert the string to a number unless we use the option
> "--non-decimal-data".
>
> So let's convert the hexadecimal number before using it in the awk
> script. The shell as no issue with dealing with hexadecimal-constant
> so we'll simply use the expression "$(( 0x15 ))" to convert the value
> before using it in awk.
>
> Fixes: 4d037425dc ("x86: Build check for embedded endbr64 instructions")
> Reported-by: Luca Fancellu <Luca.Fancellu@xxxxxxx>
> Reported-by: Mathieu Tarral <mathieu.tarral@xxxxxxxxxxxxxx>
> Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
Thanks for doing this. You beat me to it.
On policy first, we have https://gitlab.com/xen-project/xen/-/issues/26
open for tracking this bug.
We should consider having
Resolves xen-project/xen#26
in our list of tags, so Gitlab can properly cross-reference this fix.
(I wonder if Resolves: works...)
https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically
is the full list of patterns available, but I think we want to keep
Fixes: for it's current meaning.
I also want to wait for the patchew CI run to complete because we've got
several build environments which have been a fertile source of shell
related bugs.
~Andrew
|