All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 4.16 00/68] 4.16.3-stable review
@ 2018-04-17 15:57 Greg Kroah-Hartman
  2018-04-17 15:57 ` [PATCH 4.16 01/68] cdc_ether: flag the Cinterion AHS8 modem by gemalto as WWAN Greg Kroah-Hartman
                   ` (68 more replies)
  0 siblings, 69 replies; 80+ messages in thread
From: Greg Kroah-Hartman @ 2018-04-17 15:57 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, torvalds, akpm, linux, shuahkh, patches,
	ben.hutchings, lkft-triage, stable

This is the start of the stable review cycle for the 4.16.3 release.
There are 68 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 Thu Apr 19 15:57:33 UTC 2018.
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/v4.x/stable-review/patch-4.16.3-rc1.gz
or in the git tree and branch at:
	git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.16.y
and the diffstat can be found below.

thanks,

greg k-h

-------------
Pseudo-Shortlog of commits:

Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Linux 4.16.3-rc1

Sudhir Sreedharan <ssreedharan@mvista.com>
    rtl8187: Fix NULL pointer dereference in priv->conf_mutex

Hans de Goede <hdegoede@redhat.com>
    Bluetooth: hci_bcm: Treat Interrupt ACPI resources as always being active-low

Szymon Janc <szymon.janc@codecoup.pl>
    Bluetooth: Fix connection if directed advertising and privacy is used

Al Viro <viro@zeniv.linux.org.uk>
    getname_kernel() needs to make sure that ->name != ->iname in long case

Michael S. Tsirkin <mst@redhat.com>
    mm/gup_benchmark: handle gup failures

Michael S. Tsirkin <mst@redhat.com>
    get_user_pages_fast(): return -EFAULT on access_ok failure

Heiko Carstens <heiko.carstens@de.ibm.com>
    s390/compat: fix setup_frame32

Vasily Gorbik <gor@linux.ibm.com>
    s390/ipl: ensure loadparm valid flag is set

Julian Wiedmann <jwi@linux.vnet.ibm.com>
    s390/qdio: don't merge ERROR output buffers

Julian Wiedmann <jwi@linux.vnet.ibm.com>
    s390/qdio: don't retry EQBS after CCQ 96

Dan Williams <dan.j.williams@intel.com>
    nfit: fix region registration vs block-data-window ranges

Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
    block/loop: fix deadlock after loop_set_status

John Johansen <john.johansen@canonical.com>
    apparmor: fix resource audit messages when auditing peer

John Johansen <john.johansen@canonical.com>
    apparmor: fix display of .ns_name for containers

John Johansen <john.johansen@canonical.com>
    apparmor: fix logging of the existence test for signals

Bart Van Assche <bart.vanassche@wdc.com>
    Revert "scsi: core: return BLK_STS_OK for DID_OK in __scsi_error_from_host_byte()"

Bill Kuzeja <William.Kuzeja@stratus.com>
    scsi: qla2xxx: Fix small memory leak in qla2x00_probe_one on probe failure

Johannes Thumshirn <jthumshirn@suse.de>
    scsi: scsi_dh: Don't look for NULL devices handlers by name

J. Bruce Fields <bfields@redhat.com>
    nfsd: fix incorrect umasks

Mike Kravetz <mike.kravetz@oracle.com>
    hugetlbfs: fix bug in pgoff overflow checking

Simon Gaiser <simon@invisiblethingslab.com>
    xen: xenbus_dev_frontend: Fix XS_TRANSACTION_END handling

Amir Goldstein <amir73il@gmail.com>
    ovl: set lower layer st_dev only if setting lower st_ino

Amir Goldstein <amir73il@gmail.com>
    ovl: set i_ino to the value of st_ino for NFS export

Amir Goldstein <amir73il@gmail.com>
    ovl: fix lookup with middle layer opaque dir and absolute path redirects

Vivek Goyal <vgoyal@redhat.com>
    ovl: Set d->last properly during lookup

Ming Lei <ming.lei@redhat.com>
    blk-mq: don't keep offline CPUs mapped to hctx 0

Ming Lei <ming.lei@redhat.com>
    blk-mq: make sure that correct hctx->next_cpu is set

Ming Lei <ming.lei@redhat.com>
    blk-mq: order getting budget and driver tag

Tejun Heo <tj@kernel.org>
    blk-mq: Directly schedule q->timeout_work when aborting a request

Huacai Chen <chenhc@lemote.com>
    zboot: fix stack protector in compressed boot phase

Yury Norov <ynorov@caviumnetworks.com>
    lib: fix stall in __bitmap_parselist()

Keith Busch <keith.busch@intel.com>
    nvme: Skip checking heads without namespaces

Bart Van Assche <bart.vanassche@wdc.com>
    block: Change a rcu_read_{lock,unlock}_sched() pair into rcu_read_{lock,unlock}()

Yunlong Song <yunlong.song@huawei.com>
    f2fs: fix heap mode to reset it back

Eric Biggers <ebiggers@google.com>
    sunrpc: remove incorrect HMAC request initialization

Li RongQing <lirongqing@baidu.com>
    x86/apic: Fix signedness bug in APIC ID validity checks

Dmitry V. Levin <ldv@altlinux.org>
    x86/uapi: Fix asm/bootparam.h userspace compilation errors

Toke Høiland-Jørgensen <toke@toke.dk>
    ath9k: Protect queue draining by rcu_read_lock()

Yazen Ghannam <yazen.ghannam@amd.com>
    x86/mce/AMD: Get address from already initialized block

Yazen Ghannam <yazen.ghannam@amd.com>
    x86/mce/AMD, EDAC/mce_amd: Enumerate Reserved SMCA bank type

Yazen Ghannam <yazen.ghannam@amd.com>
    x86/mce/AMD: Pass the bank number to smca_get_bank_type()

Arnd Bergmann <arnd@arndb.de>
    radeon: hide pointless #warning when compile testing

Prashant Bhole <bhole_prashant_q7@lab.ntt.co.jp>
    perf/core: Fix use-after-free in uprobe_perf_close()

Adrian Hunter <adrian.hunter@intel.com>
    perf intel-pt: Fix timestamp following overflow

Adrian Hunter <adrian.hunter@intel.com>
    perf intel-pt: Fix error recovery from missing TIP packet

Adrian Hunter <adrian.hunter@intel.com>
    perf intel-pt: Fix sync_switch

Adrian Hunter <adrian.hunter@intel.com>
    perf intel-pt: Fix overlap detection to identify consecutive buffers correctly

Nicholas Piggin <npiggin@gmail.com>
    KVM: PPC: Book3S HV: trace_tlbie must not be called in realmode

Dexuan Cui <decui@microsoft.com>
    PCI: hv: Fix 2 hang issues in hv_compose_msi_msg()

Dexuan Cui <decui@microsoft.com>
    PCI: hv: Serialize the present and eject work items

Dexuan Cui <decui@microsoft.com>
    Drivers: hv: vmbus: do not mark HV_PCIE as perf_device

Luca Coelho <luciano.coelho@intel.com>
    iwlwifi: add a bunch of new 9000 PCI IDs

Helge Deller <deller@gmx.de>
    parisc: Fix HPMC handler by increasing size to multiple of 16 bytes

Helge Deller <deller@gmx.de>
    parisc: Fix out of array access in match_pci_device()

Corey Minyard <cminyard@mvista.com>
    ipmi: Fix some error cleanup issues

Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
    media: v4l: vsp1: Fix header display list status check in continuous mode

Mauro Carvalho Chehab <mchehab@kernel.org>
    media: v4l2-compat-ioctl32: don't oops on overlay

Mauro Carvalho Chehab <mchehab@kernel.org>
    media: v4l2-core: fix size of devnode_nums[] bitarray

Rob Gardner <rob.gardner@oracle.com>
    sparc64: Properly range check DAX completion index

Phil Elwell <phil@raspberrypi.org>
    lan78xx: Correctly indicate invalid OTP

Eric Auger <eric.auger@redhat.com>
    vhost: Fix vhost_copy_to_user()

Sabrina Dubroca <sd@queasysnail.net>
    ip_gre: clear feature flags when incompatible o_flags are set

Guillaume Nault <g.nault@alphalink.fr>
    l2tp: fix race in duplicate tunnel detection

Guillaume Nault <g.nault@alphalink.fr>
    l2tp: fix races in tunnel creation

Stefan Hajnoczi <stefanha@redhat.com>
    vhost: fix vhost_vq_access_ok() log check

Tejaswi Tanikella <tejaswit@codeaurora.org>
    slip: Check if rstate is initialized before uncompressing

Ka-Cheong Poon <ka-cheong.poon@oracle.com>
    rds: MP-RDS may use an invalid c_path

Bassem Boubaker <bassem.boubaker@actia.fr>
    cdc_ether: flag the Cinterion AHS8 modem by gemalto as WWAN


-------------

Diffstat:

 Makefile                                           |   4 +-
 arch/arm/boot/compressed/misc.c                    |   9 +-
 arch/mips/boot/compressed/decompress.c             |   9 +-
 arch/parisc/kernel/drivers.c                       |   4 +
 arch/parisc/kernel/hpmc.S                          |   6 +-
 arch/powerpc/kvm/book3s_hv_rm_mmu.c                |   4 -
 arch/s390/kernel/compat_signal.c                   |   2 +-
 arch/s390/kernel/ipl.c                             |   1 +
 arch/sh/boot/compressed/misc.c                     |   9 +-
 arch/x86/include/asm/apic.h                        |   4 +-
 arch/x86/include/asm/mce.h                         |   1 +
 arch/x86/include/uapi/asm/bootparam.h              |  18 +-
 arch/x86/kernel/acpi/boot.c                        |  13 +-
 arch/x86/kernel/apic/apic_common.c                 |   2 +-
 arch/x86/kernel/apic/apic_numachip.c               |   2 +-
 arch/x86/kernel/apic/x2apic.h                      |   2 +-
 arch/x86/kernel/apic/x2apic_phys.c                 |   2 +-
 arch/x86/kernel/apic/x2apic_uv_x.c                 |   2 +-
 arch/x86/kernel/cpu/mcheck/mce_amd.c               |  37 +++-
 arch/x86/xen/apic.c                                |   2 +-
 block/blk-core.c                                   |   4 +-
 block/blk-mq-cpumap.c                              |   5 -
 block/blk-mq.c                                     |  23 ++-
 block/blk-timeout.c                                |   2 +-
 drivers/acpi/nfit/core.c                           |  22 +-
 drivers/block/loop.c                               |  12 +-
 drivers/bluetooth/hci_bcm.c                        |  20 +-
 drivers/char/ipmi/ipmi_si_intf.c                   |  18 +-
 drivers/edac/mce_amd.c                             |  11 +-
 drivers/gpu/drm/radeon/radeon_object.c             |   3 +-
 drivers/hv/channel_mgmt.c                          |   2 +-
 drivers/media/platform/vsp1/vsp1_dl.c              |   3 +-
 drivers/media/v4l2-core/v4l2-compat-ioctl32.c      |   4 +-
 drivers/media/v4l2-core/v4l2-dev.c                 |   8 +-
 drivers/net/slip/slhc.c                            |   5 +
 drivers/net/usb/cdc_ether.c                        |   6 +
 drivers/net/usb/lan78xx.c                          |   3 +-
 drivers/net/wireless/ath/ath9k/xmit.c              |   4 +
 drivers/net/wireless/intel/iwlwifi/pcie/drv.c      | 157 +++++++++++++-
 drivers/net/wireless/realtek/rtl818x/rtl8187/dev.c |   2 +-
 drivers/nvme/host/core.c                           |   1 +
 drivers/pci/host/pci-hyperv.c                      |  92 +++++++--
 drivers/s390/cio/qdio_main.c                       |  42 ++--
 drivers/sbus/char/oradax.c                         |   2 +-
 drivers/scsi/qla2xxx/qla_os.c                      |  44 ++--
 drivers/scsi/scsi_dh.c                             |   3 +
 drivers/scsi/scsi_lib.c                            |   2 -
 drivers/vhost/vhost.c                              |  10 +-
 drivers/xen/xenbus/xenbus_dev_frontend.c           |   2 +-
 fs/f2fs/gc.c                                       |   5 +-
 fs/f2fs/segment.c                                  |   3 +-
 fs/hugetlbfs/inode.c                               |  10 +-
 fs/namei.c                                         |   3 +-
 fs/nfsd/nfs4proc.c                                 |  12 +-
 fs/nfsd/nfs4xdr.c                                  |   8 +-
 fs/nfsd/xdr4.h                                     |   2 +
 fs/overlayfs/inode.c                               |  28 ++-
 fs/overlayfs/namei.c                               |  17 +-
 fs/overlayfs/util.c                                |   8 +-
 include/media/v4l2-dev.h                           |  12 +-
 include/net/bluetooth/hci_core.h                   |   2 +-
 include/net/slhc_vj.h                              |   1 +
 kernel/events/core.c                               |   6 +
 lib/bitmap.c                                       |   2 +-
 lib/test_bitmap.c                                  |   4 +
 mm/gup.c                                           |   5 +-
 mm/gup_benchmark.c                                 |   4 +-
 net/bluetooth/hci_conn.c                           |  29 ++-
 net/bluetooth/hci_event.c                          |  15 +-
 net/bluetooth/l2cap_core.c                         |   2 +-
 net/ipv4/ip_gre.c                                  |   6 +
 net/l2tp/l2tp_core.c                               | 225 +++++++++------------
 net/l2tp/l2tp_core.h                               |   4 +-
 net/l2tp/l2tp_netlink.c                            |  22 +-
 net/l2tp/l2tp_ppp.c                                |   9 +
 net/rds/send.c                                     |  15 +-
 net/sunrpc/auth_gss/gss_krb5_crypto.c              |   3 -
 security/apparmor/apparmorfs.c                     |   4 +-
 security/apparmor/include/audit.h                  |   8 +-
 security/apparmor/include/sig_names.h              |   4 +-
 security/apparmor/ipc.c                            |   2 +-
 .../perf/util/intel-pt-decoder/intel-pt-decoder.c  |  64 +++---
 .../perf/util/intel-pt-decoder/intel-pt-decoder.h  |   2 +-
 tools/perf/util/intel-pt.c                         |  37 +++-
 84 files changed, 785 insertions(+), 443 deletions(-)

^ permalink raw reply	[flat|nested] 80+ messages in thread
* [4.16,28/68] x86/mce/AMD: Pass the bank number to smca_get_bank_type()
  2018-04-17 15:57 [PATCH 4.16 00/68] 4.16.3-stable review Greg Kroah-Hartman
@ 2018-04-17 15:57 ` Greg Kroah-Hartman
  2018-04-17 15:57 ` [PATCH 4.16 02/68] rds: MP-RDS may use an invalid c_path Greg Kroah-Hartman
                   ` (67 subsequent siblings)
  68 siblings, 0 replies; 80+ messages in thread
From: Greg Kroah-Hartman @ 2018-04-17 15:57 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Yazen Ghannam, Borislav Petkov,
	Borislav Petkov, Linus Torvalds, Peter Zijlstra, Thomas Gleixner,
	Tony Luck, linux-edac, Ingo Molnar

4.16-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Yazen Ghannam <yazen.ghannam@amd.com>

commit e5d6a126d4c473499f354254a15ca0c2d8c84ca3 upstream.

Pass the bank number to smca_get_bank_type() since that's all we need.

Also, we should compare the bank number to MAX_NR_BANKS (size of the
smca_banks array) not the number of bank types. Bank types are reused
for multiple banks, so the number of types can be different from the
number of banks in a system and thus we could return an invalid bank
type.

Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: <stable@vger.kernel.org> # 4.14.x
Cc: <stable@vger.kernel.org> # 4.14.x: 11cf887728a3 x86/MCE/AMD: Define a function to get SMCA bank type
Cc: <stable@vger.kernel.org> # 4.14.x: c6708d50f166 x86/MCE: Report only DRAM ECC as memory errors on AMD systems
Cc: Borislav Petkov <bp@alien8.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Tony Luck <tony.luck@intel.com>
Cc: linux-edac <linux-edac@vger.kernel.org>
Link: http://lkml.kernel.org/r/20180221101900.10326-6-bp@alien8.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 arch/x86/kernel/cpu/mcheck/mce_amd.c |   15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)



--
To unsubscribe from this list: send the line "unsubscribe linux-edac" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

--- a/arch/x86/kernel/cpu/mcheck/mce_amd.c
+++ b/arch/x86/kernel/cpu/mcheck/mce_amd.c
@@ -110,14 +110,14 @@ const char *smca_get_long_name(enum smca
 }
 EXPORT_SYMBOL_GPL(smca_get_long_name);
 
-static enum smca_bank_types smca_get_bank_type(struct mce *m)
+static enum smca_bank_types smca_get_bank_type(unsigned int bank)
 {
 	struct smca_bank *b;
 
-	if (m->bank >= N_SMCA_BANK_TYPES)
+	if (bank >= MAX_NR_BANKS)
 		return N_SMCA_BANK_TYPES;
 
-	b = &smca_banks[m->bank];
+	b = &smca_banks[bank];
 	if (!b->hwid)
 		return N_SMCA_BANK_TYPES;
 
@@ -760,7 +760,7 @@ bool amd_mce_is_memory_error(struct mce
 	u8 xec = (m->status >> 16) & 0x1f;
 
 	if (mce_flags.smca)
-		return smca_get_bank_type(m) == SMCA_UMC && xec == 0x0;
+		return smca_get_bank_type(m->bank) == SMCA_UMC && xec == 0x0;
 
 	return m->bank == 4 && xec == 0x8;
 }
@@ -1063,7 +1063,7 @@ static struct kobj_type threshold_ktype
 
 static const char *get_name(unsigned int bank, struct threshold_block *b)
 {
-	unsigned int bank_type;
+	enum smca_bank_types bank_type;
 
 	if (!mce_flags.smca) {
 		if (b && bank == 4)
@@ -1072,11 +1072,10 @@ static const char *get_name(unsigned int
 		return th_names[bank];
 	}
 
-	if (!smca_banks[bank].hwid)
+	bank_type = smca_get_bank_type(bank);
+	if (bank_type >= N_SMCA_BANK_TYPES)
 		return NULL;
 
-	bank_type = smca_banks[bank].hwid->bank_type;
-
 	if (b && bank_type == SMCA_UMC) {
 		if (b->block < ARRAY_SIZE(smca_umc_block_names))
 			return smca_umc_block_names[b->block];

^ permalink raw reply	[flat|nested] 80+ messages in thread
* [4.16,29/68] x86/mce/AMD, EDAC/mce_amd: Enumerate Reserved SMCA bank type
  2018-04-17 15:57 [PATCH 4.16 00/68] 4.16.3-stable review Greg Kroah-Hartman
@ 2018-04-17 15:57 ` Greg Kroah-Hartman
  2018-04-17 15:57 ` [PATCH 4.16 02/68] rds: MP-RDS may use an invalid c_path Greg Kroah-Hartman
                   ` (67 subsequent siblings)
  68 siblings, 0 replies; 80+ messages in thread
From: Greg Kroah-Hartman @ 2018-04-17 15:57 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Yazen Ghannam, Borislav Petkov,
	Borislav Petkov, Linus Torvalds, Peter Zijlstra, Thomas Gleixner,
	Tony Luck, linux-edac, Ingo Molnar

4.16-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Yazen Ghannam <yazen.ghannam@amd.com>

commit 68627a697c195937672ce07683094c72b1174786 upstream.

Currently, bank 4 is reserved on Fam17h, so we chose not to initialize
bank 4 in the smca_banks array. This means that when we check if a bank
is initialized, like during boot or resume, we will see that bank 4 is
not initialized and try to initialize it.

This will cause a call trace, when resuming from suspend, due to
rdmsr_*on_cpu() calls in the init path. The rdmsr_*on_cpu() calls issue
an IPI but we're running with interrupts disabled. This triggers:

  WARNING: CPU: 0 PID: 11523 at kernel/smp.c:291 smp_call_function_single+0xdc/0xe0
  ...

Reserved banks will be read-as-zero, so their MCA_IPID register will be
zero. So, like the smca_banks array, the threshold_banks array will not
have an entry for a reserved bank since all its MCA_MISC* registers will
be zero.

Enumerate a "Reserved" bank type that matches on a HWID_MCATYPE of 0,0.

Use the "Reserved" type when checking if a bank is reserved. It's
possible that other bank numbers may be reserved on future systems.

Don't try to find the block address on reserved banks.

Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: <stable@vger.kernel.org> # 4.14.x
Cc: Borislav Petkov <bp@alien8.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Tony Luck <tony.luck@intel.com>
Cc: linux-edac <linux-edac@vger.kernel.org>
Link: http://lkml.kernel.org/r/20180221101900.10326-7-bp@alien8.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 arch/x86/include/asm/mce.h           |    1 +
 arch/x86/kernel/cpu/mcheck/mce_amd.c |    7 +++++++
 drivers/edac/mce_amd.c               |   11 +++++++----
 3 files changed, 15 insertions(+), 4 deletions(-)



--
To unsubscribe from this list: send the line "unsubscribe linux-edac" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

--- a/arch/x86/include/asm/mce.h
+++ b/arch/x86/include/asm/mce.h
@@ -346,6 +346,7 @@ enum smca_bank_types {
 	SMCA_IF,	/* Instruction Fetch */
 	SMCA_L2_CACHE,	/* L2 Cache */
 	SMCA_DE,	/* Decoder Unit */
+	SMCA_RESERVED,	/* Reserved */
 	SMCA_EX,	/* Execution Unit */
 	SMCA_FP,	/* Floating Point */
 	SMCA_L3_CACHE,	/* L3 Cache */
--- a/arch/x86/kernel/cpu/mcheck/mce_amd.c
+++ b/arch/x86/kernel/cpu/mcheck/mce_amd.c
@@ -82,6 +82,7 @@ static struct smca_bank_name smca_names[
 	[SMCA_IF]	= { "insn_fetch",	"Instruction Fetch Unit" },
 	[SMCA_L2_CACHE]	= { "l2_cache",		"L2 Cache" },
 	[SMCA_DE]	= { "decode_unit",	"Decode Unit" },
+	[SMCA_RESERVED]	= { "reserved",		"Reserved" },
 	[SMCA_EX]	= { "execution_unit",	"Execution Unit" },
 	[SMCA_FP]	= { "floating_point",	"Floating Point Unit" },
 	[SMCA_L3_CACHE]	= { "l3_cache",		"L3 Cache" },
@@ -127,6 +128,9 @@ static enum smca_bank_types smca_get_ban
 static struct smca_hwid smca_hwid_mcatypes[] = {
 	/* { bank_type, hwid_mcatype, xec_bitmap } */
 
+	/* Reserved type */
+	{ SMCA_RESERVED, HWID_MCATYPE(0x00, 0x0), 0x0 },
+
 	/* ZN Core (HWID=0xB0) MCA types */
 	{ SMCA_LS,	 HWID_MCATYPE(0xB0, 0x0), 0x1FFFEF },
 	{ SMCA_IF,	 HWID_MCATYPE(0xB0, 0x1), 0x3FFF },
@@ -433,6 +437,9 @@ static u32 get_block_address(unsigned in
 	u32 addr = 0, offset = 0;
 
 	if (mce_flags.smca) {
+		if (smca_get_bank_type(bank) == SMCA_RESERVED)
+			return addr;
+
 		if (!block) {
 			addr = MSR_AMD64_SMCA_MCx_MISC(bank);
 		} else {
--- a/drivers/edac/mce_amd.c
+++ b/drivers/edac/mce_amd.c
@@ -854,21 +854,24 @@ static void decode_mc6_mce(struct mce *m
 static void decode_smca_error(struct mce *m)
 {
 	struct smca_hwid *hwid;
-	unsigned int bank_type;
+	enum smca_bank_types bank_type;
 	const char *ip_name;
 	u8 xec = XEC(m->status, xec_mask);
 
 	if (m->bank >= ARRAY_SIZE(smca_banks))
 		return;
 
-	if (x86_family(m->cpuid) >= 0x17 && m->bank == 4)
-		pr_emerg(HW_ERR "Bank 4 is reserved on Fam17h.\n");
-
 	hwid = smca_banks[m->bank].hwid;
 	if (!hwid)
 		return;
 
 	bank_type = hwid->bank_type;
+
+	if (bank_type == SMCA_RESERVED) {
+		pr_emerg(HW_ERR "Bank %d is reserved.\n", m->bank);
+		return;
+	}
+
 	ip_name = smca_get_long_name(bank_type);
 
 	pr_emerg(HW_ERR "%s Extended Error Code: %d\n", ip_name, xec);

^ permalink raw reply	[flat|nested] 80+ messages in thread
* [4.16,30/68] x86/mce/AMD: Get address from already initialized block
  2018-04-17 15:57 [PATCH 4.16 00/68] 4.16.3-stable review Greg Kroah-Hartman
@ 2018-04-17 15:57 ` Greg Kroah-Hartman
  2018-04-17 15:57 ` [PATCH 4.16 02/68] rds: MP-RDS may use an invalid c_path Greg Kroah-Hartman
                   ` (67 subsequent siblings)
  68 siblings, 0 replies; 80+ messages in thread
From: Greg Kroah-Hartman @ 2018-04-17 15:57 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Yazen Ghannam, Borislav Petkov,
	Borislav Petkov, Linus Torvalds, Peter Zijlstra, Thomas Gleixner,
	Tony Luck, linux-edac, Ingo Molnar

4.16-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Yazen Ghannam <yazen.ghannam@amd.com>

commit 27bd59502702fe51d9eb00450a75b727ec6bfcb4 upstream.

The block address is saved after the block is initialized when
threshold_init_device() is called.

Use the saved block address, if available, rather than trying to
rediscover it.

This will avoid a call trace, when resuming from suspend, due to the
rdmsr_safe_on_cpu() call in get_block_address(). The rdmsr_safe_on_cpu()
call issues an IPI but we're running with interrupts disabled. This
triggers:

    WARNING: CPU: 0 PID: 11523 at kernel/smp.c:291 smp_call_function_single+0xdc/0xe0

Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: <stable@vger.kernel.org> # 4.14.x
Cc: Borislav Petkov <bp@alien8.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Tony Luck <tony.luck@intel.com>
Cc: linux-edac <linux-edac@vger.kernel.org>
Link: http://lkml.kernel.org/r/20180221101900.10326-8-bp@alien8.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 arch/x86/kernel/cpu/mcheck/mce_amd.c |   15 +++++++++++++++
 1 file changed, 15 insertions(+)



--
To unsubscribe from this list: send the line "unsubscribe linux-edac" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

--- a/arch/x86/kernel/cpu/mcheck/mce_amd.c
+++ b/arch/x86/kernel/cpu/mcheck/mce_amd.c
@@ -436,6 +436,21 @@ static u32 get_block_address(unsigned in
 {
 	u32 addr = 0, offset = 0;
 
+	if ((bank >= mca_cfg.banks) || (block >= NR_BLOCKS))
+		return addr;
+
+	/* Get address from already initialized block. */
+	if (per_cpu(threshold_banks, cpu)) {
+		struct threshold_bank *bankp = per_cpu(threshold_banks, cpu)[bank];
+
+		if (bankp && bankp->blocks) {
+			struct threshold_block *blockp = &bankp->blocks[block];
+
+			if (blockp)
+				return blockp->address;
+		}
+	}
+
 	if (mce_flags.smca) {
 		if (smca_get_bank_type(bank) == SMCA_RESERVED)
 			return addr;

^ permalink raw reply	[flat|nested] 80+ messages in thread

end of thread, other threads:[~2018-04-19  6:40 UTC | newest]

Thread overview: 80+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-17 15:57 [PATCH 4.16 00/68] 4.16.3-stable review Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 01/68] cdc_ether: flag the Cinterion AHS8 modem by gemalto as WWAN Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 02/68] rds: MP-RDS may use an invalid c_path Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 03/68] slip: Check if rstate is initialized before uncompressing Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 04/68] vhost: fix vhost_vq_access_ok() log check Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 05/68] l2tp: fix races in tunnel creation Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 06/68] l2tp: fix race in duplicate tunnel detection Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 07/68] ip_gre: clear feature flags when incompatible o_flags are set Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 08/68] vhost: Fix vhost_copy_to_user() Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 09/68] lan78xx: Correctly indicate invalid OTP Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 10/68] [PATCH] sparc64: Properly range check DAX completion index Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 11/68] media: v4l2-core: fix size of devnode_nums[] bitarray Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 12/68] media: v4l2-compat-ioctl32: dont oops on overlay Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 13/68] media: v4l: vsp1: Fix header display list status check in continuous mode Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 14/68] ipmi: Fix some error cleanup issues Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 15/68] parisc: Fix out of array access in match_pci_device() Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 16/68] parisc: Fix HPMC handler by increasing size to multiple of 16 bytes Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 17/68] iwlwifi: add a bunch of new 9000 PCI IDs Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 18/68] Drivers: hv: vmbus: do not mark HV_PCIE as perf_device Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 19/68] PCI: hv: Serialize the present and eject work items Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 20/68] PCI: hv: Fix 2 hang issues in hv_compose_msi_msg() Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 21/68] KVM: PPC: Book3S HV: trace_tlbie must not be called in realmode Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 22/68] perf intel-pt: Fix overlap detection to identify consecutive buffers correctly Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 23/68] perf intel-pt: Fix sync_switch Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 24/68] perf intel-pt: Fix error recovery from missing TIP packet Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 25/68] perf intel-pt: Fix timestamp following overflow Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 26/68] perf/core: Fix use-after-free in uprobe_perf_close() Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 27/68] radeon: hide pointless #warning when compile testing Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 31/68] ath9k: Protect queue draining by rcu_read_lock() Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 32/68] x86/uapi: Fix asm/bootparam.h userspace compilation errors Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 33/68] x86/apic: Fix signedness bug in APIC ID validity checks Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 34/68] sunrpc: remove incorrect HMAC request initialization Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 35/68] f2fs: fix heap mode to reset it back Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 36/68] block: Change a rcu_read_{lock,unlock}_sched() pair into rcu_read_{lock,unlock}() Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 37/68] nvme: Skip checking heads without namespaces Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 38/68] lib: fix stall in __bitmap_parselist() Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 39/68] zboot: fix stack protector in compressed boot phase Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 40/68] blk-mq: Directly schedule q->timeout_work when aborting a request Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 41/68] blk-mq: order getting budget and driver tag Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 42/68] blk-mq: make sure that correct hctx->next_cpu is set Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 43/68] blk-mq: dont keep offline CPUs mapped to hctx 0 Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 44/68] ovl: Set d->last properly during lookup Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 45/68] ovl: fix lookup with middle layer opaque dir and absolute path redirects Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 46/68] ovl: set i_ino to the value of st_ino for NFS export Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 47/68] ovl: set lower layer st_dev only if setting lower st_ino Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 48/68] xen: xenbus_dev_frontend: Fix XS_TRANSACTION_END handling Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 49/68] hugetlbfs: fix bug in pgoff overflow checking Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 50/68] nfsd: fix incorrect umasks Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 51/68] scsi: scsi_dh: Dont look for NULL devices handlers by name Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 52/68] scsi: qla2xxx: Fix small memory leak in qla2x00_probe_one on probe failure Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 53/68] Revert "scsi: core: return BLK_STS_OK for DID_OK in __scsi_error_from_host_byte()" Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 54/68] apparmor: fix logging of the existence test for signals Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 55/68] apparmor: fix display of .ns_name for containers Greg Kroah-Hartman
2018-04-18 15:05   ` Serge E. Hallyn
2018-04-17 15:58 ` [PATCH 4.16 56/68] apparmor: fix resource audit messages when auditing peer Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 57/68] block/loop: fix deadlock after loop_set_status Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 58/68] nfit: fix region registration vs block-data-window ranges Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 59/68] s390/qdio: dont retry EQBS after CCQ 96 Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 60/68] s390/qdio: dont merge ERROR output buffers Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 61/68] s390/ipl: ensure loadparm valid flag is set Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 62/68] s390/compat: fix setup_frame32 Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 63/68] get_user_pages_fast(): return -EFAULT on access_ok failure Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 64/68] mm/gup_benchmark: handle gup failures Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 65/68] getname_kernel() needs to make sure that ->name != ->iname in long case Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 66/68] Bluetooth: Fix connection if directed advertising and privacy is used Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 67/68] Bluetooth: hci_bcm: Treat Interrupt ACPI resources as always being active-low Greg Kroah-Hartman
2018-04-17 15:58 ` [PATCH 4.16 68/68] rtl8187: Fix NULL pointer dereference in priv->conf_mutex Greg Kroah-Hartman
2018-04-17 21:03 ` [PATCH 4.16 00/68] 4.16.3-stable review Shuah Khan
2018-04-18  6:58   ` Greg Kroah-Hartman
2018-04-17 23:43 ` kernelci.org bot
2018-04-18  5:13 ` Naresh Kamboju
2018-04-18  6:59   ` Greg Kroah-Hartman
2018-04-18 15:41 ` Guenter Roeck
2018-04-19  6:40   ` Greg Kroah-Hartman
  -- strict thread matches above, loose matches on Subject: below --
2018-04-17 15:57 [4.16,28/68] x86/mce/AMD: Pass the bank number to smca_get_bank_type() Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 28/68] " Greg Kroah-Hartman
2018-04-17 15:57 [4.16,29/68] x86/mce/AMD, EDAC/mce_amd: Enumerate Reserved SMCA bank type Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 29/68] " Greg Kroah-Hartman
2018-04-17 15:57 [4.16,30/68] x86/mce/AMD: Get address from already initialized block Greg Kroah-Hartman
2018-04-17 15:57 ` [PATCH 4.16 30/68] " Greg Kroah-Hartman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.