[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240628093656.GA103025@k08j02272.eu95sqa>
Date: Fri, 28 Jun 2024 17:36:56 +0800
From: "Hou Wenlong" <houwenlong.hwl@...group.com>
To: Xin Li <xin@...or.com>
Cc: <linux-kernel@...r.kernel.org>,
"Lai Jiangshan" <jiangshan.ljs@...group.com>,
"Thomas Gleixner" <tglx@...utronix.de>,
"Ingo Molnar" <mingo@...hat.com>,
"Borislav Petkov" <bp@...en8.de>,
"Dave Hansen" <dave.hansen@...ux.intel.com>,
<x86@...nel.org>,
"H. Peter Anvin" <hpa@...or.com>,
"Xin Li" <xin3.li@...el.com>,
"Jacob Pan" <jacob.jun.pan@...ux.intel.com>,
"Rick Edgecombe" <rick.p.edgecombe@...el.com>,
"Paolo Bonzini" <pbonzini@...hat.com>
Subject: Re: [PATCH 1/2] x86/fred: Always install system interrupt handler
into IDT
On Tue, Jun 25, 2024 at 05:19:20PM +0800, Xin Li wrote:
> On 6/21/2024 6:12 AM, Hou Wenlong wrote:
> >In sysvec_install(), the system interrupt handler is not installed into
> >the IDT when the FRED feature is present, but FRED can be disabled
> >in trap_init(). However, sysvec_install() can be used
> >before trap_init(), e.g., the HYPERVISOR_CALLBACK_VECTOR handler is
> >registered in kvm_guest_init(), which is called by setup_arch() before
> >trap_init(). If FRED is disabled later, then the spurious_interrupt()
> >handler will be used due to the handler not being installed into the
> >IDT. Therefore, always install system interrupt handler into IDT.
> >
> >Fixes: 3810da12710a ("x86/fred: Add a fred= cmdline param")
> >Signed-off-by: Hou Wenlong <houwenlong.hwl@...group.com>
> >---
> > arch/x86/include/asm/idtentry.h | 3 +--
> > 1 file changed, 1 insertion(+), 2 deletions(-)
> >
> >diff --git a/arch/x86/include/asm/idtentry.h b/arch/x86/include/asm/idtentry.h
> >index d4f24499b256..daee9f7765bc 100644
> >--- a/arch/x86/include/asm/idtentry.h
> >+++ b/arch/x86/include/asm/idtentry.h
> >@@ -470,8 +470,7 @@ static inline void fred_install_sysvec(unsigned int vector, const idtentry_t fun
> > #define sysvec_install(vector, function) { \
> > if (cpu_feature_enabled(X86_FEATURE_FRED)) \
> > fred_install_sysvec(vector, function); \
> >- else \
> >- idt_install_sysvec(vector, asm_##function); \
>
> empty line, it improves readability.
>
> And please put a comment here to explain why this is unconditionally
> done for IDT.
>
Hi Xin,
It seems preferable to parse the FRED command line and disable FRED
early instead of using this method. As mentioned in my cover letter, I
initially attempted to fix the problem this way (by parsing the command
line in cpu_parse_early_param()). Should I send a new patch for it, or
will you be covering it in your work to enable FRED early?
Thanks!
> >+ idt_install_sysvec(vector, asm_##function); \
> > }
> > #else /* !__ASSEMBLY__ */
>
> Thanks!
> Xin
Powered by blists - more mailing lists