From patchwork Thu Apr 29 16:41:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jones X-Patchwork-Id: 12231565 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 51CC0C43460 for ; Thu, 29 Apr 2021 16:41:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1F73961407 for ; Thu, 29 Apr 2021 16:41:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240839AbhD2Qme (ORCPT ); Thu, 29 Apr 2021 12:42:34 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:35288 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233099AbhD2Qmd (ORCPT ); Thu, 29 Apr 2021 12:42:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1619714506; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YsWBDQcBjYg5w88YF1WhzwzOokFQvL14Q/QvvOyRBQQ=; b=HZR3uZLkMbtY/zmatFLYnmapWCwA9ucY1f+Ln3bF7y6426r20GtYoMblJ94I1+HVsHXtC6 l3bywG6Hs7CU53IFjoVsOrOyR/yKYu7KGh6nUD0eKR5r4TAueULfofHs8GjfddWzaltz6B KSZkBR/0Xc27MVc+gtvcqp+WJySOQ+o= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-411-OBv2WfIzMt-aVwCxD5XuBA-1; Thu, 29 Apr 2021 12:41:44 -0400 X-MC-Unique: OBv2WfIzMt-aVwCxD5XuBA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2A0961B18BC5; Thu, 29 Apr 2021 16:41:42 +0000 (UTC) Received: from gator.redhat.com (unknown [10.40.192.243]) by smtp.corp.redhat.com (Postfix) with ESMTP id B14065D768; Thu, 29 Apr 2021 16:41:40 +0000 (UTC) From: Andrew Jones To: kvm@vger.kernel.org Cc: alexandru.elisei@arm.com, nikos.nikoleris@arm.com, andre.przywara@arm.com, eric.auger@redhat.com Subject: [PATCH kvm-unit-tests v3 2/8] arm/arm64: Move setup_vm into setup Date: Thu, 29 Apr 2021 18:41:24 +0200 Message-Id: <20210429164130.405198-3-drjones@redhat.com> In-Reply-To: <20210429164130.405198-1-drjones@redhat.com> References: <20210429164130.405198-1-drjones@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Consolidate our setup calls to reduce the amount we need to do from init::start. Also remove a couple of pointless comments from setup(). Reviewed-by: Nikos Nikoleris Reviewed-by: Alexandru Elisei Signed-off-by: Andrew Jones --- arm/cstart.S | 6 ------ arm/cstart64.S | 5 ----- lib/arm/setup.c | 7 +++++-- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/arm/cstart.S b/arm/cstart.S index b2c0ba061cd5..bf3c78157e6a 100644 --- a/arm/cstart.S +++ b/arm/cstart.S @@ -81,12 +81,7 @@ start: /* complete setup */ pop {r0-r1} bl setup - bl get_mmu_off - cmp r0, #0 - bne 1f - bl setup_vm -1: /* run the test */ ldr r0, =__argc ldr r0, [r0] @@ -108,7 +103,6 @@ enable_vfp: vmsr fpexc, r0 mov pc, lr -.global get_mmu_off get_mmu_off: ldr r0, =auxinfo ldr r0, [r0, #4] diff --git a/arm/cstart64.S b/arm/cstart64.S index 7963e1fea979..27251fe8b5cd 100644 --- a/arm/cstart64.S +++ b/arm/cstart64.S @@ -93,11 +93,7 @@ start: /* complete setup */ bl setup // x0 is the addr of the dtb - bl get_mmu_off - cbnz x0, 1f - bl setup_vm -1: /* run the test */ adrp x0, __argc ldr w0, [x0, :lo12:__argc] @@ -111,7 +107,6 @@ start: .text -.globl get_mmu_off get_mmu_off: adrp x0, auxinfo ldr x0, [x0, :lo12:auxinfo + 8] diff --git a/lib/arm/setup.c b/lib/arm/setup.c index 751ba980000a..9c16f6004e9f 100644 --- a/lib/arm/setup.c +++ b/lib/arm/setup.c @@ -16,6 +16,8 @@ #include #include #include +#include +#include #include #include #include @@ -233,7 +235,6 @@ void setup(const void *fdt) freemem += initrd_size; } - /* call init functions */ mem_init(PAGE_ALIGN((unsigned long)freemem)); cpu_init(); @@ -243,7 +244,6 @@ void setup(const void *fdt) /* mem_init must be called before io_init */ io_init(); - /* finish setup */ timer_save_state(); ret = dt_get_bootargs(&bootargs); @@ -256,4 +256,7 @@ void setup(const void *fdt) memcpy(env, initrd, initrd_size); setup_env(env, initrd_size); } + + if (!(auxinfo.flags & AUXINFO_MMU_OFF)) + setup_vm(); }