[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20240417202842.GGZiAw-h6iKQ8efsVM@fat_crate.local>
Date: Wed, 17 Apr 2024 22:28:42 +0200
From: Borislav Petkov <bp@...en8.de>
To: "H. Peter Anvin" <hpa@...or.com>
Cc: "Xin Li (Intel)" <xin@...or.com>, linux-kernel@...r.kernel.org,
luto@...nel.org, tglx@...utronix.de, mingo@...hat.com,
dave.hansen@...ux.intel.com, x86@...nel.org
Subject: Re: [PATCH v3 1/1] x86/fred: Fix INT80 emulation for FRED
On Wed, Apr 17, 2024 at 07:59:25AM -0700, H. Peter Anvin wrote:
> FRED has separate entry flows depending on if the event came from user space
> or kernel space:
>
> asm_fred_entrypoint_user -> fred_entry_from_user
>
> asm_fred_entrypoint_kernel -> fred_entry_from_kernel
>
> fred_entry_from_kernel does not invoke fred_intx() if the event type is
> EVENT_TYPE_SWINT, instead it falls through to fred_bad_type(). Perhaps
> fred_intx() should be renamed fred_intx_user() for additional clarity.
Sure.
> (It might also we worth noting in that function that the reason int $0x03
> and int $0x04 are dispatched as INT3 and INTO is to be fully user space
> compatible with legacy IDT, which behaves similarly.)
Also yes.
> Thus, the int $0x80 code is simply not reachable from kernel space; if
> kernel code were to invoke int $0x80 or any other INT instruction it will
> error out before getting to this code.
Yah, that explanation is a lot better, thanks. I'll use it. :)
> I suggested putting it into a comment for future reference. Obviously
> no need to duplicate it in the commit message :)
Yap, that makes more sense.
Thx.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
Powered by blists - more mailing lists