From patchwork Mon Jan 13 00:47:44 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 856916 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1214364wrc; Sun, 12 Jan 2025 16:54:45 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXeY1BynYMrFRJtPXYMocDDggo/8UVWXp7hsej0cQpo9Qf08MhY120whEJ73rjTI9LtIsuHKA==@linaro.org X-Google-Smtp-Source: AGHT+IHMwFtdo7E3TWHLdjGdVr3TPlPzKdoTKr2JgxUnGBJxG186YLIEw+aexgaiASF5+gZBJ4vW X-Received: by 2002:a05:622a:4207:b0:46c:72b7:2f12 with SMTP id d75a77b69052e-46c72b72f49mr286550831cf.48.1736729684878; Sun, 12 Jan 2025 16:54:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736729684; cv=none; d=google.com; s=arc-20240605; b=SvAblCmm72xHl5kdJ40b34ADSg1Ig6a4xIDLh9IraZyiP27UyrvsnLr1pHWCBkqGGx 9Eh4QL3inys68czyaLMtMCc3zjInw471dIqWO1TMChpNqRH7Fww8nJEuf176tUcCGqNo 2zfEGIszJxP415UXilG6q1DEDMcUZ30HhoY0E3h+n9OR36vA9OYFxhpeRYQODOHt3Qz3 N+2RFVQWFRpk4kx1pHrqsJCGYZZFLljxsGqLBorH3njYC4IYNd2YALkDJslmKoyHPAR1 vhOmJvD5ozmF1mASFMsripgveOe/zgKf/ofe5RlA7HPLVTM1Mfrd0PBbhu1AY2f5gwVz xr0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=OTZEKKLS4PrCy1H2BI5piTVs8fWWFd13d+VvsRM6L5Y=; fh=NAziacGX1oLRG5aXR1KEGKyZTrl+lhslKvmHcMEZt5Y=; b=NeRsF0mvIBdn6HIb19yTwiOP3tz7MRV12+UbknbkCZT8aDaCqR4kOcfqbYIySRoubl tRbtSMRGDptZro9k13E87zFvkXVZp6XLEtVpYm0F+wdUKUjZpPXhZAqTr98gf6GBb55p d0eGugV7tizcNjtz376IAhMOMMBAposBgy79mw3QjfpajZo3bbHZUzxbZzQ7J5RiPodY OTz1s1fBj+NpXAieM3Obu1+qqBb6d8bJIWG6+StOQGFwCLKngiS5uLQz0p3HuYM6nYSA OS33F7U/ylGhCnskI6dzU2VqYY9mT6F6XjTdO+araoZRwBWcl768Rrtcw2It9fhGtmVw S61A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uuPd5TJQ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46c8743e1e6si81630311cf.644.2025.01.12.16.54.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 16:54:44 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uuPd5TJQ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tX8eM-0006wx-FZ; Sun, 12 Jan 2025 19:49:51 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tX8eF-0006ZU-Qc for qemu-devel@nongnu.org; Sun, 12 Jan 2025 19:49:45 -0500 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tX8eD-0000xn-Eg for qemu-devel@nongnu.org; Sun, 12 Jan 2025 19:49:43 -0500 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-3862d6d5765so2058933f8f.3 for ; Sun, 12 Jan 2025 16:49:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736729379; x=1737334179; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=OTZEKKLS4PrCy1H2BI5piTVs8fWWFd13d+VvsRM6L5Y=; b=uuPd5TJQmx9W6i+B4ueJV1st9rxu/eKkrvaDThOW+0deqQsU7lZyu0oOyy7DZUUFEp IataLQ2OrA8ZYscBDqznB7HO2fMiTpBjq3f0if3q8Q+w0zVnnUv7McjUoPTDHrCv67Wv mA5NROtRTrfyMyfvn0pYOqvCINCY9Fph9u1Refzfzsfx4FJdkILsLikPeEhqo4QM21Ut Rsx7BMmRZUi1X7sj/SsemI/rE46OWtwLhCEJ1eNCpvjSt+Hv1oud+utfWwYBt/ta8CdB CQLgDiaRkshHOvk0vjGKGDSQxVN5OqqZ/zR8hnOgAf7DMZ8Y9IQx+4ED3z7mU315K0vY 3q+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736729379; x=1737334179; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OTZEKKLS4PrCy1H2BI5piTVs8fWWFd13d+VvsRM6L5Y=; b=pvUoRIosGUVLenCjWyjP6X/aAu7UWTu5QGHf2YvF4+ARFiyik4vXyLirpXHvQ8C6/R xm0Ml9fXZIEOujfkEfPb7IYGm+q1dhQxa9jYhUxfdpvyO/Iv/X8WaACNkcnqna8ZBgml TnOpJ47ESx8rhkIROgUETSLXP+wcpFyvd0uNcd2wQVakrpDBypY8QiJ560EP1ATmH3De 3iXMAka5iURuww43k+nOF8KFeoNXzjPtyPRz72MzJqI3gEDXcrfiF0w58qydzGO9XI1Z lH5ZL78l0KKNl2SNX0Lpi+cJxxj5OVmv7c026vHV7FazGfLnFjG0Ka+xaVzJlK1KgrRs /F3A== X-Gm-Message-State: AOJu0YzV7iSxCDhhyx+llA5Po3K9RiaRlnoxwen4AT7MRF09VM150OTz Go+yxm+QJmWOb1g0vjTbAHyKjIURUApMd+iS7mST6wSYu6cjQnnC1jt0LnqaijOOc1sNlaVZXJb NFL0= X-Gm-Gg: ASbGnct3YxpJKeY8xNNBq2ABFyrni36SbVCho5kK1QkDjfmJqXXWCk9YfdiCh8HbmwX MzXkdqb+SKyOf5itVKjAmXeslxsXiDnqcaxItCiClcN8pCDAsb7F02Ie0LzNGlm5UssesnxgBOB JRPseXahT0ccMPc3YLp5wmrImrINCTiHvJk2wLxSfWJ4w7x6hEY951kg3Or1oC7PQ0wArKUZC6d kCMXjBU6rMiL4L953glV9nMCk2svMyEjmU3VZMuHSYu3NlQq8UVkVZB5luADqPYtXkGFKowRnFM 5/ZsZekHT1alkFNqZsXGRSKmNjVT4Ms= X-Received: by 2002:a5d:5f44:0:b0:38a:864e:29b1 with SMTP id ffacd0b85a97d-38a8730ddf8mr17410096f8f.41.1736729379134; Sun, 12 Jan 2025 16:49:39 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e37d0casm10893890f8f.11.2025.01.12.16.49.37 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 16:49:37 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Aleksandar Rikalo , Huacai Chen , Paul Burton , Aurelien Jarno , Jiaxun Yang Subject: [PATCH 19/23] hw/mips/fuloong: Propagate CPU to write_bootloader() Date: Mon, 13 Jan 2025 01:47:44 +0100 Message-ID: <20250113004748.41658-20-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250113004748.41658-1-philmd@linaro.org> References: <20250113004748.41658-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=philmd@linaro.org; helo=mail-wr1-x42e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org mips_fuloong2e_init() created the vCPU so has its reference, propagate it to write_bootloader(), removing the &first_cpu use. Signed-off-by: Philippe Mathieu-Daudé --- hw/mips/fuloong2e.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/mips/fuloong2e.c b/hw/mips/fuloong2e.c index b87622ee6e3..1e55adacdd2 100644 --- a/hw/mips/fuloong2e.c +++ b/hw/mips/fuloong2e.c @@ -163,7 +163,7 @@ static uint64_t load_kernel(MIPSCPU *cpu) return kernel_entry; } -static void write_bootloader(CPUMIPSState *env, uint8_t *base, +static void write_bootloader(const MIPSCPU *cpu, uint8_t *base, uint64_t kernel_addr) { uint32_t *p; @@ -179,7 +179,7 @@ static void write_bootloader(CPUMIPSState *env, uint8_t *base, /* Second part of the bootloader */ p = (uint32_t *)(base + 0x040); - bl_gen_jump_kernel(MIPS_CPU(first_cpu), (void **)&p, + bl_gen_jump_kernel(cpu, (void **)&p, true, ENVP_VADDR - 64, true, 2, true, ENVP_VADDR, true, ENVP_VADDR + 8, @@ -258,7 +258,7 @@ static void mips_fuloong2e_init(MachineState *machine) loaderparams.kernel_cmdline = kernel_cmdline; loaderparams.initrd_filename = initrd_filename; kernel_entry = load_kernel(cpu); - write_bootloader(env, memory_region_get_ram_ptr(bios), kernel_entry); + write_bootloader(cpu, memory_region_get_ram_ptr(bios), kernel_entry); } else { filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, machine->firmware ?: FULOONG_BIOSNAME);