[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [XEN PATCH 1/2] xen: Fix check-endbr with mawk
- To: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Fri, 15 Jul 2022 12:51:55 +0200
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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=Jp1LeJhPFHwfYBbhRNsYQf6Nf0QdVhWm96SXmKJGxPM=; b=nihH/j5+gq0/vV43eXznsNHM/HHRmryMkjDSQaxH+3+GNc8k4mXO7bIq7xoIhTum1XrU9JgwE+TyOtgK6aDdQQ7661+aGYwiKtIWlwQ8/QrqaKrCApECEtk+z0eOHTJo8ucYC8RLvcEESF1JjohS0vMM8P7MpHE1sRJ1H1BtFqoWO0Al1er2xMWUzmpRwYzv4qZ412YgUG9snobCPZkUKBH4QV5XJ9WqOCln6N5NhOWg77toOP7w5Kp1c9WTFJvooCxgzJf+oPedkC+O8/yyVKNChoCHrlaXmyN20vraBWUMXchoZPY4ExikgUCFcbeIKS9hwC1vgvVyNJIYrc1XzQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Lb3Eyn8Vsah1eRby7o9fGZsIniuCSAB58clkhz8l+qAdK0WhSqnnGxfVsljLsbxnpsrhC8wIBKFzNsFU+QVBdIJLEOzUJ4U5C4et37Gtnu/mrDx/hdNk+VfM3Wm12/QkvGu0+/2mHWAP5XuB6Qda128mzxHEUBHVyXVIGhdaafJ6XA3KofH2hLig2Pd5GkK3a+Yu2lkjgkBwmhLXQzZW0ZwOnuSteDNIoT3qeEwqB7ICATkzTRebRjTi4z2F9zc6KT5yMy9qGKtBBI9ek0LXjRURHBf6UiS44JBGZXUkKIxxkw98d3rQHn19aYDxODxtM5u1+gUM5omV/c1yX1t9Yw==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
- Cc: Luca Fancellu <Luca.Fancellu@xxxxxxx>, Mathieu Tarral <mathieu.tarral@xxxxxxxxxxxxxx>, George Dunlap <George.Dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Anthony Perard <anthony.perard@xxxxxxxxxx>
- Delivery-date: Fri, 15 Jul 2022 10:52:19 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 15.07.2022 12:43, Andrew Cooper wrote:
> On 15/07/2022 11:14, Jan Beulich wrote:
>> On 14.07.2022 16:39, Anthony PERARD wrote:
>>> --- a/xen/tools/check-endbr.sh
>>> +++ b/xen/tools/check-endbr.sh
>>> @@ -78,7 +78,7 @@ then
>>> else
>>> grep -aob -e "$(printf '\363\17\36\372')" -e "$(printf
>>> '\363\17\36\373')" \
>>> -e "$(printf '\146\17\37\1')" $TEXT_BIN
>>> -fi | awk -F':' '{printf "%s%x\n", "'$vma_hi'", int(0x'$vma_lo') + $1}' >
>>> $ALL
>>> +fi | awk -F':' '{printf "%s%x\n", "'$vma_hi'", int('$((0x$vma_lo))') +
>>> $1}' > $ALL
>> I'm afraid that's not portable to environments where sizeof(long) < 8.
>> The shell isn't required to use wider than long for the evaluation.
>
> Yuck. This works at the moment in 32 bit builds because:
>
> ++ objdump -j .text xen-syms -h
> ++ awk '$2 == ".text" {printf "vma_hi=%s\nvma_lo=%s\n", substr($4, 1,
> 8), substr($4, 9, 16)}'
> + eval vma_hi=ffff82d0 vma_lo=40200000
> ++ vma_hi=ffff82d0
> ++ vma_lo=40200000
>
> so the top bit isn't set.
>
> And going from an 8/8 split to a 9/7 split doesn't work either because
> that uses 4 bits and we've only got 2 to play with given .text's 1G
> alignment.
Why does text alignment matter here? All we care about are offsets
into the Xen image. An I guess we aren't really at risk of going
beyond 256M in image size ...
> I know it's disgusting, but how about a BUILD_BUG_ON(XEN_VIRT_START &
> (1u << 31)) ?
In the worst case, why not. But that would be an odd restriction on
changes to the memory layout (which we've done in the past).
Jan
|