From patchwork Tue Apr 19 17:26:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 8882191 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BC359BF440 for ; Tue, 19 Apr 2016 17:26:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 61C9D20251 for ; Tue, 19 Apr 2016 17:26:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 49C2E202C8 for ; Tue, 19 Apr 2016 17:26:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754859AbcDSR0t (ORCPT ); Tue, 19 Apr 2016 13:26:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53002 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753179AbcDSR0r (ORCPT ); Tue, 19 Apr 2016 13:26:47 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DBB3B78224; Tue, 19 Apr 2016 17:26:46 +0000 (UTC) Received: from thinkpad.redhat.com (ovpn-112-40.ams2.redhat.com [10.36.112.40]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u3JHQd9D016430; Tue, 19 Apr 2016 13:26:43 -0400 From: Laurent Vivier To: kvm@vger.kernel.org, kvm-ppc@vger.kernel.org Cc: drjones@redhat.com, thuth@redhat.com, dgibson@redhat.com, pbonzini@redhat.com, Laurent Vivier Subject: [kvm-unit-tests PATCH 1/2] powerpc: use well known kernel start address Date: Tue, 19 Apr 2016 19:26:27 +0200 Message-Id: <1461086788-3102-2-git-send-email-lvivier@redhat.com> In-Reply-To: <1461086788-3102-1-git-send-email-lvivier@redhat.com> References: <1461086788-3102-1-git-send-email-lvivier@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 As we know where QEMU will load the kernel, it seems an useless pain to try to compute it instead of using the well known value. Signed-off-by: Laurent Vivier Reviewed-by: David Gibson Reviewed-by: Thomas Huth --- powerpc/boot_rom.S | 3 ++- powerpc/cstart64.S | 6 +++--- powerpc/spapr.h | 6 ++++++ 3 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 powerpc/spapr.h diff --git a/powerpc/boot_rom.S b/powerpc/boot_rom.S index ae2c08d..266d61f 100644 --- a/powerpc/boot_rom.S +++ b/powerpc/boot_rom.S @@ -1,4 +1,5 @@ -#define SPAPR_KERNEL_LOAD_ADDR 0x400000 +#include "spapr.h" + .text .globl start start: diff --git a/powerpc/cstart64.S b/powerpc/cstart64.S index ceb6397..c47b67d 100644 --- a/powerpc/cstart64.S +++ b/powerpc/cstart64.S @@ -11,6 +11,8 @@ #include #include +#include "spapr.h" + .section .init /* @@ -25,9 +27,7 @@ start: * so we just linked at zero. This means the first thing to do is * to find our stack and toc, and then do a relocate. */ - bl 0f -0: mflr r31 - subi r31, r31, 0b - start /* QEMU's kernel load address */ + LOAD_REG_IMMEDIATE(r31, SPAPR_KERNEL_LOAD_ADDR) ld r1, (p_stack - start)(r31) ld r2, (p_toc - start)(r31) add r1, r1, r31 diff --git a/powerpc/spapr.h b/powerpc/spapr.h new file mode 100644 index 0000000..b41aece --- /dev/null +++ b/powerpc/spapr.h @@ -0,0 +1,6 @@ +#ifndef _ASMPOWERPC_SPAPR_H_ +#define _ASMPOWERPC_SPAPR_H_ + +#define SPAPR_KERNEL_LOAD_ADDR 0x400000 + +#endif /* _ASMPOWERPC_SPAPR_H_ */