[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <60adb804-8a3a-599a-64cd-3149cc82447d@gmail.com>
Date: Mon, 14 Nov 2022 09:28:31 +0800
From: Tianyu Lan <ltykernel@...il.com>
To: "Kalra, Ashish" <ashish.kalra@....com>, luto@...nel.org,
tglx@...utronix.de, mingo@...hat.com, bp@...en8.de,
dave.hansen@...ux.intel.com, x86@...nel.org, hpa@...or.com,
seanjc@...gle.com, pbonzini@...hat.com, jgross@...e.com,
tiala@...rosoft.com, kirill@...temov.name,
jiangshan.ljs@...group.com, peterz@...radead.org,
srutherford@...gle.com, akpm@...ux-foundation.org,
anshuman.khandual@....com, pawan.kumar.gupta@...ux.intel.com,
adrian.hunter@...el.com, daniel.sneddon@...ux.intel.com,
alexander.shishkin@...ux.intel.com, sandipan.das@....com,
ray.huang@....com, brijesh.singh@....com, michael.roth@....com,
thomas.lendacky@....com, venu.busireddy@...cle.com,
sterritt@...gle.com, tony.luck@...el.com, samitolvanen@...gle.com,
fenghua.yu@...el.com
Cc: linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
linux-hyperv@...r.kernel.org, linux-arch@...r.kernel.org
Subject: Re: [RFC PATCH 16/17] x86/sev: Add a #HV exception handler
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.
Powered by blists - more mailing lists