From: Thomas Gleixner <tglx@linutronix.de>
To: Xin Li <xin@zytor.com>, Hou Wenlong <houwenlong.hwl@antgroup.com>,
linux-kernel@vger.kernel.org
Cc: Lai Jiangshan <jiangshan.ljs@antgroup.com>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
Xin Li <xin3.li@intel.com>,
Jacob Pan <jacob.jun.pan@linux.intel.com>,
Rick Edgecombe <rick.p.edgecombe@intel.com>,
Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH 1/2] x86/fred: Always install system interrupt handler into IDT
Date: Tue, 25 Jun 2024 19:01:17 +0200 [thread overview]
Message-ID: <871q4l5542.ffs@tglx> (raw)
In-Reply-To: <49c53a1a-55b2-441e-8ec2-1a2d87a3ccc4@zytor.com>
On Tue, Jun 25 2024 at 09:30, Xin Li wrote:
> On 6/25/2024 5:31 AM, Thomas Gleixner wrote:
>> On Tue, Jun 25 2024 at 02:19, Xin Li wrote:
>>> On 6/21/2024 6:12 AM, Hou Wenlong wrote:
>>>> 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.
>>
>> Wait. If we need this during early boot, then why don't we enable FRED
>> earlier?
>
> Unconditionally call idt_install_sysvec() is still needed, right?
Not when we enable FRED early enough.
> But this sounds a smart move to me! Because it helps to deal with not
> only the initialization order issue, but also the following cases in a
> longer term:
>
> 1) BIOS enables FRED and keeps it enabled when transferring control to
> Linux. Then we just need to disable FRED when it is disabled in the
> kernel command line.
>
> 2) IDT support is removed from a kernel config thus a kernel binary, say
> a new kernel config CONFIG_X86_IDT is added and set to N.
>
> And we need to:
>
> 1) Find a place to enable FRED as early as possible if not yet enabled.
>
> 2) Disable FRED when fred=off is in the kernel command line.
>
> Anything I missed?
No.
Thanks,
tglx
next prev parent reply other threads:[~2024-06-25 17:01 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-21 13:12 [PATCH 0/2] x86/fred: Fix two problems during the FRED initialization Hou Wenlong
2024-06-21 13:12 ` [PATCH 1/2] x86/fred: Always install system interrupt handler into IDT Hou Wenlong
2024-06-25 9:19 ` Xin Li
2024-06-25 12:31 ` Thomas Gleixner
2024-06-25 16:30 ` Xin Li
2024-06-25 17:01 ` Thomas Gleixner [this message]
2024-06-25 17:08 ` Li, Xin3
2024-06-25 17:11 ` Thomas Gleixner
2024-06-28 9:36 ` Hou Wenlong
2024-06-28 15:18 ` Xin Li
2024-07-02 17:16 ` Xin Li
2024-07-03 2:44 ` Hou Wenlong
2024-07-03 3:42 ` Xin Li
2024-06-21 13:12 ` [PATCH 2/2] x86/fred: Add a page fault entry stub for FRED Hou Wenlong
2024-06-22 0:31 ` [PATCH 0/2] x86/fred: Fix two problems during the FRED initialization Xin Li
2024-06-24 6:21 ` Hou Wenlong
2024-06-25 9:09 ` Xin Li
2024-06-25 17:24 ` H. Peter Anvin
2024-06-25 17:31 ` Xin Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=871q4l5542.ffs@tglx \
--to=tglx@linutronix.de \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=houwenlong.hwl@antgroup.com \
--cc=hpa@zytor.com \
--cc=jacob.jun.pan@linux.intel.com \
--cc=jiangshan.ljs@antgroup.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=rick.p.edgecombe@intel.com \
--cc=x86@kernel.org \
--cc=xin3.li@intel.com \
--cc=xin@zytor.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox