Bug#841850: linux-image-4.7.0-1-686_4.7.8-1_i386.deb does not boot on Thinkpad T41
Hi Petra,
On Wed, Oct 26, 2016 at 08:26:32AM +0200, Petra Ruebe-Pugliese wrote:
> Hi,
>
> On Wednesday 26 October 2016 at 07:36:21 +0200 Salvatore Bonaccorso (carnil@debian.org) wrote:
> [...]
> >
> > There seem to be an upstream fix now for this issue:
> >
> > https://git.kernel.org/linus/ff8560512b8d4b7ca3ef4fd69166634ac30b2525
> >
> > Can you by chance confirm that this works as well for you?
>
> Not sure. I am not at all knowledgeable in kernel compilation.
> I did what I did last time by rigorously following the
> explanations on
> https://kernel-handbook.alioth.debian.org/ch-common-tasks.html#s-common-official
>
> So should I start again with the same basic sources as obtained
> by yesterday's "apt-get source linux" and then call
> "bash debian/bin/test-patches ../newpatch"
> where "newpatch" would be a file containing the final lines
> from that webpage, i.e.:
>
> -------------------------snip-------------------------------------
> diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
> index 951f093..42f5eb7 100644
> --- a/arch/x86/kernel/smpboot.c
> +++ b/arch/x86/kernel/smpboot.c
> @@ -1409,15 +1409,17 @@ __init void prefill_possible_map(void)
>
> /* No boot processor was found in mptable or ACPI MADT */
> if (!num_processors) {
> - int apicid = boot_cpu_physical_apicid;
> - int cpu = hard_smp_processor_id();
> + if (boot_cpu_has(X86_FEATURE_APIC)) {
> + int apicid = boot_cpu_physical_apicid;
> + int cpu = hard_smp_processor_id();
>
> - pr_warn("Boot CPU (id %d) not listed by BIOS\n", cpu);
> + pr_warn("Boot CPU (id %d) not listed by BIOS\n", cpu);
>
> - /* Make sure boot cpu is enumerated */
> - if (apic->cpu_present_to_apicid(0) == BAD_APICID &&
> - apic->apic_id_valid(apicid))
> - generic_processor_info(apicid, boot_cpu_apic_version);
> + /* Make sure boot cpu is enumerated */
> + if (apic->cpu_present_to_apicid(0) == BAD_APICID &&
> + apic->apic_id_valid(apicid))
> + generic_processor_info(apicid, boot_cpu_apic_version);
> + }
>
> if (!num_processors)
> num_processors = 1;
> -------------------------snap-------------------------------------
>
> If so, I could start that experiment tonight and have a look
> at the result tomorrow morning.
Yes you can follow the same procedure starting from a new source tree
without the previous applied.
You can get the above patch as well directly via
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/patch/?id=ff8560512b8d4b7ca3ef4fd69166634ac30b2525
so that you don't have to copy paste it from the webpage to a file. It
should apply with only some fuzz to the source.
Thanks a lot for testing,
If it is confirmed, then I can attach the attached changes to the
packaging repository.
Regards,
Salvatore
>From 8b720b82338b2995badbde42b6156b6f8738538b Mon Sep 17 00:00:00 2001
From: Salvatore Bonaccorso <carnil@debian.org>
Date: Wed, 26 Oct 2016 08:14:56 +0200
Subject: [PATCH] [x86] boot/smp: Don't try to poke disabled/non-existent APIC
Closes: #841850
---
debian/changelog | 5 ++
...p-Don-t-try-to-poke-disabled-non-existent.patch | 73 ++++++++++++++++++++++
debian/patches/series | 1 +
3 files changed, 79 insertions(+)
create mode 100644 debian/patches/bugfix/x86/x86-boot-smp-Don-t-try-to-poke-disabled-non-existent.patch
diff --git a/debian/changelog b/debian/changelog
index 7242a7f..c5aef53 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,10 +1,15 @@
linux (4.8.4-1~exp2) UNRELEASED; urgency=medium
+ [ Ben Hutchings ]
* cpufreq: Re-enable CPU_FREQ_STAT, which can no longer be modular
* [armhf] dts: imx53: add support for USB armory board (Closes: #840137)
* kconfig: Renumber SYMBOL_NEW, fixing regression of allnoconfig
(Closes: #841357)
+ [ Salvatore Bonaccorso ]
+ * [x86] boot/smp: Don't try to poke disabled/non-existent APIC
+ (Closes: #841850)
+
-- Ben Hutchings <ben@decadent.org.uk> Mon, 24 Oct 2016 02:25:26 +0100
linux (4.8.4-1~exp1) experimental; urgency=medium
diff --git a/debian/patches/bugfix/x86/x86-boot-smp-Don-t-try-to-poke-disabled-non-existent.patch b/debian/patches/bugfix/x86/x86-boot-smp-Don-t-try-to-poke-disabled-non-existent.patch
new file mode 100644
index 0000000..663982a
--- /dev/null
+++ b/debian/patches/bugfix/x86/x86-boot-smp-Don-t-try-to-poke-disabled-non-existent.patch
@@ -0,0 +1,73 @@
+From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@linux.intel.com>
+Date: Sat, 22 Oct 2016 05:18:04 +0300
+Subject: x86/boot/smp: Don't try to poke disabled/non-existent APIC
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+Origin: https://git.kernel.org/linus/ff8560512b8d4b7ca3ef4fd69166634ac30b2525
+
+Apparently trying to poke a disabled or non-existent APIC
+leads to a box that doesn't even boot. Let's not do that.
+
+No real clue if this is the right fix, but at least my
+P3 machine boots again.
+
+Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
+Cc: Andy Lutomirski <luto@kernel.org>
+Cc: Borislav Petkov <bp@alien8.de>
+Cc: Borislav Petkov <bp@suse.de>
+Cc: Brian Gerst <brgerst@gmail.com>
+Cc: Denys Vlasenko <dvlasenk@redhat.com>
+Cc: Eric Biederman <ebiederm@xmission.com>
+Cc: H. Peter Anvin <hpa@zytor.com>
+Cc: Jiri Olsa <jolsa@redhat.com>
+Cc: Josh Poimboeuf <jpoimboe@redhat.com>
+Cc: Juergen Gross <jgross@suse.com>
+Cc: Len Brown <len.brown@intel.com>
+Cc: Linus Torvalds <torvalds@linux-foundation.org>
+Cc: Peter Zijlstra <peterz@infradead.org>
+Cc: Prarit Bhargava <prarit@redhat.com>
+Cc: Thomas Gleixner <tglx@linutronix.de>
+Cc: Yinghai Lu <yinghai@kernel.org>
+Cc: dyoung@redhat.com
+Cc: kexec@lists.infradead.org
+Cc: stable@vger.kernel.org
+Fixes: 2a51fe083eba ("arch/x86: Handle non enumerated CPU after physical hotplug")
+Link: http://lkml.kernel.org/r/1477102684-5092-1-git-send-email-ville.syrjala@linux.intel.com
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+---
+ arch/x86/kernel/smpboot.c | 16 +++++++++-------
+ 1 file changed, 9 insertions(+), 7 deletions(-)
+
+diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
+index 951f093..42f5eb7 100644
+--- a/arch/x86/kernel/smpboot.c
++++ b/arch/x86/kernel/smpboot.c
+@@ -1409,15 +1409,17 @@ __init void prefill_possible_map(void)
+
+ /* No boot processor was found in mptable or ACPI MADT */
+ if (!num_processors) {
+- int apicid = boot_cpu_physical_apicid;
+- int cpu = hard_smp_processor_id();
++ if (boot_cpu_has(X86_FEATURE_APIC)) {
++ int apicid = boot_cpu_physical_apicid;
++ int cpu = hard_smp_processor_id();
+
+- pr_warn("Boot CPU (id %d) not listed by BIOS\n", cpu);
++ pr_warn("Boot CPU (id %d) not listed by BIOS\n", cpu);
+
+- /* Make sure boot cpu is enumerated */
+- if (apic->cpu_present_to_apicid(0) == BAD_APICID &&
+- apic->apic_id_valid(apicid))
+- generic_processor_info(apicid, boot_cpu_apic_version);
++ /* Make sure boot cpu is enumerated */
++ if (apic->cpu_present_to_apicid(0) == BAD_APICID &&
++ apic->apic_id_valid(apicid))
++ generic_processor_info(apicid, boot_cpu_apic_version);
++ }
+
+ if (!num_processors)
+ num_processors = 1;
+--
+2.10.1
+
diff --git a/debian/patches/series b/debian/patches/series
index 791f1c9..a52dfd7 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -48,6 +48,7 @@ debian/fanotify-taint-on-use-of-fanotify_access_permissions.patch
# Arch bug fixes
bugfix/powerpc/powerpc-xmon-don-t-use-ld-on-32-bit.patch
bugfix/arm64/arm64-mm-limit-task_size_64-for-compatibility.patch
+bugfix/x86/x86-boot-smp-Don-t-try-to-poke-disabled-non-existent.patch
# Arch features
features/mips/MIPS-increase-MAX-PHYSMEM-BITS-on-Loongson-3-only.patch
--
2.10.1
Reply to: