Hi,
+stable
On Wed, 22 Jul 2020, Mark Brown wrote:
> Applied to
>
> https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
[...]
>
> [1/1] ASoC: intel/skl/hda - fix probe regression on systems without i915
> commit: ffc6d45d96f07a32700cb6b7be2d3459e63c255a
please apply this to stable kernels as well. Without the patch, audio is
broken with 5.8.x on many laptops (with Intel audio and non-Intel
graphics). One more recent bug filed:
https://github.com/thesofproject/sof/issues/3345
This does _not_ affect 5.7.x and older, plus already fixed in 5.9-rc.
Br, Kai
Commit 633260fa143 ("x86/irq: Convey vector as argument and not in ptregs")
changed the handover logic of the vector identifier from ~vector in orig_ax
to purely register based. Unfortunately, this field has another consumer
in the APIC code which the commit did not touch. The net result was that
IRQ balancing did not work and instead resulted in interrupt storms, slowing
down the system.
This patch restores the original semantics that orig_ax contains the vector.
When we receive an interrupt now, the actual vector number stays stored in
the orig_ax field which then gets consumed by the APIC code.
To ensure that nobody else trips over this in the future, the patch also adds
comments at strategic places to warn anyone who would refactor the code that
there is another consumer of the field.
With this patch in place, IRQ balancing works as expected and performance
levels are restored to previous levels.
Reported-by: Alex bykov <alex.bykov(a)scylladb.com>
Reported-by: Avi Kivity <avi(a)scylladb.com>
Fixes: 633260fa143 ("x86/irq: Convey vector as argument and not in ptregs")
Cc: stable(a)vger.kernel.org
Signed-off-by: Alexander Graf <graf(a)amazon.com>
---
arch/x86/entry/entry_32.S | 2 +-
arch/x86/entry/entry_64.S | 17 +++++++++++------
arch/x86/kernel/apic/vector.c | 2 +-
3 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/arch/x86/entry/entry_32.S b/arch/x86/entry/entry_32.S
index df8c017..22e829c 100644
--- a/arch/x86/entry/entry_32.S
+++ b/arch/x86/entry/entry_32.S
@@ -727,7 +727,7 @@ SYM_CODE_START_LOCAL(asm_\cfunc)
ENCODE_FRAME_POINTER
movl %esp, %eax
movl PT_ORIG_EAX(%esp), %edx /* get the vector from stack */
- movl $-1, PT_ORIG_EAX(%esp) /* no syscall to restart */
+ /* keep vector on stack for APIC's irq_complete_move() */
call \cfunc
jmp handle_exception_return
SYM_CODE_END(asm_\cfunc)
diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S
index 70dea93..d78fb1c 100644
--- a/arch/x86/entry/entry_64.S
+++ b/arch/x86/entry/entry_64.S
@@ -319,7 +319,7 @@ SYM_CODE_END(ret_from_fork)
* @cfunc: C function to be called
* @has_error_code: Hardware pushed error code on stack
*/
-.macro idtentry_body cfunc has_error_code:req
+.macro idtentry_body cfunc has_error_code:req preserve_error_code:req
call error_entry
UNWIND_HINT_REGS
@@ -328,7 +328,9 @@ SYM_CODE_END(ret_from_fork)
.if \has_error_code == 1
movq ORIG_RAX(%rsp), %rsi /* get error code into 2nd argument*/
- movq $-1, ORIG_RAX(%rsp) /* no syscall to restart */
+ .if \preserve_error_code == 0
+ movq $-1, ORIG_RAX(%rsp) /* no syscall to restart */
+ .endif
.endif
call \cfunc
@@ -346,7 +348,7 @@ SYM_CODE_END(ret_from_fork)
* The macro emits code to set up the kernel context for straight forward
* and simple IDT entries. No IST stack, no paranoid entry checks.
*/
-.macro idtentry vector asmsym cfunc has_error_code:req
+.macro idtentry vector asmsym cfunc has_error_code:req preserve_error_code=0
SYM_CODE_START(\asmsym)
UNWIND_HINT_IRET_REGS offset=\has_error_code*8
ASM_CLAC
@@ -369,7 +371,7 @@ SYM_CODE_START(\asmsym)
.Lfrom_usermode_no_gap_\@:
.endif
- idtentry_body \cfunc \has_error_code
+ idtentry_body \cfunc \has_error_code \preserve_error_code
_ASM_NOKPROBE(\asmsym)
SYM_CODE_END(\asmsym)
@@ -382,11 +384,14 @@ SYM_CODE_END(\asmsym)
* position of idtentry exceptions, and jump to one of the two idtentry points
* (common/spurious).
*
+ * The original vector number on the stack has to stay untouched, so that the
+ * APIC irq_complete_move() code can access it later on IRQ ack.
+ *
* common_interrupt is a hotpath, align it to a cache line
*/
.macro idtentry_irq vector cfunc
.p2align CONFIG_X86_L1_CACHE_SHIFT
- idtentry \vector asm_\cfunc \cfunc has_error_code=1
+ idtentry \vector asm_\cfunc \cfunc has_error_code=1 preserve_error_code=1
.endm
/*
@@ -440,7 +445,7 @@ SYM_CODE_START(\asmsym)
/* Switch to the regular task stack and use the noist entry point */
.Lfrom_usermode_switch_stack_\@:
- idtentry_body noist_\cfunc, has_error_code=0
+ idtentry_body noist_\cfunc, has_error_code=0, preserve_error_code=0
_ASM_NOKPROBE(\asmsym)
SYM_CODE_END(\asmsym)
diff --git a/arch/x86/kernel/apic/vector.c b/arch/x86/kernel/apic/vector.c
index dae32d9..e81b835 100644
--- a/arch/x86/kernel/apic/vector.c
+++ b/arch/x86/kernel/apic/vector.c
@@ -924,7 +924,7 @@ static void __irq_complete_move(struct irq_cfg *cfg, unsigned vector)
void irq_complete_move(struct irq_cfg *cfg)
{
- __irq_complete_move(cfg, ~get_irq_regs()->orig_ax);
+ __irq_complete_move(cfg, (u8)get_irq_regs()->orig_ax);
}
/*
--
1.8.3.1
Amazon Development Center Germany GmbH
Krausenstr. 38
10117 Berlin
Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss
Eingetragen am Amtsgericht Charlottenburg unter HRB 149173 B
Sitz: Berlin
Ust-ID: DE 289 237 879
-------------------
Note, ok, this is really going to be the final 5.7.y kernel release. I
mean it this time....
-------------------
This is the start of the stable review cycle for the 5.7.19 release.
There are 15 patches in this series, all will be posted as a response
to this one. If anyone has any issues with these being applied, please
let me know.
Responses should be made by Fri, 28 Aug 2020 11:48:35 +0000.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.7.19-rc1…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.7.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 5.7.19-rc1
Max Filippov <jcmvbkbc(a)gmail.com>
binfmt_flat: revert "binfmt_flat: don't offset the data start"
Michael Ellerman <mpe(a)ellerman.id.au>
powerpc/64s: Don't init FSCR_DSCR in __init_FSCR()
Maxim Mikityanskiy <maximmi(a)mellanox.com>
ethtool: Don't omit the netlink reply if no features were changed
Maxim Mikityanskiy <maximmi(a)mellanox.com>
ethtool: Account for hw_features in netlink interface
Maxim Mikityanskiy <maximmi(a)mellanox.com>
ethtool: Fix preserving of wanted feature bits in netlink interface
Shay Agroskin <shayagr(a)amazon.com>
net: ena: Make missed_tx stat incremental
Cong Wang <xiyou.wangcong(a)gmail.com>
tipc: fix uninit skb->data in tipc_nl_compat_dumpit()
Xin Long <lucien.xin(a)gmail.com>
tipc: call rcu_read_lock() in tipc_aead_encrypt_done()
Peilin Ye <yepeilin.cs(a)gmail.com>
net/smc: Prevent kernel-infoleak in __smc_diag_dump()
David Laight <David.Laight(a)ACULAB.COM>
net: sctp: Fix negotiation of the number of data streams.
Alaa Hleihel <alaa(a)mellanox.com>
net/sched: act_ct: Fix skb double-free in tcf_ct_handle_fragments() error flow
Necip Fazil Yildiran <necip(a)google.com>
net: qrtr: fix usage of idr in port assignment to socket
Nikolay Aleksandrov <nikolay(a)cumulusnetworks.com>
net: nexthop: don't allow empty NHA_GROUP
Miaohe Lin <linmiaohe(a)huawei.com>
net: Fix potential wrong skb->protocol in skb_vlan_untag()
Mark Tomlinson <mark.tomlinson(a)alliedtelesis.co.nz>
gre6: Fix reception with IP6_TNL_F_RCV_DSCP_COPY
-------------
Diffstat:
Makefile | 4 ++--
arch/powerpc/kernel/cpu_setup_power.S | 2 +-
drivers/net/ethernet/amazon/ena/ena_netdev.c | 5 ++++-
fs/binfmt_flat.c | 20 ++++++++++++--------
net/core/skbuff.c | 4 ++--
net/ethtool/features.c | 19 ++++++++++---------
net/ipv4/nexthop.c | 5 ++++-
net/ipv6/ip6_tunnel.c | 10 +++++++++-
net/qrtr/qrtr.c | 20 +++++++++++---------
net/sched/act_ct.c | 2 +-
net/sctp/stream.c | 6 ++++--
net/smc/smc_diag.c | 16 +++++++++-------
net/tipc/crypto.c | 2 ++
net/tipc/netlink_compat.c | 12 +++++++++++-
14 files changed, 82 insertions(+), 45 deletions(-)
This is the start of the stable review cycle for the 5.8.5 release.
There are 16 patches in this series, all will be posted as a response
to this one. If anyone has any issues with these being applied, please
let me know.
Responses should be made by Fri, 28 Aug 2020 11:49:02 +0000.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.8.5-rc1.…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.8.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 5.8.5-rc1
Max Filippov <jcmvbkbc(a)gmail.com>
binfmt_flat: revert "binfmt_flat: don't offset the data start"
Pavel Begunkov <asml.silence(a)gmail.com>
io_uring: fix missing ->mm on exit
Johannes Berg <johannes.berg(a)intel.com>
netlink: fix state reallocation in policy export
Maxim Mikityanskiy <maximmi(a)mellanox.com>
ethtool: Don't omit the netlink reply if no features were changed
Maxim Mikityanskiy <maximmi(a)mellanox.com>
ethtool: Account for hw_features in netlink interface
Maxim Mikityanskiy <maximmi(a)mellanox.com>
ethtool: Fix preserving of wanted feature bits in netlink interface
Shay Agroskin <shayagr(a)amazon.com>
net: ena: Make missed_tx stat incremental
Cong Wang <xiyou.wangcong(a)gmail.com>
tipc: fix uninit skb->data in tipc_nl_compat_dumpit()
Xin Long <lucien.xin(a)gmail.com>
tipc: call rcu_read_lock() in tipc_aead_encrypt_done()
Peilin Ye <yepeilin.cs(a)gmail.com>
net/smc: Prevent kernel-infoleak in __smc_diag_dump()
David Laight <David.Laight(a)ACULAB.COM>
net: sctp: Fix negotiation of the number of data streams.
Alaa Hleihel <alaa(a)mellanox.com>
net/sched: act_ct: Fix skb double-free in tcf_ct_handle_fragments() error flow
Necip Fazil Yildiran <necip(a)google.com>
net: qrtr: fix usage of idr in port assignment to socket
Nikolay Aleksandrov <nikolay(a)cumulusnetworks.com>
net: nexthop: don't allow empty NHA_GROUP
Miaohe Lin <linmiaohe(a)huawei.com>
net: Fix potential wrong skb->protocol in skb_vlan_untag()
Mark Tomlinson <mark.tomlinson(a)alliedtelesis.co.nz>
gre6: Fix reception with IP6_TNL_F_RCV_DSCP_COPY
-------------
Diffstat:
Makefile | 4 ++--
drivers/net/ethernet/amazon/ena/ena_netdev.c | 5 ++++-
fs/binfmt_flat.c | 20 ++++++++++++--------
fs/io_uring.c | 3 ++-
net/core/skbuff.c | 4 ++--
net/ethtool/features.c | 19 ++++++++++---------
net/ipv4/nexthop.c | 5 ++++-
net/ipv6/ip6_tunnel.c | 10 +++++++++-
net/netlink/policy.c | 3 +++
net/qrtr/qrtr.c | 20 +++++++++++---------
net/sched/act_ct.c | 2 +-
net/sctp/stream.c | 6 ++++--
net/smc/smc_diag.c | 16 +++++++++-------
net/tipc/crypto.c | 2 ++
net/tipc/netlink_compat.c | 12 +++++++++++-
15 files changed, 86 insertions(+), 45 deletions(-)
On Thu, 27 Aug 2020 at 06:56, Caleb Jorden <caljorden(a)hotmail.com> wrote:
>
> I can tell you all assumed this, but just by way as a quick update on the original issue:
>
> I have confirmed that Herbert's patch (crypto: af_alg - Work around empty control messages without MSG_MORE) does indeed fix the original iwd 1.8 + WPA Enterprise issue.
>
> Thank you!
>
> Caleb Jorden
>
Thanks for confirming.
> ________________________________________
> From: Herbert Xu <herbert(a)gondor.apana.org.au>
> Sent: Thursday, August 27, 2020 3:49 AM
> To: Ard Biesheuvel
> Cc: Denis Kenzior; Andrew Zaborowski; Paul Menzel; Caleb Jorden; Sasha Levin; iwd(a)lists.01.org; # 3.4.x; Greg KH; LKML; David S. Miller; Linux Crypto Mailing List
> Subject: Re: Issue with iwd + Linux 5.8.3 + WPA Enterprise
>
> On Wed, Aug 26, 2020 at 05:42:27PM +0200, Ard Biesheuvel wrote:
> >
> > I still get a failure in aes_siv_encrypt(), which does not occur with
> > the kernel side fix applied.
>
> Where is this test from? I can't find it in the ell git tree.
>
> Thanks,
> --
> Email: Herbert Xu <herbert(a)gondor.apana.org.au>
> Home Page: http://gondor.apana.org.au/~herbert/
> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt