From patchwork Fri Oct 31 07:52:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Young X-Patchwork-Id: 5202921 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CDFE59F318 for ; Fri, 31 Oct 2014 07:56:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0F4742011D for ; Fri, 31 Oct 2014 07:56:52 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E50D420109 for ; Fri, 31 Oct 2014 07:56:50 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Xk71n-0005zi-HN; Fri, 31 Oct 2014 07:53:47 +0000 Received: from mx1.redhat.com ([209.132.183.28]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Xk70r-00050X-2R; Fri, 31 Oct 2014 07:52:49 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s9V7qHAo020482 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 31 Oct 2014 03:52:18 -0400 Received: from darkstar.nay.redhat.com (dhcp-16-138.nay.redhat.com [10.66.16.138]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s9V7qAep021404 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Fri, 31 Oct 2014 03:52:13 -0400 Date: Fri, 31 Oct 2014 15:52:09 +0800 From: Dave Young To: Geoff Levand Subject: Re: [PATCH 00/10] arm64 kexec kernel patches V5 Message-ID: <20141031075209.GH3290@darkstar.nay.redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141031_005249_224008_7F8737EA X-CRM114-Status: GOOD ( 11.79 ) X-Spam-Score: -5.6 (-----) Cc: marc.zyngier@arm.com, Catalin Marinas , Will Deacon , christoffer.dall@linaro.org, Grant Likely , kexec@lists.infradead.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi Geoff I tested your patches. The macihne is using spin-table cpu enable method so I tried maxcpus=1 as you suggested. There's below issues for me, thoughts? 1. For acpi booting there's no /proc/device-tree so kexec can not find dtb to use. 2. adding "acpi=off" to 1st kernel boot cmdline, kexec load fails with error like below: machine_apply_elf_rel: ERROR Unknown type: 261 I did below hack then kexec load works fine, but `kexec -e` still does not work there's nothing more than "Disableing non-boot CPUS ...\n Bye!": Thanks Dave diff --git a/kexec/arch/arm64/kexec-arm64.c b/kexec/arch/arm64/kexec-arm64.c index 9db1c07..2df24f0 100644 --- a/kexec/arch/arm64/kexec-arm64.c +++ b/kexec/arch/arm64/kexec-arm64.c @@ -790,6 +790,10 @@ void machine_apply_elf_rel(struct mem_ehdr *ehdr, unsigned long r_type, # define R_AARCH64_ABS64 257 #endif +#if !defined(R_AARCH64_PREL32) +#define R_AARCH64_PREL32 261 +#endif + #if !defined(R_AARCH64_LD_PREL_LO19) # define R_AARCH64_LD_PREL_LO19 273 #endif @@ -806,6 +810,7 @@ void machine_apply_elf_rel(struct mem_ehdr *ehdr, unsigned long r_type, # define R_AARCH64_CALL26 283 #endif + uint64_t *location1 = (uint64_t *)ptr; uint32_t *location = (uint32_t *)ptr; uint32_t data = *location; const char *type = NULL; @@ -813,7 +818,11 @@ void machine_apply_elf_rel(struct mem_ehdr *ehdr, unsigned long r_type, switch(r_type) { case R_AARCH64_ABS64: type = "ABS64"; - *location += value; + *location1 += value; + break; + case R_AARCH64_PREL32: + type = "PREL32"; + *location += value - address; break; case R_AARCH64_LD_PREL_LO19: type = "LD_PREL_LO19"; @@ -839,7 +848,7 @@ void machine_apply_elf_rel(struct mem_ehdr *ehdr, unsigned long r_type, break; } - dbgprintf("%s: %s %x->%x\n", __func__, type, data, *location); + dbgprintf("%s: %s %x->%lx\n", __func__, type, data, (r_type == R_AARCH64_ABS64)? *location1: *location); } void arch_reuse_initrd(void)