From patchwork Mon Jan 13 00:47:33 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: 856903 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1213429wrc; Sun, 12 Jan 2025 16:49:57 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVC7fB/YYgwGZctR+jYSjnO1d5cEyp1wiphjnpWiRNHe8LaJ/+EUJtnSTRycaxpP3/YfjPrzA==@linaro.org X-Google-Smtp-Source: AGHT+IGr1ZE2aVhZfGZbhcGteLp3kNzl6b19NZR6JR5o4rDzf35MHKK5weGyeLE0LSj5KYtk1mEC X-Received: by 2002:ac8:4644:0:b0:466:8e3a:e6cb with SMTP id d75a77b69052e-46c7102c9f3mr222282531cf.29.1736729397439; Sun, 12 Jan 2025 16:49:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736729397; cv=none; d=google.com; s=arc-20240605; b=cUhw4RnECSrkolzdPlqY5AVjSh88Sl+yIVIVTaCjs3ltQqFJl2ru3ZxitxSi/iXFTL bPaqiH0jLV9D2t+99iM/Yv4UJgxEcWOoem7Iny5chj8N7k04oofUouKrFIg1GUDV44R/ Hl44Yb8fEi12rCQLGJkxlSYsaR2C6FBJwVo43UIV1iRNUS7Y/Bces3YuK2FL9Ef9Dv5m 78abE2HQIs5y8fS6sqCfatHfdqm3KvDkj74nVqBNFVasjuBhfoE/TwmfrN7gQ1WR/soz HPq7iwc/dyfQk5sb0BxJ2awUyFYphODgLeXu10EuUjyO01q5RC8i+OzYW4zezdFAllGM ZPkg== 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=v6Clg/N9h/uY9sG75mKmNN87S01issR08U/shM6098E=; fh=NAziacGX1oLRG5aXR1KEGKyZTrl+lhslKvmHcMEZt5Y=; b=aeyYyDAKMIFHxAoPfrfeUDyAtBGwYo1sPom2Gevqia/Mq5LD3+bJhiFY563TDHfQmI B7nLdpO6j9IMESApXdTZz1SUyfwZYQsOzovAi401tEA0ReNX/x7DLSWKQR+8Tz/+SNSq QKPFgvLs6YyLNm6KawRG7Gwvm7qKcql7khooX3dP0FQbYGyZcDFrgIz+BXn6xiHShxxc zvcWY7fD18bDVM3mS4ZQ1Y9dMB2pKIeeFn0w04EZPVl6xi80Zey2oOwOdrBTrrfiJF0l NtPDohVvQo2fRnMTfqykK5lD5KOwwX6CHbX2klDu85cpRa45pzYy/rfQUxOiblLeL2Nx HJ7g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="qHxs/dOe"; 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-46c874132c2si74927691cf.494.2025.01.12.16.49.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 16:49:57 -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="qHxs/dOe"; 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 1tX8dP-0004ha-81; Sun, 12 Jan 2025 19:48: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 1tX8dG-0004av-PJ for qemu-devel@nongnu.org; Sun, 12 Jan 2025 19:48:44 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tX8dF-0000lL-96 for qemu-devel@nongnu.org; Sun, 12 Jan 2025 19:48:42 -0500 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-4361f664af5so43334625e9.1 for ; Sun, 12 Jan 2025 16:48:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736729318; x=1737334118; 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=v6Clg/N9h/uY9sG75mKmNN87S01issR08U/shM6098E=; b=qHxs/dOedUTiTcJjNhREer6+S0x0TK0losO7ZyryVYbJWM8EMQWvNIDRZ0Aa0N89fp TJIqv0n1V6av+YmSeaiHJeV7CA7Yb8Kdt+PES4XkWxHSokAqsPVkk2kA/UmkkdQKCZyH CZ1RO6GLP68vTB+orxbcXGwQDHF4lpzI2ohEn10cuQoucGG7gdMVLKq7vZeXcC2ZBaTs 1W03CiwieIuHbB7oXJgWFoprqIQW042CiDhQLc9bwB243yY+YDFvjtZdZGyUN0QZObQG Jna4AXFDhXGocJafgWTsA0udv9Kp6ZWA2Nd0kJit5US9NwCpWma0CWbLRvW6hu6krWB5 1vpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736729318; x=1737334118; 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=v6Clg/N9h/uY9sG75mKmNN87S01issR08U/shM6098E=; b=BvZT9z1sysUb5a4oBUGvBv5W7/bu3rreLVhDCd5ujXK/dDXq4VXhnNOhg1byNZK9JL dBkeK8Z+yUi/tcKikC2T8xHqqyZ1efXS1nw2Ld+auogne2//7eifteMg2DyxJjGXfjyF ZJHRDYDbODo/PHZOi7pmVjCD9nOLBwob0BiMCpaVj0884Ynn9MVe2d0dYEe9yfNyZiVA Urj0ji4SuPkayefTurp2LQs9EmzIeSV35TRIgGhnh9ly8VCPLrXALsa/fXPwI4xThzFu wNmQ84WhU9KT1zD070CswC1yIe1Rfu4fPkfRu13nuudjI4lG9TWyUrvHNBxQmr2hSX0K mU6g== X-Gm-Message-State: AOJu0YwQFhpoRkLYy56Qwb+QErnOAUxMBvyshn6O6p55IVGHr3nKA/aV ravQOJZLpDSseaUD/QiM61fccm9a7HL1uwf2Z1CK3CJfmkOg+ayx0iCjkoSNUmO0YphBgisDDHy PlJQ= X-Gm-Gg: ASbGnctDIs7CJ72it3VizKvAdlDe3Q+wMDyyPBPGbDTq24Kqh6N7+nc5zwk/t7b0Mhj WKms/uJT8LvAbZ0iRoNWuHqe4oWp+jT6PKG/BUo6govcgrRW0teZP90A+0GH+E8xaD6WVJ0oEz8 JCsllRbV5zY6vyGa3E3LdCjIvd1z83JwZRmW/8LooFh2r8AG5Zs48G1SfjqODl3eZ85iMUqYxxu WOjCx2uNkioGpCide99HtZCr7SRSLwu6M5dg3FrFzGPY/4SiYF2zOwc5BfnZJx/WhC707SW0wjc rYr0sYPJvDigkBz6AMtSXKmDrOnw3OI= X-Received: by 2002:a05:6000:1f81:b0:386:7fe:af8e with SMTP id ffacd0b85a97d-38a872fb17fmr14396971f8f.12.1736729318623; Sun, 12 Jan 2025 16:48:38 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e9d26a7bsm130244375e9.0.2025.01.12.16.48.37 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 16:48:38 -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 08/23] hw/mips/bootloader: Propagate CPU env to bl_gen_sw() Date: Mon, 13 Jan 2025 01:47:33 +0100 Message-ID: <20250113004748.41658-9-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::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.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_sw() function. Signed-off-by: Philippe Mathieu-Daudé --- hw/mips/bootloader.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hw/mips/bootloader.c b/hw/mips/bootloader.c index 9f35b23653a..30e6422d331 100644 --- a/hw/mips/bootloader.c +++ b/hw/mips/bootloader.c @@ -195,9 +195,10 @@ static void bl_gen_sw_nm(void **ptr, bl_reg rt, uint8_t rs, uint16_t ofs12) st_nm32_p(ptr, insn); } -static void bl_gen_sw(void **p, bl_reg rt, uint8_t base, uint16_t offset) +static void bl_gen_sw(const CPUMIPSState *env, void **p, + bl_reg rt, uint8_t base, uint16_t offset) { - if (bootcpu_supports_isa(&MIPS_CPU(first_cpu)->env, ISA_NANOMIPS32)) { + if (bootcpu_supports_isa(env, ISA_NANOMIPS32)) { bl_gen_sw_nm(p, rt, base, offset); } else { bl_gen_i_type(p, 0x2b, base, rt, offset); @@ -285,7 +286,7 @@ void bl_gen_write_ulong(void **p, target_ulong addr, target_ulong val) if (bootcpu_supports_isa(&MIPS_CPU(first_cpu)->env, ISA_MIPS3)) { bl_gen_sd(p, BL_REG_K0, BL_REG_K1, 0x0); } else { - bl_gen_sw(p, BL_REG_K0, BL_REG_K1, 0x0); + bl_gen_sw(&MIPS_CPU(first_cpu)->env, p, BL_REG_K0, BL_REG_K1, 0x0); } } @@ -293,7 +294,7 @@ void bl_gen_write_u32(void **p, target_ulong addr, uint32_t val) { bl_gen_li(p, BL_REG_K0, val); bl_gen_load_ulong(p, BL_REG_K1, addr); - bl_gen_sw(p, BL_REG_K0, BL_REG_K1, 0x0); + bl_gen_sw(&MIPS_CPU(first_cpu)->env, p, BL_REG_K0, BL_REG_K1, 0x0); } void bl_gen_write_u64(void **p, target_ulong addr, uint64_t val)