From patchwork Mon Jan 13 19:55:20 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: 856954 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1601484wrc; Mon, 13 Jan 2025 11:58:15 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVK2Fh0eOgIL+CH3x0Arr3Dok+iyFerbv2V0m4wozpSN8mxfjp1zASX6hxjUhShxoaelWqNEQ==@linaro.org X-Google-Smtp-Source: AGHT+IG4UWsV7ni0XNoo1POXNZFH28k8BDBTDihDd51YLc3E4NIq74Vak6h763Tw8/87vEs1sE6u X-Received: by 2002:a05:620a:1a04:b0:7ac:a0a5:9bf4 with SMTP id af79cd13be357-7bcd97622efmr3847946985a.40.1736798295208; Mon, 13 Jan 2025 11:58:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736798295; cv=none; d=google.com; s=arc-20240605; b=C/Pdte6kiN5SNrdKuXUholErH5eYiMVPaiDsJEN+4u4hecoNScLIiQY+2Jui7Ry3i3 HKmeoLdQDbBUsqCk4n3SfZTC6ot+IaRh3EHhtCmUkXYYAlauWQMTK4yVXz46+8SzA6iF MarS5StD/Hy6zUYiL0cM28F/ojiX7/194Vpz4I7nC3bDikcV5wyCq5lZ4Qz2CtUAowih xbP07Rfe8tQiN8Ls9tEdl0dueWlIfmtYR0x0YB200os9++ZLWwd+b5UgpfSdGa/qF+c2 D5tjSxF0O0+oOgxtPAseV9qdsXRVr7d4IbqNYja7/mXZGTAJrV12yBHmqdGwPAi70KqD EJEA== 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=8+YIN1f80FVmcBoMH1oRH2tR6JuH5Kh9JlAiouQJECQ=; fh=wMwPlu6s3WDa+luMUca6ONpSmNJKUwF5E3uCFeq1PI4=; b=kRcWlBlKuKKfwVUZrrQCZRCCulaek5iUT5kdb3qe/i8TGT00OzBKDGNbJbqzhZtPJI fHyt4AX7vCvsxrmmlw4L/rUw55x2CkigQWZEskLMi7459C23RFN/6aZvNdxLqK9TLtVi hzPH/rRNX/2a1XK8deUtuyFU2SF4+R0ysTvNyi1KKN5ViYncUI7etX92peKMKgJ4AvfU au8GHXDNPc4qV0M84QQfncZ48TDeAx6WMOGnwjMnNc7Fq4B/DmS53Rw6J8+vZj7P4Tp2 +oeoMsB0ESpJVzumfP7Ktza7bVhaLHs4qTVT5IsLrTyzeCTw5Gy8zoNYGVBgOp8erFDe HCoA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=bYG0stNo; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=fail 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 af79cd13be357-7bce34fe50csi1142647485a.485.2025.01.13.11.58.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 Jan 2025 11:58:15 -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=fail header.i=@linaro.org header.s=google header.b=bYG0stNo; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=fail 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 1tXQYd-0007iO-Or; Mon, 13 Jan 2025 14:57:08 -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 1tXQYG-0006Rt-OY for qemu-devel@nongnu.org; Mon, 13 Jan 2025 14:56:48 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tXQYC-0007Vd-8m for qemu-devel@nongnu.org; Mon, 13 Jan 2025 14:56:44 -0500 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-385e06af753so2379326f8f.2 for ; Mon, 13 Jan 2025 11:56:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736798198; x=1737402998; 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=8+YIN1f80FVmcBoMH1oRH2tR6JuH5Kh9JlAiouQJECQ=; b=bYG0stNoIA+QqJXQum+oTOafFUL/oMZSOvTFO0CINPBSxk2WRBkcMo/jcrlVECbjHn RrROtFd5+sOLDBF3o2Y/cjtl7KQxytFGuO6hMPusJZYdApuHtJeVsdQklbt7Totr3OA1 431j9/anREwXjrHcSPMfRsEXzWMp5SkYLnDZwVfq+Q9kqWVlHbhSoOFY+t4zm+aJG0QN eU4h2j6TDQoHSoPLKvJCzB4uEtXSKtnhxTiURIPz1wtMsCHIy9IReioUprkZFRyKwmas W/hYWh8pEIruPJVe81Y/fy3x1RCOnSHmqbQOqtAUMnw5FZInZQuif+Ya0jrWxPMzlHM4 PxTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736798198; x=1737402998; 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=8+YIN1f80FVmcBoMH1oRH2tR6JuH5Kh9JlAiouQJECQ=; b=HKxZ7iLfKXIsYe/6j9g0V36yN7hHpcThISNvmGMu4NWTnei6suJcRbFgTLwthPC+T5 fY2YxzntVD4j9Do1MQ4+eUSm/5bOBLU+1LEs+263bqXTjw1A7yQ5LMb1AQTnIvvzNfRD aq17mxcwdNYZufzG1GJ5SUgIAMPQogqLMXfmKC2v1Wc5+YB6HJO7PjhkH9qPZgszZJjL oJb/jIXzSWWvojRkZvXgiYvzas5iUjGttslOaJ9h7zuF2sr/64Gd6eFNBY/pqcp0dt6L 6Q2Q9JFcFsWDp4iL8Jk8bLMHwqiE8lym3hakwuL9sC5AWa0J8IcmE/pH/hmLQq2NgEbm AhZQ== X-Gm-Message-State: AOJu0YzEKa2zcP2fX8qNFpX3oYgtM0ggMJeSqh1K8yFga4/MNfz8R3UB i0UGK97nkDZMp4KHD/4eb4jnf6XquzyE9LRDlIGQCXRllgLXNkx7SAPWlz7+mZ3zuzHhunSEwJ8 znVo= X-Gm-Gg: ASbGncvcLXtfGmcWAi0eSYV9uXuUK8onq8PYsr3xK2+sgrHSMW81sgPyGm41zX0GdDX Q3sYQC5///OkNHNJui/5VJVqT+Oj2gdF3SFVFtfApAY8EdzWz4z+VudI6Q1vohfX8EzJCFsOBQg PWfiFcm/pGXr5l8zJOS8AeXoIWjw55k5vZ9jE0UmnOUDrgZ+Uls0fOE3msTcOR3FSinrgh8jlyT Ndvb1db3wsMMiVdfMcSfVuzuwZ5Hq6N8337eXqR9E+085M4MKFjeW25CT6LGv7JGFSgQt5JOH5Z wX/bp44gZ8Qm87KtZkUmWopT0VhKwsg= X-Received: by 2002:a05:6000:2a3:b0:386:3684:c97e with SMTP id ffacd0b85a97d-38a87309ca0mr21630331f8f.23.1736798198277; Mon, 13 Jan 2025 11:56: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 ffacd0b85a97d-38a8e3840bfsm13212260f8f.39.2025.01.13.11.56.36 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 13 Jan 2025 11:56:37 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paul Burton , Aurelien Jarno , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Jiaxun Yang , Aleksandar Rikalo , Huacai Chen Subject: [PATCH v2 14/19] hw/mips/bootloader: Propagate CPU env to bl_gen_s[w, d]() Date: Mon, 13 Jan 2025 20:55:20 +0100 Message-ID: <20250113195525.57150-15-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250113195525.57150-1-philmd@linaro.org> References: <20250113195525.57150-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=philmd@linaro.org; helo=mail-wr1-x42d.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() and bl_gen_sd() functions. Signed-off-by: Philippe Mathieu-Daudé --- hw/mips/bootloader.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/hw/mips/bootloader.c b/hw/mips/bootloader.c index 464ed5f4f1a..288dccce473 100644 --- a/hw/mips/bootloader.c +++ b/hw/mips/bootloader.c @@ -194,7 +194,8 @@ 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(ISA_NANOMIPS32)) { bl_gen_sw_nm(p, rt, base, offset); @@ -203,7 +204,8 @@ static void bl_gen_sw(void **p, bl_reg rt, uint8_t base, uint16_t offset) } } -static void bl_gen_sd(void **p, bl_reg rt, uint8_t base, uint16_t offset) +static void bl_gen_sd(const CPUMIPSState *env, void **p, + bl_reg rt, uint8_t base, uint16_t offset) { if (bootcpu_supports_isa(ISA_MIPS3)) { bl_gen_i_type(p, 0x3f, base, rt, offset); @@ -292,9 +294,9 @@ void bl_gen_write_ulong(const MIPSCPU *cpu, void **p, bl_gen_load_ulong(env, p, BL_REG_K0, val); bl_gen_load_ulong(env, p, BL_REG_K1, addr); if (bootcpu_supports_isa(ISA_MIPS3)) { - bl_gen_sd(p, BL_REG_K0, BL_REG_K1, 0x0); + bl_gen_sd(env, p, BL_REG_K0, BL_REG_K1, 0x0); } else { - bl_gen_sw(p, BL_REG_K0, BL_REG_K1, 0x0); + bl_gen_sw(env, p, BL_REG_K0, BL_REG_K1, 0x0); } } @@ -305,7 +307,7 @@ void bl_gen_write_u32(const MIPSCPU *cpu, void **p, bl_gen_li(env, p, BL_REG_K0, val); bl_gen_load_ulong(env, p, BL_REG_K1, addr); - bl_gen_sw(p, BL_REG_K0, BL_REG_K1, 0x0); + bl_gen_sw(env, p, BL_REG_K0, BL_REG_K1, 0x0); } void bl_gen_write_u64(const MIPSCPU *cpu, void **p, @@ -315,5 +317,5 @@ void bl_gen_write_u64(const MIPSCPU *cpu, void **p, bl_gen_dli(env, p, BL_REG_K0, val); bl_gen_load_ulong(env, p, BL_REG_K1, addr); - bl_gen_sd(p, BL_REG_K0, BL_REG_K1, 0x0); + bl_gen_sd(env, p, BL_REG_K0, BL_REG_K1, 0x0); }