Re: [RFC PATCH] x86: Make sure verify_cpu has a good stack

From: H. Peter Anvin
Date: Wed Mar 02 2016 - 12:54:07 EST


On March 2, 2016 8:25:30 AM PST, Borislav Petkov <bp@xxxxxxxxx> wrote:
>On Wed, Mar 02, 2016 at 11:22:30AM -0500, Brian Gerst wrote:
>> This should be: movq stack_start(%rip), %rsp
>
>No it wouldn't. That doesn't work.
>
>> > + subq $__START_KERNEL_map, %rsp
>>
>> It would be better to add the offset to the initializer for
>> stack_start instead of adjusting it at runtime. That would require
>> moving the existing load of stack_start from the common path to the
>> secondary startup,
>
>This is the BSP we're talking about - no secondary startup. We want to
>run
>verify_cpu as early as possible.

Please explain why we can't use rip-relative addressing in some form...
--
Sent from my Android device with K-9 Mail. Please excuse brevity and formatting.