lkml.org 
[lkml]   [2022]   [Nov]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [RFC PATCH 16/17] x86/sev: Add a #HV exception handler
From
Thanks for your review.

On 11/11/2022 4:38 AM, Kalra, Ashish wrote:
>> +    UNWIND_HINT_REGS
>> +
>> +    /* Update pt_regs */
>> +    movq    ORIG_RAX(%rsp), %rsi    /* get error code into 2nd
>> argument*/
>> +    movq    $-1, ORIG_RAX(%rsp)    /* no syscall to restart */
>> +
>> +    movq    %rsp, %rdi        /* pt_regs pointer */
>> +    call    kernel_\cfunc
>> +
>> +    jmp    paranoid_exit
>> +
>> +.Lfrom_usermode_switch_stack_\@:
>> +    idtentry_body user_\cfunc, has_error_code=1
>
> #HV exception handler cannot/does not inject an error code, so shouldn't
> has_error_code == 0?

Nice catch. Will update in the next version.

>> +    irqentry_state_t irq_state;
>> +
>> +    if (unlikely(on_hv_fallback_stack(regs))) {
>> +            instrumentation_begin();
>> +            panic("Can't handle #HV exception from unsupported
>> context\n");
>> +            instrumentation_end();
>> +    }
>
> HV fallback stack exists and is used if we couldn't switch to HV stack.
> If we have to issue a panic() here, why don't we simply issue the
> panic() in hv_switch_off_ist(), when we couldn't switch to HV stack ?
>

Yes, this is a good idea. Will update. Thanks.

\
 
 \ /
  Last update: 2022-11-14 02:29    [W:0.085 / U:0.816 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site