lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140826090641.GA16550@darkstar.nay.redhat.com>
Date:	Tue, 26 Aug 2014 17:06:41 +0800
From:	Dave Young <dyoung@...hat.com>
To:	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>,
	"H. Peter Anvin" <hpa@...or.com>, x86@...nel.org,
	Andrew Morton <akpm@...ux-foundation.org>,
	matt.fleming@...el.com, linux-efi@...r.kernel.org,
	linux-acpi@...r.kernel.org, linux-kernel@...r.kernel.org,
	devel@...ica.org, lenb@...nel.org, rafael.j.wysocki@...el.com,
	robert.moore@...el.com
Subject: [PATCH RFC] x86 early_ioremap: increase FIX_BTMAPS_SLOTS to 8

3.16 kernel boot fail with earlyprintk=efi, it keeps scrolling at the
bottom line of screen.

Bisected, the first bad commit is below:
commit 86dfc6f339886559d80ee0d4bd20fe5ee90450f0
Author: Lv Zheng <lv.zheng@...el.com>
Date:   Fri Apr 4 12:38:57 2014 +0800

    ACPICA: Tables: Fix table checksums verification before installation.


I did some debugging by enabling both serial and efi earlyprintk, below is
some debug dmesg, seems early_ioremap fails in scroll up function due to
no free slot, see below dmesg output:

[snip]
[    0.000000] RAMDISK: [mem 0x3e1b0000-0x3e982fff]
[    0.000000] ACPI: Early table checksum verification disabled
[    0.000000] ACPI: RSDP 0x00000000DB752000 000024 (v02 HPQOEM)
[    0.000000] ACPI: XSDT 0x00000000DB752088 00008C (v01 HPQOEM SLIC-WKS 01072009 AMI  00010013)
[    0.000000] ACPI: FACP 0x00000000DB759590 00010C (v05 HPQOEM SLIC-WKS 01072009 AMI  00010013)
[    0.000000] ------------[ cut here ]------------
[    0.000000] WARNING: CPU: 0 PID: 0 at mm/early_ioremap.c:116 __early_ioremap+0x90/0x1c4()
[    0.000000] __early_ioremap(ed00c800, 00000c80) not found slot
[    0.000000] Modules linked in:
[    0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 3.17.0-rc1+ #204
[    0.000000] Hardware name: Hewlett-Packard HP Z420 Workstation/1589, BIOS J61 v03.15 05/09/2013
[    0.000000]  0000000000000000 ffffffff8173b970 ffffffff814bb919 ffffffff8173b9b8
[    0.000000]  ffffffff8173b9a8 ffffffff810638c9 ffffffff8184ee81 ffffffffff538000
[    0.000000]  0000000000000c80 0000000000000003 0000000000000c80 ffffffff8173ba08
[    0.000000] Call Trace:
[    0.000000]  [<ffffffff814bb919>] dump_stack+0x4e/0x7a
[    0.000000]  [<ffffffff810638c9>] warn_slowpath_common+0x75/0x8e
[    0.000000]  [<ffffffff8184ee81>] ? __early_ioremap+0x90/0x1c4
[    0.000000]  [<ffffffff81063929>] warn_slowpath_fmt+0x47/0x49
[    0.000000]  [<ffffffff8184ee81>] __early_ioremap+0x90/0x1c4
[    0.000000]  [<ffffffff8124cf4d>] ? sprintf+0x46/0x48
[    0.000000]  [<ffffffff8184f169>] early_ioremap+0x13/0x15
[    0.000000]  [<ffffffff814ae4f0>] early_efi_map+0x24/0x26
[    0.000000]  [<ffffffff81060985>] early_efi_scroll_up+0x6d/0xc0
[    0.000000]  [<ffffffff81060b88>] early_efi_write+0x1b0/0x214
[    0.000000]  [<ffffffff8109ec3a>] call_console_drivers.constprop.21+0x73/0x7e
[    0.000000]  [<ffffffff8109fab4>] console_unlock+0x151/0x3b2
[    0.000000]  [<ffffffff810a01b4>] ? vprintk_emit+0x49f/0x532
[    0.000000]  [<ffffffff810a0236>] vprintk_emit+0x521/0x532
[    0.000000]  [<ffffffff8109fce6>] ? console_unlock+0x383/0x3b2
[    0.000000]  [<ffffffff814b6f01>] printk+0x4f/0x51
[    0.000000]  [<ffffffff81292f9c>] acpi_os_vprintf+0x2b/0x2d
[    0.000000]  [<ffffffff81292fe1>] acpi_os_printf+0x43/0x45
[    0.000000]  [<ffffffff812bc44c>] acpi_info+0x5c/0x63
[    0.000000]  [<ffffffff8183cdfa>] ? __acpi_map_table+0x13/0x18
[    0.000000]  [<ffffffff814afc88>] ? acpi_os_map_iomem+0x21/0x147
[    0.000000]  [<ffffffff812b7e59>] acpi_tb_print_table_header+0x177/0x186
[    0.000000]  [<ffffffff812b79da>] acpi_tb_install_table_with_override+0x4b/0x62
[    0.000000]  [<ffffffff812b7b80>] acpi_tb_install_standard_table+0xd9/0x215
[    0.000000]  [<ffffffff8184f169>] ? early_ioremap+0x13/0x15
[    0.000000]  [<ffffffff8183cdfa>] ? __acpi_map_table+0x13/0x18
[    0.000000]  [<ffffffff81857545>] acpi_tb_parse_root_table+0x16e/0x1b4
[    0.000000]  [<ffffffff818575e2>] acpi_initialize_tables+0x57/0x59
[    0.000000]  [<ffffffff8185591d>] acpi_table_init+0x50/0xce
[    0.000000]  [<ffffffff8183cea2>] acpi_boot_table_init+0x1e/0x85
[    0.000000]  [<ffffffff81834638>] setup_arch+0x9b7/0xcc4
[    0.000000]  [<ffffffff81830b3e>] start_kernel+0x94/0x42d
[    0.000000]  [<ffffffff81830120>] ? early_idt_handlers+0x120/0x120
[    0.000000]  [<ffffffff818304a2>] x86_64_start_reservations+0x2a/0x2c
[    0.000000]  [<ffffffff81830597>] x86_64_start_kernel+0xf3/0x100
[    0.000000] ---[ end trace 48732c7db414b8fe ]---
[    0.000000] ------------[ cut here ]------------
[    0.000000] WARNING: CPU: 0 PID: 0 at mm/early_ioremap.c:116 __early_ioremap+0x90/0x1c4()
[    0.000000] __early_ioremap(ed00c800, 00000c80) not found slot
[    0.000000] Modules linked in:
[    0.000000] CPU: 0 PID: 0 Comm: swapper Tainted: G        W      3.17.0-rc1+ #204
[    0.000000] Hardware name: Hewlett-Packard HP Z420 Workstation/1589, BIOS J61 v03.15 05/09/2013
[    0.000000]  0000000000000000 ffffffff8173b970 ffffffff814bb919 ffffffff8173b9b8
[    0.000000]  ffffffff8173b9a8 ffffffff810638c9 ffffffff8184ee81 ffffffffff538000
[    0.000000]  0000000000000c80 0000000000000003 0000000000000c80 ffffffff8173ba08
[    0.000000] Call Trace:
[    0.000000]  [<ffffffff814bb919>] dump_stack+0x4e/0x7a
[    0.000000]  [<ffffffff810638c9>] warn_slowpath_common+0x75/0x8e
[    0.000000]  [<ffffffff8184ee81>] ? __early_ioremap+0x90/0x1c4
[    0.000000]  [<ffffffff81063929>] warn_slowpath_fmt+0x47/0x49
[    0.000000]  [<ffffffff8184ee81>] __early_ioremap+0x90/0x1c4
[    0.000000]  [<ffffffff8184f169>] early_ioremap+0x13/0x15
[    0.000000]  [<ffffffff814ae4f0>] early_efi_map+0x24/0x26
[    0.000000]  [<ffffffff81060985>] early_efi_scroll_up+0x6d/0xc0
[    0.000000]  [<ffffffff81060b88>] early_efi_write+0x1b0/0x214
[    0.000000]  [<ffffffff8109ec3a>] call_console_drivers.constprop.21+0x73/0x7e
[    0.000000]  [<ffffffff8109fb5d>] console_unlock+0x1fa/0x3b2
[    0.000000]  [<ffffffff810a0236>] vprintk_emit+0x521/0x532
[    0.000000]  [<ffffffff8109fce6>] ? console_unlock+0x383/0x3b2
[    0.000000]  [<ffffffff814b6f01>] printk+0x4f/0x51
[    0.000000]  [<ffffffff81292f9c>] acpi_os_vprintf+0x2b/0x2d
[    0.000000]  [<ffffffff81292fe1>] acpi_os_printf+0x43/0x45
[    0.000000]  [<ffffffff812bc44c>] acpi_info+0x5c/0x63
[    0.000000]  [<ffffffff8183cdfa>] ? __acpi_map_table+0x13/0x18
[    0.000000]  [<ffffffff814afc88>] ? acpi_os_map_iomem+0x21/0x147
[    0.000000]  [<ffffffff812b7e59>] acpi_tb_print_table_header+0x177/0x186
[    0.000000]  [<ffffffff812b79da>] acpi_tb_install_table_with_override+0x4b/0x62
[    0.000000]  [<ffffffff812b7b80>] acpi_tb_install_standard_table+0xd9/0x215
[    0.000000]  [<ffffffff8184f169>] ? early_ioremap+0x13/0x15
[    0.000000]  [<ffffffff8183cdfa>] ? __acpi_map_table+0x13/0x18
[    0.000000]  [<ffffffff81857545>] acpi_tb_parse_root_table+0x16e/0x1b4
[    0.000000]  [<ffffffff818575e2>] acpi_initialize_tables+0x57/0x59
[    0.000000]  [<ffffffff8185591d>] acpi_table_init+0x50/0xce
[    0.000000]  [<ffffffff8183cea2>] acpi_boot_table_init+0x1e/0x85
[    0.000000]  [<ffffffff81834638>] setup_arch+0x9b7/0xcc4
[    0.000000]  [<ffffffff81830b3e>] start_kernel+0x94/0x42d
[    0.000000]  [<ffffffff81830120>] ? early_idt_handlers+0x120/0x120
[    0.000000]  [<ffffffff818304a2>] x86_64_start_reservations+0x2a/0x2c


Quote reply from Lv.zheng about the early ioremap slot usage in this case:

"""
In early_efi_scroll_up(), 2 mapping entries will be used for the src/dst screen buffer.
In drivers/acpi/acpica/tbutils.c, we've improved the early table loading code in acpi_tb_parse_root_table().
We now need 2 mapping entries:
1. One mapping entry is used for RSDT table mapping. Each RSDT entry contains an address for another ACPI table.
2. For each entry in RSDP, we need another mapping entry to map the table to perform necessary check/override before installing it.

When acpi_tb_parse_root_table() prints something through EFI earlyprintk console, we'll have 4 mapping entries used.
The current 4 slots setting of early_ioremap() seems to be too small for such a use case.
"""

Thus increase the slot to 8 in this patch to fix this issue.
boot-time mappings become 512 page with this patch.

Signed-off-by: Dave Young <dyoung@...hat.com>
---
I'm not sure if this is ok in 32bit, review and comments are appreciated.
 arch/x86/include/asm/fixmap.h |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Index: linux/arch/x86/include/asm/fixmap.h
===================================================================
--- linux.orig/arch/x86/include/asm/fixmap.h
+++ linux/arch/x86/include/asm/fixmap.h
@@ -106,14 +106,14 @@ enum fixed_addresses {
 	__end_of_permanent_fixed_addresses,
 
 	/*
-	 * 256 temporary boot-time mappings, used by early_ioremap(),
+	 * 512 temporary boot-time mappings, used by early_ioremap(),
 	 * before ioremap() is functional.
 	 *
-	 * If necessary we round it up to the next 256 pages boundary so
+	 * If necessary we round it up to the next 512 pages boundary so
 	 * that we can have a single pgd entry and a single pte table:
 	 */
 #define NR_FIX_BTMAPS		64
-#define FIX_BTMAPS_SLOTS	4
+#define FIX_BTMAPS_SLOTS	8
 #define TOTAL_FIX_BTMAPS	(NR_FIX_BTMAPS * FIX_BTMAPS_SLOTS)
 	FIX_BTMAP_END =
 	 (__end_of_permanent_fixed_addresses ^
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ