[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 08:31:35 +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=kFDPlnES46gaFrh3KpECNd/9vUfZejEdyF0UyGGB9KU=; b=QzXtOtIepZIcbLLKJYGbikZjw7fQ5cHASrufseNNhaAnlS09Jw11WBI2MD/nxlWZYIrmDU88MEOzyMovLNN05qiJaAYSwCQ+owYiawgtE3T3brln4UGx67rDb6UkcoIlg638Vj5xCkCqx4y5yjnr4FaylHKABRqaB2Md4XnbB+p925xrlnr25wZY0KfP938z8RKxZnsayjxSuuypAj3eSLz6yhJ+Wcckb4wNHAduvC5f1gA2wSG58u3sgzToT7RK5DQKqmrhZwMZDzkCxdm7Hl6E0W4yadDtznzJZWCpwtk3eZKeIbpr6Ti3PMSrebNBcBGfWXH9qBCKcfSeavM6XA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EGEWzQKziyK9Cao/KXPfVRdveZhJ3K/BSO54ZMGUldvMW4i5VKhW/Wnn08oJU09HXeojBKsI70j4G7O5/UlsuOz7ZMqXjzBcdLnVpPZh0WBpqhwz71Gcfp9MhHzyo1NUBA8iyuhMv2RSHkwL095dHxZFVrWvNeS+aoxm5CFx3gJqsKd0cvAjiQtROz2PF6CvtmWiBTDp8ELpFbxF/T78fp/idzj+lINByGwyf9TNO/dmaBhQ1mThRWLXPYaun+PuitkHE93cBv1ZOpAUYu9hynVtKzAFmc7L9IJ2v9hPeH/5AX0tGgLAw5e79LoGOHLhNhtUoPJP8WSk7WnBR3bw7w==
- 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 07:31:50 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 15.02.2023 18:59, Oleksii wrote:
> Hello Jan and community,
>
> I experimented and switched RISC-V to x86 implementation. All that I
> changed in x86 implementation for RISC-V was _ASM_BUGFRAME_TEXT. Other
> things are the same as for x86.
>
> For RISC-V it is fine to skip '%c' modifier so _ASM_BUGFRAME_TEXT will
> look like:
>
> #define _ASM_BUGFRAME_TEXT(second_frame) \
> ".Lbug%=: ebreak\n"
> ".pushsection .bug_frames.%[bf_type], \"a\", @progbits\n"
> ".p2align 2\n"
> ".Lfrm%=:\n"
> ".long (.Lbug%= - .Lfrm%=) + %[bf_line_hi]\n"
> ".long (%[bf_ptr] - .Lfrm%=) + %[bf_line_lo]\n"
> ".if " #second_frame "\n"
> ".long 0, %[bf_msg] - .Lfrm%=\n"
> ".endif\n"
> ".popsection\n"
I expect this could be further abstracted such that only the actual
instruction is arch-specific.
> 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()?)
Jan
|