Skip to contentSkip to conversation

+ x86-export-x86-boot_params-to-sysfs.patch added to -mm tree

PATCH [email protected] 1 participant 1 message Dec 10, 2013 x86

lore
Share & tools
lore
#0 lore raw

Subject: + x86-export-x86-boot_params-to-sysfs.patch added to -mm tree
To: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected]
From: [email protected]
Date: Tue, 10 Dec 2013 15:23:26 -0800

The patch titled
Subject: x86: export x86 boot_params to sysfs
has been added to the -mm tree. Its filename is

     x86-export-x86-boot_params-to-sysfs.patch

This patch should soon appear at

    http://ozlabs.org/~akpm/mmots/broken-out/x86-export-x86-boot_params-to-sysfs.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/x86-export-x86-boot_params-to-sysfs.patch

Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated there every 3-4 working days

------------------------------------------------------
From: Dave Young <[email protected]>
Subject: x86: export x86 boot_params to sysfs

kexec-tools use boot_params for getting the 1st kernel hardware_subarch, the kexec kernel efi runtime support also need read the old efi_info from boot_params. Currently it exists in debugfs which is not a good place for such infomation. Per HPA, we should avoid of "sploit debugfs".

In this patch /sys/kernel/boot_params are exported, also the setup_data is exported as a subdirectory. kexec-tools is using debugfs for hardware_subarch for a long time now so we're not removing it yet.

Structure is like below:

/sys/kernel/boot_params

|__ data                /* boot_params in binary*/
|__ setup_data
|   |__ 0               /* the first setup_data node */
|   |   |__ data        /* setup_data node 0 in binary*/
|   |   |__ type        /* setup_data type of setup_data node 0, hex string */

[snip]
|__ version /* boot protocal version (in hex, "0x" prefixed)*/

Cc "Eric W. Biederman" <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc Greg KH <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc James Bottomley <[email protected]>
Cc Matt Fleming <[email protected]>
Cc Matthew Garrett <[email protected]>
Cc Simon Horman <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Toshi Kani <[email protected]>
Cc Vivek Goyal <[email protected]>

---

 Documentation/ABI/testing/sysfs-kernel-boot_params |   39 +
 arch/x86/kernel/Makefile                           |    1 
 arch/x86/kernel/ksysfs.c                           |  339 +++++++++++
 3 files changed, 379 insertions(+)
Documentation/ABI/testing/sysfs-kernel-boot_params new file +39 -0
diff -puN /dev/null Documentation/ABI/testing/sysfs-kernel-boot_params
@@ -0,0 +1,39 @@
+What:		/sys/kernel/boot_params
+Date:		December 2013
+Contact:	Dave Young <[email protected]>
+Description:
+		The /sys/kernel/boot_params directory contains two
+		files: "data" and "version" and one subdirectory "setup_data".
+		It is used to export the kernel boot parameters of an x86
+		platform to userspace for kexec and debugging purpose.
+
+		If there's no setup_data in boot_params the subdirectory will
+		not be created.
+
+		"data" file is the binary representation of struct boot_params.
+
+		"version" file is the string representation of boot
+		protocol version.
+
+		"setup_data" subdirectory contains the setup_data data
+		structure in boot_params. setup_data is maintained in kernel
+		as a link list. In "setup_data" subdirectory there's one
+		subdirectory for each link list node named with the number
+		of the list nodes. The list node subdirectory contains two
+		files "type" and "data". "type" file is the string
+		representation of setup_data type. "data" file is the binary
+		representation of setup_data payload.
+
+		The whole boot_params directory structure is like below:
+		/sys/kernel/boot_params
+		|__ data
+		|__ setup_data
+		|   |__ 0
+		|   |   |__ data
+		|   |   |__ type
+		|   |__ 1
+		|       |__ data
+		|       |__ type
+		|__ version
+
+Users:		Kexec
arch/x86/kernel/Makefile renamed from arch/x86/kernel/Makefile~x86-export-x86-boot_params-to-sysfs +1 -0
diff -puN arch/x86/kernel/Makefile~x86-export-x86-boot_params-to-sysfs arch/x86/kernel/Makefile
@@ -29,6 +29,7 @@ obj-$(CONFIG_X86_64)	+= sys_x86_64.o x86
 obj-y			+= syscall_$(BITS).o
 obj-$(CONFIG_X86_64)	+= vsyscall_64.o
 obj-$(CONFIG_X86_64)	+= vsyscall_emu_64.o
+obj-$(CONFIG_SYSFS)	+= ksysfs.o
 obj-y			+= bootflag.o e820.o
 obj-y			+= pci-dma.o quirks.o topology.o kdebugfs.o
 obj-y			+= alternative.o i8253.o pci-nommu.o hw_breakpoint.o
arch/x86/kernel/ksysfs.c new file +339 -0

339 lines not on this page · raw message

_

Patches currently in -mm which might be from [email protected] are

kexec-migrate-to-reboot-cpu.patch x86-mm-sparse-warning-fix-for-early_memremap.patch efi-use-early_memremap-and-early_memunmap.patch efi-remove-unused-variables-in-__map_region.patch efi-add-a-wrapper-function-efi_map_region_fixed.patch efi-reserve-boot-service-fix.patch efi-cleanup-efi_enter_virtual_mode-function.patch efi-export-more-efi-table-variable-to-sysfs.patch efi-export-efi-runtime-memory-mapping-to-sysfs.patch efi-pass-kexec-necessary-efi-data-via-setup_data.patch efi-only-print-saved-efi-runtime-maps-instead-of-all-memmap-ranges-for-kexec.patch x86-add-xloadflags-bit-for-efi-runtime-support-on-kexec.patch x86-export-x86-boot_params-to-sysfs.patch x86-reserve-setup_data-ranges-late-after-parsing-memmap-cmdline.patch x86-kdebugfs-do-not-use-__va-for-getting-setup_data-virt-addr.patch