Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S270538AbUJUKsN (ORCPT ); Thu, 21 Oct 2004 06:48:13 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S270634AbUJUKr7 (ORCPT ); Thu, 21 Oct 2004 06:47:59 -0400 Received: from e34.co.us.ibm.com ([32.97.110.132]:2176 "EHLO e34.co.us.ibm.com") by vger.kernel.org with ESMTP id S270538AbUJUKpb (ORCPT ); Thu, 21 Oct 2004 06:45:31 -0400 Message-ID: <41779345.8080009@in.ibm.com> Date: Thu, 21 Oct 2004 16:15:25 +0530 From: Hariprasad Nellitheertha User-Agent: Mozilla Thunderbird 0.8 (X11/20040913) X-Accept-Language: en-us, en MIME-Version: 1.0 To: linux-kernel@vger.kernel.org CC: Vara Prasad Subject: [PATCH][1/4] kexec based dump: Loading kernel from non-default offset References: <417792BA.8090205@in.ibm.com> In-Reply-To: <417792BA.8090205@in.ibm.com> Content-Type: multipart/mixed; boundary="------------080209060304090806010200" Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 9513 Lines: 279 This is a multi-part message in MIME format. --------------080209060304090806010200 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit This patch makes it possible for us to load i386 kernels from non-default physical addresses. Regards, Hari --------------080209060304090806010200 Content-Type: text/plain; name="kd-kern-offset.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="kd-kern-offset.patch" Signed-off-by: Hariprasad Nellitheertha --- linux-old-hari/arch/i386/Kconfig | 10 ++++ linux-old-hari/arch/i386/boot/compressed/head.S | 6 +- linux-old-hari/arch/i386/boot/compressed/misc.c | 7 +- linux-old-hari/arch/i386/kernel/vmlinux.lds.S | 56 +++++++++++++---------- linux-old-hari/include/asm-generic/vmlinux.lds.h | 2 linux-old-hari/include/asm-i386/segment.h | 2 6 files changed, 54 insertions(+), 29 deletions(-) diff -puN arch/i386/Kconfig~kd-kern-offset arch/i386/Kconfig --- linux-old/arch/i386/Kconfig~kd-kern-offset 2004-10-19 19:00:17.000000000 +0530 +++ linux-old-hari/arch/i386/Kconfig 2004-10-19 19:03:47.000000000 +0530 @@ -882,6 +882,16 @@ config REGPARM source "drivers/perfctr/Kconfig" +config KERN_PHYS_OFFSET + int "Physical address where the kernel is loaded (1-112)MB" + range 1 112 + default "1" + help + This gives the physical address where the kernel is loaded. + Primarily used in the case of kexec on panic where the + recovery kernel needs to run at a different address than + the panic-ed kernel. + config KEXEC bool "kexec system call (EXPERIMENTAL)" depends on EXPERIMENTAL diff -puN arch/i386/boot/compressed/head.S~kd-kern-offset arch/i386/boot/compressed/head.S --- linux-old/arch/i386/boot/compressed/head.S~kd-kern-offset 2004-10-19 19:04:55.000000000 +0530 +++ linux-old-hari/arch/i386/boot/compressed/head.S 2004-10-19 19:06:02.000000000 +0530 @@ -74,7 +74,7 @@ startup_32: popl %esi # discard address popl %esi # real mode pointer xorl %ebx,%ebx - ljmp $(__BOOT_CS), $0x100000 + ljmp $(__BOOT_CS), $KERN_PHYS_OFFSET /* * We come here, if we were loaded high. @@ -99,7 +99,7 @@ startup_32: popl %ecx # lcount popl %edx # high_buffer_start popl %eax # hcount - movl $0x100000,%edi + movl $KERN_PHYS_OFFSET,%edi cli # make sure we don't get interrupted ljmp $(__BOOT_CS), $0x1000 # and jump to the move routine @@ -124,5 +124,5 @@ move_routine_start: movsl movl %ebx,%esi # Restore setup pointer xorl %ebx,%ebx - ljmp $(__BOOT_CS), $0x100000 + ljmp $(__BOOT_CS), $KERN_PHYS_OFFSET move_routine_end: diff -puN arch/i386/boot/compressed/misc.c~kd-kern-offset arch/i386/boot/compressed/misc.c --- linux-old/arch/i386/boot/compressed/misc.c~kd-kern-offset 2004-10-19 19:04:55.000000000 +0530 +++ linux-old-hari/arch/i386/boot/compressed/misc.c 2004-10-19 19:08:07.000000000 +0530 @@ -14,6 +14,7 @@ #include #include