Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2017-10-22 08:56:24 +0200
committerTakashi Iwai <tiwai@suse.de>2017-10-22 08:56:24 +0200
commit1d80e8ae891703b5b43208ed51c1e9b82fbffae4 (patch)
tree2292671b7521bf12e02b4cff34358c8501c2e419
parentc872d849092ccc14129cac121ea0742ca9871370 (diff)
parenta69df70f25bb9f986a02b8fb7832c815fa58d739 (diff)
Merge branch 'SLE12-SP3-fastpath' into openSUSE-42.3rpm-4.4.92-31
-rw-r--r--patches.arch/0370-ACPI-bus-Support-for-platform-initiated-graceful-shu.patch2
-rw-r--r--patches.arch/powerpc-bigmem-16-mm-Add-addr_limit-to-mm_context-and-use-it-t.patch13
-rw-r--r--patches.drivers/ibmvnic-103-Initialize-SCRQ-s-during-login-renegotiation.patch3
-rw-r--r--patches.drivers/ibmvnic-104-Check-for-transport-event-on-driver-resume.patch3
-rw-r--r--patches.drivers/ibmvnic-105-Report-rx-buffer-return-codes-as-netdev_dbg.patch3
-rw-r--r--patches.drivers/ibmvnic-110-Clean-up-resources-on-probe-failure.patch3
-rw-r--r--patches.fixes/packet-hold-bind-lock-when-rebinding-to-fanout-hook.patch77
-rw-r--r--patches.fixes/packet-in-packet_do_bind-test-fanout-with-bind_lock-.patch56
-rw-r--r--patches.fixes/scsi-sg-close-race-condition-in-sg_remove_sfp_userco.patch94
-rw-r--r--patches.fixes/scsi-sg-don-t-return-bogus-Sg_requests.patch48
-rw-r--r--patches.fixes/scsi-sg-only-check-for-dxfer_len-greater-than-256M.patch43
-rw-r--r--patches.fixes/x86-apic-Prevent-pointless-warning-messages.patch57
-rw-r--r--patches.suse/Revert-x86-acpi-Enable-MADT-APIs-to-return-disabled-apicids.patch192
-rw-r--r--patches.suse/Revert-x86-acpi-Set-persistent-cpuid-nodeid-mapping-when-booting.patch182
-rw-r--r--patches.suse/acpi-processor-Check-for-duplicate-processor-ids-at-hotplug-time.patch94
-rw-r--r--patches.suse/acpi-processor-Implement-DEVICE-operator-for-processor-enumeration.patch96
-rw-r--r--patches.suse/x86-acpi-Restore-the-order-of-CPU-IDs.patch103
-rw-r--r--patches.suse/x86-cpu-Remove-unused-and-undefined-__generic_processor_info-declaration.patch43
-rw-r--r--series.conf19
19 files changed, 1053 insertions, 78 deletions
diff --git a/patches.arch/0370-ACPI-bus-Support-for-platform-initiated-graceful-shu.patch b/patches.arch/0370-ACPI-bus-Support-for-platform-initiated-graceful-shu.patch
index b39ff1f5af..c9dfc5a827 100644
--- a/patches.arch/0370-ACPI-bus-Support-for-platform-initiated-graceful-shu.patch
+++ b/patches.arch/0370-ACPI-bus-Support-for-platform-initiated-graceful-shu.patch
@@ -105,9 +105,9 @@ Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@suse.com>
Device Matching
-------------------------------------------------------------------------- */
@@ -1112,6 +1165,7 @@ static int __init acpi_init(void)
+ acpi_debugfs_init();
acpi_sleep_proc_init();
acpi_wakeup_device_init();
- acpi_set_processor_mapping();
+ acpi_setup_sb_notify_handler();
return 0;
}
diff --git a/patches.arch/powerpc-bigmem-16-mm-Add-addr_limit-to-mm_context-and-use-it-t.patch b/patches.arch/powerpc-bigmem-16-mm-Add-addr_limit-to-mm_context-and-use-it-t.patch
index c315a2ee6b..78f6e57593 100644
--- a/patches.arch/powerpc-bigmem-16-mm-Add-addr_limit-to-mm_context-and-use-it-t.patch
+++ b/patches.arch/powerpc-bigmem-16-mm-Add-addr_limit-to-mm_context-and-use-it-t.patch
@@ -22,8 +22,8 @@ Acked-by: Michal Suchanek <msuchanek@suse.de>
arch/powerpc/include/asm/mmu-hash64.h | 4 +++-
arch/powerpc/kernel/setup_64.c | 9 +++++++++
arch/powerpc/mm/mmu_context_hash64.c | 7 +++++++
- arch/powerpc/mm/slice.c | 22 ++++++++++++----------
- 5 files changed, 32 insertions(+), 11 deletions(-)
+ arch/powerpc/mm/slice.c | 20 +++++++++++---------
+ 4 files changed, 30 insertions(+), 10 deletions(-)
diff --git a/arch/powerpc/include/asm/mmu-hash64.h b/arch/powerpc/include/asm/mmu-hash64.h
index 3383e87..afe7c9b5 100644
@@ -155,15 +155,6 @@ index 9f98738..d1248fd 100644
slice_dbg(" fits potential !\n");
goto convert;
}
-@@ -646,7 +648,7 @@ void slice_set_user_psize(struct mm_struct *mm, unsigned int psize)
- mm->context.low_slices_psize = lpsizes;
-
- hpsizes = mm->context.high_slices_psize;
-- for (i = 0; i < SLICE_NUM_HIGH; i++) {
-+ for (i = 0; i < GET_HIGH_SLICE_INDEX(mm->context.addr_limit); i++) {
- mask_index = i & 0x1;
- index = i >> 1;
- if (((hpsizes[index] >> (mask_index * 4)) & 0xf) == old_psize)
@@ -718,6 +720,6 @@ int is_hugepage_only_range(struct mm_struct *mm, unsigned long addr,
slice_print_mask(" mask", mask);
slice_print_mask(" available", available);
diff --git a/patches.drivers/ibmvnic-103-Initialize-SCRQ-s-during-login-renegotiation.patch b/patches.drivers/ibmvnic-103-Initialize-SCRQ-s-during-login-renegotiation.patch
index 2c48dc1fe3..3fa1785cc4 100644
--- a/patches.drivers/ibmvnic-103-Initialize-SCRQ-s-during-login-renegotiation.patch
+++ b/patches.drivers/ibmvnic-103-Initialize-SCRQ-s-during-login-renegotiation.patch
@@ -4,8 +4,7 @@ Date: Tue, 1 Aug 2017 15:04:36 -0500
Subject: [PATCH] ibmvnic: Initialize SCRQ's during login renegotiation
References: bsc#1052223
-Patch-mainline: queued
-Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git
+Patch-mainline: v4.13-rc5
Git-commit: 4d96f12a072c669d48dc3a2c6b539a9faeca138d
SCRQ resources are freed during renegotiation, but they are not
diff --git a/patches.drivers/ibmvnic-104-Check-for-transport-event-on-driver-resume.patch b/patches.drivers/ibmvnic-104-Check-for-transport-event-on-driver-resume.patch
index fbdbd3531c..2815c6d66f 100644
--- a/patches.drivers/ibmvnic-104-Check-for-transport-event-on-driver-resume.patch
+++ b/patches.drivers/ibmvnic-104-Check-for-transport-event-on-driver-resume.patch
@@ -4,8 +4,7 @@ Date: Mon, 24 Jul 2017 13:26:06 -0500
Subject: [PATCH] ibmvnic: Check for transport event on driver resume
References: bsc#1051556, bsc#1052709
-Patch-mainline: queued
-Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git
+Patch-mainline: v4.14-rc1
Git-commit: a248878d7a1d35ea3bb874891997144ad16d7c27
On resume, the ibmvnic driver will fail to resume normal operation.
diff --git a/patches.drivers/ibmvnic-105-Report-rx-buffer-return-codes-as-netdev_dbg.patch b/patches.drivers/ibmvnic-105-Report-rx-buffer-return-codes-as-netdev_dbg.patch
index a5ce77e322..7e5898025a 100644
--- a/patches.drivers/ibmvnic-105-Report-rx-buffer-return-codes-as-netdev_dbg.patch
+++ b/patches.drivers/ibmvnic-105-Report-rx-buffer-return-codes-as-netdev_dbg.patch
@@ -4,8 +4,7 @@ Date: Mon, 7 Aug 2017 15:42:30 -0500
Subject: [PATCH] ibmvnic: Report rx buffer return codes as netdev_dbg
References: bsc#1052794
-Patch-mainline: queued
-Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git
+Patch-mainline: v4.14-rc1
Git-commit: e1cea2e7396820730ca98d53e986bd5241ef14cc
Reporting any return code for a receive buffer as an "rx error" only
diff --git a/patches.drivers/ibmvnic-110-Clean-up-resources-on-probe-failure.patch b/patches.drivers/ibmvnic-110-Clean-up-resources-on-probe-failure.patch
index 61019b17f0..0b69a0685b 100644
--- a/patches.drivers/ibmvnic-110-Clean-up-resources-on-probe-failure.patch
+++ b/patches.drivers/ibmvnic-110-Clean-up-resources-on-probe-failure.patch
@@ -4,8 +4,7 @@ Date: Tue, 8 Aug 2017 14:28:45 -0500
Subject: [PATCH] ibmvnic: Clean up resources on probe failure
References: fate#323285, bsc#1058116
-Patch-mainline: queued
-Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git
+Patch-mainline: v4.14-rc1
Git-commit: 7c1885ae9aba0d6b3f854dfee099a3c1c796755f
Ensure that any resources allocated during probe are released if the
diff --git a/patches.fixes/packet-hold-bind-lock-when-rebinding-to-fanout-hook.patch b/patches.fixes/packet-hold-bind-lock-when-rebinding-to-fanout-hook.patch
new file mode 100644
index 0000000000..30c8e0fff1
--- /dev/null
+++ b/patches.fixes/packet-hold-bind-lock-when-rebinding-to-fanout-hook.patch
@@ -0,0 +1,77 @@
+From: Willem de Bruijn <willemb@google.com>
+Date: Thu, 14 Sep 2017 17:14:41 -0400
+Subject: packet: hold bind lock when rebinding to fanout hook
+Patch-mainline: v4.14-rc2
+Git-commit: 008ba2a13f2d04c947adc536d19debb8fe66f110
+References: CVE-2017-15649 bsc#1064388
+
+Packet socket bind operations must hold the po->bind_lock. This keeps
+po->running consistent with whether the socket is actually on a ptype
+list to receive packets.
+
+fanout_add unbinds a socket and its packet_rcv/tpacket_rcv call, then
+binds the fanout object to receive through packet_rcv_fanout.
+
+Make it hold the po->bind_lock when testing po->running and rebinding.
+Else, it can race with other rebind operations, such as that in
+packet_set_ring from packet_rcv to tpacket_rcv. Concurrent updates
+can result in a socket being added to a fanout group twice, causing
+use-after-free KASAN bug reports, among others.
+
+Reported independently by both trinity and syzkaller.
+Verified that the syzkaller reproducer passes after this patch.
+
+Fixes: dc99f600698d ("packet: Add fanout support.")
+Reported-by: nixioaming <nixiaoming@huawei.com>
+Signed-off-by: Willem de Bruijn <willemb@google.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Acked-by: Michal Kubecek <mkubecek@suse.cz>
+
+---
+ net/packet/af_packet.c | 16 +++++++++++-----
+ 1 file changed, 11 insertions(+), 5 deletions(-)
+
+diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
+index e706e202f463..25ebfda3230b 100644
+--- a/net/packet/af_packet.c
++++ b/net/packet/af_packet.c
+@@ -1651,10 +1651,6 @@ static int fanout_add(struct sock *sk, u16 id, u16 type_flags)
+
+ mutex_lock(&fanout_mutex);
+
+- err = -EINVAL;
+- if (!po->running)
+- goto out;
+-
+ err = -EALREADY;
+ if (po->fanout)
+ goto out;
+@@ -1703,7 +1699,10 @@ static int fanout_add(struct sock *sk, u16 id, u16 type_flags)
+ list_add(&match->list, &fanout_list);
+ }
+ err = -EINVAL;
+- if (match->type == type &&
++
++ spin_lock(&po->bind_lock);
++ if (po->running &&
++ match->type == type &&
+ match->prot_hook.type == po->prot_hook.type &&
+ match->prot_hook.dev == po->prot_hook.dev) {
+ err = -ENOSPC;
+@@ -1715,6 +1714,13 @@ static int fanout_add(struct sock *sk, u16 id, u16 type_flags)
+ err = 0;
+ }
+ }
++ spin_unlock(&po->bind_lock);
++
++ if (err && !atomic_read(&match->sk_ref)) {
++ list_del(&match->list);
++ kfree(match);
++ }
++
+ out:
+ if (err && rollover) {
+ kfree(rollover);
+--
+2.14.2
+
diff --git a/patches.fixes/packet-in-packet_do_bind-test-fanout-with-bind_lock-.patch b/patches.fixes/packet-in-packet_do_bind-test-fanout-with-bind_lock-.patch
new file mode 100644
index 0000000000..646227a686
--- /dev/null
+++ b/patches.fixes/packet-in-packet_do_bind-test-fanout-with-bind_lock-.patch
@@ -0,0 +1,56 @@
+From: Willem de Bruijn <willemb@google.com>
+Date: Tue, 26 Sep 2017 12:19:37 -0400
+Subject: packet: in packet_do_bind, test fanout with bind_lock held
+Patch-mainline: v4.14-rc4
+Git-commit: 4971613c1639d8e5f102c4e797c3bf8f83a5a69e
+References: CVE-2017-15649 bsc#1064388
+
+Once a socket has po->fanout set, it remains a member of the group
+until it is destroyed. The prot_hook must be constant and identical
+across sockets in the group.
+
+If fanout_add races with packet_do_bind between the test of po->fanout
+and taking the lock, the bind call may make type or dev inconsistent
+with that of the fanout group.
+
+Hold po->bind_lock when testing po->fanout to avoid this race.
+
+I had to introduce artificial delay (local_bh_enable) to actually
+observe the race.
+
+Fixes: dc99f600698d ("packet: Add fanout support.")
+Signed-off-by: Willem de Bruijn <willemb@google.com>
+Reviewed-by: Eric Dumazet <edumazet@google.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Acked-by: Michal Kubecek <mkubecek@suse.cz>
+
+---
+ net/packet/af_packet.c | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
+index 25ebfda3230b..0fef59c8dabf 100644
+--- a/net/packet/af_packet.c
++++ b/net/packet/af_packet.c
+@@ -2943,13 +2943,15 @@ static int packet_do_bind(struct sock *sk, const char *name, int ifindex,
+ int ret = 0;
+ bool unlisted = false;
+
+- if (po->fanout)
+- return -EINVAL;
+-
+ lock_sock(sk);
+ spin_lock(&po->bind_lock);
+ rcu_read_lock();
+
++ if (po->fanout) {
++ ret = -EINVAL;
++ goto out_unlock;
++ }
++
+ if (name) {
+ dev = dev_get_by_name_rcu(sock_net(sk), name);
+ if (!dev) {
+--
+2.14.2
+
diff --git a/patches.fixes/scsi-sg-close-race-condition-in-sg_remove_sfp_userco.patch b/patches.fixes/scsi-sg-close-race-condition-in-sg_remove_sfp_userco.patch
new file mode 100644
index 0000000000..0b15517232
--- /dev/null
+++ b/patches.fixes/scsi-sg-close-race-condition-in-sg_remove_sfp_userco.patch
@@ -0,0 +1,94 @@
+From: Hannes Reinecke <hare@suse.de>
+Date: Fri, 7 Apr 2017 09:34:17 +0200
+Subject: [PATCH] scsi: sg: close race condition in sg_remove_sfp_usercontext()
+Git-commit: 97d27b0dd015e980ade63fda111fd1353276e28b
+Patch-Mainline: v4.12
+References: bsc#1064206
+
+sg_remove_sfp_usercontext() is clearing any sg requests, but needs to
+take 'rq_list_lock' when modifying the list.
+
+Reported-by: Christoph Hellwig <hch@lst.de>
+Signed-off-by: Hannes Reinecke <hare@suse.com>
+Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
+Tested-by: Johannes Thumshirn <jthumshirn@suse.de>
+Reviewed-by: Christoph Hellwig <hch@lst.de>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+---
+ drivers/scsi/sg.c | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
+index 02dfbc1..f5b5090 100644
+--- a/drivers/scsi/sg.c
++++ b/drivers/scsi/sg.c
+@@ -525,6 +525,7 @@ sg_read(struct file *filp, char __user *buf, size_t count, loff_t * ppos)
+ } else
+ count = (old_hdr->result == 0) ? 0 : -EIO;
+ sg_finish_rem_req(srp);
++ sg_remove_request(sfp, srp);
+ retval = count;
+ free_old_hdr:
+ kfree(old_hdr);
+@@ -565,6 +566,7 @@ sg_new_read(Sg_fd * sfp, char __user *buf, size_t count, Sg_request * srp)
+ }
+ err_out:
+ err2 = sg_finish_rem_req(srp);
++ sg_remove_request(sfp, srp);
+ return err ? : err2 ? : count;
+ }
+
+@@ -779,6 +781,7 @@ sg_common_write(Sg_fd * sfp, Sg_request * srp,
+ SCSI_LOG_TIMEOUT(1, sg_printk(KERN_INFO, sfp->parentdp,
+ "sg_common_write: start_req err=%d\n", k));
+ sg_finish_rem_req(srp);
++ sg_remove_request(sfp, srp);
+ return k; /* probably out of space --> ENOMEM */
+ }
+ if (atomic_read(&sdp->detaching)) {
+@@ -791,6 +794,7 @@ sg_common_write(Sg_fd * sfp, Sg_request * srp,
+ }
+
+ sg_finish_rem_req(srp);
++ sg_remove_request(sfp, srp);
+ return -ENODEV;
+ }
+
+@@ -1291,6 +1295,7 @@ sg_rq_end_io_usercontext(struct work_struct *work)
+ struct sg_fd *sfp = srp->parentfp;
+
+ sg_finish_rem_req(srp);
++ sg_remove_request(sfp, srp);
+ kref_put(&sfp->f_ref, sg_remove_sfp);
+ }
+
+@@ -1835,8 +1840,6 @@ sg_finish_rem_req(Sg_request *srp)
+ else
+ sg_remove_scat(sfp, req_schp);
+
+- sg_remove_request(sfp, srp);
+-
+ return ret;
+ }
+
+@@ -2184,12 +2187,17 @@ sg_remove_sfp_usercontext(struct work_struct *work)
+ struct sg_fd *sfp = container_of(work, struct sg_fd, ew.work);
+ struct sg_device *sdp = sfp->parentdp;
+ Sg_request *srp;
++ unsigned long iflags;
+
+ /* Cleanup any responses which were never read(). */
++ write_lock_irqsave(&sfp->rq_list_lock, iflags);
+ while (!list_empty(&sfp->rq_list)) {
+ srp = list_first_entry(&sfp->rq_list, Sg_request, entry);
+ sg_finish_rem_req(srp);
++ list_del(&srp->entry);
++ srp->parentfp = NULL;
+ }
++ write_unlock_irqrestore(&sfp->rq_list_lock, iflags);
+
+ if (sfp->reserve.bufflen > 0) {
+ SCSI_LOG_TIMEOUT(6, sg_printk(KERN_INFO, sdp,
+--
+1.8.5.6
+
diff --git a/patches.fixes/scsi-sg-don-t-return-bogus-Sg_requests.patch b/patches.fixes/scsi-sg-don-t-return-bogus-Sg_requests.patch
new file mode 100644
index 0000000000..bf001f2a60
--- /dev/null
+++ b/patches.fixes/scsi-sg-don-t-return-bogus-Sg_requests.patch
@@ -0,0 +1,48 @@
+From: Johannes Thumshirn <jthumshirn@suse.de>
+Date: Wed, 10 May 2017 09:53:40 +0200
+Subject: [PATCH] scsi: sg: don't return bogus Sg_requests
+Git-commit: 48ae8484e9fc324b4968d33c585e54bc98e44d61
+Patch-Mainline: v4.12
+References: bsc#1064206
+
+If the list search in sg_get_rq_mark() fails to find a valid request, we
+return a bogus element. This then can later lead to a GPF in
+sg_remove_scat().
+
+So don't return bogus Sg_requests in sg_get_rq_mark() but NULL in case
+the list search doesn't find a valid request.
+
+Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
+Reported-by: Andrey Konovalov <andreyknvl@google.com>
+Cc: Hannes Reinecke <hare@suse.de>
+Cc: Christoph Hellwig <hch@lst.de>
+Cc: Doug Gilbert <dgilbert@interlog.com>
+Reviewed-by: Hannes Reinecke <hare@suse.de>
+Acked-by: Doug Gilbert <dgilbert@interlog.com>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+---
+ drivers/scsi/sg.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
+index f5b5090..a7c26be 100644
+--- a/drivers/scsi/sg.c
++++ b/drivers/scsi/sg.c
+@@ -2075,11 +2075,12 @@ sg_get_rq_mark(Sg_fd * sfp, int pack_id)
+ if ((1 == resp->done) && (!resp->sg_io_owned) &&
+ ((-1 == pack_id) || (resp->header.pack_id == pack_id))) {
+ resp->done = 2; /* guard against other readers */
+- break;
++ write_unlock_irqrestore(&sfp->rq_list_lock, iflags);
++ return resp;
+ }
+ }
+ write_unlock_irqrestore(&sfp->rq_list_lock, iflags);
+- return resp;
++ return NULL;
+ }
+
+ /* always adds to end of list */
+--
+1.8.5.6
+
diff --git a/patches.fixes/scsi-sg-only-check-for-dxfer_len-greater-than-256M.patch b/patches.fixes/scsi-sg-only-check-for-dxfer_len-greater-than-256M.patch
new file mode 100644
index 0000000000..8c00a0891d
--- /dev/null
+++ b/patches.fixes/scsi-sg-only-check-for-dxfer_len-greater-than-256M.patch
@@ -0,0 +1,43 @@
+From: Johannes Thumshirn <jthumshirn@suse.de>
+Date: Thu, 27 Jul 2017 09:11:26 +0200
+Subject: [PATCH] scsi: sg: only check for dxfer_len greater than 256M
+Git-commit: f930c7043663188429cd9b254e9d761edfc101ce
+Patch-Mainline: v4.12
+References: bsc#1064206
+
+Don't make any assumptions on the sg_io_hdr_t::dxfer_direction or the
+sg_io_hdr_t::dxferp in order to determine if it is a valid request. The
+only way we can check for bad requests is by checking if the length
+exceeds 256M.
+
+Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
+Fixes: 28676d869bbb (scsi: sg: check for valid direction before starting the
+request)
+Reported-by: Jason L Tibbitts III <tibbs@math.uh.edu>
+Tested-by: Jason L Tibbitts III <tibbs@math.uh.edu>
+Suggested-by: Doug Gilbert <dgilbert@interlog.com>
+Cc: Doug Gilbert <dgilbert@interlog.com>
+Cc: <stable@vger.kernel.org>
+Reviewed-by: Hannes Reinecke <hare@suse.com>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+---
+ drivers/scsi/sg.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
+index a7c26be..5b83b7f 100644
+--- a/drivers/scsi/sg.c
++++ b/drivers/scsi/sg.c
+@@ -776,6 +776,9 @@ sg_common_write(Sg_fd * sfp, Sg_request * srp,
+ "sg_common_write: scsi opcode=0x%02x, cmd_size=%d\n",
+ (int) cmnd[0], (int) hp->cmd_len));
+
++ if (hp->dxfer_len >= SZ_256M)
++ return -EINVAL;
++
+ k = sg_start_req(srp, cmnd);
+ if (k) {
+ SCSI_LOG_TIMEOUT(1, sg_printk(KERN_INFO, sfp->parentdp,
+--
+1.8.5.6
+
diff --git a/patches.fixes/x86-apic-Prevent-pointless-warning-messages.patch b/patches.fixes/x86-apic-Prevent-pointless-warning-messages.patch
deleted file mode 100644
index a5bb90338a..0000000000
--- a/patches.fixes/x86-apic-Prevent-pointless-warning-messages.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-From df610d678893c85b82d3a68eea0d87dd4e03e615 Mon Sep 17 00:00:00 2001
-From: Thomas Gleixner <tglx@linutronix.de>
-Date: Fri, 7 Oct 2016 15:55:13 +0200
-Subject: [PATCH] x86/apic: Prevent pointless warning messages
-Git-commit: df610d678893c85b82d3a68eea0d87dd4e03e615
-Patch-mainline: 4.9-rc1
-References: bnc#1037354
-
-Markus reported that he sees new warnings:
-
- APIC: NR_CPUS/possible_cpus limit of 4 reached. Processor 4/0x84 ignored.
- APIC: NR_CPUS/possible_cpus limit of 4 reached. Processor 5/0x85 ignored.
-
-This comes from the recent persistant cpuid - nodeid changes. The code
-which emits the warning has been called prior to these changes only for
-enabled processors. Now it's called for disabled processors as well to get
-the possible cpu accounting correct. So if the kernel is compiled for the
-number of actual available/enabled CPUs and the BIOS reports disabled CPUs
-as well then the above warnings are printed.
-
-That's a pointless exercise as it only makes sense if there are more CPUs
-enabled than the kernel supports.
-
-Nake the warning conditional on enabled processors so we are back to the
-state before these changes.
-
-Fixes: 8f54969dc8d6 ("x86/acpi: Introduce persistent storage for cpuid <-> apicid mapping")
-Reported-and-tested-by: Markus Trippelsdorf <markus@trippelsdorf.de>
-Cc: One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>
-Cc: Dou Liyang <douly.fnst@cn.fujitsu.com>
-Cc: linux-acpi@vger.kernel.org
-Cc: Gu Zheng <guz.fnst@cn.fujitsu.com>
-Link: http://lkml.kernel.org/r/alpine.DEB.2.20.1610071549330.19804@nanos
-Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-Acked-by: Michal Hocko <mhocko@suse.com>
-
----
- arch/x86/kernel/apic/apic.c | 8 +++++---
- 1 file changed, 5 insertions(+), 3 deletions(-)
-
---- a/arch/x86/kernel/apic/apic.c
-+++ b/arch/x86/kernel/apic/apic.c
-@@ -2105,9 +2105,11 @@ int __generic_processor_info(int apicid,
- if (num_processors >= nr_cpu_ids) {
- int thiscpu = max + disabled_cpus;
-
-- pr_warning(
-- "ACPI: NR_CPUS/possible_cpus limit of %i reached."
-- " Processor %d/0x%x ignored.\n", max, thiscpu, apicid);
-+ if (enabled) {
-+ pr_warning("ACPI: NR_CPUS/possible_cpus limit of %i "
-+ "reached. Processor %d/0x%x ignored.\n",
-+ max, thiscpu, apicid);
-+ }
-
- disabled_cpus++;
- return -EINVAL;
diff --git a/patches.suse/Revert-x86-acpi-Enable-MADT-APIs-to-return-disabled-apicids.patch b/patches.suse/Revert-x86-acpi-Enable-MADT-APIs-to-return-disabled-apicids.patch
new file mode 100644
index 0000000000..2cd27def2e
--- /dev/null
+++ b/patches.suse/Revert-x86-acpi-Enable-MADT-APIs-to-return-disabled-apicids.patch
@@ -0,0 +1,192 @@
+From b8c3ac6a7ef72075b16e1638a28074a032fd0411 Mon Sep 17 00:00:00 2001
+From: Dou Liyang <douly.fnst@cn.fujitsu.com>
+Date: Fri, 3 Mar 2017 16:02:24 +0800
+Subject: [PATCH] Revert"x86/acpi: Enable MADT APIs to return disabled apicids"
+
+References: bnc#1056230
+Patch-mainline: v4.11
+Git-commit: 09c3f2bd5c7e5f18687663acb6adc6b167484ca5
+
+Revert: 8ad893faf2ea ("x86/acpi: Enable MADT APIs to return disabled apicids")
+
+Remove the leftovers of the boot time 'cpuid <-> nodeid' mapping approach.
+
+Signed-off-by: Dou Liyang <douly.fnst@cn.fujitsu.com>
+Tested-by: Xiaolong Ye <xiaolong.ye@intel.com>
+Cc: rjw@rjwysocki.net
+Cc: linux-acpi@vger.kernel.org
+Cc: guzheng1@huawei.com
+Cc: izumi.taku@jp.fujitsu.com
+Cc: lenb@kernel.org
+Link: http://lkml.kernel.org/r/1488528147-2279-3-git-send-email-douly.fnst@cn.fujitsu.com
+Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
+Signed-off-by: Mel Gorman <mgorman@suse.de>
+---
+ drivers/acpi/processor_core.c | 60 ++++++++++++++++---------------------------
+ 1 file changed, 22 insertions(+), 38 deletions(-)
+
+diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
+index 288ae44f568f..1b9780162eb4 100644
+--- a/drivers/acpi/processor_core.c
++++ b/drivers/acpi/processor_core.c
+@@ -32,12 +32,12 @@ static struct acpi_table_madt *get_madt_table(void)
+ }
+
+ static int map_lapic_id(struct acpi_subtable_header *entry,
+- u32 acpi_id, phys_cpuid_t *apic_id, bool ignore_disabled)
++ u32 acpi_id, phys_cpuid_t *apic_id)
+ {
+ struct acpi_madt_local_apic *lapic =
+ container_of(entry, struct acpi_madt_local_apic, header);
+
+- if (ignore_disabled && !(lapic->lapic_flags & ACPI_MADT_ENABLED))
++ if (!(lapic->lapic_flags & ACPI_MADT_ENABLED))
+ return -ENODEV;
+
+ if (lapic->processor_id != acpi_id)
+@@ -48,13 +48,12 @@ static int map_lapic_id(struct acpi_subtable_header *entry,
+ }
+
+ static int map_x2apic_id(struct acpi_subtable_header *entry,
+- int device_declaration, u32 acpi_id, phys_cpuid_t *apic_id,
+- bool ignore_disabled)
++ int device_declaration, u32 acpi_id, phys_cpuid_t *apic_id)
+ {
+ struct acpi_madt_local_x2apic *apic =
+ container_of(entry, struct acpi_madt_local_x2apic, header);
+
+- if (ignore_disabled && !(apic->lapic_flags & ACPI_MADT_ENABLED))
++ if (!(apic->lapic_flags & ACPI_MADT_ENABLED))
+ return -ENODEV;
+
+ if (device_declaration && (apic->uid == acpi_id)) {
+@@ -66,13 +65,12 @@ static int map_x2apic_id(struct acpi_subtable_header *entry,
+ }
+
+ static int map_lsapic_id(struct acpi_subtable_header *entry,
+- int device_declaration, u32 acpi_id, phys_cpuid_t *apic_id,
+- bool ignore_disabled)
++ int device_declaration, u32 acpi_id, phys_cpuid_t *apic_id)
+ {
+ struct acpi_madt_local_sapic *lsapic =
+ container_of(entry, struct acpi_madt_local_sapic, header);
+
+- if (ignore_disabled && !(lsapic->lapic_flags & ACPI_MADT_ENABLED))
++ if (!(lsapic->lapic_flags & ACPI_MADT_ENABLED))
+ return -ENODEV;
+
+ if (device_declaration) {
+@@ -89,13 +87,12 @@ static int map_lsapic_id(struct acpi_subtable_header *entry,
+ * Retrieve the ARM CPU physical identifier (MPIDR)
+ */
+ static int map_gicc_mpidr(struct acpi_subtable_header *entry,
+- int device_declaration, u32 acpi_id, phys_cpuid_t *mpidr,
+- bool ignore_disabled)
++ int device_declaration, u32 acpi_id, phys_cpuid_t *mpidr)
+ {
+ struct acpi_madt_generic_interrupt *gicc =
+ container_of(entry, struct acpi_madt_generic_interrupt, header);
+
+- if (ignore_disabled && !(gicc->flags & ACPI_MADT_ENABLED))
++ if (!(gicc->flags & ACPI_MADT_ENABLED))
+ return -ENODEV;
+
+ /* device_declaration means Device object in DSDT, in the
+@@ -112,7 +109,7 @@ static int map_gicc_mpidr(struct acpi_subtable_header *entry,
+ }
+
+ static phys_cpuid_t map_madt_entry(struct acpi_table_madt *madt,
+- int type, u32 acpi_id, bool ignore_disabled)
++ int type, u32 acpi_id)
+ {
+ unsigned long madt_end, entry;
+ phys_cpuid_t phys_id = PHYS_CPUID_INVALID; /* CPU hardware ID */
+@@ -130,20 +127,16 @@ static phys_cpuid_t map_madt_entry(struct acpi_table_madt *madt,
+ struct acpi_subtable_header *header =
+ (struct acpi_subtable_header *)entry;
+ if (header->type == ACPI_MADT_TYPE_LOCAL_APIC) {
+- if (!map_lapic_id(header, acpi_id, &phys_id,
+- ignore_disabled))
++ if (!map_lapic_id(header, acpi_id, &phys_id))
+ break;
+ } else if (header->type == ACPI_MADT_TYPE_LOCAL_X2APIC) {
+- if (!map_x2apic_id(header, type, acpi_id, &phys_id,
+- ignore_disabled))
++ if (!map_x2apic_id(header, type, acpi_id, &phys_id))
+ break;
+ } else if (header->type == ACPI_MADT_TYPE_LOCAL_SAPIC) {
+- if (!map_lsapic_id(header, type, acpi_id, &phys_id,
+- ignore_disabled))
++ if (!map_lsapic_id(header, type, acpi_id, &phys_id))
+ break;
+ } else if (header->type == ACPI_MADT_TYPE_GENERIC_INTERRUPT) {
+- if (!map_gicc_mpidr(header, type, acpi_id, &phys_id,
+- ignore_disabled))
++ if (!map_gicc_mpidr(header, type, acpi_id, &phys_id))
+ break;
+ }
+ entry += header->length;
+@@ -163,15 +156,14 @@ phys_cpuid_t __init acpi_map_madt_entry(u32 acpi_id)
+ if (!madt)
+ return PHYS_CPUID_INVALID;
+
+- rv = map_madt_entry(madt, 1, acpi_id, true);
++ rv = map_madt_entry(madt, 1, acpi_id);
+
+ early_acpi_os_unmap_memory(madt, tbl_size);
+
+ return rv;
+ }
+
+-static phys_cpuid_t map_mat_entry(acpi_handle handle, int type, u32 acpi_id,
+- bool ignore_disabled)
++static phys_cpuid_t map_mat_entry(acpi_handle handle, int type, u32 acpi_id)
+ {
+ struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
+ union acpi_object *obj;
+@@ -192,38 +184,30 @@ static phys_cpuid_t map_mat_entry(acpi_handle handle, int type, u32 acpi_id,
+
+ header = (struct acpi_subtable_header *)obj->buffer.pointer;
+ if (header->type == ACPI_MADT_TYPE_LOCAL_APIC)
+- map_lapic_id(header, acpi_id, &phys_id, ignore_disabled);
++ map_lapic_id(header, acpi_id, &phys_id);
+ else if (header->type == ACPI_MADT_TYPE_LOCAL_SAPIC)
+- map_lsapic_id(header, type, acpi_id, &phys_id, ignore_disabled);
++ map_lsapic_id(header, type, acpi_id, &phys_id);
+ else if (header->type == ACPI_MADT_TYPE_LOCAL_X2APIC)
+- map_x2apic_id(header, type, acpi_id, &phys_id, ignore_disabled);
++ map_x2apic_id(header, type, acpi_id, &phys_id);
+ else if (header->type == ACPI_MADT_TYPE_GENERIC_INTERRUPT)
+- map_gicc_mpidr(header, type, acpi_id, &phys_id,
+- ignore_disabled);
++ map_gicc_mpidr(header, type, acpi_id, &phys_id);
+
+ exit:
+ kfree(buffer.pointer);
+ return phys_id;
+ }
+
+-static phys_cpuid_t __acpi_get_phys_id(acpi_handle handle, int type,
+- u32 acpi_id, bool ignore_disabled)
++phys_cpuid_t acpi_get_phys_id(acpi_handle handle, int type, u32 acpi_id)
+ {
+ phys_cpuid_t phys_id;
+
+- phys_id = map_mat_entry(handle, type, acpi_id, ignore_disabled);
++ phys_id = map_mat_entry(handle, type, acpi_id);
+ if (invalid_phys_cpuid(phys_id))
+- phys_id = map_madt_entry(get_madt_table(), type, acpi_id,
+- ignore_disabled);
++ phys_id = map_madt_entry(get_madt_table(), type, acpi_id);
+
+ return phys_id;
+ }
+
+-phys_cpuid_t acpi_get_phys_id(acpi_handle handle, int type, u32 acpi_id)
+-{
+- return __acpi_get_phys_id(handle, type, acpi_id, true);
+-}
+-
+ int acpi_map_cpuid(phys_cpuid_t phys_id, u32 acpi_id)
+ {
+ #ifdef CONFIG_SMP
diff --git a/patches.suse/Revert-x86-acpi-Set-persistent-cpuid-nodeid-mapping-when-booting.patch b/patches.suse/Revert-x86-acpi-Set-persistent-cpuid-nodeid-mapping-when-booting.patch
new file mode 100644
index 0000000000..87d46e5bc0
--- /dev/null
+++ b/patches.suse/Revert-x86-acpi-Set-persistent-cpuid-nodeid-mapping-when-booting.patch
@@ -0,0 +1,182 @@
+From 37694cf35504643937530e55e1e5273834a2c01c Mon Sep 17 00:00:00 2001
+From: Dou Liyang <douly.fnst@cn.fujitsu.com>
+Date: Fri, 3 Mar 2017 16:02:23 +0800
+Subject: [PATCH] Revert "x86/acpi: Set persistent cpuid <-> nodeid mapping
+ when booting"
+
+References: bnc#1056230
+Patch-mainline: v4.11
+Git-commit: c962cff17dfa11f4a8227ac16de2b28aea3312e4
+
+Revert: dc6db24d2476 ("x86/acpi: Set persistent cpuid <-> nodeid mapping when booting")
+
+The mapping of "cpuid <-> nodeid" is established at boot time via ACPI
+tables to keep associations of workqueues and other node related items
+consistent across cpu hotplug.
+
+But, ACPI tables are unreliable and failures with that boot time mapping
+have been reported on machines where the ACPI table and the physical
+information which is retrieved at actual hotplug is inconsistent.
+
+Revert the mapping implementation so it can be replaced with a less error
+prone approach.
+
+Signed-off-by: Dou Liyang <douly.fnst@cn.fujitsu.com>
+Tested-by: Xiaolong Ye <xiaolong.ye@intel.com>
+Cc: rjw@rjwysocki.net
+Cc: linux-acpi@vger.kernel.org
+Cc: guzheng1@huawei.com
+Cc: izumi.taku@jp.fujitsu.com
+Cc: lenb@kernel.org
+Link: http://lkml.kernel.org/r/1488528147-2279-2-git-send-email-douly.fnst@cn.fujitsu.com
+Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
+Signed-off-by: Mel Gorman <mgorman@suse.de>
+---
+ arch/x86/kernel/acpi/boot.c | 2 +-
+ drivers/acpi/acpi_processor.c | 5 ---
+ drivers/acpi/bus.c | 1 -
+ drivers/acpi/processor_core.c | 73 -------------------------------------------
+ include/linux/acpi.h | 3 --
+ 5 files changed, 1 insertion(+), 83 deletions(-)
+
+diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
+index ce6e67d74df9..782b281eecba 100644
+--- a/arch/x86/kernel/acpi/boot.c
++++ b/arch/x86/kernel/acpi/boot.c
+@@ -705,7 +705,7 @@ static void __init acpi_set_irq_model_ioapic(void)
+ #ifdef CONFIG_ACPI_HOTPLUG_CPU
+ #include <acpi/processor.h>
+
+-int acpi_map_cpu2node(acpi_handle handle, int cpu, int physid)
++static int acpi_map_cpu2node(acpi_handle handle, int cpu, int physid)
+ {
+ #ifdef CONFIG_ACPI_NUMA
+ int nid;
+diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c
+index bb8768c5103a..4d163e239105 100644
+--- a/drivers/acpi/acpi_processor.c
++++ b/drivers/acpi/acpi_processor.c
+@@ -182,11 +182,6 @@ int __weak arch_register_cpu(int cpu)
+
+ void __weak arch_unregister_cpu(int cpu) {}
+
+-int __weak acpi_map_cpu2node(acpi_handle handle, int cpu, int physid)
+-{
+- return -ENODEV;
+-}
+-
+ static int acpi_processor_hotadd_init(struct acpi_processor *pr)
+ {
+ unsigned long long sta;
+diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
+index e923502d79e0..d4ba825b170c 100644
+--- a/drivers/acpi/bus.c
++++ b/drivers/acpi/bus.c
+@@ -1164,7 +1164,6 @@ static int __init acpi_init(void)
+ acpi_debugfs_init();
+ acpi_sleep_proc_init();
+ acpi_wakeup_device_init();
+- acpi_set_processor_mapping();
+ return 0;
+ }
+
+diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
+index 1c97432818bd..288ae44f568f 100644
+--- a/drivers/acpi/processor_core.c
++++ b/drivers/acpi/processor_core.c
+@@ -280,79 +280,6 @@ int acpi_get_cpuid(acpi_handle handle, int type, u32 acpi_id)
+ }
+ EXPORT_SYMBOL_GPL(acpi_get_cpuid);
+
+-#ifdef CONFIG_ACPI_HOTPLUG_CPU
+-static bool __init
+-map_processor(acpi_handle handle, phys_cpuid_t *phys_id, int *cpuid)
+-{
+- int type, id;
+- u32 acpi_id;
+- acpi_status status;
+- acpi_object_type acpi_type;
+- unsigned long long tmp;
+- union acpi_object object = { 0 };
+- struct acpi_buffer buffer = { sizeof(union acpi_object), &object };
+-
+- status = acpi_get_type(handle, &acpi_type);
+- if (ACPI_FAILURE(status))
+- return false;
+-
+- switch (acpi_type) {
+- case ACPI_TYPE_PROCESSOR:
+- status = acpi_evaluate_object(handle, NULL, NULL, &buffer);
+- if (ACPI_FAILURE(status))
+- return false;
+- acpi_id = object.processor.proc_id;
+-
+- /* validate the acpi_id */
+- if(acpi_processor_validate_proc_id(acpi_id))
+- return false;
+- break;
+- case ACPI_TYPE_DEVICE:
+- status = acpi_evaluate_integer(handle, "_UID", NULL, &tmp);
+- if (ACPI_FAILURE(status))
+- return false;
+- acpi_id = tmp;
+- break;
+- default:
+- return false;
+- }
+-
+- type = (acpi_type == ACPI_TYPE_DEVICE) ? 1 : 0;
+-
+- *phys_id = __acpi_get_phys_id(handle, type, acpi_id, false);
+- id = acpi_map_cpuid(*phys_id, acpi_id);
+-
+- if (id < 0)
+- return false;
+- *cpuid = id;
+- return true;
+-}
+-
+-static acpi_status __init
+-set_processor_node_mapping(acpi_handle handle, u32 lvl, void *context,
+- void **rv)
+-{
+- phys_cpuid_t phys_id;
+- int cpu_id;
+-
+- if (!map_processor(handle, &phys_id, &cpu_id))
+- return AE_ERROR;
+-
+- acpi_map_cpu2node(handle, cpu_id, phys_id);
+- return AE_OK;
+-}
+-
+-void __init acpi_set_processor_mapping(void)
+-{
+- /* Set persistent cpu <-> node mapping for all processors. */
+- acpi_walk_namespace(ACPI_TYPE_PROCESSOR, ACPI_ROOT_OBJECT,
+- ACPI_UINT32_MAX, set_processor_node_mapping,
+- NULL, NULL, NULL);
+-}
+-#else
+-void __init acpi_set_processor_mapping(void) {}
+-#endif /* CONFIG_ACPI_HOTPLUG_CPU */
+-
+ #ifdef CONFIG_ACPI_HOTPLUG_IOAPIC
+ static int get_ioapic_id(struct acpi_subtable_header *entry, u32 gsi_base,
+ u64 *phys_addr, int *ioapic_id)
+diff --git a/include/linux/acpi.h b/include/linux/acpi.h
+index f9821b4acac9..eb2e6c20fe42 100644
+--- a/include/linux/acpi.h
++++ b/include/linux/acpi.h
+@@ -232,11 +232,8 @@ bool acpi_processor_validate_proc_id(int proc_id);
+ /* Arch dependent functions for cpu hotplug support */
+ int acpi_map_cpu(acpi_handle handle, phys_cpuid_t physid, int *pcpu);
+ int acpi_unmap_cpu(int cpu);
+-int acpi_map_cpu2node(acpi_handle handle, int cpu, int physid);
+ #endif /* CONFIG_ACPI_HOTPLUG_CPU */
+
+-void acpi_set_processor_mapping(void);
+-
+ #ifdef CONFIG_ACPI_HOTPLUG_IOAPIC
+ int acpi_get_ioapic_id(acpi_handle handle, u32 gsi_base, u64 *phys_addr);
+ #endif
diff --git a/patches.suse/acpi-processor-Check-for-duplicate-processor-ids-at-hotplug-time.patch b/patches.suse/acpi-processor-Check-for-duplicate-processor-ids-at-hotplug-time.patch
new file mode 100644
index 0000000000..b286c14878
--- /dev/null
+++ b/patches.suse/acpi-processor-Check-for-duplicate-processor-ids-at-hotplug-time.patch
@@ -0,0 +1,94 @@
+From f920f74200f3d5d43fc327801a964d27c3034533 Mon Sep 17 00:00:00 2001
+From: Dou Liyang <douly.fnst@cn.fujitsu.com>
+Date: Fri, 3 Mar 2017 16:02:27 +0800
+Subject: [PATCH] acpi/processor: Check for duplicate processor ids at hotplug
+ time
+
+References: bnc#1056230
+Patch-mainline: v4.11
+Git-commit: a77d6cd968497792e072b74dff45b891ba778ddb
+
+The check for duplicate processor ids happens at boot time based on the
+ACPI table contents, but the final sanity checks for a processor happen
+at hotplug time.
+
+At hotplug time, where the physical information is available, which might
+differ from the ACPI table information, a check for duplicate processor
+ids is missing.
+
+Add it to the hotplug checks and rename the function so it better
+reflects its purpose.
+
+Signed-off-by: Dou Liyang <douly.fnst@cn.fujitsu.com>
+Tested-by: Xiaolong Ye <xiaolong.ye@intel.com>
+Cc: rjw@rjwysocki.net
+Cc: linux-acpi@vger.kernel.org
+Cc: guzheng1@huawei.com
+Cc: izumi.taku@jp.fujitsu.com
+Cc: lenb@kernel.org
+Link: http://lkml.kernel.org/r/1488528147-2279-6-git-send-email-douly.fnst@cn.fujitsu.com
+Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
+Signed-off-by: Mel Gorman <mgorman@suse.de>
+---
+ drivers/acpi/acpi_processor.c | 13 ++++++++++---
+ include/linux/acpi.h | 2 +-
+ 2 files changed, 11 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c
+index f0de4ae8360e..56d4caad9d06 100644
+--- a/drivers/acpi/acpi_processor.c
++++ b/drivers/acpi/acpi_processor.c
+@@ -280,6 +280,13 @@ static int acpi_processor_get_info(struct acpi_device *device)
+ pr->acpi_id = value;
+ }
+
++ if (acpi_duplicate_processor_id(pr->acpi_id)) {
++ dev_err(&device->dev,
++ "Failed to get unique processor _UID (0x%x)\n",
++ pr->acpi_id);
++ return -ENODEV;
++ }
++
+ pr->phys_id = acpi_get_phys_id(pr->handle, device_declaration,
+ pr->acpi_id);
+ if (invalid_phys_cpuid(pr->phys_id))
+@@ -564,7 +571,7 @@ static struct acpi_scan_handler processor_handler = {
+ static int nr_unique_ids __initdata;
+
+ /* The number of the duplicate processor IDs */
+-static int nr_duplicate_ids __initdata;
++static int nr_duplicate_ids;
+
+ /* Used to store the unique processor IDs */
+ static int unique_processor_ids[] __initdata = {
+@@ -572,7 +579,7 @@ static int unique_processor_ids[] __initdata = {
+ };
+
+ /* Used to store the duplicate processor IDs */
+-static int duplicate_processor_ids[] __initdata = {
++static int duplicate_processor_ids[] = {
+ [0 ... NR_CPUS - 1] = -1,
+ };
+
+@@ -663,7 +670,7 @@ void __init acpi_processor_check_duplicates(void)
+ NULL, NULL);
+ }
+
+-bool __init acpi_processor_validate_proc_id(int proc_id)
++bool acpi_duplicate_processor_id(int proc_id)
+ {
+ int i;
+
+diff --git a/include/linux/acpi.h b/include/linux/acpi.h
+index eb2e6c20fe42..4a0eacee34b2 100644
+--- a/include/linux/acpi.h
++++ b/include/linux/acpi.h
+@@ -226,7 +226,7 @@ static inline bool invalid_phys_cpuid(phys_cpuid_t phys_id)
+ }
+
+ /* Validate the processor object's proc_id */
+-bool acpi_processor_validate_proc_id(int proc_id);
++bool acpi_duplicate_processor_id(int proc_id);
+
+ #ifdef CONFIG_ACPI_HOTPLUG_CPU
+ /* Arch dependent functions for cpu hotplug support */
diff --git a/patches.suse/acpi-processor-Implement-DEVICE-operator-for-processor-enumeration.patch b/patches.suse/acpi-processor-Implement-DEVICE-operator-for-processor-enumeration.patch
new file mode 100644
index 0000000000..401583df61
--- /dev/null
+++ b/patches.suse/acpi-processor-Implement-DEVICE-operator-for-processor-enumeration.patch
@@ -0,0 +1,96 @@
+From 168314134daea0defb6717749a486688b4400429 Mon Sep 17 00:00:00 2001
+From: Dou Liyang <douly.fnst@cn.fujitsu.com>
+Date: Fri, 3 Mar 2017 16:02:26 +0800
+Subject: [PATCH] acpi/processor: Implement DEVICE operator for processor
+ enumeration
+
+References: bnc#1056230
+Patch-mainline: v4.11
+Git-commit: 8c8cb30f49b86333d8e036e1945cf1a78c03577e
+
+ACPI allows to declare processors either with the PROCESSOR or with the
+DEVICE operator. The current implementation handles only the PROCESSOR
+operator.
+
+On a system which uses the DEVICE operator for processor enumeration the
+evaluation fails.
+
+Check for the ACPI type of the ACPI handle and evaluate PROCESSOR and
+DEVICE types separately.
+
+Signed-off-by: Dou Liyang <douly.fnst@cn.fujitsu.com>
+Tested-by: Xiaolong Ye <xiaolong.ye@intel.com>
+Cc: rjw@rjwysocki.net
+Cc: linux-acpi@vger.kernel.org
+Cc: guzheng1@huawei.com
+Cc: izumi.taku@jp.fujitsu.com
+Cc: lenb@kernel.org
+Link: http://lkml.kernel.org/r/1488528147-2279-5-git-send-email-douly.fnst@cn.fujitsu.com
+Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
+Signed-off-by: Mel Gorman <mgorman@suse.de>
+---
+ drivers/acpi/acpi_processor.c | 39 ++++++++++++++++++++++++++++++++-------
+ 1 file changed, 32 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c
+index 4d163e239105..f0de4ae8360e 100644
+--- a/drivers/acpi/acpi_processor.c
++++ b/drivers/acpi/acpi_processor.c
+@@ -617,25 +617,50 @@ static acpi_status __init acpi_processor_ids_walk(acpi_handle handle,
+ void **rv)
+ {
+ acpi_status status;
++ acpi_object_type acpi_type;
++ unsigned long long uid;
+ union acpi_object object = { 0 };
+ struct acpi_buffer buffer = { sizeof(union acpi_object), &object };
+
+- status = acpi_evaluate_object(handle, NULL, NULL, &buffer);
++ status = acpi_get_type(handle, &acpi_type);
+ if (ACPI_FAILURE(status))
+- acpi_handle_info(handle, "Not get the processor object\n");
+- else
+- processor_validated_ids_update(object.processor.proc_id);
++ return false;
++
++ switch (acpi_type) {
++ case ACPI_TYPE_PROCESSOR:
++ status = acpi_evaluate_object(handle, NULL, NULL, &buffer);
++ if (ACPI_FAILURE(status))
++ goto err;
++ uid = object.processor.proc_id;
++ break;
++
++ case ACPI_TYPE_DEVICE:
++ status = acpi_evaluate_integer(handle, "_UID", NULL, &uid);
++ if (ACPI_FAILURE(status))
++ goto err;
++ break;
++ default:
++ goto err;
++ }
++
++ processor_validated_ids_update(uid);
++ return true;
++
++err:
++ acpi_handle_info(handle, "Invalid processor object\n");
++ return false;
+
+- return AE_OK;
+ }
+
+-static void __init acpi_processor_check_duplicates(void)
++void __init acpi_processor_check_duplicates(void)
+ {
+- /* Search all processor nodes in ACPI namespace */
++ /* check the correctness for all processors in ACPI namespace */
+ acpi_walk_namespace(ACPI_TYPE_PROCESSOR, ACPI_ROOT_OBJECT,
+ ACPI_UINT32_MAX,
+ acpi_processor_ids_walk,
+ NULL, NULL, NULL);
++ acpi_get_devices(ACPI_PROCESSOR_DEVICE_HID, acpi_processor_ids_walk,
++ NULL, NULL);
+ }
+
+ bool __init acpi_processor_validate_proc_id(int proc_id)
diff --git a/patches.suse/x86-acpi-Restore-the-order-of-CPU-IDs.patch b/patches.suse/x86-acpi-Restore-the-order-of-CPU-IDs.patch
new file mode 100644
index 0000000000..4579b94103
--- /dev/null
+++ b/patches.suse/x86-acpi-Restore-the-order-of-CPU-IDs.patch
@@ -0,0 +1,103 @@
+From 713fd5425c0fb575f09b4b96a3f48d91417b2ef2 Mon Sep 17 00:00:00 2001
+From: Dou Liyang <douly.fnst@cn.fujitsu.com>
+Date: Fri, 3 Mar 2017 16:02:25 +0800
+Subject: [PATCH] x86/acpi: Restore the order of CPU IDs
+
+References: bnc#1056230
+Patch-mainline: v4.11
+Git-commit: 2b85b3d22920db7473e5fed5719e7955c0ec323e
+
+The following commits:
+
+ f7c28833c2 ("x86/acpi: Enable acpi to register all possible cpus at
+boot time") and 8f54969dc8 ("x86/acpi: Introduce persistent storage
+for cpuid <-> apicid mapping")
+
+... registered all the possible CPUs at boot time via ACPI tables to
+make the mapping of cpuid <-> apicid fixed. Both enabled and disabled
+CPUs could have a logical CPU ID after boot time.
+
+But, ACPI tables are unreliable. the number amd order of Local APIC
+entries which depends on the firmware is often inconsistent with the
+physical devices. Even if they are consistent, The disabled CPUs which
+take up some logical CPU IDs will also make the order discontinuous.
+
+Revert the part of disabled CPUs registration, keep the allocation
+logic of logical CPU IDs and also keep some code location changes.
+
+Signed-off-by: Dou Liyang <douly.fnst@cn.fujitsu.com>
+Tested-by: Xiaolong Ye <xiaolong.ye@intel.com>
+Cc: rjw@rjwysocki.net
+Cc: linux-acpi@vger.kernel.org
+Cc: guzheng1@huawei.com
+Cc: izumi.taku@jp.fujitsu.com
+Cc: lenb@kernel.org
+Link: http://lkml.kernel.org/r/1488528147-2279-4-git-send-email-douly.fnst@cn.fujitsu.com
+Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
+Signed-off-by: Mel Gorman <mgorman@suse.de>
+---
+ arch/x86/kernel/acpi/boot.c | 7 ++++++-
+ arch/x86/kernel/apic/apic.c | 18 ++++--------------
+ 2 files changed, 10 insertions(+), 15 deletions(-)
+
+diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
+index 782b281eecba..0cc633307099 100644
+--- a/arch/x86/kernel/acpi/boot.c
++++ b/arch/x86/kernel/acpi/boot.c
+@@ -174,10 +174,15 @@ static int acpi_register_lapic(int id, u8 enabled)
+ return -EINVAL;
+ }
+
++ if (!enabled) {
++ ++disabled_cpus;
++ return -EINVAL;
++ }
++
+ if (boot_cpu_physical_apicid != -1U)
+ ver = apic_version[boot_cpu_physical_apicid];
+
+- return __generic_processor_info(id, ver, enabled);
++ return generic_processor_info(id, ver);
+ }
+
+ static int __init
+diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
+index 1db8b5ec2570..6249c331a677 100644
+--- a/arch/x86/kernel/apic/apic.c
++++ b/arch/x86/kernel/apic/apic.c
+@@ -2047,7 +2047,7 @@ static int allocate_logical_cpuid(int apicid)
+ return nr_logical_cpuids++;
+ }
+
+-int __generic_processor_info(int apicid, int version, bool enabled)
++int generic_processor_info(int apicid, int version)
+ {
+ int cpu, max = nr_cpu_ids;
+ bool boot_cpu_detected = physid_isset(boot_cpu_physical_apicid,
+@@ -2162,23 +2162,13 @@ int __generic_processor_info(int apicid, int version, bool enabled)
+ apic->x86_32_early_logical_apicid(cpu);
+ #endif
+ set_cpu_possible(cpu, true);
+-
+- if (enabled) {
+- num_processors++;
+- physid_set(apicid, phys_cpu_present_map);
+- set_cpu_present(cpu, true);
+- } else {
+- disabled_cpus++;
+- }
++ physid_set(apicid, phys_cpu_present_map);
++ set_cpu_present(cpu, true);
++ num_processors++;
+
+ return cpu;
+ }
+
+-int generic_processor_info(int apicid, int version)
+-{
+- return __generic_processor_info(apicid, version, true);
+-}
+-
+ int hard_smp_processor_id(void)
+ {
+ return read_apic_id();
diff --git a/patches.suse/x86-cpu-Remove-unused-and-undefined-__generic_processor_info-declaration.patch b/patches.suse/x86-cpu-Remove-unused-and-undefined-__generic_processor_info-declaration.patch
new file mode 100644
index 0000000000..fa0556eb34
--- /dev/null
+++ b/patches.suse/x86-cpu-Remove-unused-and-undefined-__generic_processor_info-declaration.patch
@@ -0,0 +1,43 @@
+From b711bc8df04935820387526faa25666b62fc5412 Mon Sep 17 00:00:00 2001
+From: Dou Liyang <douly.fnst@cn.fujitsu.com>
+Date: Mon, 11 Sep 2017 11:43:23 +0800
+Subject: [PATCH] x86/cpu: Remove unused and undefined
+ __generic_processor_info() declaration
+
+References: bnc#1056230
+Patch-mainline: v4.14
+Git-commit: e2329b4252f373c244e75928be38bf1dd45b35da
+
+The following revert:
+
+ 2b85b3d22920 ("x86/acpi: Restore the order of CPU IDs")
+
+... got rid of __generic_processor_info(), but forgot to remove its
+declaration in mpspec.h.
+
+Remove the declaration and update the comments as well.
+
+Signed-off-by: Dou Liyang <douly.fnst@cn.fujitsu.com>
+Cc: Linus Torvalds <torvalds@linux-foundation.org>
+Cc: Peter Zijlstra <peterz@infradead.org>
+Cc: Thomas Gleixner <tglx@linutronix.de>
+Cc: lenb@kernel.org
+Link: http://lkml.kernel.org/r/1505101403-29100-1-git-send-email-douly.fnst@cn.fujitsu.com
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Signed-off-by: Mel Gorman <mgorman@suse.de>
+---
+ arch/x86/include/asm/mpspec.h | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/arch/x86/include/asm/mpspec.h b/arch/x86/include/asm/mpspec.h
+index db902d878aca..b07233b64578 100644
+--- a/arch/x86/include/asm/mpspec.h
++++ b/arch/x86/include/asm/mpspec.h
+@@ -86,7 +86,6 @@ static inline void early_reserve_e820_mpc_new(void) { }
+ #endif
+
+ int generic_processor_info(int apicid, int version);
+-int __generic_processor_info(int apicid, int version, bool enabled);
+
+ #define PHYSID_ARRAY_SIZE BITS_TO_LONGS(MAX_LOCAL_APIC)
+
diff --git a/series.conf b/series.conf
index 1172aaffb2..d0168a5229 100644
--- a/series.conf
+++ b/series.conf
@@ -3053,12 +3053,16 @@
patches.arch/0002-x86-acpi-Enable-acpi-to-register-all-possible-cpus-a.patch
patches.arch/0003-x86-acpi-Introduce-persistent-storage-for-cpuid-apic.patch
patches.fixes/x86-acpi-Prevent-LAPIC-id-0xff-from-being-accounted.patch
- patches.fixes/x86-apic-Prevent-pointless-warning-messages.patch
+
+ # Note that these are partially reverted later and redone due to bnc#1056230
+ # It's much later in the series due to the number of dependant patches that
+ # affect this area.
patches.arch/0004-x86-acpi-Enable-MADT-APIs-to-return-disabled-apicids.patch
patches.arch/0005-x86-acpi-Set-persistent-cpuid-nodeid-mapping-when-bo.patch
patches.fixes/acpi-Fix-broken-error-check-in-map_processor.patch
patches.arch/0006-acpi-Provide-mechanism-to-validate-processors-in-the.patch
patches.arch/0007-acpi-Validate-processor-id-when-mapping-the-processo.patch
+
# Memory hotplug patches for Hueawei KunLun
patches.suse/0002-mm-memory_hotplug-use-node-instead-of-zone-in-can_on.patch
patches.suse/0003-mm-drop-page_initialized-check-from-get_nid_for_pfn.patch
@@ -3233,6 +3237,14 @@
patches.arch/arm64-acpi-add-acpi-on-cmdline-option-to-prefer-ACPI.patch
+ # bnc#1056230
+ patches.suse/Revert-x86-acpi-Set-persistent-cpuid-nodeid-mapping-when-booting.patch
+ patches.suse/Revert-x86-acpi-Enable-MADT-APIs-to-return-disabled-apicids.patch
+ patches.suse/x86-acpi-Restore-the-order-of-CPU-IDs.patch
+ patches.suse/acpi-processor-Implement-DEVICE-operator-for-processor-enumeration.patch
+ patches.suse/acpi-processor-Check-for-duplicate-processor-ids-at-hotplug-time.patch
+ patches.suse/x86-cpu-Remove-unused-and-undefined-__generic_processor_info-declaration.patch
+
# RPi3 sdio / wifi support
patches.drivers/0001-dt-bindings-Add-binding-for-brcm-bcm2835-sdhost.patch
patches.drivers/0002-mmc-bcm2835-sdhost-Add-new-driver-for-the-internal-S.patch
@@ -3831,6 +3843,8 @@
patches.fixes/l2tp-fix-race-in-l2tp_recv_common.patch
patches.fixes/bonding-avoid-defaulting-hard_header_len-to-ETH_HLEN.patch
patches.fixes/af_key-fix-slab-out-of-bounds-in-pfkey_compile_policy.patch
+ patches.fixes/packet-hold-bind-lock-when-rebinding-to-fanout-hook.patch
+ patches.fixes/packet-in-packet_do_bind-test-fanout-with-bind_lock-.patch
########################################################
# Netfilter
@@ -5923,6 +5937,9 @@
patches.fixes/scsi_transport_fc-Also-check-for-NOTPRESENT-in-fc_re.patch
patches.fixes/scsi_transport_fc-set-scsi_target_id-upon-rescan.patch
patches.fixes/scsi-fixup-kernel-warning-during-rmmod.patch
+ patches.fixes/scsi-sg-close-race-condition-in-sg_remove_sfp_userco.patch
+ patches.fixes/scsi-sg-don-t-return-bogus-Sg_requests.patch
+ patches.fixes/scsi-sg-only-check-for-dxfer_len-greater-than-256M.patch
# ATA update
patches.drivers/ata-0001-ahci-per-port-msix-support.patch