From patchwork Tue Jan 22 22:12:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 10776365 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3C7CC1390 for ; Tue, 22 Jan 2019 22:30:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2CF612B70E for ; Tue, 22 Jan 2019 22:30:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 213A82B718; Tue, 22 Jan 2019 22:30:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,FROM_LOCAL_NOVOWEL,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CD9BC2B70E for ; Tue, 22 Jan 2019 22:30:57 +0000 (UTC) Received: from localhost ([127.0.0.1]:51587 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gm4ZN-00063e-7H for patchwork-qemu-devel@patchwork.kernel.org; Tue, 22 Jan 2019 17:30:57 -0500 Received: from eggs.gnu.org ([209.51.188.92]:46527) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gm4W7-000313-D2 for qemu-devel@nongnu.org; Tue, 22 Jan 2019 17:27:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gm4II-0006iT-1T for qemu-devel@nongnu.org; Tue, 22 Jan 2019 17:13:18 -0500 Received: from mail-lf1-x141.google.com ([2a00:1450:4864:20::141]:41791) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gm4IH-0006hs-Qw for qemu-devel@nongnu.org; Tue, 22 Jan 2019 17:13:17 -0500 Received: by mail-lf1-x141.google.com with SMTP id c16so85836lfj.8 for ; Tue, 22 Jan 2019 14:13:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=wL56fAox7icrdi83CNQLZNN8qExDm9YrJmEUoAEyltY=; b=KsRfzCj5smGwaQ/Pni9Nro9p5lTNd8fmyEbWL4wGzqnL2dIo+40y7A+cqu2AgZNJbh Z/gQNyRNCe9vN14FZXqzT825gqsSgAU/1HOiq5sS+Cs3TudEfVI99Q/va95fHYL3IolL 0hhWni22/N7doPFy8OZG1a3MUzhxpQJtp1gEKHrC2nx+4aEbCMa2Im86unoJgTaO9qq2 3kpaJqmH1CPpWucsAhw1V60UDtupP7pv1jtUqX+I2pUnj4FJu6mcts0AsiqBB3JM/uaA 8n9A6KGEaaCDd0+DJYcPsh2QNmSQ1fClndlDr5Ij3uy+CJMeKNSE9MTg1OiEVYrKxnjt Hndg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=wL56fAox7icrdi83CNQLZNN8qExDm9YrJmEUoAEyltY=; b=nPoiIhvYjpA4vhnicvCYSZ5sI+GyufwFMizvj8Yp+mlgwYPPSBD9OPSb0Co0WMzOSg Vnlg+/EgAG1O/PQLmPA7FnKSMvFdLF91eeoUUAbvKeBv0JUgJGXnE1oWW+L9Ym71vzHw 71EI9YwqikjzGG3NUPLWU4dSp+VMO1ovuvLlQLVB8pgcFYebtqusSPxgs7na6+rdIJvq HtbGJFb59dq0eXUaZDCeFWziQVZ8XeL0V5789QQbg/BNF6+PIoWEPQ/cnUb4I3tL+/bM hl7VKNiHTXspBMWOjKshrg+1DVU0WPAd13AgbaU7e1OpWSoz7j4XkxEzuZYNg1hMlQB3 JOKg== X-Gm-Message-State: AJcUukcVZ2kEJDxi+kbCM91QEfC4zgZep5nvTpGBHe26VNWsrnUL44KZ Sk9UqWvLQL21vmrTVaFmnsJBVFoBRFM= X-Google-Smtp-Source: ALg8bN5tmLZNlSqdtHMZJWI9QBJ10Itp2nxJXMGiav7h/YrKf2mXSb4bBZfFV0qQXb8Jw6/pE/IHIA== X-Received: by 2002:a19:a86:: with SMTP id 128mr21303775lfk.139.1548195195950; Tue, 22 Jan 2019 14:13:15 -0800 (PST) Received: from octofox.cadence.com (jcmvbkbc-1-pt.tunnel.tserv24.sto1.ipv6.he.net. [2001:470:27:1fa::2]) by smtp.gmail.com with ESMTPSA id i13-v6sm184404ljg.82.2019.01.22.14.13.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Jan 2019 14:13:15 -0800 (PST) From: Max Filippov To: qemu-devel@nongnu.org Date: Tue, 22 Jan 2019 14:12:55 -0800 Message-Id: <20190122221256.20883-2-jcmvbkbc@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190122221256.20883-1-jcmvbkbc@gmail.com> References: <20190122221256.20883-1-jcmvbkbc@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::141 Subject: [Qemu-devel] [PATCH 1/2] hw/xtensa: xtfpga: fix bootloader placement in SMP X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Max Filippov Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Use BSP reset PC as a place for the mini-bootloader because in SMP configurations APs and BSP may have different boot addresses. This fixes SMP linux uImage boot on xtfpga boards. Signed-off-by: Max Filippov --- hw/xtensa/xtfpga.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/hw/xtensa/xtfpga.c b/hw/xtensa/xtfpga.c index 21094319a659..d3afdfc247a7 100644 --- a/hw/xtensa/xtfpga.c +++ b/hw/xtensa/xtfpga.c @@ -234,10 +234,15 @@ static void xtfpga_init(const XtfpgaBoardDesc *board, MachineState *machine) int n; for (n = 0; n < smp_cpus; n++) { + CPUXtensaState *cenv = NULL; + cpu = XTENSA_CPU(cpu_create(machine->cpu_type)); - env = &cpu->env; + cenv = &cpu->env; + if (!env) { + env = cenv; + } - env->sregs[PRID] = n; + cenv->sregs[PRID] = n; qemu_register_reset(xtfpga_reset, cpu); /* Need MMU initialized prior to ELF loading, * so that ELF gets loaded into virtual addresses