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

Re: [PATCH v1 1/4] xen: introduce CONFIG_GENERIC_BUG_FRAME


  • To: Oleksii <oleksii.kurochko@xxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 16 Feb 2023 15:55:57 +0100
  • 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=k+idfS9v1qLA8l3q1lWtl+G91cvYeHNlTIRrzXeMpvs=; b=X9S+eKdSFJhdnO434SrHGaIgvXJYH6LVAlkwMFGOaThgzdvMBAnaHX8SV8VaKfED2+ymDtQU3fJFfXHL95vczQRKMN+19qXQ5LiEXeaayf7QGlCFD8TvDQTO1gB/dGbty8NWO6T2jKL7mRRniBAng58eZgwa/SMGbYvXPTIpbHdu7nxhiiRcz1wp7KIz3lpy9f9CCgfXDF0e05LkNkcTqCgaKPHip11C0f4Bo4ggXfGFlx/SQOgxLMbX68XXRBv7NZFMTQuhv0de64IgvcLVx1uEQtlS0joBoEVcP2kdIti6YTNe+zlv1bmP7DpHvw87VNBb7zI4GjPrKO4YYDHOqw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MwDq2hjqYDyk1MiFppVbfNi29k1dan5AHlpT7Xrk/cyJ4s0I2VIMAs0Y1JUJoxmPHi7/ygcalgGKYw2BAXurbi/kRD+s8Z3mRoFTdq1qA6tMHWQwVUr7EeJUIBxlozvEXX6U4WtLP0VldpWaQlR/EVa0Bhz4sQWu0Y7xmWodm2Tyvdq84wz252EgK6Htjyhx4xG6Ku4n+cWsvBtu9NJOYX8q0V0BmeICfuISUD+FF6hwSX84NgTVRWNOjPsyqxWJtHvaVcQOFin/83m2KCF4CtnnVF/KT8ESXTxItwVx8xYMz1xoSIKMilX10FBWkVpmVmsgCYxVRpIaW/MvMJNYlg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 16 Feb 2023 14:56:13 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 16.02.2023 11:44, Oleksii wrote:
> On Thu, 2023-02-16 at 08:31 +0100, Jan Beulich wrote:
>> On 15.02.2023 18:59, Oleksii wrote:
>>> The only thing I am worried about is:
>>>
>>> #define _ASM_BUGFRAME_INFO(type, line, ptr, msg) \
>>>   [bf_type] "i" (type), ...
>>> because as I understand it can be an issue with 'i' modifier in
>>> case of
>>> PIE. I am not sure that Xen enables PIE somewhere but still...
>>> If it is not an issue then we can use x86 implementation as a
>>> generic
>>> one.
>>
>> "i" is not generally an issue with PIE, it only is when the value is
>> the
>> address of a symbol. Here "type" is a constant in all cases. (Or else
>> how would you express an immediate operand of an instruction in an
>> asm()?)
> Hmm. I don't know other ways to express an immediate operand except
> 'i'.
> 
> It looks like type, line, msg are always 'constants' 
> (
> they possibly can be passed without 'i' and used directly inside asm():
>    ...
>    ".pushsection .bug_frames." __stringify(type) ", \"a\",
> %progbits\n"\
>    ...
> ) but the issue will be with 'ptr' for which we have to use 'i'.
> 
> And I am not sure about all 'constants'. For example, I think that it
> can be an issue with 'line' = '((line & ((1 << BUG_LINE_LO_WIDTH) - 1))
> << BUG_DISP_WIDTH)' if we will use that directly inside asm(...).

Not matter how complex an expression, the compiler will evaluate it to
a plain number if it's a constant expression. The only think to worry
about with "i" is, as said, is the value supplied is the address of
some symbol (or an expression involving such).

Jan



 


Rackspace

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