Bug 1061396 - kernel 4.11 and higher fails boot on amd geode CPU
kernel 4.11 and higher fails boot on amd geode CPU
Status: RESOLVED FIXED
Classification: openSUSE
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Kernel
Current
i586 Other
: P5 - None : Normal (vote)
: ---
Assigned To: Borislav Petkov
E-mail List
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-10-03 09:25 UTC by Sven Glodowski
Modified: 2017-10-19 11:28 UTC (History)
2 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
config taken from /proc/config.gz (189.68 KB, text/x-mpsub)
2017-10-07 09:01 UTC, Sven Glodowski
Details
dmesg from last running TW kernel (25.05 KB, text/plain)
2017-10-07 09:02 UTC, Sven Glodowski
Details
cpuinfo (793 bytes, text/plain)
2017-10-07 09:06 UTC, Sven Glodowski
Details
test patch (650 bytes, patch)
2017-10-07 09:51 UTC, Borislav Petkov
Details | Diff
test2.patch (869 bytes, patch)
2017-10-07 09:54 UTC, Borislav Petkov
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sven Glodowski 2017-10-03 09:25:49 UTC
New microcode update causes reset loop on AMD Geode CPU, 
even if disabled with CMDLINE option "dis_ucode_ldr".

Reason:
  on file "/arch/x86/kernel/cpu/microcode/core.c"
  fuction "check_loader_disabled_bsp(void)"  

  CMD line option checked after CPU type detection.
  New CPU type detection of 4.11 triggers CPU reset on GEODE.

  Order for chekking is microcode update possiblity needs to be changed, 
  CMD line need to bechecked at first:

File: "/arch/x86/kernel/cpu/microcode/core.c"

static bool __init check_loader_disabled_bsp(void)
{
	static const char *__dis_opt_str = "dis_ucode_ldr";

#ifdef CONFIG_X86_32
	const char *cmdline = (const char *)__pa_nodebug(boot_command_line);
	const char *option  = (const char *)__pa_nodebug(__dis_opt_str);
	bool *res = (bool *)__pa_nodebug(&dis_ucode_ldr);

#else /* CONFIG_X86_64 */
	const char *cmdline = boot_command_line;
	const char *option  = __dis_opt_str;
	bool *res = &dis_ucode_ldr;
#endif

+	if (cmdline_find_option_bool(cmdline, option) > 0)
+		return *res;

	if (!have_cpuid_p())
		return *res;

	/*
	 * CPUID(1).ECX[31]: reserved for hypervisor use. This is still not
	 * completely accurate as xen pv guests don't see that CPUID bit set but
	 * that's good enough as they don't land on the BSP path anyway.
	 */
	if (native_cpuid_ecx(1) & BIT(31))
		return *res;

	if (x86_cpuid_vendor() == X86_VENDOR_AMD) {
		if (amd_check_current_patch_level())
			return *res;
	}

-	if (cmdline_find_option_bool(cmdline, option) <= 0)
-		*res = false;
+	*res = false;

	return *res;
}
Comment 1 Borislav Petkov 2017-10-05 11:57:15 UTC
Can you upload

- kernel .config
- dmesg from a working kernel
- /proc/cpuinfo

pls?

Thx.
Comment 2 Sven Glodowski 2017-10-07 09:01:06 UTC
Created attachment 743455 [details]
config taken from /proc/config.gz
Comment 3 Sven Glodowski 2017-10-07 09:02:47 UTC
Created attachment 743456 [details]
dmesg from last running TW kernel
Comment 4 Sven Glodowski 2017-10-07 09:06:44 UTC
Created attachment 743457 [details]
cpuinfo
Comment 5 Sven Glodowski 2017-10-07 09:26:16 UTC
Disabling ucode with .config & "make rpm" results working kernel.
changing ucode code and "make rpm" results working kernel too.

Both makes DVB-Driver broken so system is unusable for me.
It seems "make rpm" kernels differs from Kernel-Buil of Opensuse.

Relating Kernel logs new AMD CPUs require new CPU type detection on ucode loader.

For generic kernels easiest solution would be to make behaviour identical of 
.config "# CONFIG_MICROCODE is not set" and cmdline "dis_ucode_ldr" 

For me it's useless to detect CPU type even when ucode disabled with cmdline.

Same can be happen with next-next intel CPU so this looks like an generic kernel bug of implemetation "cmdline dis_ucode_ldr" feature.

rgs
Comment 6 Borislav Petkov 2017-10-07 09:51:40 UTC
Created attachment 743458 [details]
test patch
Comment 7 Borislav Petkov 2017-10-07 09:54:46 UTC
Created attachment 743459 [details]
test2.patch
Comment 8 Borislav Petkov 2017-10-07 09:55:17 UTC
Does this test2.patch fix it?
Comment 9 Sven Glodowski 2017-10-08 21:01:20 UTC
(In reply to Borislav Petkov from comment #8)
> Does this test2.patch fix it?

It works! 

AMD Geode LX System boots.
Even with microcode loadig enabled on .config and cmdline.

used git kernel-source stable v4.10.13 

(DVB-T2 works, mn88473 v4.11-v4.13 driver always writes PLP-filter value
 which wasn't konfigured on tvheadend)

Many thanks.
Comment 10 Sven Glodowski 2017-10-08 21:03:14 UTC
(In reply to Borislav Petkov from comment #8)
> Does this test2.patch fix it?

It works! 

AMD Geode LX System boots.
Even with microcode loadig enabled on .config and cmdline.

used git kernel-source stable v4.13.4-1

(DVB-T2 works, mn88473 v4.11-v4.13 driver always writes PLP-filter value
 which wasn't konfigured on tvheadend)

Many thanks.
Comment 11 Borislav Petkov 2017-10-10 07:20:13 UTC
Can you try the kernel here please:

http://beta.suse.com/private/bpetkov/tw/

with the official fix?

Thx.
Comment 12 Sven Glodowski 2017-10-11 20:57:47 UTC
(In reply to Borislav Petkov from comment #11)
> Can you try the kernel here please:
> 
> http://beta.suse.com/private/bpetkov/tw/
> 
> with the official fix?
> 
> Thx.
It's a 32 Bit system ... on Your site are only 64 Bit kernels.
Comment 13 Borislav Petkov 2017-10-11 21:32:27 UTC
(In reply to Sven Glodowski from comment #12)
> It's a 32 Bit system ... on Your site are only 64 Bit kernels.

Whoops, just added i586 and i686 flavors.
Comment 14 Sven Glodowski 2017-10-11 22:13:44 UTC
(In reply to Borislav Petkov from comment #13)
> (In reply to Sven Glodowski from comment #12)
> > It's a 32 Bit system ... on Your site are only 64 Bit kernels.
> 
> Whoops, just added i586 and i686 flavors.

i586 kernel Works fine!

# uname -a
Linux alix 4.13.5-1.g330779d-default #1 SMP Mon Oct 9 20:53:29 UTC 2017 (330779d) i586 i586 i386 GNU/Linux

# cat /proc/cmdline
BOOT_IMAGE=/boot/vmlinuz-4.13.5-1.g330779d-default root=UUID=7a5f776f-0c9a-4172-a00e-45b799ae582f console=ttyS0,38400n8 resume=/dev/disk/by-uuid/6db5e3fd-6b00-49ed-a2c6-78ca430a4a1a acpi=off libata.force=short40c splash=silent quiet showopts

Many Thanks.
Comment 15 Borislav Petkov 2017-10-11 22:30:18 UTC
(In reply to Sven Glodowski from comment #14)
> i586 kernel Works fine!

Good, thanks for testing.

I'll add your Tested-by to the fix.

(Clean up stale NEEDINFO, while at it.)
Comment 16 Borislav Petkov 2017-10-19 11:28:49 UTC
Ok, fix is in 4.13.8 and in:

http://kernel.suse.com/packages/stable

Closing.