[kernel] Fixup patches

Josh Boyer jwboyer at fedoraproject.org
Mon Jul 30 13:33:38 UTC 2012


commit af258da073d70ddb69fcaf62b667c40ee70950e3
Author: Josh Boyer <jwboyer at redhat.com>
Date:   Mon Jul 30 09:33:20 2012 -0400

    Fixup patches

 ...the-return-value-of-power_supply_register.patch |   37 --
 crypto-aesni-intel-fix-wrong-kfree-pointer.patch   |   45 --
 ...allow-aesni-intel-and-ghash_clmulni-intel.patch |  122 -----
 kernel.spec                                        |   19 +-
 power-x86-destdir.patch                            |    7 +-
 secure-boot-20120724.patch                         |  469 --------------------
 6 files changed, 8 insertions(+), 691 deletions(-)
---
diff --git a/kernel.spec b/kernel.spec
index 8fd9091..b83118c 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -62,7 +62,7 @@ Summary: The Linux kernel
 # For non-released -rc kernels, this will be appended after the rcX and
 # gitX tags, so a 3 here would become part of release "0.rcX.gitX.3"
 #
-%global baserelease 1
+%global baserelease 2
 %global fedora_build %{baserelease}
 
 # base_sublevel is the kernel version we're starting with and patching
@@ -738,13 +738,6 @@ Patch22000: weird-root-dentry-name-debug.patch
 #selinux ptrace child permissions
 Patch22001: selinux-apply-different-permission-to-ptrace-child.patch
 
-#Fix FIPS for aesni hardare
-Patch22050: crypto-testmgr-allow-aesni-intel-and-ghash_clmulni-intel.patch
-Patch22051: crypto-aesni-intel-fix-wrong-kfree-pointer.patch
-
-#rhbz 772730
-Patch22058: ACPI-AC-check-the-return-value-of-power_supply_register.patch
-
 #rhbz 836742
 Patch22059: uvcvideo-Reset-bytesused-field-when-recycling-erroneous-buffer.patch
 
@@ -1431,13 +1424,6 @@ ApplyPatch weird-root-dentry-name-debug.patch
 #selinux ptrace child permissions
 ApplyPatch selinux-apply-different-permission-to-ptrace-child.patch
 
-#Fix FIPS for aesni hardare
-ApplyPatch crypto-testmgr-allow-aesni-intel-and-ghash_clmulni-intel.patch
-ApplyPatch crypto-aesni-intel-fix-wrong-kfree-pointer.patch
-
-#rhbz 772730
-ApplyPatch ACPI-AC-check-the-return-value-of-power_supply_register.patch
-
 #rhbz 836742
 ApplyPatch uvcvideo-Reset-bytesused-field-when-recycling-erroneous-buffer.patch
 
@@ -2298,6 +2284,9 @@ fi
 #                 ||----w |
 #                 ||     ||
 %changelog
+* Mon Jul 30 2012 Josh Boyer <jwboyer at redhat.com>
+- Fixup patches
+
 * Fri Jul 27 2012 Justin M. Forbes <jforbes at redhat.com> - 3.6.0-0.rc0.git3.1
 - Linux v3.5-6982-gb387e41
 
diff --git a/power-x86-destdir.patch b/power-x86-destdir.patch
index 5fb48ac..9766531 100644
--- a/power-x86-destdir.patch
+++ b/power-x86-destdir.patch
@@ -1,13 +1,14 @@
 diff --git a/tools/power/x86/turbostat/Makefile b/tools/power/x86/turbostat/Makefile
-index fd8e1f1..7af5e8c 100644
+index f856495..984cc00 100644
 --- a/tools/power/x86/turbostat/Makefile
 +++ b/tools/power/x86/turbostat/Makefile
-@@ -1,8 +1,10 @@
+@@ -1,3 +1,5 @@
 +DESTDIR ?=
 +
  turbostat : turbostat.c
+ CFLAGS +=	-Wall
  
- clean :
+@@ -5,5 +7,5 @@ clean :
  	rm -f turbostat
  
  install :
diff --git a/secure-boot-20120724.patch b/secure-boot-20120724.patch
index 862e7e0..20898e1 100644
--- a/secure-boot-20120724.patch
+++ b/secure-boot-20120724.patch
@@ -1,472 +1,3 @@
-From 56ce13afe1b17cd2817c596b3a9e25e51937a328 Mon Sep 17 00:00:00 2001
-From: Matt Fleming <matt.fleming at intel.com>
-Date: Thu, 19 Jul 2012 10:23:48 +0100
-Subject: [PATCH 01/14] x86, efi: Handover Protocol
-
-As things currently stand, traditional EFI boot loaders and the EFI
-boot stub are carrying essentially the same initialisation code
-required to setup an EFI machine for booting a kernel. There's really
-no need to have this code in two places and the hope is that, with
-this new protocol, initialisation and booting of the kernel can be
-left solely to the kernel's EFI boot stub. The responsibilities of the
-boot loader then become,
-
-   o Loading the kernel image from boot media
-
-File system code still needs to be carried by boot loaders for the
-scenario where the kernel and initrd files reside on a file system
-that the EFI firmware doesn't natively understand, such as ext4, etc.
-
-   o Providing a user interface
-
-Boot loaders still need to display any menus/interfaces, for example
-to allow the user to select from a list of kernels.
-
-Bump the boot protocol number because we added the 'handover_offset'
-field to indicate the location of the handover protocol entry point.
-
-Cc: H. Peter Anvin <hpa at zytor.com>
-Cc: Matthew Garrett <mjg at redhat.com>
-Cc: Peter Jones <pjones at redhat.com>
-Cc: Ingo Molnar <mingo at kernel.org>
-Signed-off-by: Matt Fleming <matt.fleming at intel.com>
----
- Documentation/x86/boot.txt         |  41 ++++++++
- arch/x86/boot/compressed/eboot.c   | 198 ++++++++++++++++++++++---------------
- arch/x86/boot/compressed/head_32.S |  10 ++
- arch/x86/boot/compressed/head_64.S |  10 ++
- arch/x86/boot/header.S             |   4 +-
- arch/x86/include/asm/bootparam.h   |   1 +
- 6 files changed, 185 insertions(+), 79 deletions(-)
-
-diff --git a/Documentation/x86/boot.txt b/Documentation/x86/boot.txt
-index 7c3a880..c6539a4 100644
---- a/Documentation/x86/boot.txt
-+++ b/Documentation/x86/boot.txt
-@@ -54,6 +54,9 @@ Protocol 2.10:	(Kernel 2.6.31) Added a protocol for relaxed alignment
- 		beyond the kernel_alignment added, new init_size and
- 		pref_address fields.  Added extended boot loader IDs.
- 
-+Protocol 2.11:	(Kernel 3.6) Added a field for offset of EFI handover
-+		protocol entry point.
-+
- **** MEMORY LAYOUT
- 
- The traditional memory map for the kernel loader, used for Image or
-@@ -189,6 +192,7 @@ Offset	Proto	Name		Meaning
- 				of struct setup_data
- 0258/8	2.10+	pref_address	Preferred loading address
- 0260/4	2.10+	init_size	Linear memory required during initialization
-+0264/4	2.11+	handover_offset	Offset of handover entry point
- 
- (1) For backwards compatibility, if the setup_sects field contains 0, the
-     real value is 4.
-@@ -690,6 +694,16 @@ Offset/size:	0x260/4
-   else
- 	runtime_start = pref_address
- 
-+Field name:	handover_offset
-+Type:		read
-+Offset/size:	0x264/4
-+
-+  This field is the offset from the beginning of the kernel image to
-+  the EFI handover protocol entry point. Boot loaders using the EFI
-+  handover protocol to boot the kernel should jump to this offset.
-+
-+  See EFI HANDOVER PROTOCOL below for more details.
-+
- 
- **** THE IMAGE CHECKSUM
- 
-@@ -1010,3 +1024,30 @@ segment; __BOOS_CS must have execute/read permission, and __BOOT_DS
- must have read/write permission; CS must be __BOOT_CS and DS, ES, SS
- must be __BOOT_DS; interrupt must be disabled; %esi must hold the base
- address of the struct boot_params; %ebp, %edi and %ebx must be zero.
-+
-+**** EFI HANDOVER PROTOCOL
-+
-+This protocol allows boot loaders to defer initialisation to the EFI
-+boot stub. The boot loader is required to load the kernel/initrd(s)
-+from the boot media and jump to the EFI handover protocol entry point
-+which is hdr->handover_offset bytes from the beginning of
-+startup_{32,64}.
-+
-+The function prototype for the handover entry point looks like this,
-+
-+    efi_main(void *handle, efi_system_table_t *table, struct boot_params *bp)
-+
-+'handle' is the EFI image handle passed to the boot loader by the EFI
-+firmware, 'table' is the EFI system table - these are the first two
-+arguments of the "handoff state" as described in section 2.3 of the
-+UEFI specification. 'bp' is the boot loader-allocated boot params.
-+
-+The boot loader *must* fill out the following fields in bp,
-+
-+    o hdr.code32_start
-+    o hdr.cmd_line_ptr
-+    o hdr.cmdline_size
-+    o hdr.ramdisk_image (if applicable)
-+    o hdr.ramdisk_size  (if applicable)
-+
-+All other fields should be zero.
-diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c
-index 4e85f5f..b3e0227 100644
---- a/arch/x86/boot/compressed/eboot.c
-+++ b/arch/x86/boot/compressed/eboot.c
-@@ -729,32 +729,68 @@ fail:
-  * need to create one ourselves (usually the bootloader would create
-  * one for us).
-  */
--static efi_status_t make_boot_params(struct boot_params *boot_params,
--				     efi_loaded_image_t *image,
--				     void *handle)
-+struct boot_params *make_boot_params(void *handle, efi_system_table_t *_table)
- {
--	struct efi_info *efi = &boot_params->efi_info;
--	struct apm_bios_info *bi = &boot_params->apm_bios_info;
--	struct sys_desc_table *sdt = &boot_params->sys_desc_table;
--	struct e820entry *e820_map = &boot_params->e820_map[0];
--	struct e820entry *prev = NULL;
--	struct setup_header *hdr = &boot_params->hdr;
--	unsigned long size, key, desc_size, _size;
--	efi_memory_desc_t *mem_map;
--	void *options = image->load_options;
--	u32 load_options_size = image->load_options_size / 2; /* ASCII */
-+	struct boot_params *boot_params;
-+	struct sys_desc_table *sdt;
-+	struct apm_bios_info *bi;
-+	struct setup_header *hdr;
-+	struct efi_info *efi;
-+	efi_loaded_image_t *image;
-+	void *options;
-+	u32 load_options_size;
-+	efi_guid_t proto = LOADED_IMAGE_PROTOCOL_GUID;
- 	int options_size = 0;
- 	efi_status_t status;
--	__u32 desc_version;
- 	unsigned long cmdline;
--	u8 nr_entries;
- 	u16 *s2;
- 	u8 *s1;
- 	int i;
- 
-+	sys_table = _table;
-+
-+	/* Check if we were booted by the EFI firmware */
-+	if (sys_table->hdr.signature != EFI_SYSTEM_TABLE_SIGNATURE)
-+		return NULL;
-+
-+	status = efi_call_phys3(sys_table->boottime->handle_protocol,
-+				handle, &proto, (void *)&image);
-+	if (status != EFI_SUCCESS) {
-+		efi_printk("Failed to get handle for LOADED_IMAGE_PROTOCOL\n");
-+		return NULL;
-+	}
-+
-+	status = low_alloc(0x4000, 1, (unsigned long *)&boot_params);
-+	if (status != EFI_SUCCESS) {
-+		efi_printk("Failed to alloc lowmem for boot params\n");
-+		return NULL;
-+	}
-+
-+	memset(boot_params, 0x0, 0x4000);
-+
-+	hdr = &boot_params->hdr;
-+	efi = &boot_params->efi_info;
-+	bi = &boot_params->apm_bios_info;
-+	sdt = &boot_params->sys_desc_table;
-+
-+	/* Copy the second sector to boot_params */
-+	memcpy(&hdr->jump, image->image_base + 512, 512);
-+
-+	/*
-+	 * Fill out some of the header fields ourselves because the
-+	 * EFI firmware loader doesn't load the first sector.
-+	 */
-+	hdr->root_flags = 1;
-+	hdr->vid_mode = 0xffff;
-+	hdr->boot_flag = 0xAA55;
-+
-+	hdr->code32_start = (__u64)(unsigned long)image->image_base;
-+
- 	hdr->type_of_loader = 0x21;
- 
- 	/* Convert unicode cmdline to ascii */
-+	options = image->load_options;
-+	load_options_size = image->load_options_size / 2; /* ASCII */
- 	cmdline = 0;
- 	s2 = (u16 *)options;
- 
-@@ -791,18 +827,36 @@ static efi_status_t make_boot_params(struct boot_params *boot_params,
- 	hdr->ramdisk_image = 0;
- 	hdr->ramdisk_size = 0;
- 
--	status = handle_ramdisks(image, hdr);
--	if (status != EFI_SUCCESS)
--		goto free_cmdline;
--
--	setup_graphics(boot_params);
--
- 	/* Clear APM BIOS info */
- 	memset(bi, 0, sizeof(*bi));
- 
- 	memset(sdt, 0, sizeof(*sdt));
- 
--	memcpy(&efi->efi_loader_signature, EFI_LOADER_SIGNATURE, sizeof(__u32));
-+	status = handle_ramdisks(image, hdr);
-+	if (status != EFI_SUCCESS)
-+		goto fail2;
-+
-+	return boot_params;
-+fail2:
-+	if (options_size)
-+		low_free(options_size, hdr->cmd_line_ptr);
-+fail:
-+	low_free(0x4000, (unsigned long)boot_params);
-+	return NULL;
-+}
-+
-+static efi_status_t exit_boot(struct boot_params *boot_params,
-+			      void *handle)
-+{
-+	struct efi_info *efi = &boot_params->efi_info;
-+	struct e820entry *e820_map = &boot_params->e820_map[0];
-+	struct e820entry *prev = NULL;
-+	unsigned long size, key, desc_size, _size;
-+	efi_memory_desc_t *mem_map;
-+	efi_status_t status;
-+	__u32 desc_version;
-+	u8 nr_entries;
-+	int i;
- 
- 	size = sizeof(*mem_map) * 32;
- 
-@@ -811,7 +865,7 @@ again:
- 	_size = size;
- 	status = low_alloc(size, 1, (unsigned long *)&mem_map);
- 	if (status != EFI_SUCCESS)
--		goto free_cmdline;
-+		return status;
- 
- 	status = efi_call_phys5(sys_table->boottime->get_memory_map, &size,
- 				mem_map, &key, &desc_size, &desc_version);
-@@ -823,6 +877,7 @@ again:
- 	if (status != EFI_SUCCESS)
- 		goto free_mem_map;
- 
-+	memcpy(&efi->efi_loader_signature, EFI_LOADER_SIGNATURE, sizeof(__u32));
- 	efi->efi_systab = (unsigned long)sys_table;
- 	efi->efi_memdesc_size = desc_size;
- 	efi->efi_memdesc_version = desc_version;
-@@ -906,61 +961,13 @@ again:
- 
- free_mem_map:
- 	low_free(_size, (unsigned long)mem_map);
--free_cmdline:
--	if (options_size)
--		low_free(options_size, hdr->cmd_line_ptr);
--fail:
- 	return status;
- }
- 
--/*
-- * On success we return a pointer to a boot_params structure, and NULL
-- * on failure.
-- */
--struct boot_params *efi_main(void *handle, efi_system_table_t *_table)
-+static efi_status_t relocate_kernel(struct setup_header *hdr)
- {
--	struct boot_params *boot_params;
- 	unsigned long start, nr_pages;
--	struct desc_ptr *gdt, *idt;
--	efi_loaded_image_t *image;
--	struct setup_header *hdr;
- 	efi_status_t status;
--	efi_guid_t proto = LOADED_IMAGE_PROTOCOL_GUID;
--	struct desc_struct *desc;
--
--	sys_table = _table;
--
--	/* Check if we were booted by the EFI firmware */
--	if (sys_table->hdr.signature != EFI_SYSTEM_TABLE_SIGNATURE)
--		goto fail;
--
--	status = efi_call_phys3(sys_table->boottime->handle_protocol,
--				handle, &proto, (void *)&image);
--	if (status != EFI_SUCCESS) {
--		efi_printk("Failed to get handle for LOADED_IMAGE_PROTOCOL\n");
--		goto fail;
--	}
--
--	status = low_alloc(0x4000, 1, (unsigned long *)&boot_params);
--	if (status != EFI_SUCCESS) {
--		efi_printk("Failed to alloc lowmem for boot params\n");
--		goto fail;
--	}
--
--	memset(boot_params, 0x0, 0x4000);
--
--	hdr = &boot_params->hdr;
--
--	/* Copy the second sector to boot_params */
--	memcpy(&hdr->jump, image->image_base + 512, 512);
--
--	/*
--	 * Fill out some of the header fields ourselves because the
--	 * EFI firmware loader doesn't load the first sector.
--	 */
--	hdr->root_flags = 1;
--	hdr->vid_mode = 0xffff;
--	hdr->boot_flag = 0xAA55;
- 
- 	/*
- 	 * The EFI firmware loader could have placed the kernel image
-@@ -978,16 +985,40 @@ struct boot_params *efi_main(void *handle, efi_system_table_t *_table)
- 	if (status != EFI_SUCCESS) {
- 		status = low_alloc(hdr->init_size, hdr->kernel_alignment,
- 				   &start);
--		if (status != EFI_SUCCESS) {
-+		if (status != EFI_SUCCESS)
- 			efi_printk("Failed to alloc mem for kernel\n");
--			goto fail;
--		}
- 	}
- 
-+	if (status == EFI_SUCCESS)
-+		memcpy((void *)start, (void *)(unsigned long)hdr->code32_start,
-+		       hdr->init_size);
-+
-+	hdr->pref_address = hdr->code32_start;
- 	hdr->code32_start = (__u32)start;
--	hdr->pref_address = (__u64)(unsigned long)image->image_base;
- 
--	memcpy((void *)start, image->image_base, image->image_size);
-+	return status;
-+}
-+
-+/*
-+ * On success we return a pointer to a boot_params structure, and NULL
-+ * on failure.
-+ */
-+struct boot_params *efi_main(void *handle, efi_system_table_t *_table,
-+			     struct boot_params *boot_params)
-+{
-+	struct desc_ptr *gdt, *idt;
-+	efi_loaded_image_t *image;
-+	struct setup_header *hdr = &boot_params->hdr;
-+	efi_status_t status;
-+	struct desc_struct *desc;
-+
-+	sys_table = _table;
-+
-+	/* Check if we were booted by the EFI firmware */
-+	if (sys_table->hdr.signature != EFI_SYSTEM_TABLE_SIGNATURE)
-+		goto fail;
-+
-+	setup_graphics(boot_params);
- 
- 	status = efi_call_phys3(sys_table->boottime->allocate_pool,
- 				EFI_LOADER_DATA, sizeof(*gdt),
-@@ -1015,7 +1046,18 @@ struct boot_params *efi_main(void *handle, efi_system_table_t *_table)
- 	idt->size = 0;
- 	idt->address = 0;
- 
--	status = make_boot_params(boot_params, image, handle);
-+	/*
-+	 * If the kernel isn't already loaded at the preferred load
-+	 * address, relocate it.
-+	 */
-+	if (hdr->pref_address != hdr->code32_start) {
-+		status = relocate_kernel(hdr);
-+
-+		if (status != EFI_SUCCESS)
-+			goto fail;
-+	}
-+
-+	status = exit_boot(boot_params, handle);
- 	if (status != EFI_SUCCESS)
- 		goto fail;
- 
-diff --git a/arch/x86/boot/compressed/head_32.S b/arch/x86/boot/compressed/head_32.S
-index c85e3ac..aa4aaf1 100644
---- a/arch/x86/boot/compressed/head_32.S
-+++ b/arch/x86/boot/compressed/head_32.S
-@@ -42,6 +42,16 @@ ENTRY(startup_32)
- 	 */
- 	add	$0x4, %esp
- 
-+	call	make_boot_params
-+	cmpl	$0, %eax
-+	je	1f
-+	movl	0x4(%esp), %esi
-+	movl	(%esp), %ecx
-+	pushl	%eax
-+	pushl	%esi
-+	pushl	%ecx
-+
-+	.org 0x30,0x90
- 	call	efi_main
- 	cmpl	$0, %eax
- 	movl	%eax, %esi
-diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S
-index 87e03a1..2c4b171 100644
---- a/arch/x86/boot/compressed/head_64.S
-+++ b/arch/x86/boot/compressed/head_64.S
-@@ -209,6 +209,16 @@ ENTRY(startup_64)
- 	.org 0x210
- 	mov	%rcx, %rdi
- 	mov	%rdx, %rsi
-+	pushq	%rdi
-+	pushq	%rsi
-+	call	make_boot_params
-+	cmpq	$0,%rax
-+	je	1f
-+	mov	%rax, %rdx
-+	popq	%rsi
-+	popq	%rdi
-+
-+	.org 0x230,0x90
- 	call	efi_main
- 	movq	%rax,%rsi
- 	cmpq	$0,%rax
-diff --git a/arch/x86/boot/header.S b/arch/x86/boot/header.S
-index efe5acf..cd921fe 100644
---- a/arch/x86/boot/header.S
-+++ b/arch/x86/boot/header.S
-@@ -283,7 +283,7 @@ _start:
- 	# Part 2 of the header, from the old setup.S
- 
- 		.ascii	"HdrS"		# header signature
--		.word	0x020a		# header version number (>= 0x0105)
-+		.word	0x020b		# header version number (>= 0x0105)
- 					# or else old loadlin-1.5 will fail)
- 		.globl realmode_swtch
- realmode_swtch:	.word	0, 0		# default_switch, SETUPSEG
-@@ -401,6 +401,8 @@ pref_address:		.quad LOAD_PHYSICAL_ADDR	# preferred load addr
- #define INIT_SIZE VO_INIT_SIZE
- #endif
- init_size:		.long INIT_SIZE		# kernel initialization size
-+handover_offset:	.long 0x30		# offset to the handover
-+						# protocol entry point
- 
- # End of setup header #####################################################
- 
-diff --git a/arch/x86/include/asm/bootparam.h b/arch/x86/include/asm/bootparam.h
-index eb45aa6..2ad874c 100644
---- a/arch/x86/include/asm/bootparam.h
-+++ b/arch/x86/include/asm/bootparam.h
-@@ -66,6 +66,7 @@ struct setup_header {
- 	__u64	setup_data;
- 	__u64	pref_address;
- 	__u32	init_size;
-+	__u32	handover_offset;
- } __attribute__((packed));
- 
- struct sys_desc_table {
--- 
-1.7.11.2
-
-
 From 948fbe310f85f3a51a101ea23f38c59c70792832 Mon Sep 17 00:00:00 2001
 From: Matthew Garrett <mjg at redhat.com>
 Date: Thu, 8 Mar 2012 09:56:33 -0500


More information about the scm-commits mailing list