[PATCH v4 06/15] x86: rework arch_local_irq_restore() to not use popf

2021-01-20 Thread Juergen Gross
ested-by: Andy Lutomirski Signed-off-by: Juergen Gross --- arch/x86/include/asm/irqflags.h | 20 ++- arch/x86/include/asm/paravirt.h | 5 - arch/x86/include/asm/paravirt_types.h | 7 ++- arch/x86/kernel/irqflags.S| 11 --- arch/x86/kernel/p

[PATCH v4 03/15] x86/xen: use specific Xen pv interrupt entry for DF

2021-01-20 Thread Juergen Gross
Xen PV guests don't use IST. For double fault interrupts switch to the same model as NMI. Correct a typo in a comment while copying it. Signed-off-by: Juergen Gross Acked-by: Peter Zijlstra (Intel) Reviewed-by: Thomas Gleixner --- V2: - fix typo (Andy Lutomirski) --- arch/x86/includ

[PATCH v4 00/15] x86: major paravirt cleanup

2021-01-20 Thread Juergen Gross
atch 1 for making usage of static_call easier - even more cleanup Changes in V3: - added patches 7 and 12 - addressed all comments Changes in V2: - added patches 5-12 Juergen Gross (14): x86/xen: use specific Xen pv interrupt entry for MCE x86/xen: use specific Xen pv interrupt entry for D

[PATCH v4 02/15] x86/xen: use specific Xen pv interrupt entry for MCE

2021-01-20 Thread Juergen Gross
Xen PV guests don't use IST. For machine check interrupts switch to the same model as debug interrupts. Signed-off-by: Juergen Gross Acked-by: Peter Zijlstra (Intel) Reviewed-by: Thomas Gleixner --- arch/x86/include/asm/idtentry.h | 3 +++ arch/x86/xen/enlighten_pv.c

[PATCH v4 01/15] static_call: Pull some static_call declarations to the type headers

2021-01-20 Thread Juergen Gross
: Peter Zijlstra (Intel) Cc: Thomas Gleixner Cc: Mel Gorman Cc: Ingo Molnar Cc: Michal Hocko Cc: Paul E. McKenney Signed-off-by: Juergen Gross --- include/linux/static_call.h | 20 -- include/linux/static_call_types.h | 27 + tools

[GIT PULL] xen: branch for v5.11-rc5

2021-01-20 Thread Juergen Gross
Linus, Please git pull the following tag: git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip.git for-linus-5.11-rc5-tag xen: branch for v5.11-rc5 It contains a fix for build failure showing up in some configurations. Thanks. Juergen arch/x86/xen/smp_hvm.c | 2 ++ 1 file changed, 2 ins

[PATCH v4 04/15] x86/pv: switch SWAPGS to ALTERNATIVE

2021-01-20 Thread Juergen Gross
are never executed in a Xen PV guest. Replace those with the plain swapgs instruction. For SWAPGS_UNSAFE_STACK the same applies. Signed-off-by: Juergen Gross Acked-by: Andy Lutomirski Acked-by: Peter Zijlstra (Intel) Reviewed-by: Borislav Petkov Reviewed-by: Thomas Gleixner --- arch/x86/entry

[PATCH v4 08/15] x86/alternative: support "not feature" and ALTERNATIVE_TERNARY

2021-01-20 Thread Juergen Gross
instr", FEATURE_NR, "feature_on_instr", "feature_off_instr" which will start with "default_instr" and at patch time will, depending on FEATURE_NR being set or not, patch that with either "feature_on_instr" or "feature_off_ins

[PATCH v4 07/15] x86/paravirt: switch time pvops functions to use static_call()

2021-01-20 Thread Juergen Gross
The time pvops functions are the only ones left which might be used in 32-bit mode and which return a 64-bit value. Switch them to use the static_call() mechanism instead of pvops, as this allows quite some simplification of the pvops implementation. Signed-off-by: Juergen Gross --- V4: - drop

[PATCH v4 15/15] x86/paravirt: have only one paravirt patch function

2021-01-20 Thread Juergen Gross
There is no need any longer to have different paravirt patch functions for native and Xen. Eliminate native_patch() and rename paravirt_patch_default() to paravirt_patch(). Signed-off-by: Juergen Gross --- V3: - remove paravirt_patch_insns() (kernel test robot) --- arch/x86/include/asm

[PATCH v4 07/15] x86/paravirt: switch time pvops functions to use static_call()

2021-01-20 Thread Juergen Gross
The time pvops functions are the only ones left which might be used in 32-bit mode and which return a 64-bit value. Switch them to use the static_call() mechanism instead of pvops, as this allows quite some simplification of the pvops implementation. Signed-off-by: Juergen Gross --- V4: - drop

[PATCH v4 14/15] x86/paravirt: switch functions with custom code to ALTERNATIVE

2021-01-20 Thread Juergen Gross
register defines for assembler paravirt calling, as there isn't much usage left. Signed-off-by: Juergen Gross --- V4: - fixed SAVE_FLAGS() (kernel test robot) - added assembler paravirt cleanup --- arch/x86/entry/entry_64.S | 2 +- arch/x86/include/asm/irqflags.h | 2 +- arc

[PATCH v4 10/15] x86/paravirt: remove no longer needed 32-bit pvops cruft

2021-01-20 Thread Juergen Gross
code only, so it can just be replaced by cli. INTERRUPT_RETURN in 32-bit code can be replaced by iret. ENABLE_INTERRUPTS is used nowhere, so it can be removed. Signed-off-by: Juergen Gross --- arch/x86/entry/entry_32.S | 4 +- arch/x86/include/asm/irqflags.h | 5 -- arch/x

[PATCH v4 13/15] x86/paravirt: add new macros PVOP_ALT* supporting pvops in ALTERNATIVEs

2021-01-20 Thread Juergen Gross
Instead of using paravirt patching for custom code sequences add support for using ALTERNATIVE handling combined with paravirt call patching. Signed-off-by: Juergen Gross --- V3: - drop PVOP_ALT_VCALL() macro --- arch/x86/include/asm/paravirt_types.h | 49 ++- 1 file

[PATCH v4 11/15] x86/paravirt: simplify paravirt macros

2021-01-20 Thread Juergen Gross
)PVOP_CALL(long, ...). Note that it isn't easily possible to just redefine PVOP_VCALL() to use PVOP_CALL() instead, as this would require further hiding of commas in macro parameters. Signed-off-by: Juergen Gross --- V3: - new patch V4: - fix build warnings with clang (kernel test

[PATCH v4 08/15] x86/alternative: support "not feature" and ALTERNATIVE_TERNARY

2021-01-20 Thread Juergen Gross
instr", FEATURE_NR, "feature_on_instr", "feature_off_instr" which will start with "default_instr" and at patch time will, depending on FEATURE_NR being set or not, patch that with either "feature_on_instr" or "feature_off_ins

[PATCH v4 09/15] x86: add new features for paravirt patching

2021-01-20 Thread Juergen Gross
patching later. Make sure paravirt patching is performed before alternative patching. Signed-off-by: Juergen Gross --- V3: - add comment (Boris Petkov) - no negative features (Boris Petkov) V4: - move paravirt_set_cap() to paravirt-spinlocks.c --- arch/x86/include/asm/cpufeatures.h | 2

[PATCH v4 12/15] x86/paravirt: switch iret pvops to ALTERNATIVE

2021-01-20 Thread Juergen Gross
The iret paravirt op is rather special as it is using a jmp instead of a call instruction. Switch it to ALTERNATIVE. Signed-off-by: Juergen Gross --- V3: - use ALTERNATIVE_TERNARY --- arch/x86/include/asm/paravirt.h | 6 +++--- arch/x86/include/asm/paravirt_types.h | 5 + arch/x86

[PATCH v4 06/15] x86: rework arch_local_irq_restore() to not use popf

2021-01-20 Thread Juergen Gross
ested-by: Andy Lutomirski Signed-off-by: Juergen Gross --- arch/x86/include/asm/irqflags.h | 20 ++- arch/x86/include/asm/paravirt.h | 5 - arch/x86/include/asm/paravirt_types.h | 7 ++- arch/x86/kernel/irqflags.S| 11 --- arch/x86/kernel/p

[PATCH v4 04/15] x86/pv: switch SWAPGS to ALTERNATIVE

2021-01-20 Thread Juergen Gross
are never executed in a Xen PV guest. Replace those with the plain swapgs instruction. For SWAPGS_UNSAFE_STACK the same applies. Signed-off-by: Juergen Gross Acked-by: Andy Lutomirski Acked-by: Peter Zijlstra (Intel) Reviewed-by: Borislav Petkov Reviewed-by: Thomas Gleixner --- arch/x86/entry

[PATCH v4 05/15] x86/xen: drop USERGS_SYSRET64 paravirt call

2021-01-20 Thread Juergen Gross
in the kernel more than compensate for this drop (a kernel build in a Xen PV guest was slightly faster with this patch applied). While at it remove the stale sysret32 remnants. Signed-off-by: Juergen Gross --- V3: - simplify ALTERNATIVE (Boris Petkov) --- arch/x86/entry/entry_64.S

[PATCH v4 02/15] x86/xen: use specific Xen pv interrupt entry for MCE

2021-01-20 Thread Juergen Gross
Xen PV guests don't use IST. For machine check interrupts switch to the same model as debug interrupts. Signed-off-by: Juergen Gross Acked-by: Peter Zijlstra (Intel) Reviewed-by: Thomas Gleixner --- arch/x86/include/asm/idtentry.h | 3 +++ arch/x86/xen/enlighten_pv.c

[PATCH v4 00/15] x86: major paravirt cleanup

2021-01-20 Thread Juergen Gross
tch, as objtool patches are in tip now - added patch 1 for making usage of static_call easier - even more cleanup Changes in V3: - added patches 7 and 12 - addressed all comments Changes in V2: - added patches 5-12 Juergen Gross (14): x86/xen: use specific Xen pv interrupt entry for MCE x86/xen: u

[PATCH v4 03/15] x86/xen: use specific Xen pv interrupt entry for DF

2021-01-20 Thread Juergen Gross
Xen PV guests don't use IST. For double fault interrupts switch to the same model as NMI. Correct a typo in a comment while copying it. Signed-off-by: Juergen Gross Acked-by: Peter Zijlstra (Intel) Reviewed-by: Thomas Gleixner --- V2: - fix typo (Andy Lutomirski) --- arch/x86/includ

[PATCH v4 01/15] static_call: Pull some static_call declarations to the type headers

2021-01-20 Thread Juergen Gross
: Peter Zijlstra (Intel) Cc: Thomas Gleixner Cc: Mel Gorman Cc: Ingo Molnar Cc: Michal Hocko Cc: Paul E. McKenney Signed-off-by: Juergen Gross --- include/linux/static_call.h | 20 -- include/linux/static_call_types.h | 27 + tools

[PATCH v4 13/15] x86/paravirt: add new macros PVOP_ALT* supporting pvops in ALTERNATIVEs

2021-01-20 Thread Juergen Gross
Instead of using paravirt patching for custom code sequences add support for using ALTERNATIVE handling combined with paravirt call patching. Signed-off-by: Juergen Gross --- V3: - drop PVOP_ALT_VCALL() macro --- arch/x86/include/asm/paravirt_types.h | 49 ++- 1 file

[PATCH v7 08/14] x86: add new features for paravirt patching

2021-03-11 Thread Juergen Gross
patching later. Make sure paravirt patching is performed before alternative patching. Signed-off-by: Juergen Gross Acked-by: Peter Zijlstra (Intel) --- V3: - add comment (Boris Petkov) - no negative features (Boris Petkov) V4: - move paravirt_set_cap() to paravirt-spinlocks.c --- arch/x86

[PATCH v7 02/14] static_call: move struct static_call_key definition to static_call_types.h

2021-03-11 Thread Juergen Gross
ff-by: Juergen Gross Acked-by: Peter Zijlstra (Intel) --- V5: - new patch --- include/linux/static_call.h | 18 -- include/linux/static_call_types.h | 18 ++ tools/include/linux/static_call_types.h | 18 ++ 3 files changed, 36 inser

[PATCH v7 07/14] x86/alternative: don't open code ALTERNATIVE_TERNARY() in _static_cpu_has()

2021-03-11 Thread Juergen Gross
_static_cpu_has() contains a completely open coded version of ALTERNATIVE_TERNARY(). Replace that with the macro instead. Signed-off-by: Juergen Gross --- V6: - new patch V7: - moved patch earlier in series (Boris Petkov) --- arch/x86/include/asm/cpufeature.h | 41

[PATCH v7 03/14] static_call: add function to query current function

2021-03-11 Thread Juergen Gross
(). Signed-off-by: Juergen Gross --- V7: - new patch --- include/linux/static_call.h | 8 1 file changed, 8 insertions(+) diff --git a/include/linux/static_call.h b/include/linux/static_call.h index 76b881259144..e01b61ab86b1 100644 --- a/include/linux/static_call.h +++ b/include/linux

[PATCH v7 13/14] x86/paravirt: switch functions with custom code to ALTERNATIVE

2021-03-11 Thread Juergen Gross
register defines for assembler paravirt calling, as there isn't much usage left. Signed-off-by: Juergen Gross Acked-by: Peter Zijlstra (Intel) --- V4: - fixed SAVE_FLAGS() (kernel test robot) - added assembler paravirt cleanup --- arch/x86/entry/entry_64.S | 2 +- arch/x86/includ

[PATCH v7 10/14] x86/paravirt: simplify paravirt macros

2021-03-11 Thread Juergen Gross
)PVOP_CALL(long, ...). Note that it isn't easily possible to just redefine PVOP_VCALL() to use PVOP_CALL() instead, as this would require further hiding of commas in macro parameters. Signed-off-by: Juergen Gross Acked-by: Peter Zijlstra (Intel) --- V3: - new patch V4: - fix build warnings

[PATCH v7 09/14] x86/paravirt: remove no longer needed 32-bit pvops cruft

2021-03-11 Thread Juergen Gross
code only, so it can just be replaced by cli. INTERRUPT_RETURN in 32-bit code can be replaced by iret. ENABLE_INTERRUPTS is used nowhere, so it can be removed. Signed-off-by: Juergen Gross Acked-by: Peter Zijlstra (Intel) --- arch/x86/entry/entry_32.S | 4 +- arch/x86/include/a

[PATCH v7 12/14] x86/paravirt: add new macros PVOP_ALT* supporting pvops in ALTERNATIVEs

2021-03-11 Thread Juergen Gross
Instead of using paravirt patching for custom code sequences add support for using ALTERNATIVE handling combined with paravirt call patching. Signed-off-by: Juergen Gross Acked-by: Peter Zijlstra (Intel) --- V3: - drop PVOP_ALT_VCALL() macro --- arch/x86/include/asm/paravirt_types.h | 49

[PATCH v7 11/14] x86/paravirt: switch iret pvops to ALTERNATIVE

2021-03-11 Thread Juergen Gross
The iret paravirt op is rather special as it is using a jmp instead of a call instruction. Switch it to ALTERNATIVE. Signed-off-by: Juergen Gross Acked-by: Peter Zijlstra (Intel) --- V3: - use ALTERNATIVE_TERNARY --- arch/x86/include/asm/paravirt.h | 6 +++--- arch/x86/include/asm

[PATCH v7 04/14] x86/paravirt: switch time pvops functions to use static_call()

2021-03-11 Thread Juergen Gross
The time pvops functions are the only ones left which might be used in 32-bit mode and which return a 64-bit value. Switch them to use the static_call() mechanism instead of pvops, as this allows quite some simplification of the pvops implementation. Signed-off-by: Juergen Gross Acked-by: Peter

[PATCH v7 14/14] x86/paravirt: have only one paravirt patch function

2021-03-11 Thread Juergen Gross
There is no need any longer to have different paravirt patch functions for native and Xen. Eliminate native_patch() and rename paravirt_patch_default() to paravirt_patch(). Signed-off-by: Juergen Gross Acked-by: Peter Zijlstra (Intel) --- V3: - remove paravirt_patch_insns() (kernel test robot

[PATCH v7 06/14] x86/alternative: support ALTERNATIVE_TERNARY

2021-03-11 Thread Juergen Gross
ot;default_instr" and at patch time will, depending on FEATURE_NR being set or not, patch that with either "feature_on_instr" or "feature_off_instr". Signed-off-by: Juergen Gross Acked-by: Peter Zijlstra (Intel) --- V3: - new patch V4: - use X86_FEATURE_ALWAYS instead

[PATCH v7 05/14] x86/alternative: support not-feature

2021-03-11 Thread Juergen Gross
Add support for alternative patching for the case a feature is not present on the current cpu. For users of ALTERNATIVE() and friends an inverted feature is specified by applying the ALT_NOT() macro to it, e.g.: ALTERNATIVE(old, new, ALT_NOT(feature)) Signed-off-by: Juergen Gross --- V5

[PATCH v7 01/14] x86/alternative: merge include files

2021-03-11 Thread Juergen Gross
Merge arch/x86/include/asm/alternative-asm.h into arch/x86/include/asm/alternative.h in order to make it easier to use common definitions later. Signed-off-by: Juergen Gross --- V6: - new patch V7: - moved to begin of series (Boris Petkov) --- arch/x86/entry/entry_32.S| 2

[PATCH v7 00/14] x86: major paravirt cleanup

2021-03-11 Thread Juergen Gross
e of static_call easier - even more cleanup Changes in V3: - added patches 7 and 12 - addressed all comments Changes in V2: - added patches 5-12 Juergen Gross (14): x86/alternative: merge include files static_call: move struct static_call_key definition to static_call_types.h static_call:

[PATCH v3 4/4] kernel/smp: fix flush_smp_call_function_queue() cpu offline detection

2021-03-02 Thread Juergen Gross
The warnings for flushing a logically offline cpu's call_single_queue are gated by a wrong if statement. It should trigger when there have been new requests before dequeueing them, not afterwards. Signed-off-by: Juergen Gross --- V3: - new patch --- kernel/smp.c | 2 +- 1 file chang

[PATCH v3 1/4] kernel/smp: add boot parameter for controlling CSD lock debugging

2021-03-02 Thread Juergen Gross
boot parameter for switching the debug functionality on. This will reduce any performance impact of the debug coding to a bare minimum when not being used. Signed-off-by: Juergen Gross --- .../admin-guide/kernel-parameters.txt | 6 +++ kernel/smp.c | 38

[PATCH v3 2/4] kernel/smp: prepare more CSD lock debugging

2021-03-02 Thread Juergen Gross
In order to be able to easily add more CSD lock debugging data to struct call_function_data->csd move the call_single_data_t element into a sub-structure. Signed-off-by: Juergen Gross --- kernel/smp.c | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/ker

[PATCH v3 0/4] kernel/smp.c: add more CSD lock debugging

2021-03-02 Thread Juergen Gross
, but this option will have a larger impact on performance. I hope that the "ext" setting will help to find the root cause of the problem. Juergen Gross (4): kernel/smp: add boot parameter for controlling CSD lock debugging kernel/smp: prepare more CSD lock debugging kernel/smp: add

[PATCH v3 3/4] kernel/smp: add more data to CSD lock debugging

2021-03-02 Thread Juergen Gross
nts for the source cpu of the hanging request, and receiver side events for the target cpu), and the related events just before those (for adding data needed to identify a possible race). Printing all available data would be possible, but this would add large amounts of data printed on larger

[PATCH v4 0/3] xen/events: bug fixes and some diagnostic aids

2021-03-06 Thread Juergen Gross
Those are fixes for XSA-332. The rest of the V3 patches have been applied already. There is one additional fix in patch 2 which addresses network outages when a guest is doing reboot loops. Juergen Gross (3): xen/events: reset affinity of 2-level event when tearing it down xen/events: don&#

[PATCH v4 2/3] xen/events: don't unmask an event channel when an eoi is pending

2021-03-06 Thread Juergen Gross
/unmasking and temporary masking. The event channel should only be able to generate an interrupt if all flags are cleared. Cc: sta...@vger.kernel.org Fixes: 54c9de89895e0a36047 ("xen/events: add a new late EOI evtchn framework") Reported-by: Julien Grall Signed-off-by: Juergen Gross Revie

[PATCH v4 1/3] xen/events: reset affinity of 2-level event when tearing it down

2021-03-06 Thread Juergen Gross
: Julien Grall Signed-off-by: Juergen Gross Reviewed-by: Julien Grall --- V2: - reset affinity when tearing down the event (Julien Grall) --- drivers/xen/events/events_2l.c | 15 +++ drivers/xen/events/events_base.c | 1 + drivers/xen/events/events_internal.h | 8 3

[PATCH v4 3/3] xen/events: avoid handling the same event on two cpus at the same time

2021-03-06 Thread Juergen Gross
t set. Cc: sta...@vger.kernel.org Reported-by: Julien Grall Signed-off-by: Juergen Gross Reviewed-by: Julien Grall --- V2: - new patch V3: - use common helper for end of handler action (Julien Grall) - move setting is_active to 0 for lateeoi (Boris Ostrovsky) --- drivers/xen/events/eve

[PATCH v5 01/12] staticcall: move struct static_call_key definition to static_call_types.h

2021-03-08 Thread Juergen Gross
ff-by: Juergen Gross --- V5: - new patch --- include/linux/static_call.h | 18 -- include/linux/static_call_types.h | 18 ++ tools/include/linux/static_call_types.h | 18 ++ 3 files changed, 36 insertions(+), 18 deletions(-) diff --

[PATCH v5 03/12] x86/alternative: drop feature parameter from ALTINSTR_REPLACEMENT()

2021-03-08 Thread Juergen Gross
The macro ALTINSTR_REPLACEMENT() doesn't make use of the feature parameter, so drop it. Signed-off-by: Juergen Gross --- V5: - new patch --- arch/x86/include/asm/alternative.h | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/x86/include/asm/alternat

[PATCH v5 02/12] x86/paravirt: switch time pvops functions to use static_call()

2021-03-08 Thread Juergen Gross
The time pvops functions are the only ones left which might be used in 32-bit mode and which return a 64-bit value. Switch them to use the static_call() mechanism instead of pvops, as this allows quite some simplification of the pvops implementation. Signed-off-by: Juergen Gross --- V4: - drop

[PATCH v5 04/12] x86/alternative: support not-feature

2021-03-08 Thread Juergen Gross
it, e.g.: ALTERNATIVE(old, new, ~feature) This requires adapting the objtool information for struct alt_instr. Signed-off-by: Juergen Gross --- V5: - split off from next patch - reworked to use flag byte (Boris Petkov) --- arch/x86/include/asm/alternative-asm.h| 6 ++ arch/x86

[PATCH v5 00/12] x86: major paravirt cleanup

2021-03-08 Thread Juergen Gross
king usage of static_call easier - even more cleanup Changes in V3: - added patches 7 and 12 - addressed all comments Changes in V2: - added patches 5-12 Juergen Gross (12): staticcall: move struct static_call_key definition to static_call_types.h x86/paravirt: switch time pvops functi

[PATCH v5 07/12] x86/paravirt: remove no longer needed 32-bit pvops cruft

2021-03-08 Thread Juergen Gross
code only, so it can just be replaced by cli. INTERRUPT_RETURN in 32-bit code can be replaced by iret. ENABLE_INTERRUPTS is used nowhere, so it can be removed. Signed-off-by: Juergen Gross --- arch/x86/entry/entry_32.S | 4 +- arch/x86/include/asm/irqflags.h | 5 -- arch/x

[PATCH v5 09/12] x86/paravirt: switch iret pvops to ALTERNATIVE

2021-03-08 Thread Juergen Gross
The iret paravirt op is rather special as it is using a jmp instead of a call instruction. Switch it to ALTERNATIVE. Signed-off-by: Juergen Gross --- V3: - use ALTERNATIVE_TERNARY --- arch/x86/include/asm/paravirt.h | 6 +++--- arch/x86/include/asm/paravirt_types.h | 5 + arch/x86

[PATCH v5 10/12] x86/paravirt: add new macros PVOP_ALT* supporting pvops in ALTERNATIVEs

2021-03-08 Thread Juergen Gross
Instead of using paravirt patching for custom code sequences add support for using ALTERNATIVE handling combined with paravirt call patching. Signed-off-by: Juergen Gross --- V3: - drop PVOP_ALT_VCALL() macro --- arch/x86/include/asm/paravirt_types.h | 49 ++- 1 file

[PATCH v5 12/12] x86/paravirt: have only one paravirt patch function

2021-03-08 Thread Juergen Gross
There is no need any longer to have different paravirt patch functions for native and Xen. Eliminate native_patch() and rename paravirt_patch_default() to paravirt_patch(). Signed-off-by: Juergen Gross --- V3: - remove paravirt_patch_insns() (kernel test robot) --- arch/x86/include/asm

[PATCH v5 05/12] x86/alternative: support ALTERNATIVE_TERNARY

2021-03-08 Thread Juergen Gross
ot;default_instr" and at patch time will, depending on FEATURE_NR being set or not, patch that with either "feature_on_instr" or "feature_off_instr". Signed-off-by: Juergen Gross --- V3: - new patch V4: - use X86_FEATURE_ALWAYS instead of negated feature (Boris Petkov) - un

[PATCH v5 11/12] x86/paravirt: switch functions with custom code to ALTERNATIVE

2021-03-08 Thread Juergen Gross
register defines for assembler paravirt calling, as there isn't much usage left. Signed-off-by: Juergen Gross --- V4: - fixed SAVE_FLAGS() (kernel test robot) - added assembler paravirt cleanup --- arch/x86/entry/entry_64.S | 2 +- arch/x86/include/asm/irqflags.h | 2 +- arc

[PATCH v5 08/12] x86/paravirt: simplify paravirt macros

2021-03-08 Thread Juergen Gross
)PVOP_CALL(long, ...). Note that it isn't easily possible to just redefine PVOP_VCALL() to use PVOP_CALL() instead, as this would require further hiding of commas in macro parameters. Signed-off-by: Juergen Gross --- V3: - new patch V4: - fix build warnings with clang (kernel test

[PATCH v5 06/12] x86: add new features for paravirt patching

2021-03-08 Thread Juergen Gross
patching later. Make sure paravirt patching is performed before alternative patching. Signed-off-by: Juergen Gross --- V3: - add comment (Boris Petkov) - no negative features (Boris Petkov) V4: - move paravirt_set_cap() to paravirt-spinlocks.c --- arch/x86/include/asm/cpufeatures.h | 2

[PATCH v6 01/12] static_call: move struct static_call_key definition to static_call_types.h

2021-03-09 Thread Juergen Gross
ff-by: Juergen Gross Acked-by: Peter Zijlstra (Intel) --- V5: - new patch --- include/linux/static_call.h | 18 -- include/linux/static_call_types.h | 18 ++ tools/include/linux/static_call_types.h | 18 ++ 3 files changed, 36 inser

[PATCH v6 03/12] x86/alternative: drop feature parameter from ALTINSTR_REPLACEMENT()

2021-03-09 Thread Juergen Gross
The macro ALTINSTR_REPLACEMENT() doesn't make use of the feature parameter, so drop it. Signed-off-by: Juergen Gross Acked-by: Peter Zijlstra (Intel) --- V5: - new patch --- arch/x86/include/asm/alternative.h | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --

[PATCH v6 04/12] x86/alternative: support not-feature

2021-03-09 Thread Juergen Gross
Add support for alternative patching for the case a feature is not present on the current cpu. For users of ALTERNATIVE() and friends an inverted feature is specified by applying the ALT_NOT() macro to it, e.g.: ALTERNATIVE(old, new, ALT_NOT(feature)) Signed-off-by: Juergen Gross --- V5

[PATCH v6 02/12] x86/paravirt: switch time pvops functions to use static_call()

2021-03-09 Thread Juergen Gross
The time pvops functions are the only ones left which might be used in 32-bit mode and which return a 64-bit value. Switch them to use the static_call() mechanism instead of pvops, as this allows quite some simplification of the pvops implementation. Signed-off-by: Juergen Gross Acked-by: Peter

[PATCH v6 05/12] x86/alternative: support ALTERNATIVE_TERNARY

2021-03-09 Thread Juergen Gross
ot;default_instr" and at patch time will, depending on FEATURE_NR being set or not, patch that with either "feature_on_instr" or "feature_off_instr". Signed-off-by: Juergen Gross Acked-by: Peter Zijlstra (Intel) --- V3: - new patch V4: - use X86_FEATURE_ALWAYS instead

[PATCH v6 07/12] x86/paravirt: remove no longer needed 32-bit pvops cruft

2021-03-09 Thread Juergen Gross
code only, so it can just be replaced by cli. INTERRUPT_RETURN in 32-bit code can be replaced by iret. ENABLE_INTERRUPTS is used nowhere, so it can be removed. Signed-off-by: Juergen Gross Acked-by: Peter Zijlstra (Intel) --- arch/x86/entry/entry_32.S | 4 +- arch/x86/include/a

[PATCH v6 00/12] x86: major paravirt cleanup

2021-03-09 Thread Juergen Gross
" Changes in V4: - fixed several build failures - removed objtool patch, as objtool patches are in tip now - added patch 1 for making usage of static_call easier - even more cleanup Changes in V3: - added patches 7 and 12 - addressed all comments Changes in V2: - added patches 5-12 Juergen G

[PATCH v6 09/12] x86/paravirt: switch iret pvops to ALTERNATIVE

2021-03-09 Thread Juergen Gross
The iret paravirt op is rather special as it is using a jmp instead of a call instruction. Switch it to ALTERNATIVE. Signed-off-by: Juergen Gross Acked-by: Peter Zijlstra (Intel) --- V3: - use ALTERNATIVE_TERNARY --- arch/x86/include/asm/paravirt.h | 6 +++--- arch/x86/include/asm

[PATCH v6 11/12] x86/paravirt: switch functions with custom code to ALTERNATIVE

2021-03-09 Thread Juergen Gross
register defines for assembler paravirt calling, as there isn't much usage left. Signed-off-by: Juergen Gross Acked-by: Peter Zijlstra (Intel) --- V4: - fixed SAVE_FLAGS() (kernel test robot) - added assembler paravirt cleanup --- arch/x86/entry/entry_64.S | 2 +- arch/x86/includ

[PATCH v6 10/12] x86/paravirt: add new macros PVOP_ALT* supporting pvops in ALTERNATIVEs

2021-03-09 Thread Juergen Gross
Instead of using paravirt patching for custom code sequences add support for using ALTERNATIVE handling combined with paravirt call patching. Signed-off-by: Juergen Gross Acked-by: Peter Zijlstra (Intel) --- V3: - drop PVOP_ALT_VCALL() macro --- arch/x86/include/asm/paravirt_types.h | 49

[PATCH v6 08/12] x86/paravirt: simplify paravirt macros

2021-03-09 Thread Juergen Gross
)PVOP_CALL(long, ...). Note that it isn't easily possible to just redefine PVOP_VCALL() to use PVOP_CALL() instead, as this would require further hiding of commas in macro parameters. Signed-off-by: Juergen Gross Acked-by: Peter Zijlstra (Intel) --- V3: - new patch V4: - fix build warnings

[PATCH v6 06/12] x86: add new features for paravirt patching

2021-03-09 Thread Juergen Gross
patching later. Make sure paravirt patching is performed before alternative patching. Signed-off-by: Juergen Gross Acked-by: Peter Zijlstra (Intel) --- V3: - add comment (Boris Petkov) - no negative features (Boris Petkov) V4: - move paravirt_set_cap() to paravirt-spinlocks.c --- arch/x86

[PATCH v6 12/12] x86/paravirt: have only one paravirt patch function

2021-03-09 Thread Juergen Gross
There is no need any longer to have different paravirt patch functions for native and Xen. Eliminate native_patch() and rename paravirt_patch_default() to paravirt_patch(). Signed-off-by: Juergen Gross Acked-by: Peter Zijlstra (Intel) --- V3: - remove paravirt_patch_insns() (kernel test robot

[PATCH v6 13/12] x86/alternative: merge include files

2021-03-09 Thread Juergen Gross
Merge arch/x86/include/asm/alternative-asm.h into arch/x86/include/asm/alternative.h in order to make it easier to use common definitions later. Signed-off-by: Juergen Gross --- arch/x86/entry/entry_32.S| 2 +- arch/x86/entry/vdso/vdso32/system_call.S | 2 +- arch/x86

[PATCH v6 14/12] x86/alternative: don't open code ALTERNATIVE_TERNARY() in _static_cpu_has()

2021-03-09 Thread Juergen Gross
_static_cpu_has() contains a completely open coded version of ALTERNATIVE_TERNARY(). Replace that with the macro instead. Signed-off-by: Juergen Gross --- arch/x86/include/asm/cpufeature.h | 41 +++ 1 file changed, 9 insertions(+), 32 deletions(-) diff --git a/arch

[PATCH 3/7] xen/events: fix lateeoi irq acknowledgment

2021-02-06 Thread Juergen Gross
kernel.org Signed-off-by: Juergen Gross --- drivers/xen/events/events_base.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c index 6a836d131e73..7b26ef817f8b 100644 --- a/drivers/xen/events/events_base.c +++ b/drivers/

[PATCH 0/7] xen/events: bug fixes and some diagnostic aids

2021-02-06 Thread Juergen Gross
control. Patches 6 and 7 are minor fixes I had lying around. Juergen Gross (7): xen/events: reset affinity of 2-level event initially xen/events: don't unmask an event channel when an eoi is pending xen/events: fix lateeoi irq acknowledgement xen/events: link interdomain events to assoc

[PATCH 2/7] xen/events: don't unmask an event channel when an eoi is pending

2021-02-06 Thread Juergen Gross
/unmasking. The event channel should only be able to generate an interrupt if both flags are cleared. Cc: sta...@vger.kernel.org Fixes: 54c9de89895e0a36047 ("xen/events: add a new late EOI evtchn framework") Reported-by: Julien Grall Signed-off-by: Juergen Gross --- drivers/xen/event

[PATCH 1/7] xen/events: reset affinity of 2-level event initially

2021-02-06 Thread Juergen Gross
percpu events get initialized before the percpu event channel hook is called, resetting of the affinities happens after offlining a vcpu (this is working, as initial percpu memory is zeroed out). Cc: sta...@vger.kernel.org Reported-by: Julien Grall Signed-off-by: Juergen Gross --- drivers/xen

[PATCH 6/7] xen/evtch: use smp barriers for user event ring

2021-02-06 Thread Juergen Gross
The ring buffer for user events is used in the local system only, so smp barriers are fine for ensuring consistency. Reported-by: Andrew Cooper Signed-off-by: Juergen Gross --- drivers/xen/evtchn.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/xen/evtchn.c b

[PATCH 7/7] xen/evtchn: read producer index only once

2021-02-06 Thread Juergen Gross
In evtchn_read() use READ_ONCE() for reading the producer index in order to avoid the compiler generating multiple accesses. Signed-off-by: Juergen Gross --- drivers/xen/evtchn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/xen/evtchn.c b/drivers/xen/evtchn.c

[PATCH 5/7] xen/events: add per-xenbus device event statistics and settings

2021-02-06 Thread Juergen Gross
Add sysfs nodes for each xenbus device showing event statistics (number of events and spurious events, number of associated event channels) and for setting a spurious event threshold in case a frontend is sending too many events without being rogue on purpose. Signed-off-by: Juergen Gross

[PATCH 4/7] xen/events: link interdomain events to associated xenbus device

2021-02-06 Thread Juergen Gross
id of the other side. While at it remove the stale prototype of bind_evtchn_to_irq_lateeoi(). Signed-off-by: Juergen Gross --- drivers/block/xen-blkback/xenbus.c | 2 +- drivers/net/xen-netback/interface.c | 16 +-- drivers/xen/events/events_base.c| 41

[GIT PULL] xen: branch for v5.11-rc4

2021-01-15 Thread Juergen Gross
Linus, Please git pull the following tag: git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip.git for-linus-5.11-rc4-tag xen: branch for v5.11-rc4 It contains: - A series for fixing a regression when running as a fully virtualized guest on an old Xen hypervisor not supporting PV interrup

[GIT PULL] xen: branch for v5.11-rc4

2021-01-15 Thread Juergen Gross
Linus, Please git pull the following tag: git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip.git for-linus-5.11-rc4-tag xen: branch for v5.11-rc4 It contains: - A series for fixing a regression when running as a fully virtualized guest on an old Xen hypervisor not supporting PV interrup

[PATCH] x86/xen: avoid warning in Xen pv guest with CONFIG_AMD_MEM_ENCRYPT enabled

2021-01-25 Thread Juergen Gross
Runtime #VC Exception Handler") Cc: # v5.10 Signed-off-by: Juergen Gross --- arch/x86/include/asm/idtentry.h | 3 +++ arch/x86/xen/enlighten_pv.c | 11 +++ arch/x86/xen/xen-asm.S | 3 +++ 3 files changed, 17 insertions(+) diff --git a/arch/x86/include/asm/idtentry.h b/

[PATCH v2] x86/xen: avoid warning in Xen pv guest with CONFIG_AMD_MEM_ENCRYPT enabled

2021-01-27 Thread Juergen Gross
andler, which will just panic the system in case such a trap will ever happen. Fixes: 0786138c78e793 ("x86/sev-es: Add a Runtime #VC Exception Handler") Cc: # v5.10 Signed-off-by: Juergen Gross --- V2: - use generic handler for unknown traps (Andrew Cooper) --- arch/x86/include/asm

[GIT PULL] xen: branch for v5.11-rc6

2021-01-28 Thread Juergen Gross
+++ 5 files changed, 54 insertions(+), 14 deletions(-) David Woodhouse (1): xen: Fix XenStore initialisation for XS_LOCAL Juergen Gross (1): x86/xen: avoid warning in Xen pv guest with CONFIG_AMD_MEM_ENCRYPT enabled Roger Pau Monne (1): xen-blkfront: allow discard-* nodes to be

[PATCH v2] xen/xenbus: make xs_talkv() interruptible

2020-12-15 Thread Juergen Gross
In case a process waits for any Xenstore action in the xenbus driver it should be interruptible by signals. Signed-off-by: Juergen Gross --- V2: - don't special case SIGKILL as libxenstore is handling -EINTR fine --- drivers/xen/xenbus/xenbus_xs.c | 9 - 1 file changed, 8 inser

[GIT PULL] xen: branch for v5.11-rc1

2020-12-15 Thread Juergen Gross
Linus, Please git pull the following tag: git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip.git for-linus-5.11-rc1-tag xen: branch for v5.11-rc1 It contains fixes for security issues just having been disclosed: - a 5 patch series for fixing of XSA-349 (DoS via resource depletion in Xen

Oops in scsi_put_host_cmd_pool

2014-07-31 Thread Juergen Gross
During test of Xen pvSCSI frontend module I found the following issue: When unplugging a passed-through SCSI-device the SCSI Host is removed. When calling the final scsi_host_put() from the driver an Oops is happening: [ 219.816292] (file=drivers/scsi/xen-scsifront.c, line=808) scsifront_remov

Re: Oops in scsi_put_host_cmd_pool

2014-07-31 Thread Juergen Gross
On 08/01/2014 07:41 AM, Juergen Gross wrote: During test of Xen pvSCSI frontend module I found the following issue: When unplugging a passed-through SCSI-device the SCSI Host is removed. When calling the final scsi_host_put() from the driver an Oops is happening: [ 219.816292] (file=drivers

Re: Oops in scsi_put_host_cmd_pool

2014-08-01 Thread Juergen Gross
On 08/01/2014 09:05 AM, James Bottomley wrote: On Fri, 2014-08-01 at 08:02 +0200, Juergen Gross wrote: On 08/01/2014 07:41 AM, Juergen Gross wrote: During test of Xen pvSCSI frontend module I found the following issue: When unplugging a passed-through SCSI-device the SCSI Host is removed

Re: [Xen-devel] [PATCH V2 2/3] xen: eliminate scalability issues from initrd handling

2014-09-17 Thread Juergen Gross
On 09/17/2014 03:45 PM, David Vrabel wrote: On 17/09/14 05:12, Juergen Gross wrote: Size restrictions native kernels wouldn't have resulted from the initrd getting mapped into the initial mapping. The kernel doesn't really need the initrd to be mapped, so use infrastructure available

Re: [Xen-devel] [PATCH V2 3/3] xen: eliminate scalability issues from initial mapping setup

2014-09-17 Thread Juergen Gross
On 09/17/2014 04:07 PM, David Vrabel wrote: On 17/09/14 05:12, Juergen Gross wrote: Direct Xen to place the initial P->M table outside of the initial mapping, as otherwise the 1G (implementation) / 2G (theoretical) restriction on the size of the initial mapping limits the amount of memor

Re: [Xen-devel] [PATCH V2 3/3] xen: eliminate scalability issues from initial mapping setup

2014-09-17 Thread Juergen Gross
On 09/17/2014 04:42 PM, David Vrabel wrote: On 17/09/14 15:20, Juergen Gross wrote: On 09/17/2014 04:07 PM, David Vrabel wrote: Are you missing a ClearPagePinned(..) here? Probably, yes. Jan pointed out that this is not needed. @@ -1529,6 +1604,22 @@ static pte_t __init mask_rw_pte

Re: [PATCH V2 0/3] xen: remove some memory limits from pv-domains

2014-09-17 Thread Juergen Gross
On 09/17/2014 04:43 PM, David Vrabel wrote: On 17/09/14 05:12, Juergen Gross wrote: When a Xen pv-domain is booted the initial memory map contains multiple objects in the top 2 GB including the initrd and the p2m list. This limits the supported maximum size of the initrd and the maximum memory

<    1   2   3   4   5   6   7   8   9   10   >