From patchwork Mon Jan 13 00:47:36 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: 856906 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1213942wrc; Sun, 12 Jan 2025 16:52:38 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVu1juWLCMhb2AmfnRsMwY/KwLBRnQjAaTN3U6QwLOvu30RrQpuUy916XnhuPObY65uBi+67w==@linaro.org X-Google-Smtp-Source: AGHT+IH5getuo3vaVtegnV2wwni9+R4Ocd9eHvHL7lVdDSxfSqa9IqXwmC1iPTraWoHUqnTcdnqO X-Received: by 2002:a05:6214:300e:b0:6d8:95c9:af2b with SMTP id 6a1803df08f44-6df9b2adae6mr293239016d6.35.1736729558135; Sun, 12 Jan 2025 16:52:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736729558; cv=none; d=google.com; s=arc-20240605; b=B9lMtGzh8+3bqSN03WOl3TWyEcSR0DQGQXuBbD0LTj5WEL6N4+RxE4O5QtrVXcQEPs asggETIVw1vYQLQAd/cC6EtS/NxRGABf8FQJfKtjgZvsneLWoUH78GGPaaKccApQtwA/ tUqQX0eXkFHJIIUP29FryFBlRZ4X20F2e8BPAbZiYKJ7zRZdmEkKdeB1Rw0893R2BwkK zmkKZjlqwEsoenEGkvJLQgIFO5W7fAJjM9ISVds/BQqLWCHDiDD5RUFFUYk2axf5dAL2 xoMwngiBr3pBFqLAPDXFZSWxCzi5uCvjVa2e/M5IlAmSaEz9r3AqcBGeTsTlyQat31QP Pybw== 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=qjcLIqHjS0KwZ5g9pteWJiKRnJ/jUR3zkxQLD75pUx0=; fh=NAziacGX1oLRG5aXR1KEGKyZTrl+lhslKvmHcMEZt5Y=; b=DrzE1W2Gy1YI5IsjL9W5e8cI8M+vNa2vE5j8Zav8ZIiEHqnCVijqj1PjaMP/EG3t2Z mYPgxUl6m4edR9cIb/y5ExDZCkeSiMSBI0FHspEtyOjYX8TtOps9NjcHP8bR/w/bAzDu Ve0C/h9Of92vQaKFnpHZ1zbAxnsiOORSAMYwxzCxjcAt/i0/3Qyfk6v/p75h796W5cWL upvt+ULBGFZQky2FFf789frf/lk1W9b0k23ckCcInVg54YTA2URv6PWbkDwUqvRjVgqA 1l1I0ss6tT42pqSrQ7G3OVFDnQnZ/gK3Sr9Vpno8YdBbhPsNcKuVoeDxXZeXW1+3HzMX bTnA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=o0LWr3Jg; 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-46c87425991si75693261cf.631.2025.01.12.16.52.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 16:52:38 -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=o0LWr3Jg; 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 1tX8dZ-000589-Qu; Sun, 12 Jan 2025 19:49:01 -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 1tX8dX-00055N-77 for qemu-devel@nongnu.org; Sun, 12 Jan 2025 19:48:59 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tX8dV-0000nv-Km for qemu-devel@nongnu.org; Sun, 12 Jan 2025 19:48:58 -0500 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-4361c705434so26496375e9.3 for ; Sun, 12 Jan 2025 16:48:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736729336; x=1737334136; 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=qjcLIqHjS0KwZ5g9pteWJiKRnJ/jUR3zkxQLD75pUx0=; b=o0LWr3Jg4649Q9Smymm2j50VP3BAzSPJ4OiVIbmkv9S10oWM5/GxOnXBapyl4yRpW3 gEIykz+WibDANH02BW4Ed0ShKoD2thI3nMMMINGQdFp6z6ESpryj/j5U+nDS2ROxN8Zv 00nYh8EYJPu0rc9J9ZESu4ourjaT36p2+vSKGj66Fco73zitJ0DzMumOiuyD2DJm2Rdk ve5+nttc2nZRoD7gBvsF0TOYHoIt1YoTTFKQ4F8hp7XVmROauR0KiLhOyNlqYlhUAKEU jxIkR1RhgoE3XpkaPYDYUu9tMKwGTYzMHGuH3zQUpaFaxdZ2phRWBIYHzfVr1uzRY9yg zFkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736729336; x=1737334136; 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=qjcLIqHjS0KwZ5g9pteWJiKRnJ/jUR3zkxQLD75pUx0=; b=aXFK1OuX3DnE5HHI0JXPAyABaB25ibDskS+YDx1RdDXSQbjOtAcSLOcSx3+5dLQZEG zNw4HLm42beIbMfTlzdSsqZLm2QWRO+yc6FQ1DeOqW0pTbU+B1MhilgyXRoz9wAZK9Tn cdGz6XPS3VZpKCCWObihZH7OKGwEIA4q2juJE2ltfM47TGO+0BCueinhwm148IqUXKoK wmPyUmukphJyaEKs+Ck7SGCIdK/j7b4DnH3XPjbMpGyz9QiXo7xE6nSElk9gImP/ny2X PwHAI7i8bqh4d0xcn+9LJWjGSvk0ErPPaPDCzenSEYh4dYwpEH7CUdHq0h3wmEPLtmOt Qyxw== X-Gm-Message-State: AOJu0Yyir5Kju8vGQgZsqppK+EVmjnhnIjtgHZyk5a8xH97DE1XcAcS2 4h8TxAO7EkeY0Q9kLSg+ctfhQVF9NVU+F1Vs/rx5klWoib9X4ycNK1XqLV8dk73CIrUIkLTs8CR ZtrI= X-Gm-Gg: ASbGnctZWj9DTy7E3NIx4UvP6ApmntKXgo6hGgh6fGZ/GcDh18Q+4+v3oJcVebIxZuM Ick5T5HlakS4MTLgv5BTbQrbudXI+tM1vsfbVHlRPbLs2xpVeapvtwN0oznxw6DMdTuvf+EW8VQ EWIgIBA0FIJj3pqNjQR+89OIjugPMPL43fzYnEDU2agQTCgTZcxHXurdrrfPaLoVznjSTAy0UU0 4kZTBzHAg5UWDyiPEyw+1EBYXSIjifxlKCC5f5e3INkpxvEqQ0KtfvAEIuHHcupbRpAICI2U3ic aMRsUVWZXcyU877Vs/f28qvkCP8YJm8= X-Received: by 2002:a5d:59ab:0:b0:385:df6b:7ef6 with SMTP id ffacd0b85a97d-38a873579a8mr17602393f8f.51.1736729335848; Sun, 12 Jan 2025 16:48:55 -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-38a8e38bd0dsm10735862f8f.45.2025.01.12.16.48.53 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 16:48:54 -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 11/23] hw/mips/bootloader: Propagate CPU env to bl_gen_dli() Date: Mon, 13 Jan 2025 01:47:36 +0100 Message-ID: <20250113004748.41658-12-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::330; envelope-from=philmd@linaro.org; helo=mail-wm1-x330.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 Propagate the target specific CPU env to the locally declared bl_gen_dli() function. Signed-off-by: Philippe Mathieu-Daudé --- hw/mips/bootloader.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/hw/mips/bootloader.c b/hw/mips/bootloader.c index 32811e48cdd..95ee59f33c9 100644 --- a/hw/mips/bootloader.c +++ b/hw/mips/bootloader.c @@ -228,19 +228,20 @@ static void bl_gen_li(const CPUMIPSState *env, void **p, } } -static void bl_gen_dli(void **p, bl_reg rt, uint64_t imm) +static void bl_gen_dli(const CPUMIPSState *env, void **p, + bl_reg rt, uint64_t imm) { - bl_gen_li(&MIPS_CPU(first_cpu)->env, p, rt, extract64(imm, 32, 32)); - bl_gen_dsll(&MIPS_CPU(first_cpu)->env, p, rt, rt, 16); + bl_gen_li(env, p, rt, extract64(imm, 32, 32)); + bl_gen_dsll(env, p, rt, rt, 16); bl_gen_ori(p, rt, rt, extract64(imm, 16, 16)); - bl_gen_dsll(&MIPS_CPU(first_cpu)->env, p, rt, rt, 16); + bl_gen_dsll(env, p, rt, rt, 16); bl_gen_ori(p, rt, rt, extract64(imm, 0, 16)); } static void bl_gen_load_ulong(void **p, bl_reg rt, target_ulong imm) { if (bootcpu_supports_isa(&MIPS_CPU(first_cpu)->env, ISA_MIPS3)) { - bl_gen_dli(p, rt, imm); /* 64bit */ + bl_gen_dli(&MIPS_CPU(first_cpu)->env, p, rt, imm); /* 64bit */ } else { bl_gen_li(&MIPS_CPU(first_cpu)->env, p, rt, imm); /* 32bit */ } @@ -301,7 +302,7 @@ void bl_gen_write_u32(void **p, target_ulong addr, uint32_t val) void bl_gen_write_u64(void **p, target_ulong addr, uint64_t val) { - bl_gen_dli(p, BL_REG_K0, val); + bl_gen_dli(&MIPS_CPU(first_cpu)->env, p, BL_REG_K0, val); bl_gen_load_ulong(p, BL_REG_K1, addr); bl_gen_sd(&MIPS_CPU(first_cpu)->env, p, BL_REG_K0, BL_REG_K1, 0x0); }