x86/fred: Remove ENDBR64 from FRED entry points
Subsystems (3)
Xin Li (Intel)
maintainerPATCH 1/1 x86/fred: Remove ENDBR64 from FRED entry points
The FRED specification v9.0 states that there is no need for FRED event handlers to begin with ENDBR64, because in the presence of supervisor indirect branch tracking, FRED event delivery does not enter the WAIT_FOR_ENDBRANCH state.
As a result, remove ENDBR64 from FRED entry points.
Then add ANNOTATE_NOENDBR to indicate that FRED entry points will never be used for indirect calls to suppress an objtool warning.
This change implies that any indirect CALL/JMP to FRED entry points causes #CP in the presence of supervisor indirect branch tracking.
Credit goes to Jennifer Miller <[email protected]> and other contributors from Arizona State University whose work led to this change.
--- arch/x86/entry/entry_64_fred.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/entry/entry_64_fred.S +1 -1
@@ -16,7 +16,7 @@ .macro FRED_ENTER UNWIND_HINT_END_OF_STACK - ENDBR + ANNOTATE_NOENDBR PUSH_AND_CLEAR_REGS movq %rsp, %rdi /* %rdi -> pt_regs */ .endm
Signature · 1 line
2.50.1
Xin Li
maintainerQuoted 16 lines · Xin Li (Intel)
The FRED specification v9.0 states that there is no need for FRED event handlers to begin with ENDBR64, because in the presence of supervisor indirect branch tracking, FRED event delivery does not enter the
WAIT_FOR_ENDBRANCHstate.As a result, remove ENDBR64 from FRED entry points.
Then add
ANNOTATE_NOENDBRto indicate that FRED entry points will never be used for indirect calls to suppress an objtool warning.This change implies that any indirect CALL/JMP to FRED entry points causes #CP in the presence of supervisor indirect branch tracking.
Credit goes to Jennifer Miller <[email protected]> and other contributors from Arizona State University whose work led to this change.
Quoted 7 lines
Reviewed-by H. Peter Anvin (Intel) <[email protected]>Signed-off-by Xin Li (Intel) <[email protected]>Cc Jennifer Miller <[email protected]>Cc Peter Zijlstra <[email protected]>Cc Andrew Cooper <[email protected]>Cc H. Peter Anvin <[email protected]>
Sorry, forgot to put CC stable.
Quoted 17 lines
--- arch/x86/entry/entry_64_fred.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/x86/entry/entry_64_fred.S +1
-1@@ -16,7 +16,7 @@ .macro FRED_ENTER UNWIND_HINT_END_OF_STACK - ENDBR + ANNOTATE_NOENDBR PUSH_AND_CLEAR_REGS movq %rsp, %rdi /* %rdi -> pt_regs */ .endm
Quoted 25 lines · Xin Li
Quoted 16 lines · Xin Li (Intel)
The FRED specification v9.0 states that there is no need for FRED event handlers to begin with ENDBR64, because in the presence of supervisor indirect branch tracking, FRED event delivery does not enter the
WAIT_FOR_ENDBRANCHstate.As a result, remove ENDBR64 from FRED entry points.
Then add
ANNOTATE_NOENDBRto indicate that FRED entry points will never be used for indirect calls to suppress an objtool warning.This change implies that any indirect CALL/JMP to FRED entry points causes #CP in the presence of supervisor indirect branch tracking.
Credit goes to Jennifer Miller <[email protected]> and other contributors from Arizona State University whose work led to this change.
Quoted 7 lines
Reviewed-by H. Peter Anvin (Intel) <[email protected]>Signed-off-by Xin Li (Intel) <[email protected]>Cc Jennifer Miller <[email protected]>Cc Peter Zijlstra <[email protected]>Cc Andrew Cooper <[email protected]>Cc H. Peter Anvin <[email protected]>
Quoted 1 line
Sorry, forgot to put CC stable.
Right?
Quoted 18 lines
Quoted 17 lines
--- arch/x86/entry/entry_64_fred.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/x86/entry/entry_64_fred.S +1
-1@@ -16,7 +16,7 @@ .macro FRED_ENTER UNWIND_HINT_END_OF_STACK - ENDBR + ANNOTATE_NOENDBR PUSH_AND_CLEAR_REGS movq %rsp, %rdi /* %rdi -> pt_regs */ .endm
Xin Li
maintainerQuoted 25 lines · Peter Zijlstra
Quoted 24 lines · Xin Li
Quoted 23 lines · Xin Li (Intel)
The FRED specification v9.0 states that there is no need for FRED event handlers to begin with ENDBR64, because in the presence of supervisor indirect branch tracking, FRED event delivery does not enter the
WAIT_FOR_ENDBRANCHstate.As a result, remove ENDBR64 from FRED entry points.
Then add
ANNOTATE_NOENDBRto indicate that FRED entry points will never be used for indirect calls to suppress an objtool warning.This change implies that any indirect CALL/JMP to FRED entry points causes #CP in the presence of supervisor indirect branch tracking.
Credit goes to Jennifer Miller<[email protected]> and other contributors from Arizona State University whose work led to this change.
Reviewed-by H. Peter Anvin (Intel)<[email protected]>Signed-off-by Xin Li (Intel)<[email protected]>Cc Jennifer Miller<[email protected]>Cc Peter Zijlstra<[email protected]>Cc Andrew Cooper<[email protected]>Cc H. Peter Anvin<[email protected]>
Quoted 4 lines
Quoted 1 line
Sorry, forgot to put CC stable.
Fixes 14619d912b65 ("x86/fred: FRED entry/exit and dispatch code")Right?
You bet!
Will send v2 to address it soon.
Quoted 4 lines · Xin Li (Intel)
The FRED specification v9.0 states that there is no need for FRED event handlers to begin with ENDBR64, because in the presence of supervisor indirect branch tracking, FRED event delivery does not enter the
WAIT_FOR_ENDBRANCHstate.
I would suggest phrasing this as "The FRED specification has been changed in v9 to..."
Simply "v9 states" can be read as "we mistook what v8 said and did it wrong".
After all, the change here is specifically as a result of new research showing ENDBR on the entrypoints to be of negative value.
Quoted 12 lines
As a result, remove ENDBR64 from FRED entry points.
Then add
ANNOTATE_NOENDBRto indicate that FRED entry points will never be used for indirect calls to suppress an objtool warning.This change implies that any indirect CALL/JMP to FRED entry points causes #CP in the presence of supervisor indirect branch tracking.
Credit goes to Jennifer Miller <[email protected]> and other contributors from Arizona State University whose work led to this change.
Quoted 7 lines
Reviewed-by H. Peter Anvin (Intel) <[email protected]>Signed-off-by Xin Li (Intel) <[email protected]>Cc Jennifer Miller <[email protected]>Cc Peter Zijlstra <[email protected]>Cc Andrew Cooper <[email protected]>Cc H. Peter Anvin <[email protected]>
Preferably with an adjusted commit message, Reviewed-by Andrew Cooper <[email protected]>
Any idea when an updated SIMICS will be available?
~Andrew
Xin Li
maintainerQuoted 6 lines · Andrew Cooper
Quoted 4 lines · Xin Li (Intel)
The FRED specification v9.0 states that there is no need for FRED event handlers to begin with ENDBR64, because in the presence of supervisor indirect branch tracking, FRED event delivery does not enter the
WAIT_FOR_ENDBRANCHstate.
Quoted 8 lines
I would suggest phrasing this as "The FRED specification has been changed in v9 to..."
Simply "v9 states" can be read as "we mistook what v8 said and did it wrong".
After all, the change here is specifically as a result of new research showing ENDBR on the entrypoints to be of negative value.
Sure, that makes it more like a story ;)
Quoted 21 lines
Quoted 13 lines
As a result, remove ENDBR64 from FRED entry points.
Then add
ANNOTATE_NOENDBRto indicate that FRED entry points will never be used for indirect calls to suppress an objtool warning.This change implies that any indirect CALL/JMP to FRED entry points causes #CP in the presence of supervisor indirect branch tracking.
Credit goes to Jennifer Miller <[email protected]> and other contributors from Arizona State University whose work led to this change.
Quoted 7 lines
Reviewed-by H. Peter Anvin (Intel) <[email protected]>Signed-off-by Xin Li (Intel) <[email protected]>Cc Jennifer Miller <[email protected]>Cc Peter Zijlstra <[email protected]>Cc Andrew Cooper <[email protected]>Cc H. Peter Anvin <[email protected]>
Quoted 2 lines
Preferably with an adjusted commit message, Reviewed-by Andrew Cooper <[email protected]>
Thanks, will add in v3 later today (Sent out v2 just now).
Quoted 2 lines
Any idea when an updated SIMICS will be available?
The FRED testing is more focused on hardware now :).
Anyway, let me check here.