[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>
- From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
- Date: Thu, 14 Jul 2022 14:57:51 +0000
- Accept-language: en-GB, en-US
- Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
- Arc-message-signature: i=2; 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=DkD+V04XSIkTHahi19jI9OlNy5zjuYhTGjZdDHwLeOw=; b=IJS9OGWhD5SrTQ0gVuS9nSEljX7Lkn3g9dsTy5Yste7Z8IuvYPMtSxzfpWdsz6foHvCUpFLZT5HA1F5kM1ArLz5v/geXp+/MvuzRUjKYquRZUzml9UG3HQH7XlXkin2S4RUephbaFgXTw6yrpMcftXTuVezISBQdqcXuEctvK8O4PFp5y8QRwz4yUxPYMXJp/GHOZzdKwypLF7P+gEY2ZY2qe10G20jKfppL80arR0KIO+nsmcsrP8l+w0CtDdSDn3K8PDfQD5zkUGBjN5bX5HLrqAE8Ij87oKpUbL5oHq6EjlI4fIV3aalczpUAbjkLcrK1ygMPqu+vcUSNR44C/A==
- 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=DkD+V04XSIkTHahi19jI9OlNy5zjuYhTGjZdDHwLeOw=; b=dU2p/oTy4hkLhYe/c2Tox72uZCurKIJRcv+VdYiTvt9aSb8VEDVuTYLQrnMo2OET18voGC7g8oQ/c8ffXptDLeYywz+LRqrXxhEROKa0W11AjQmcNj6NS016U2GjCepi1o6KgVlKzkQi6sTqVBUkVa3dwLGapZ14wseNYSPGNDGvKc3An2D5TfYHryswkfqZr7Vw8mTmnOQCmjF98mNapiu+lGx35X5C8x6AVEa+KkmWYOSL43MPqHDTfRANVrc9qB0LMckPfyHW0B/W6MjdZvAeude08RNwE1fk9f6jfoONSi9foS4qjSARICYta+2u4Is0Hi1u3Ub7ERUPwyUODg==
- Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=nFkWFkHbNb1I44cip1f1hld6Zy2BjSb7+icQSJpy5JWshxZK3AnbofByqi3Px/cc8bD+A5aaIf7vCKMMoHm1AASSPbyhmBFnyO2b6I1Oh56bAg0HEg2rxARz1UtsaQ4vZMK9QSjW7F8WPKOzy9JCn4p4/yQNgTxj8jrDnT8UdoIym/6HEHGx0PPGoxuxMbMEwgIm3TfqrZJDFg0lNvy+H3/Bo8rjEl9fNVYhf+DbICefDENOxCzhfjdqSekB2EoODNNmxkmoNkJLJtVxIunMBiNxb9ulBpn2xD1mRXilfzELtTT77iNBG0YaTTfNhenj0Vq1pUcdD7yie5x1QDp3Zw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gB9Rxjp03qB473cI84uIbYlOgfv0KbcwsgfLHnuTFpP3+yPpcBPtjHQ2BKx1jbXvyhT1akpLjL9scbRAgY1Uho/54NBJOEuYhJX+g5XM/LgF/N8x1xrwerMzmHgV43kz3+yiohgPujj6Ane4FT6fIIODQc/TfCNNW/s48ZfMD49COUx76pI7/0CK8Iywc6MPvH2vL+OaeWFEMxP0XiptxLUItpDV2Q3OhSLUXYzSmWNlNif06ILYKOOJP9urupYGLEPMYMghreJ1uIMwIPco8jdX2llfz3WvXXlXpc0jsStva1g+2SI1teKuThrUKpvlq2kZ0BGu5tSA8hPF7awFAQ==
- Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Luca Fancellu <Luca.Fancellu@xxxxxxx>, Mathieu Tarral <mathieu.tarral@xxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
- Delivery-date: Thu, 14 Jul 2022 14:58:17 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Nodisclaimer: true
- Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Thread-index: AQHYl4+SOiEnzZfQqUyU0a50UPEkY6199Q0A
- Thread-topic: [XEN PATCH 1/2] xen: Fix check-endbr with mawk
Hi Anthony,
> On 14 Jul 2022, at 15:39, Anthony PERARD <anthony.perard@xxxxxxxxxx> 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>
Very nice solution
Reviewed-by: Bertrand Marquis <bertrand.marquis@xxxxxxx>
Cheers
Bertrand
|