[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <21210f9c-8831-9f5a-e391-0f44f277b024@gmail.com>
Date: Sat, 15 Apr 2023 00:32:46 +0800
From: Tianyu Lan <ltykernel@...il.com>
To: Pankaj Gupta <pankaj.gupta.linux@...il.com>
Cc: 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,
ashish.kalra@....com, 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,
pangupta@....com, linux-kernel@...r.kernel.org,
kvm@...r.kernel.org, linux-hyperv@...r.kernel.org,
linux-arch@...r.kernel.org
Subject: Re: [RFC PATCH V4 13/17] x86/sev: Add Check of #HV event in path
On 4/14/2023 7:02 PM, Pankaj Gupta wrote:
>> +void check_hv_pending_irq_enable(void)
>> +{
>> + struct pt_regs regs;
>> +
>> + if (!cc_platform_has(CC_ATTR_GUEST_SEV_SNP))
>> + return;
>> +
>> + memset(®s, 0, sizeof(struct pt_regs));
>> + asm volatile("movl %%cs, %%eax;" : "=a" (regs.cs));
>> + asm volatile("movl %%ss, %%eax;" : "=a" (regs.ss));
>> + regs.orig_ax = 0xffffffff;
>> + regs.flags = native_save_fl();
>> +
>> + /*
>> + * Disable irq when handle pending #HV events after
>> + * re-enabling irq.
>> + */
>> + asm volatile("cli" : : : "memory");
> Just curious, Does the hypervisor injects irqs via doorbell page when
> interrupts are disabled with "cli" ? Trying to understand the need to
> cli/sti covering on "do_exc_hv".
Hi Pankaj:
Thanks for your review. Yes, Hypervisor still injects #HV exception
when irq was disabled check_hv_pending() is called when
there is a #HV exception. It checks irq flag and return back without
handling irq event when irq was disabled.
Powered by blists - more mailing lists