arm/nospec: Make nospec helpers always_inline
PATCH 1/1 arm/nospec: Make nospec helpers always_inline
While today they don't implement fencing in a way that would block speculation, once/if they do they'll absolutely need to be inlined, even if -fno-inline or -fno-early-inlining are passed.
--- xen/arch/arm/include/asm/nospec.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
xen/arch/arm/include/asm/nospec.h +2 -2
@@ -4,12 +4,12 @@#ifndef _ASM_ARM_NOSPEC_H#define _ASM_ARM_NOSPEC_H -static inline bool evaluate_nospec (bool condition) +static always_inline bool evaluate_nospec(bool condition) {return condition; } -static inline void block_speculation (void ) +static always_inline void block_speculation(void) { }
base-commit: 290959692726bed9a9404fbb151767dba9928c5b
Signature · 1 line
2.43.0
Quoted 5 lines · Alejandro Vallejo
While today they don't implement fencing in a way that would block speculation, once/if they do they'll absolutely need to be inlined, even if -fno-inline or -fno-early-inlining are passed.
Signed-off-by Alejandro Vallejo <[email protected]>
but this should be done for Arm, RISCV and PPC at once in which case you can keep my tag for v2 # for Arm.
~Michal
Quoted 11 lines · Michal
Quoted 5 lines · Alejandro Vallejo
While today they don't implement fencing in a way that would block speculation, once/if they do they'll absolutely need to be inlined, even if -fno-inline or -fno-early-inlining are passed.
Signed-off-by Alejandro Vallejo <[email protected]>Reviewed-by Michal Orzel <[email protected]>but this should be done for Arm, RISCV and PPC at once in which case you can keep my tag for v2 # for Arm.
I previously had a patch series which made this all common, for these kinds of reasons.
I think I'd prefer to kick that over the line, than to keep on taking micro-bugfixes like this.
~Andrew
Quoted 10 lines · Andrew Cooper
Quoted 9 lines · Michal
Quoted 5 lines · Alejandro Vallejo
While today they don't implement fencing in a way that would block speculation, once/if they do they'll absolutely need to be inlined, even if -fno-inline or -fno-early-inlining are passed.
Signed-off-by Alejandro Vallejo <[email protected]>Reviewed-by Michal Orzel <[email protected]>
Quoted 8 lines
Quoted 2 lines
but this should be done for Arm, RISCV and PPC at once in which case you can keep my tag for v2 # for Arm.
I previously had a patch series which made this all common, for these kinds of reasons.
I think I'd prefer to kick that over the line, than to keep on taking micro-bugfixes like this.
for reference:
https://lore.kernel.org/all/[email protected]/
I wouldn't mind that, I can R-by it if you resend it. I'll still send a v2 of this on the grounds that it's a strict improvement over existing matters and might land faster.
Cheers,
Alejandro
Quoted 2 lines
~Andrew
Quoted 7 lines · Michal
Quoted 4 lines · Alejandro Vallejo
While today they don't implement fencing in a way that would block speculation, once/if they do they'll absolutely need to be inlined, even if -fno-inline or -fno-early-inlining are passed.
Quoted 5 lines
Quoted 1 line
Signed-off-by Alejandro Vallejo <[email protected]>Reviewed-by Michal Orzel <[email protected]>but this should be done for Arm, RISCV and PPC at once in which case you can keep my tag for v2 # for Arm.
Neither RISCV nor PPC implement nospec.h today. Should I considered the R-by just settled for this patch?
Cheers,
Alejandro
Quoted 2 lines
~Michal
Quoted 8 lines · Alejandro Vallejo
Quoted 7 lines · Michal
Quoted 4 lines · Alejandro Vallejo
While today they don't implement fencing in a way that would block speculation, once/if they do they'll absolutely need to be inlined, even if -fno-inline or -fno-early-inlining are passed.
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
Signed-off-by Alejandro Vallejo <[email protected]>Reviewed-by Michal Orzel <[email protected]>but this should be done for Arm, RISCV and PPC at once in which case you can keep my tag for v2 # for Arm.
Neither RISCV nor PPC implement
nospec.htoday. Should I considered the R-by just settled for this patch?
I'm not sure I understand. You wrote that they don't implement the header whereas I can see:arch/riscv/include/asm/nospec.harch/ppc/include/asm/nospec.h
hence my remark to fix all at once.
~Michal
Quoted 17 lines · Michal
Quoted 14 lines · Alejandro Vallejo
Quoted 12 lines · Michal
Quoted 5 lines · Alejandro Vallejo
While today they don't implement fencing in a way that would block speculation, once/if they do they'll absolutely need to be inlined, even if -fno-inline or -fno-early-inlining are passed.
Signed-off-by Alejandro Vallejo <[email protected]>Reviewed-by Michal Orzel <[email protected]>but this should be done for Arm, RISCV and PPC at once in which case you can keep my tag for v2 # for Arm.
Quoted 7 lines
Quoted 2 lines
Neither RISCV nor PPC implement
nospec.htoday. Should I considered the R-by just settled for this patch?I'm not sure I understand. You wrote that they don't implement the header whereas I can see:
arch/riscv/include/asm/nospec.harch/ppc/include/asm/nospec.h
hence my remark to fix all at once.
Bah, I was on a completely different baseline than I should've been. Even v1 doesn't apply cleanly.
Let me prep a proper v2 then.
Cheers,
Alejandro
Quoted 2 lines
~Michal
Quoted 3 lines · Alejandro Vallejo
While today they don't implement fencing in a way that would block speculation, once/if they do they'll absolutely need to be inlined, even if -fno-inline or -fno-early-inlining are passed.
FWIW, it's my understanding that -fno-early-inlining is not really relevant here; it disables the early inlining pass, but the late(r) one(s) is/are still present, so inlining will happen, just later in the compilation process. -fno-inline is indeed relevant here.
Thanks, Roger.