From patchwork Wed Mar 18 08:49:45 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 12786 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n2I8rQGb023605 for ; Wed, 18 Mar 2009 08:53:27 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754782AbZCRIwV (ORCPT ); Wed, 18 Mar 2009 04:52:21 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755250AbZCRIwU (ORCPT ); Wed, 18 Mar 2009 04:52:20 -0400 Received: from yx-out-2324.google.com ([74.125.44.29]:52905 "EHLO yx-out-2324.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753647AbZCRIwS (ORCPT ); Wed, 18 Mar 2009 04:52:18 -0400 Received: by yx-out-2324.google.com with SMTP id 31so434133yxl.1 for ; Wed, 18 Mar 2009 01:52:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:date:message-id :subject; bh=mRrdSC7acYB8Nj57SZ7kf/e3bkHMTO8czuTfjAGCKXY=; b=wcd8PfOc0104EpWRyrgrmhLWqYJ+65oln9vNeE+0Civ1PJ7VJz+j63VqDcQ53D+MpJ jNpcdfr8VMQXBX3tRhwbMCWhpUa/SsedMSq6d2yJCrww97ALfGNxPcYrOw2QK1GsM5CD Um+DS9+g8Mz8Zz+eNU2Zbf9p+UQN4ws5toPIM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:subject; b=XP6VXLzLYCFr+vTuUs7AVt+P1YwmWhf4p7hq6hydOkK0wILUjgrIcnVigKC/QaDBGc NVYlWZeNfy9mtfyIq8umC6+F1f1yXgC/RP408vjqtXCXcu9wJEd+AN1H6Z+DFfA6s1sX sYvxdLLgUx0suzSWEW12yqM+UrMlDZNIeZ//0= Received: by 10.142.179.2 with SMTP id b2mr416575wff.308.1237366335388; Wed, 18 Mar 2009 01:52:15 -0700 (PDT) Received: from rx1.opensource.se (210.5.32.202.bf.2iij.net [202.32.5.210]) by mx.google.com with ESMTPS id 22sm1289923wfd.46.2009.03.18.01.52.14 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 18 Mar 2009 01:52:14 -0700 (PDT) From: Magnus Damm To: linux-sh@vger.kernel.org Cc: Magnus Damm , lethal@linux-sh.org Date: Wed, 18 Mar 2009 17:49:45 +0900 Message-Id: <20090318084945.5927.11325.sendpatchset@rx1.opensource.se> Subject: [PATCH] sh: rework kexec segment code Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org From: Magnus Damm Rework the kexec code to avoid using P2SEG. Instead we walk the page list in machine_kexec() and convert the addresses from physical to virtual using C. Signed-off-by: Magnus Damm --- arch/sh/kernel/machine_kexec.c | 17 ++++++++++++++++- arch/sh/kernel/relocate_kernel.S | 6 +----- 2 files changed, 17 insertions(+), 6 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- 0005/arch/sh/kernel/machine_kexec.c +++ work/arch/sh/kernel/machine_kexec.c 2009-03-18 16:38:37.000000000 +0900 @@ -76,6 +76,21 @@ void machine_kexec(struct kimage *image) unsigned long page_list; unsigned long reboot_code_buffer; relocate_new_kernel_t rnk; + unsigned long entry; + unsigned long *ptr; + + /* + * Nicked from the mips version of machine_kexec(): + * The generic kexec code builds a page list with physical + * addresses. Use phys_to_virt() to convert them to virtual. + */ + for (ptr = &image->head; (entry = *ptr) && !(entry & IND_DONE); + ptr = (entry & IND_INDIRECTION) ? + phys_to_virt(entry & PAGE_MASK) : ptr + 1) { + if (*ptr & IND_SOURCE || *ptr & IND_INDIRECTION || + *ptr & IND_DESTINATION) + *ptr = (unsigned long) phys_to_virt(*ptr); + } /* Interrupts aren't acceptable while we reboot */ local_irq_disable(); @@ -101,7 +116,7 @@ void machine_kexec(struct kimage *image) #endif /* now call it */ rnk = (relocate_new_kernel_t) reboot_code_buffer; - (*rnk)(page_list, reboot_code_buffer, P2SEGADDR(image->start)); + (*rnk)(page_list, reboot_code_buffer, image->start); } void arch_crash_save_vmcoreinfo(void) --- 0005/arch/sh/kernel/relocate_kernel.S +++ work/arch/sh/kernel/relocate_kernel.S 2009-03-18 16:01:42.000000000 +0900 @@ -18,7 +18,6 @@ relocate_new_kernel: /* r6 = start_address */ mov.l 10f,r8 /* PAGE_SIZE */ - mov.l 11f,r9 /* P2SEG */ /* stack setting */ add r8,r5 @@ -29,9 +28,8 @@ relocate_new_kernel: 0: mov.l @r4+,r0 /* cmd = *ind++ */ -1: /* addr = (cmd | P2SEG) & 0xfffffff0 */ +1: /* addr = cmd & 0xfffffff0 */ mov r0,r2 - or r9,r2 mov #-16,r1 and r1,r2 @@ -85,8 +83,6 @@ relocate_new_kernel: .align 2 10: .long PAGE_SIZE -11: - .long P2SEG relocate_new_kernel_end: