lkml.org 
[lkml]   [2015]   [Jan]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] x86: introduce push/pop macros which generate CFI_REL_OFFSET and CFI_RESTORE
On Mon, Jan 12, 2015 at 12:22 PM, H. Peter Anvin <hpa@zytor.com> wrote:
> On 01/12/2015 12:14 PM, Andy Lutomirski wrote:
>> On Mon, Jan 12, 2015 at 12:11 PM, Borislav Petkov <bp@alien8.de> wrote:
>>> On Mon, Jan 12, 2015 at 11:46:53AM -0800, Andy Lutomirski wrote:
>>>> Dumb example:
>>>>
>>>> pushq_cfi $__KERNEL_DS /* ss */
>>>>
>>>> This doesn't save anything that the unwinder would care about.
>>>
>>> And? The unwinder or whatever looks at that info simply ignores stuff it
>>> is not interested in, no?
>>
>> But CFI_REL_OFFSET $__KERNEL_DS, 0 probably isn't even well-formed and
>> won't build.
>>
>
> I think this is relatively easy to deal with at the expense of a large
> .ifeq statement in the macro.
>
>

Is the usage you have in mind something like:

pushq_cfi %r11 /* saves r11 */
pushq_cfi $0 /* saves nothing */
pushq_cfi %r11, savereg=rip /* saves rip */

I think I prefer the somewhat less magical:

pushq_reg_cfi %r11 /* saves r11 */
pushq_reg_cfi %r11, savereg=rip /* saves rip */
pushq_nounwind_cfi $0

Or something like that.

--Andy

-hpa
>
>



--
Andy Lutomirski
AMA Capital Management, LLC


\
 
 \ /
  Last update: 2015-01-12 21:41    [W:0.242 / U:0.912 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site