From patchwork Wed Jan 15 23:29:41 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: 857639 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp2732708wrc; Wed, 15 Jan 2025 15:31:03 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXjioNe/sK+B+AhRYYpvdJ5LS9FRw5IeI3pMS2Kog06DQ/pVCaNF2Az8k3W6rdwOBSfRaAoaQ==@linaro.org X-Google-Smtp-Source: AGHT+IHiQ56kU+kJx28yTSi1PaSBt2INGgAnIbh1AZBEYLr5E8SzRqU6WGWdxVf8T9PrJob4OGVI X-Received: by 2002:a05:6102:3ec1:b0:4b6:1a4e:9ed7 with SMTP id ada2fe7eead31-4b61a4ea005mr23043074137.5.1736983863596; Wed, 15 Jan 2025 15:31:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736983863; cv=none; d=google.com; s=arc-20240605; b=jLS3YU77MYyA4j2gU8WsVu3Wn0tXOmCqsYwFK5l/NNIJ0I654fJZMlb9Z7aEFkc43Z spKMaWSVqVOruKT8rSO5vNiI66mUH22lEEbeyeERgue498vwNp9AsQ8OGFSTHHsAOMz6 HXxYbISB0RgPDxm44tliXp6fKhp8tPPv6SF6WB4iHmFNsLmDx0aUpqs7M7jknZMcWu4L zgothihbLxnk8GZ5emwKOPswAL2PMlAVFluTyFc5E7s76z705YTOcxAfnKP0pcr4XeZx gHdVnsdnNpuF9qwlQZ0Z6PtZYU23AN7/0zEzRIKzZch0cwT/tNgYzSlYbCY3aNNPJA5t oHTg== 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=IAnsUgZcwbLVJsP/XsIEi+0G7e096dCuqBuVIP59Z6k=; fh=vbC9XRCEPtWLeFY5dMetP0+DZx7J3Hlgl6kGR/4t3xg=; b=EahxKtYq31na5g1QJFGBaeBB+OoYn8zsrA74YyRIog/Wre2e1ylcsCTNmX4VIK3JQL xtFayPJiPD7GMJpDvqzEjuegSEAtkOaZJoi0gdS9GBZCWpezWB2aXsCh/YTeL6QNbI6p POz78JCAQklwR185/PYQPzKA7rgrM69/ZVL7afjWrHwGXO5mXWGBwu0OASKqmDuoIpRw zIR22TRSBiycGFU8zHD4taKfbVjJ/JdK0kPyLA5od5o7bGwt2H3TEp7M8YPpR0LpUxik ZFFInYsbERMS8+n3dvYw/fGN3ajkAW0OWHc7ZQJyABVMeim7Cjy6NmAWxOzL/eATBHYE a7ZQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=U38IV2GE; 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 ada2fe7eead31-4b6093dd885si4345565137.645.2025.01.15.15.31.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 Jan 2025 15:31:03 -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=U38IV2GE; 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 1tYCq2-00061a-4C; Wed, 15 Jan 2025 18:30:18 -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 1tYCpr-0005rY-I4 for qemu-devel@nongnu.org; Wed, 15 Jan 2025 18:30:09 -0500 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYCpk-0004ky-Q8 for qemu-devel@nongnu.org; Wed, 15 Jan 2025 18:30:03 -0500 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-38a34e8410bso164628f8f.2 for ; Wed, 15 Jan 2025 15:30:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736983799; x=1737588599; 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=IAnsUgZcwbLVJsP/XsIEi+0G7e096dCuqBuVIP59Z6k=; b=U38IV2GEb/wluFa0/+zkSWXPjq3nsrV0j0XsryBu2FxqXqxctc/5+7lAwE8BJts0x6 IXhZ1eL74lsQTTYOn6LYaL6NJ3/iihOg+c8oOh+W06pAW6df3cHGGfV9JK9TaD4aqlhP ihZOZ06icQfGjHPyF5jDA/OEXMzYEe6BKVafnx2nvzCRAwQKDGEhbqPque0Pt5ccof9D Q0CMCQdFA7Xw90TB+D8B2PjL/OIkAp6+1s2Sjiae0frGkIn/swoBEltj3bH8/fy0uTKh doqEN1hD4osZSFb0DTXWj6sb7sqdwKsTwCv9Iirs2/ZsLlwte/eRPcAsJRMqzHr8WY7z tm1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736983799; x=1737588599; 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=IAnsUgZcwbLVJsP/XsIEi+0G7e096dCuqBuVIP59Z6k=; b=g9zGvFgfz+a9+UvP3NPhVxfl/y0pqb/CDlF4FyPW/G07camhrU5XYabaGpL3k2TtuW pQ9MCAOTFMuxMKLRz4MofN9mxeFE7PnKlHs8daia4LsyBP4AfHuRd1oint8WbSN0U/uS aydy1bbzsMEzCfaJGpg4IK7unrruYy1Rf4xL2qQ1oW8Z0xR8YstItQBBNSGHDWn6itpZ iWykNrGg/onFqBNwF1HBpOWXv2YpwhytEbxEzQxSKnKFMLcEv1ysn4Y1M0bxb2zb9hD9 w5ho6FOr3jFf+cMwuVgd0QLyC1Bt7H4uSoMRN1tve5eWVCjYPxgBBVeBII+SyaIMNiZh A++w== X-Gm-Message-State: AOJu0YwnmZKvq/Jo8Z0fVsbgGpTXiAB2irY9we5yTkjVssGWrpQpHkoW AkSavXuntJk6/fVPCfRdzuspzDt8ffgdjLbH31jHqmDasQDJfiOUut0uf/+aDZIDv/jhA0Ol+zg vUnw= X-Gm-Gg: ASbGnctVur+PXVpz9bI/GBNaoI9SRJSCI+/MU4k9sCfY058V7gyU8oQjwziEecz0qvX 56htgLqiMGlVv4DXucdNjG0xf6z5+3vrzUPQD7fDXcdpyYwfx4lWz6YaUtQOyVH9iqBHjPA8YKm wgh4mMGk7rfGTOkS9YokC4nV1Il06W18bevGibGJLzStG7BxwvZB79GVVSzzc35+ACqOifmaGeC E6v6buRT8n+iHrfmFGWRQuhUZgFxbWXt2VyRYuqQcZyQj+tfaINA0cJLUUS9wcNRvEb5LVXJthO e8OhgnU87S0M5ppo5nBwARQJ56Fsats= X-Received: by 2002:a5d:6da4:0:b0:385:de67:2269 with SMTP id ffacd0b85a97d-38a8730e04amr26216975f8f.36.1736983798887; Wed, 15 Jan 2025 15:29:58 -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-38a8e4b7f79sm19196267f8f.69.2025.01.15.15.29.57 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 15 Jan 2025 15:29:58 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Huacai Chen , Richard Henderson Subject: [PATCH v2 01/11] hw/mips/loongson3_virt: Factor generic_cpu_reset() out Date: Thu, 16 Jan 2025 00:29:41 +0100 Message-ID: <20250115232952.31166-2-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250115232952.31166-1-philmd@linaro.org> References: <20250115232952.31166-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=philmd@linaro.org; helo=mail-wr1-x42a.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 main_cpu_reset() is misleadingly named "main": it resets all vCPUs, with a special case for the first vCPU. Factor generic_cpu_reset() out of main_cpu_reset(), allowing to remove one &first_cpu use. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/mips/loongson3_virt.c | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/hw/mips/loongson3_virt.c b/hw/mips/loongson3_virt.c index f3cc7a8376f..47d112981a2 100644 --- a/hw/mips/loongson3_virt.c +++ b/hw/mips/loongson3_virt.c @@ -399,25 +399,33 @@ static uint64_t load_kernel(CPUMIPSState *env) return kernel_entry; } -static void main_cpu_reset(void *opaque) +static void generic_cpu_reset(void *opaque) { MIPSCPU *cpu = opaque; CPUMIPSState *env = &cpu->env; cpu_reset(CPU(cpu)); - /* Loongson-3 reset stuff */ if (loaderparams.kernel_filename) { - if (cpu == MIPS_CPU(first_cpu)) { - env->active_tc.gpr[4] = loaderparams.a0; - env->active_tc.gpr[5] = loaderparams.a1; - env->active_tc.gpr[6] = loaderparams.a2; - env->active_tc.PC = loaderparams.kernel_entry; - } env->CP0_Status &= ~((1 << CP0St_BEV) | (1 << CP0St_ERL)); } } +static void main_cpu_reset(void *opaque) +{ + generic_cpu_reset(opaque); + + if (loaderparams.kernel_filename) { + MIPSCPU *cpu = opaque; + CPUMIPSState *env = &cpu->env; + + env->active_tc.gpr[4] = loaderparams.a0; + env->active_tc.gpr[5] = loaderparams.a1; + env->active_tc.gpr[6] = loaderparams.a2; + env->active_tc.PC = loaderparams.kernel_entry; + } +} + static inline void loongson3_virt_devices_init(MachineState *machine, DeviceState *pic) { @@ -572,7 +580,7 @@ static void mips_loongson3_virt_init(MachineState *machine) /* Init internal devices */ cpu_mips_irq_init_cpu(cpu); cpu_mips_clock_init(cpu); - qemu_register_reset(main_cpu_reset, cpu); + qemu_register_reset(i ? generic_cpu_reset : main_cpu_reset, cpu); if (!kvm_enabled()) { hwaddr base = ((hwaddr)node << 44) + virt_memmap[VIRT_IPI].base; From patchwork Wed Jan 15 23:29:42 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: 857643 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp2732988wrc; Wed, 15 Jan 2025 15:31:47 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVj4g6Wgu8PgDON+0rKgGDX9L2K+kL1j/e7mWsJScdCyEQj5D7oYyimLl/UqsckDMFyCs1vsA==@linaro.org X-Google-Smtp-Source: AGHT+IG0YJM/eTGMkRPPFSVgsvSa2DM+b7XjCP3xVgJo+DIGUansRX9DZp9alzEEkjFkLhN6Vpdv X-Received: by 2002:ac8:5fd1:0:b0:467:6742:5633 with SMTP id d75a77b69052e-46c7102bae6mr498387121cf.23.1736983907293; Wed, 15 Jan 2025 15:31:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736983907; cv=none; d=google.com; s=arc-20240605; b=AmKVWRHHClOSIdq+eBdsbccWqPVep/+yTQXJ4LjZNm/88Bbw48FpLnkE5wS0PAcBGT SzZjFSge3IZFEu2j5mOV69h/sHQJw5dEig1Ft1Uue3bfmEr57hLABV3wcLtcP0vG8aV3 wHo49U2zKlKxFgkUjehlNhxwg2sugclnkDHnsCKEsd+9NV/KB4XOnvRO+3Aac5vyvtJP YYPhjpLRJBVrCrF2Dg+8HPLdkLmK0d+ahckhEkP0YimkZXuPpIfhfcHVC0hK/yJhQASJ MxY6mzyDWwJty8lM4HgA0ojECheWtA3nuZW41O12yrnUhZZXxM4qLgF0Po8Res0bF3iQ hbHQ== 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=642TEQtW37S8xYU3EVMOt0HBBzzyTYdBusCSNo5Ytkw=; fh=r3TwtAT7u/i4c0AptW/V680UFZgQClyi7rFb17m/Es0=; b=e1as3rz2fMMi75DZu2HTxfVEjpCnx7njCUvEKxc+CUyzFS61KO0cIul1LLb9zekv61 ctyitqec8R+3qJoguZROynjPS5DXFw7w3N3nNjI5A+q2fzQhYC4/4hCzS4onFgx3NXtZ z+JYOA7H0B/7v5A/zMpqO2yXI/d4t0VjB9yNav/zpQEAYAm9vEI2Ds9TjmpOKYpXtgV2 52oieCrRU6Qa4xgXLFoIcIWmJKRWzsLViRAAnLeuUtenZHkebH4nna4G4P7MrzRlXcto E1PsnioUu0vxVI/eXKLE9QdnKplw/yJW4R44EvNXumqOFXiSFv2U4B40k6iKHSUsoYYB r9xg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jGwUn6j1; 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-46c8734fac0si166813781cf.151.2025.01.15.15.31.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 Jan 2025 15:31:47 -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=jGwUn6j1; 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 1tYCq4-0006CB-3s; Wed, 15 Jan 2025 18:30:20 -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 1tYCpv-0005sl-8r for qemu-devel@nongnu.org; Wed, 15 Jan 2025 18:30:13 -0500 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYCpr-0004x7-T3 for qemu-devel@nongnu.org; Wed, 15 Jan 2025 18:30:10 -0500 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-3863703258fso939192f8f.1 for ; Wed, 15 Jan 2025 15:30:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736983804; x=1737588604; 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=642TEQtW37S8xYU3EVMOt0HBBzzyTYdBusCSNo5Ytkw=; b=jGwUn6j1zUqj7NzaVbQ1zjMgPVPAe/wY5+Js1C0HHm8/yL7HJsEff/kSgPh/6hTRN2 X0V4ddH+2DRW245x2a4Q3lux6vpGI6LeTpBnJsS9Z4EV8/3Xi/y1pb23mU0R2vP3R9Q2 eCxliXP+RSPr6JU2MljxYQrQ1ETOePrDCesn/KuwWw2rcf6rZB2gVuzdRTQHP+X4rTm0 83TdZjkjsBxzHDWVznoQNecdIjXFuspcKjmc+mFyciVvRgwsNCP+0W9RsZncD2AVyQo6 mVoPkeprh0C3X6L+tB9QyU7AzggbkSynhrWS1EuNc6VcNL/ENqA5RaYCeEQja8dwvP5K /oTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736983804; x=1737588604; 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=642TEQtW37S8xYU3EVMOt0HBBzzyTYdBusCSNo5Ytkw=; b=EDjDskIUpjQ8JVwvgpoHIYw5JJsjww/mWzDFuyWaHE7JAO1ddLICCONf+GQqbK7Tzj h7teqHQELUEtIGiTXBmpIk21YEVBmml894svH4SdgHSGBX8jBx+AELy0u31F4S3HwUkW w/hAc1pN9jgfWjOelDqclkgYEnPo9/zu2NHNNtUaOIB1fKhKYr4nfNxEDSXdYpO9/662 noML3ahIZHm1mFy21+WbhoQLFPn/h+jHF1oDdLbsyY380x20nlWFKOhgP+lwpTD9RmaU YBGOqWJUdgBC8doSLS2fV3+i5zcaiL2aH3vdIMmpBWYVsD9mi0BZ9MXTBulY+OcVyJPr ZCpA== X-Gm-Message-State: AOJu0YyhQWP3Tdg7plW5vGhh/63muj/Yz5CRngKCDhBNaOJSDk+zjLkV xBOUYEThR9Sopg9HEGsP7OL2tBXvuuyLlcyIUs5rmSr3GRH6FWhgV1Fw4kU35Pe2zp2VQeYLZml ys6w= X-Gm-Gg: ASbGncsSBzba0ovHmrt5y90+32dvUx3xBh+IeH+Z6hj5ZjpcnURDeRIJAU9q3TeHhb8 29vFlvRWJ5QYSr3jwamibNOmf75E1KTOExcvEWL+lwqop9tpCnnPpavfCGkUDygBLCnIX/UdK+W Dx02/b8mFT3vVq5REUzrKyfHP7Vsd2NSpUoDyxPgSeSYSHJL3SSOi8A1H1BwIZdVC229mkJPiib BZJgyjREf/TuHFvW07tN98scTGkWnyeCHO6M0DR2fh96XWPy29S/ww01r9wQsCrE0J2yLp10GL1 /XTj4mp65dYU4hXtNMIEEm84p+2GD1g= X-Received: by 2002:a5d:47c4:0:b0:38a:5dc4:6dcd with SMTP id ffacd0b85a97d-38bec5075ebmr426747f8f.22.1736983804123; Wed, 15 Jan 2025 15:30:04 -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-38a8e37d090sm18658080f8f.2.2025.01.15.15.30.02 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 15 Jan 2025 15:30:02 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Huacai Chen Subject: [PATCH v2 02/11] hw/mips/loongson3_virt: Invert vCPU creation order to remove &first_cpu Date: Thu, 16 Jan 2025 00:29:42 +0100 Message-ID: <20250115232952.31166-3-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250115232952.31166-1-philmd@linaro.org> References: <20250115232952.31166-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=philmd@linaro.org; helo=mail-wr1-x431.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 Create vCPUs from the last one to the first one. No need to use the &first_cpu global since we already have it referenced. Signed-off-by: Philippe Mathieu-Daudé --- hw/mips/loongson3_virt.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/hw/mips/loongson3_virt.c b/hw/mips/loongson3_virt.c index 47d112981a2..488eba495cd 100644 --- a/hw/mips/loongson3_virt.c +++ b/hw/mips/loongson3_virt.c @@ -494,7 +494,6 @@ static void mips_loongson3_virt_init(MachineState *machine) long bios_size; MIPSCPU *cpu; Clock *cpuclk; - CPUMIPSState *env; DeviceState *liointc; DeviceState *ipi = NULL; char *filename; @@ -569,7 +568,7 @@ static void mips_loongson3_virt_init(MachineState *machine) cpuclk = clock_new(OBJECT(machine), "cpu-refclk"); clock_set_hz(cpuclk, DEF_LOONGSON3_FREQ); - for (i = 0; i < machine->smp.cpus; i++) { + for (i = machine->smp.cpus - 1; i >= 0; --i) { int node = i / LOONGSON3_CORE_PER_NODE; int core = i % LOONGSON3_CORE_PER_NODE; int ip; @@ -609,7 +608,6 @@ static void mips_loongson3_virt_init(MachineState *machine) pin, cpu->env.irq[ip + 2]); } } - env = &MIPS_CPU(first_cpu)->env; /* Allocate RAM/BIOS, 0x00000000~0x10000000 is alias of 0x80000000~0x90000000 */ memory_region_init_rom(bios, NULL, "loongson3.bios", @@ -640,7 +638,7 @@ static void mips_loongson3_virt_init(MachineState *machine) loaderparams.kernel_filename = kernel_filename; loaderparams.kernel_cmdline = kernel_cmdline; loaderparams.initrd_filename = initrd_filename; - loaderparams.kernel_entry = load_kernel(env); + loaderparams.kernel_entry = load_kernel(&cpu->env); init_boot_rom(); init_boot_param(); From patchwork Wed Jan 15 23:29:43 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: 857637 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp2732693wrc; Wed, 15 Jan 2025 15:31:02 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUxmXWRWfL3m/KIh4Jv07G3VneJXxrwNVyeAmumlEkAA7DJ/CxnadmpnqI4draHFkoXtkHK6g==@linaro.org X-Google-Smtp-Source: AGHT+IEMC+gepSA0VgbnBLKyee8dSRnz6gglSFJ8LMXsVkeo/0xnix/A970K3qz5jwocXgL/Wg2O X-Received: by 2002:a05:6122:3c94:b0:518:791a:3462 with SMTP id 71dfb90a1353d-51c6c50f1f3mr25180173e0c.9.1736983862461; Wed, 15 Jan 2025 15:31:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736983862; cv=none; d=google.com; s=arc-20240605; b=EAGMt7YiSLsOnnM7f8iCyGnZn1wbm/x/JhT+W2Oc7JcyUeYRkkV4QRIDN0Zt2r8Som 5vZj5/+t43wviMdsi/l+h0pCCk/Z5ZnBs47mClWjz/qoFQe+w7feBC6PPzNiK/2Au5uf eyNMoJaekaduRXDVoxvli61QeI8TG+CdTknwN60QeqEAm1AfGYpeHdsdfsg/LZNOLLcA Tt1lNaRp6MmZEOraFXrplwsuGYk39pBrpDXlj0+MfN4rjO1q2lBsxsHeWEaXqksM2sX3 li0GouDmPd7nxlNvng8Vrp0tbXzp5I59OUYGZuyeDqBRwjyqabZtfAlK9ZaygADUsPE3 UAcQ== 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=w8NsqtuLl1GgOwQ9maEwkOukw0Aj0PDgWtnDGfLDaJk=; fh=vbC9XRCEPtWLeFY5dMetP0+DZx7J3Hlgl6kGR/4t3xg=; b=G4RXJkBQTUxNnN+sUlTvRyyEyiH2MEoQGr16ianJc9Ht4k3e+W45Mxh0Zb75wZZ4CF pIU0pSDnlOZJRWM3p7J08o7y/wwJJldyZhUeu0OWR2twbhqaLPY7uc7D5P6isZrGiNRC prjszmLxiubnSKr2dCaM0zIWKXHuJ7PEZImndNf56ISVTXA4q6cz9Wqt8fuEFuRrjZrP cY0KwpFrz3o6kbrg26ki6Z8Y/su7OYYGT4heGEVo1UGGhZRCAw3rwGI+nYx2nDEBLuQL xDcDV6++Msi8S8sJzOFJ2lWsJ4XvaaxyyR3G4RzPmVgf9QuBY4kK0bCmDCn0+4UMJDF5 mO3g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qybltCIF; 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 71dfb90a1353d-51c7fba137esi5268795e0c.10.2025.01.15.15.31.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 Jan 2025 15:31:02 -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=qybltCIF; 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 1tYCq5-0006It-HI; Wed, 15 Jan 2025 18:30:21 -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 1tYCpz-0005zJ-8q for qemu-devel@nongnu.org; Wed, 15 Jan 2025 18:30:17 -0500 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYCpx-0004zB-I5 for qemu-devel@nongnu.org; Wed, 15 Jan 2025 18:30:15 -0500 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-385eed29d17so195562f8f.0 for ; Wed, 15 Jan 2025 15:30:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736983811; x=1737588611; 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=w8NsqtuLl1GgOwQ9maEwkOukw0Aj0PDgWtnDGfLDaJk=; b=qybltCIF8Ck2xiYYHKD7TVWAEeIt11y+MkS73utu2awsyqFWLRnyxgbL/AOI7bmXx9 4pAsSUxaKPubihAKED2DuXhPtB/yQ+S/yHQKIfKhvT4iIcsSfFQwUqI2DQ5ngZU7Q3r1 P2V6H/FA8dTN5bjEc1+zkYqiMQajxMtbCS0ht0Qm9DdEb1F+ktAyehhKNcfmaL10Czen iy35ZR5FTawV7Ca7dAMFjz3IConk8owWP9DPg/Off3uhES1dB/BmqNhXbLgHPqy+/bmZ WPevIdOpnPkHBc3XyCcw9h3OPeKSSCkST1QIJuMBDqVr9gvLBeviyFqW0Seh6W2OVCDs g4QA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736983811; x=1737588611; 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=w8NsqtuLl1GgOwQ9maEwkOukw0Aj0PDgWtnDGfLDaJk=; b=W7993d+wpI4K0n3lOhlX2xddeQkt7qSrAcJdkDeaPggSDlDrh1wB3Q0pFPSa0+cs/j xLrByFAyXuGujnKzgQf3NcAw6LxdzZEnh5Ke57JvPoqAOGqGojjL8SgsDGFKa75sFCup yMVU4BakclJWdCWnbZdqDOEmssYq5WVRfyxe4HVLwkQH82oGU1Gh2t4tL2HoTMP0jsv9 tzFQByMnl2vcKL0UijAzo/vmQopNVG68vSG4U+Vc01xK9Ka/PitMs7XBwsmUz9jCsRkv 5bEU28xFOGPgdQl8LmJDDdGZgWSpR/HrTvjkU6h8S3FtUEekbnIDjVjXzRexyMhlMBjP +hbg== X-Gm-Message-State: AOJu0YyzFWkIUGavr2f/nfrHNCuY4ma/xRWi5IF0Giaid4f7NHaBLSST mDjGbHMRkHCsi/v4iu5f4n1gYmOVXZulagsz0FRyn4H1EqG7ABK6tbtQmNBxflwf1dNjOXbXCwA dexU= X-Gm-Gg: ASbGncsM7FS6CQ98zRbrHY+cMLIPxeT6pkksfs+hoeq6DTQwHJfo8zSVitdKuDdev9d 8FGmyzhNAbgQER7vqBnf2Ep4Kq+KbTomcWPeCn2TJQz9dbkU4ug05fN9odgQcX55kLp3xDsIDVu SVmF5pflA/3Ql8CsvwaWndCo695fInzIqpcb1alI9RQrrZZ6RzdJaFz0JoGeNKgpBV7UYq/+z9O /jufPaSqrObTgFsxG7jb0MnELWgB2pHJ/BG7YbnotYdFHc193jE+A+4ikijAgiSRhwx64fbTpn1 yPLT/YsBpt0YTySuPeDuOpeeEknONFI= X-Received: by 2002:a5d:64a8:0:b0:385:e429:e591 with SMTP id ffacd0b85a97d-38a8730a6bdmr30749043f8f.23.1736983810210; Wed, 15 Jan 2025 15:30:10 -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-437c749a127sm39220785e9.7.2025.01.15.15.30.07 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 15 Jan 2025 15:30:09 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Huacai Chen , Richard Henderson Subject: [PATCH v2 03/11] hw/mips/loongson3_virt: Have fw_conf_init() access local loaderparams Date: Thu, 16 Jan 2025 00:29:43 +0100 Message-ID: <20250115232952.31166-4-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250115232952.31166-1-philmd@linaro.org> References: <20250115232952.31166-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=philmd@linaro.org; helo=mail-wr1-x42f.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 'loaderparams' is declared statically. Let fw_conf_init() access its 'cpu_freq' and 'ram_size' fields. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/mips/loongson3_virt.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/mips/loongson3_virt.c b/hw/mips/loongson3_virt.c index 488eba495cd..1f5952d7082 100644 --- a/hw/mips/loongson3_virt.c +++ b/hw/mips/loongson3_virt.c @@ -280,7 +280,7 @@ static void fw_cfg_boot_set(void *opaque, const char *boot_device, fw_cfg_modify_i16(opaque, FW_CFG_BOOT_DEVICE, boot_device[0]); } -static void fw_conf_init(unsigned long ram_size) +static void fw_conf_init(void) { static const uint8_t suspend[6] = {128, 0, 0, 129, 128, 128}; FWCfgState *fw_cfg; @@ -289,9 +289,9 @@ static void fw_conf_init(unsigned long ram_size) fw_cfg = fw_cfg_init_mem_wide(cfg_addr, cfg_addr + 8, 8, 0, NULL); fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, (uint16_t)current_machine->smp.cpus); fw_cfg_add_i16(fw_cfg, FW_CFG_MAX_CPUS, (uint16_t)current_machine->smp.max_cpus); - fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, (uint64_t)ram_size); + fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, loaderparams.ram_size); fw_cfg_add_i32(fw_cfg, FW_CFG_MACHINE_VERSION, 1); - fw_cfg_add_i64(fw_cfg, FW_CFG_CPU_FREQ, get_cpu_freq_hz()); + fw_cfg_add_i64(fw_cfg, FW_CFG_CPU_FREQ, loaderparams.cpu_freq); fw_cfg_add_file(fw_cfg, "etc/system-states", g_memdup2(suspend, sizeof(suspend)), sizeof(suspend)); @@ -632,9 +632,9 @@ static void mips_loongson3_virt_init(MachineState *machine) * Please use -L to set the BIOS path and -bios to set bios name. */ + loaderparams.cpu_freq = get_cpu_freq_hz(); + loaderparams.ram_size = ram_size; if (kernel_filename) { - loaderparams.cpu_freq = get_cpu_freq_hz(); - loaderparams.ram_size = ram_size; loaderparams.kernel_filename = kernel_filename; loaderparams.kernel_cmdline = kernel_cmdline; loaderparams.initrd_filename = initrd_filename; @@ -660,7 +660,7 @@ static void mips_loongson3_virt_init(MachineState *machine) exit(1); } - fw_conf_init(ram_size); + fw_conf_init(); } loongson3_virt_devices_init(machine, liointc); From patchwork Wed Jan 15 23:29: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: 857640 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp2732830wrc; Wed, 15 Jan 2025 15:31:19 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWXoFlSAE3ecyS/sGBJsIJnZctPDBqjQsqvZ9+MQ3DlWTsprGM/AiCTim0+SdVp1Piz2d9OpA==@linaro.org X-Google-Smtp-Source: AGHT+IHBcSzx6gLbmnbx4mgD76hYwslmy5IjsFGVLvTwnxMDJWOUvSfDgym2Gx+DgOCUiHAS9kYJ X-Received: by 2002:a05:6102:c4f:b0:4b2:49ff:9786 with SMTP id ada2fe7eead31-4b3d0e8ae3bmr29015031137.17.1736983879137; Wed, 15 Jan 2025 15:31:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736983879; cv=none; d=google.com; s=arc-20240605; b=LJa6aYZzgH1etFcesP8hL9S51LUtB70RM72txlmdcXFG2G1dnUH4cN34WOQpGCmeDl Y4HyWng/1VmKwxHCv3ev3WlVJ/i03IKP8VlRoZ9oBdRLuYtHvvwxZv1OnkvEPa9YkrXd u7ApwQU+Gp7KMm0vtjLvrZvrps8YoXlvFurgLThWbuP1h5sC3wl071agIQQCo3dX47Bt jtJNdQjyXLyTWafjwR+7aHTMvOrH0CqPWxKJjEb7raPw7EIO7fcEgExvWnf6ffMCNqqm 6J9Ro6zSD0fdTDxU70itCb0g23oDdOEUr/+B67HWYSPjQFhmEOz7APTaUpf2mtSIq26/ xTkA== 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=lQE5apo0BwOCfvKDAYCRzW+MfDklvN0VdczsmfqZ8+c=; fh=vbC9XRCEPtWLeFY5dMetP0+DZx7J3Hlgl6kGR/4t3xg=; b=D+k0mjoXj5RYgTXLfoiaW5EtKwcO55cICaX4Fv5VTbuxkhRxYfeNHIHXJrRVO88GX1 Oz130hUAMG/kPXq1mV9D0Z/PhpbtKG7tucI6I6Y7ut6WcCIgzS7ggKTMX+H75otM0neL Z8xfIuKWsWQaeYKl09tASW5v9OjxcYeuhttfdLEho41Y1EfG5GREuORtnMn7dO29xD31 5bY454sEm2lWoo44CWGUlrnJtA0wTW9+6PJlDdOZiJuPmJEW9BtvDjTSoh612QAfRVeD OU66dThooq86BpKU2BoUTQoYz/iI2pjgkLlerteqievdepCDjrdW7gDp1CUHfNfd093W PPKg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=g2aXa7dT; 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 ada2fe7eead31-4b609380e03si5139908137.590.2025.01.15.15.31.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 Jan 2025 15:31:19 -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=g2aXa7dT; 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 1tYCq5-0006HO-4J; Wed, 15 Jan 2025 18:30:21 -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 1tYCq2-00066h-Ra for qemu-devel@nongnu.org; Wed, 15 Jan 2025 18:30:18 -0500 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYCq1-00052X-91 for qemu-devel@nongnu.org; Wed, 15 Jan 2025 18:30:18 -0500 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-3862ca8e0bbso270003f8f.0 for ; Wed, 15 Jan 2025 15:30:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736983815; x=1737588615; 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=lQE5apo0BwOCfvKDAYCRzW+MfDklvN0VdczsmfqZ8+c=; b=g2aXa7dTkqWaCOGs3xMpKwOIa4gh63hN0eHbpPgcbDPNmr90aSHOmHkaxt1qNuctEc I8oqfZz6RuDW1T08xd6yZDqnIhFdOcM28YZUXOU16JGtavUFrGB+DscKsjq0xaaQUmkM GFJDK1OA2Vb1Xh6FXUA8i8JwnTJ/15/rGkJPc+2Zcizew3TLFR124lHiD5Whtig7kofu NX8392GB4sMTrnVAGNIsYXvPoGp61jIHlF581mRpqaeChk7/uNqkjputdoEJF+95IrKw b7TSWBreQbu6gQ5VQJxRxypZeG0J4Suvgc+YuvaO5M5YQg+lw2PY+pkP7FKlk2TTM6eQ 7y+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736983815; x=1737588615; 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=lQE5apo0BwOCfvKDAYCRzW+MfDklvN0VdczsmfqZ8+c=; b=B+5W+g0C7c5sjk7EcbFRVBwvxbZfAIhk9dFf7BdLGOtk9wnNnA4FH2QTcquJA8sWT6 ZMZdcY9kPIcRANWe4FUUqZDcY1Uk6pw0OmnKeeUQhQZVaR7GtOT4zyN3K1ltNftlhv6N JxgrtoVHLqRoisFPk4fOoQjGE3JPL4rUlK5KcbgFFmJcYazywnUG3jiPxjssYEAM9DnU n/t0lg0uvQ6y3WX+2rKGyFqMP5tlX7/XqcDROdoIKO2gBfSRtzAoGxb3Rg6Te9BAoS6V H5DUMwloylRTTd/yS3dXzjp5333H/kP5xQfCoLXdzDbS7lwymM65bW8z6DFDD5GcdU5H ZfxA== X-Gm-Message-State: AOJu0YzhrYu8HxekkhzQ8yeI2Dl4cqdAIeV3kkcwkRAIQlpoD8W36ynV rfyVh7bnLQh4kmG3NBBEGp2EXMiiXFKqWwvrV06qVWDL/DTucgy3socs60aovNoiHzuabgwx6p2 hAZk= X-Gm-Gg: ASbGncuStcKSWFE6Blm28NXWPJZaQoZrmhBnq+6Bk4ZdiWtVe2K0lw5zM2K+xafWbNX uVWLr9ry7AvKM7GABFRmGWM/rpWwLCa0Zk674sl18Xj8No50CMQRKCmzovy/ihHRDgJLN4XlIeQ YF2GgfCLdDeFcenA9B3hWLEUN++IrCBWPh0aPY6yw1bEt+EFK7XPC+pJosy2HydEAFIoxinDAKq QwBjXa55zI3rwJGyVN9lSeTiY572fKH/DKR8sZV12x/tiMYq/5ai+CL0ftOkEYXsdvqp0fMF3yb /VzMHDtI8DJwqxtxjSg6YHDKIYrBV38= X-Received: by 2002:a05:6000:4618:b0:385:f560:7916 with SMTP id ffacd0b85a97d-38a8732aeefmr32441179f8f.35.1736983815580; Wed, 15 Jan 2025 15:30:15 -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-437c7499932sm38704655e9.7.2025.01.15.15.30.14 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 15 Jan 2025 15:30:14 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Huacai Chen , Richard Henderson Subject: [PATCH v2 04/11] hw/mips/loongson3_virt: Pass CPU argument to get_cpu_freq_hz() Date: Thu, 16 Jan 2025 00:29:44 +0100 Message-ID: <20250115232952.31166-5-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250115232952.31166-1-philmd@linaro.org> References: <20250115232952.31166-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=philmd@linaro.org; helo=mail-wr1-x432.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 Pass the first vCPU as argument, allowing to remove another &first_cpu global use. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/mips/loongson3_virt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/mips/loongson3_virt.c b/hw/mips/loongson3_virt.c index 1f5952d7082..9c2001295d1 100644 --- a/hw/mips/loongson3_virt.c +++ b/hw/mips/loongson3_virt.c @@ -153,7 +153,7 @@ static const MemoryRegionOps loongson3_pm_ops = { #define DEF_LOONGSON3_FREQ (800 * 1000 * 1000) -static uint64_t get_cpu_freq_hz(void) +static uint64_t get_cpu_freq_hz(const MIPSCPU *cpu) { #ifdef CONFIG_KVM int ret; @@ -164,7 +164,7 @@ static uint64_t get_cpu_freq_hz(void) }; if (kvm_enabled()) { - ret = kvm_vcpu_ioctl(first_cpu, KVM_GET_ONE_REG, &freq_reg); + ret = kvm_vcpu_ioctl(CPU(cpu), KVM_GET_ONE_REG, &freq_reg); if (ret >= 0) { return freq * 2; } @@ -632,7 +632,7 @@ static void mips_loongson3_virt_init(MachineState *machine) * Please use -L to set the BIOS path and -bios to set bios name. */ - loaderparams.cpu_freq = get_cpu_freq_hz(); + loaderparams.cpu_freq = get_cpu_freq_hz(cpus[0]); loaderparams.ram_size = ram_size; if (kernel_filename) { loaderparams.kernel_filename = kernel_filename; From patchwork Wed Jan 15 23:29:45 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: 857638 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp2732694wrc; Wed, 15 Jan 2025 15:31:02 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXW8T5/Rk4bK+j9c2tjv/hqPruw0MbPqjU75hPLqAVObkrnSP3WIqPLjudKoqQkM/u9487uUQ==@linaro.org X-Google-Smtp-Source: AGHT+IFPTX/IPhaW1AsUHSXpKN+AXJaVGl7UJwrMCJEd2tevcT30+pXvD3bLD++2hhL3jV7ipjPd X-Received: by 2002:a05:6102:800c:b0:4b2:5c0a:98b7 with SMTP id ada2fe7eead31-4b3d0ef99c6mr26616263137.6.1736983862561; Wed, 15 Jan 2025 15:31:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736983862; cv=none; d=google.com; s=arc-20240605; b=Gj5dBKvdbDdd41t+XixCXIZuxZ3LOUcv+VWGgPCX+DsJO6yoVb5p7qQ3qjcazKuF4j cT5OXO55bHh/xPIviuPwqquSjXsx1lCfvLpNC17R+hjeHP7yXA1CIXTMLEFuEgchLJxf 1M6sOg0fs/9cIDH5GgPq2dsFdgaJlSMtKaLKZ8/hinoPtXt+0R5VgOkYCBPWRVOMNoev qs/i0vpTwmztknIv0jK7XjKQu5l3nlI1U70tYL/f9QcbIn3YHIP3gdaWm5EwnJlAYdgj n+ywyIdPJalBVckAcYSamfH2/C+JiR4U79ma8M7HlPeKuSUbJW1y3/B9girDkc8wYRGO mNKg== 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=YgJvGryqr3TkhFMqWrnYlBHew87iojgecT5lYXi9GM4=; fh=vbC9XRCEPtWLeFY5dMetP0+DZx7J3Hlgl6kGR/4t3xg=; b=R3hMwE1c3k60rUop7q/obEMW7Lh+n2TbFhjRdk+gFYaqQGAHwBRSWh6iVStGjI5Goi qwLWFh6+rxuCFoTtVxoZ46roPQh9kdh/+ydAyJi3TAbzb3hJpCtvMwyLFIyFT6IGNBVW G2k+s0iJo9G/I5bZ0oLykse6z6wczvS8mH6PxuYvwI2kn9JSShSyRscb/BHo6DMOAPLj ZIeFnWUV8RsoXc6TPy4ZOzKAfscTVffmFBWgf7tuniSGT/0zlGJ5sG2girwM+Rvdo9Il LlNfg/AuUoyaMb+UhZvL7rfW4rRaF9jgWWDZERbJQbGDWc/WJ135MlIWslCGhc/l9rOr 9j3w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=djwMv1LI; 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 a1e0cc1a2514c-8623b3ac8b1si4058391241.89.2025.01.15.15.31.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 Jan 2025 15:31:02 -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=djwMv1LI; 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 1tYCqP-0006hU-Pc; Wed, 15 Jan 2025 18:30:42 -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 1tYCqK-0006gS-Pz for qemu-devel@nongnu.org; Wed, 15 Jan 2025 18:30:37 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYCq6-00053o-Qh for qemu-devel@nongnu.org; Wed, 15 Jan 2025 18:30:36 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-4361e89b6daso1439415e9.3 for ; Wed, 15 Jan 2025 15:30:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736983821; x=1737588621; 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=YgJvGryqr3TkhFMqWrnYlBHew87iojgecT5lYXi9GM4=; b=djwMv1LIRlf7QNERrWm2SeoWBEWsigMGeox1R48QQVRzzLYydGNNM+9z1P7ZU/btFk VaJ9fYG5PUTyq0mU19aYX6qgSW/5d0OuYUcFloOsR9eKdnI/IOZOc43rMVW/bRRyAqwz u8gqlBN+KZoXfVWbxgo0LzPwWL20toa8jkiM1pjqFg1wKXvbi9BUB3SE/0XBYbB+QMU6 9hUozVlQlNiY2B6kawYHOkSv2bhgYUFyctCeCb51Q57rQECt5pDJjmk4eJjlayyX6jTO Ns1z1Vi3M1e4CQQby9rdA7AYETpq+XIeZRaUa8ZLujrZGOUXizkiPssKZvRCuVUjJHoU OGLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736983821; x=1737588621; 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=YgJvGryqr3TkhFMqWrnYlBHew87iojgecT5lYXi9GM4=; b=tV1vALRMGiSmTshRT3As3YB3wBIjUxqh2IJTrGY6J1gCpfIIdvfygYskaDGZwSLHbR gj6jXbXC8vc1g3VDLQk1e66up+0wRUdmzXiZHwQns7A/q646th1Wv3739HOeZUdVDgmd Etw8LYniOQTyB4LsNfP90mDs8wZsLMuvalqtLnDH7s1CsmoxK+b0g/COVwLpucih3sqg Z4vWobjwRKcq2w3oVybYm6NQIoqIAZeNROoK3bOLOw4vvW6KM3bC1tFc1ws1vn77wzEX RihO8CWru9MGJpAZ1s/3MB4EUrCzLjK+UmoWq9YQ/DtB12luyG3XrCuDtS4OK3WCrPez Pa0g== X-Gm-Message-State: AOJu0YxM7OkfmA22MRLotZwJjj/QQGEIqElbYsyJE6dZlK62MpYfjkvi 4ynN0vnf5oAJZV2CtdhH5RMo2xRFbWf1LssNUrD3XGPbmw8MxNdvHYEYZWlgz/igu75Nd+eq6FB WZUI= X-Gm-Gg: ASbGnculw7PQiykLcN4h4i4vWjRM/PYdudnWxAWORkVC3PZaqGPvMTmVeZltEES1Two ELlz2dhcLRR864QdJg3Yp3whThBbdp23lbwHmg9Z8AkRu1FWrilCC43t/achWQqIkHkxumZrzPJ hAW1TZzMCFAHi7MYpkOEv9nxeB1Y19nIcr80IoPkO8ueP7KFW1fZvXSggdaaqagfdw0GM7lcBbz W97I01uDVWa25eIFutPVWEdwwOXBTFzK+f6ytXgDCNRzbe29sO93jQQVPEgFWCy06/UPwHcbFAp UmyOkBjW6Tg3gVxVx0/eHeWTmJ9CoG4= X-Received: by 2002:a05:6000:1566:b0:385:f1f2:13f1 with SMTP id ffacd0b85a97d-38a87303e63mr4962500f8f.22.1736983820818; Wed, 15 Jan 2025 15:30:20 -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-38a8e37d0b1sm18999137f8f.12.2025.01.15.15.30.19 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 15 Jan 2025 15:30:20 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Huacai Chen , Richard Henderson Subject: [PATCH v2 05/11] hw/mips/loongson3_bootp: Include missing headers Date: Thu, 16 Jan 2025 00:29:45 +0100 Message-ID: <20250115232952.31166-6-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250115232952.31166-1-philmd@linaro.org> References: <20250115232952.31166-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.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_PASS=-0.001, T_SPF_HELO_TEMPERROR=0.01 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 MemMapEntry is declared in "exec/hwaddr.h", cpu_to_le32() in "qemu/bswap.h". These headers are indirectly included via "cpu.h". Include them explicitly in order to avoid when removing "cpu.h": In file included from ../../hw/mips/loongson3_bootp.c:27: hw/mips/loongson3_bootp.h:234:14: error: unknown type name 'MemMapEntry' 234 | extern const MemMapEntry virt_memmap[]; | ^ hw/mips/loongson3_bootp.c:33:18: error: call to undeclared function 'cpu_to_le32'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 33 | c->cputype = cpu_to_le32(Loongson_3A); | ^ Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/mips/loongson3_bootp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/mips/loongson3_bootp.c b/hw/mips/loongson3_bootp.c index b97b81903b7..712439c2575 100644 --- a/hw/mips/loongson3_bootp.c +++ b/hw/mips/loongson3_bootp.c @@ -21,6 +21,8 @@ #include "qemu/osdep.h" #include "qemu/units.h" #include "qemu/cutils.h" +#include "qemu/bswap.h" +#include "exec/hwaddr.h" #include "cpu.h" #include "hw/boards.h" #include "hw/mips/loongson3_bootp.h" From patchwork Wed Jan 15 23:29:46 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: 857646 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp2733010wrc; Wed, 15 Jan 2025 15:31:53 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWWOm1G5dr9468LqJV3i2awKE6IQFe/QA6AlDnSX9UMZTsOP4EJq89MHqOBvNANCI5m2noJBA==@linaro.org X-Google-Smtp-Source: AGHT+IFJQoioSPb8NmDi30FxBI0jtIfUpXnlfNOH578WqVI55zKNLZcqAhDmzt1sFTvFz1MIk6sl X-Received: by 2002:a05:620a:404b:b0:7b7:142d:53d4 with SMTP id af79cd13be357-7bcd97a41e7mr4607960785a.39.1736983913023; Wed, 15 Jan 2025 15:31:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736983913; cv=none; d=google.com; s=arc-20240605; b=JjCtK2FY+oizUpJCCDdncIFE5/Q3JcNJ1pvT5gE5hbkUHgh1Zf3s3k4p08ZUrfAvV4 sAIm9Mahnv2670I6uey0U3Oy1cBjmoFELuRmNOCsgvXEGq6djXxkesWIU4rfInJ6X+me 8Zl9ZDeo2kHF0W1kBSQL3vdX6ywlM4hNLhbB9GJCa8BHXLSchtKAJunp1qFQGHfzpBuU 1yJ1WQrYf4sAiPCvwcJfJDN1dzXg8/23IUSesBNBtfrfxXR7S85VW605P50BaRotmX0q IezzrSOKNm1QTo8OI91/OfA8NrR+E1q67xwdvJVpUGNvsCD3bPIkMxXCGC/qk8+PcWPr TfXQ== 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=QsJrlKcmyvOLkMfarrkKos3o50mVd3SgHzi3eR8aV2I=; fh=vbC9XRCEPtWLeFY5dMetP0+DZx7J3Hlgl6kGR/4t3xg=; b=ccR+9irDt/2QkjvjmgdiJwJgxzHjg0W/jxlz20GkRQhPvAUhzoO543N2MeIx7/wsfq JACkQDzTqkQEK+vifGQi8niDR7QqOXtSJ2MGC8Vg4ywrJ5ErDAeBPz9ne51OFQr08Wc2 17UM0pn/Y3GKtDtDabWf3zS5/yFdkMKzzpLkDFx7NtJa7RWCgrz/WfE4TWFqM2KGSKNF aZG9Z0YTxqtGs91AHr/KQdUDvo/wqu4pw+l04rTJdBeixH/PZy1Hc4d7bMhwCRf7QiFB u69nHwxy484tSzybeJzXyvFYN78tAEp+J8zjPfwhVoisXSghvCNo3itUevZJC98BkOrN wPcg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cUl8XFNn; 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 af79cd13be357-7bce322b35asi1691000185a.74.2025.01.15.15.31.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 Jan 2025 15:31:53 -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=cUl8XFNn; 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 1tYCqb-00076H-Sr; Wed, 15 Jan 2025 18:30:54 -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 1tYCqV-0006kV-LX for qemu-devel@nongnu.org; Wed, 15 Jan 2025 18:30:48 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYCqM-000558-Ss for qemu-devel@nongnu.org; Wed, 15 Jan 2025 18:30:41 -0500 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-435f8f29f8aso1474665e9.2 for ; Wed, 15 Jan 2025 15:30:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736983825; x=1737588625; 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=QsJrlKcmyvOLkMfarrkKos3o50mVd3SgHzi3eR8aV2I=; b=cUl8XFNnO852Ns/G1H0Vfb1U6cSGeW7ivwiGtrHeC4LWkHoSxLQ2zWfIEqtvf+IaAH 1QGphKsMoNmZrnZwTwm8fpZxjNVmEElRt++sk/9LYE+rjMLCk38D/m5p0gR6zp/bQUJD bVptUqNr2xh4JU85O1+VNcYrHtTtM37o1QUAHSdexsfu9Enfhlip9a61OMKxFnOScULD AJmhGgsgM16jdQvnFPYQotn60Y55hVV9jctu5HyZUJ0+hTe7DMC6s+Hdj1wpqWu+/o98 31GwrCYJ0rTeyBPml3E6/jpohm1zQh/3+SLshWcZXJFw9MvnqrdL9Xs58prCj5XHCjMT qgNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736983825; x=1737588625; 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=QsJrlKcmyvOLkMfarrkKos3o50mVd3SgHzi3eR8aV2I=; b=sVsUlhDXGDKKmmKnLPL2WQ8/CtLPCuowVhFwD0JisS0GBHkWnY+3Pxkzr6rMqWrs2+ e5/D354fBt5kch55/5FSTUBlq+7sV/paG2a9XO2wnJmvbEhxlTL4iKQrWWBEASjmLVPR gAUCZvRkzsEGwRYpkhaD6ZIE4XpKHhxwfe2biTO7+JKcGdfHzLXKlTdJPpqdPdwMAQI+ gRtNSc5L37WhbxggdyAv6pVvDEoy+YUqF1N2zAfueysivsXFLfdoyHruHce4YJw3+Rpl TyMu1lkBOJ/Xe8UD9nU5HRiEsyRJBCCtNDfNcMyg0SfRp4zyOvHkI0+oA8aADNfNhDhv vLdQ== X-Gm-Message-State: AOJu0YwQ2eyNlzFOnMgsMxpg7vaKMspTNtSCm9FXYVk+fJs54CTnE+v/ zC2PZ2Gb4selGP4aJh4t28w2HzRFCbD/E0gWLGV/ZKcyJX13c8ZFMbMHpRW3yJOjMQA00X6JWsv 9msE= X-Gm-Gg: ASbGncuTRy1+/A3NadzAuLK4v2zpV7DJSWRzB3SJDwqcNUddSqRu8Amn014cYavUKKM alF6Fqhzbc+SdsafFqBm1ipUJPlG2Pcr0uZETylhHzZ4pahwjtjFl7AhpVzQL3cxgUHtKm2Qt9V 3YdiDUUm6j9LxoxRAuK22tYYtb2oswJXYkk46nIq8Soh8+0ePGcbVEGBuW05TJgSZ34j1hvBXrO iZtjoV6yxVcwwkTdxwiY1u4WROQx4v2EA8D0Tm6egNiHGHxdWQiE0wjUTkBU5ywOcLGIQjA0/1S /lApr3bILsh6cnnBRrtn3vFmHeSqxno= X-Received: by 2002:a05:600c:3b2a:b0:434:f623:9ff3 with SMTP id 5b1f17b1804b1-436e26a8c3cmr303390935e9.15.1736983825453; Wed, 15 Jan 2025 15:30:25 -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-437c749935fsm39454605e9.3.2025.01.15.15.30.24 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 15 Jan 2025 15:30:24 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Huacai Chen , Richard Henderson Subject: [PATCH v2 06/11] hw/mips/loongson3: Propagate cpu_count to init_loongson_params() Date: Thu, 16 Jan 2025 00:29:46 +0100 Message-ID: <20250115232952.31166-7-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250115232952.31166-1-philmd@linaro.org> References: <20250115232952.31166-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.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 %cpu_count from the machine file, allowing to remove the "hw/boards.h" dependency (which is machine specific) from loongson3_bootp. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/mips/loongson3_bootp.h | 1 + hw/mips/loongson3_bootp.c | 11 ++++++----- hw/mips/loongson3_virt.c | 1 + 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/hw/mips/loongson3_bootp.h b/hw/mips/loongson3_bootp.h index 9091265df7f..ee6340e42c1 100644 --- a/hw/mips/loongson3_bootp.h +++ b/hw/mips/loongson3_bootp.h @@ -233,6 +233,7 @@ enum { extern const MemMapEntry virt_memmap[]; void init_loongson_params(struct loongson_params *lp, void *p, + uint32_t cpu_count, uint64_t cpu_freq, uint64_t ram_size); void init_reset_system(struct efi_reset_system_t *reset); diff --git a/hw/mips/loongson3_bootp.c b/hw/mips/loongson3_bootp.c index 712439c2575..91b58a71a68 100644 --- a/hw/mips/loongson3_bootp.c +++ b/hw/mips/loongson3_bootp.c @@ -24,10 +24,10 @@ #include "qemu/bswap.h" #include "exec/hwaddr.h" #include "cpu.h" -#include "hw/boards.h" #include "hw/mips/loongson3_bootp.h" -static void init_cpu_info(void *g_cpuinfo, uint64_t cpu_freq) +static void init_cpu_info(void *g_cpuinfo, uint32_t cpu_count, + uint64_t cpu_freq) { struct efi_cpuinfo_loongson *c = g_cpuinfo; @@ -40,8 +40,8 @@ static void init_cpu_info(void *g_cpuinfo, uint64_t cpu_freq) } c->cpu_startup_core_id = cpu_to_le16(0); - c->nr_cpus = cpu_to_le32(current_machine->smp.cpus); - c->total_node = cpu_to_le32(DIV_ROUND_UP(current_machine->smp.cpus, + c->nr_cpus = cpu_to_le32(cpu_count); + c->total_node = cpu_to_le32(DIV_ROUND_UP(cpu_count, LOONGSON3_CORE_PER_NODE)); } @@ -112,9 +112,10 @@ static void init_special_info(void *g_special) } void init_loongson_params(struct loongson_params *lp, void *p, + uint32_t cpu_count, uint64_t cpu_freq, uint64_t ram_size) { - init_cpu_info(p, cpu_freq); + init_cpu_info(p, cpu_count, cpu_freq); lp->cpu_offset = cpu_to_le64((uintptr_t)p - (uintptr_t)lp); p += ROUND_UP(sizeof(struct efi_cpuinfo_loongson), 64); diff --git a/hw/mips/loongson3_virt.c b/hw/mips/loongson3_virt.c index 9c2001295d1..93700a1612e 100644 --- a/hw/mips/loongson3_virt.c +++ b/hw/mips/loongson3_virt.c @@ -185,6 +185,7 @@ static void init_boot_param(void) init_reset_system(&(bp->reset_system)); p += ROUND_UP(sizeof(struct boot_params), 64); init_loongson_params(&(bp->efi.smbios.lp), p, + current_machine->smp.cpus, loaderparams.cpu_freq, loaderparams.ram_size); rom_add_blob_fixed("params_rom", bp, From patchwork Wed Jan 15 23:29:47 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: 857644 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp2732997wrc; Wed, 15 Jan 2025 15:31:49 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWgteNgzXkurLbuUJULWhiUE8UHdJJRe4j8DXLfvJiIX3SV/FCmbSQup2+thOmYSiima+35Tw==@linaro.org X-Google-Smtp-Source: AGHT+IGF4giFuaxwVQK03rZluFHCKAzX8QPxbHnqHJTzPKd8JPWJmyn0l/mepr+sT/lccZTYT6Eu X-Received: by 2002:a05:620a:4589:b0:7b6:a793:4223 with SMTP id af79cd13be357-7bcd976088bmr4720102985a.24.1736983909589; Wed, 15 Jan 2025 15:31:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736983909; cv=none; d=google.com; s=arc-20240605; b=IBFsBuxsmIRklWLKjnVeB345ydBIc/kFIeTBVVTf8CSK1UwV6yP+qoDt/i5s9apu2/ QSHJpSAek+FNtB4h4XbFIVXVfRiLnvivXixb6TDeB7+BEx3S9hqvokYuyhB+zVVTw79T 58NkXYIxiU6nwjot7Tvwcpcg7JGhJiRuzYswu7fSm7Vna+Fp2zgzQNWm7p/THYyKTCAF FoR7bhCcE6Y6ppvmzecRz4LKhI8UTop4Ouzmf4STHmzuaHhejbzWeaFoSGU1mQNk+QJC fHnSoGyZp3UgZCfv+EbMWn+sXt0TUlwFAL/xmmbv8Jb5KL51cT5q4PJtvcXABnbBlmqy cW2Q== 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=BRQx0SkOCPWyQiRMduvrQcrReIn+M/C8yaM71k53eWQ=; fh=vbC9XRCEPtWLeFY5dMetP0+DZx7J3Hlgl6kGR/4t3xg=; b=AAIvJtwdsXf2Sy053N5noygXvN+3/ONdGi0JROwv5bj/exNXd44A5oUBWXT5N01yFL YeRBwKzowYc85mNV3OSf0+46dgucNKNgUlevwFZAY+7IEdzbMXDfTcKRO6zayiukRa8j zYzu8kHZoVcfgoMjJmoV2Gbw/OpeAmgadDm9EiZiasMralwLYocwgvfEQL6M5JlhKzu7 PLO7AQ/UBJAxrIC9wFb9tUiOB0kNgaH3ZV1T8lLrbaUK2oSxGc3agLu01KnuSFhXfig9 afEzQH1fU4m1EzJhG/DB/fH7ajLok8neWEuhHjWjM8Stvl2y1tMtOlAFlrC0t4b+PGKr WU/A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MD072fNf; 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 6a1803df08f44-6dfadbc0d33si166373836d6.160.2025.01.15.15.31.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 Jan 2025 15:31:49 -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=MD072fNf; 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 1tYCqY-0006re-EI; Wed, 15 Jan 2025 18:30: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 1tYCqP-0006iD-W3 for qemu-devel@nongnu.org; Wed, 15 Jan 2025 18:30:42 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYCqM-00054s-Fj for qemu-devel@nongnu.org; Wed, 15 Jan 2025 18:30:40 -0500 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-4361f664af5so2560555e9.1 for ; Wed, 15 Jan 2025 15:30:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736983830; x=1737588630; 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=BRQx0SkOCPWyQiRMduvrQcrReIn+M/C8yaM71k53eWQ=; b=MD072fNfggVuLh8kkvaHTJ9t46asxgcvx/iQKupeijLdAfgr3uqxGCcl6K/4iuk+Uy xacoYB6k25MCnRlij/yxPj5LFSTdUR8jhmWby4ANpElufdmKFiRvg3aha4drJ6/9rQz3 cuEK117e7NXQaoQ5WPVLACiZBGlomMQOMQxdZHb99AR6BULvhQFc6rm6ci+LQLGapHO4 cBDFWC9VcpokF4ejhCsWADdQSpGnrLmTtt5l39VmXuPp3AbsxXOmk1xB0g376DeaRFHq VjGM+GgkUyHpmG7qcOTQJwnM7LCLk4YNTYapFuxzHO52MP86FSAkCoPAaaZkCkMRNa9x 7exA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736983830; x=1737588630; 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=BRQx0SkOCPWyQiRMduvrQcrReIn+M/C8yaM71k53eWQ=; b=OIojuwl2b2Ugnxb05/CWGHMR1RsD3fS9QgASJpcgKYgUNRFREk7+F+12GIVjIZxrIG 5TeV++tkNBkeiUEai6KgZurThle04aHbnq94ngh2vxMFxw2fuIBHUqGHOEi+TVCcuX3w AMLJyyUcnF2TZBI6MlM3+f2AJRQh1MsSy+KFsfqZPpEn6ZSYt+fSh0oCh7KKJC1nyRbR Qp53c3fsdkiyOL3C8PInPd/fnBH2JgVuFzEe3Qi4cIf03xDUdVTepBEKkvcHwtosQNRe 34g/Xam/YZ86c44KzTTaLE3sk/1sI+GjjAx5bhjzwyV1/36DbH9bpj5W/SV+ao+0V4nv 5l4w== X-Gm-Message-State: AOJu0YyxfgWZckzU+A0awig8PZ/80u9HIIBJ4bsTcO9yZ+s1EXsXk8zf 9qftM+71CYGDMG7ON5FFSsSRwiEzQQq0FvMzCU+tj+9kEh7kGbbbRt8A9DTd4xDgnjpD1uPEe92 gv3Y= X-Gm-Gg: ASbGnctjoEbQmkel9ZahYevi9LgcH7oiDe584DGZzHEAW/EkDeSPCrRKQAYUMG4O3w2 2rsdiGnzxJ14K5i2HoNilHmXAJN2YK1g9eYIpc9pG0upq7nZVh+q7oSabNSOydg00oJeyBx0d9k 1qAq7fLRcyrwY+k5Fnu2wFEroF2fGBAIyUlz+XfJbw8DvOZTXXGyc8oHGojt/ZFyXBFiqgIzqcY NrmwmvIBFY40kCSkjAsgxyePfmpF8NHMHeOZoED6NxO10j0s0J8WhKasjAYLXRESPWRQqobcen1 SVKYTUGLuTJRZjWNnGGT0j+yzY19uJc= X-Received: by 2002:a05:600c:3ca4:b0:436:6460:e680 with SMTP id 5b1f17b1804b1-436e26c3331mr272373125e9.16.1736983830075; Wed, 15 Jan 2025 15:30:30 -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-437c74c475csm39595935e9.20.2025.01.15.15.30.29 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 15 Jan 2025 15:30:29 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Huacai Chen , Richard Henderson Subject: [PATCH v2 07/11] hw/mips/loongson3_virt: Propagate cpu_count to init_boot_param() Date: Thu, 16 Jan 2025 00:29:47 +0100 Message-ID: <20250115232952.31166-8-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250115232952.31166-1-philmd@linaro.org> References: <20250115232952.31166-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.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 Remove one use of the 'current_machine' global. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/mips/loongson3_virt.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hw/mips/loongson3_virt.c b/hw/mips/loongson3_virt.c index 93700a1612e..46b298f6d72 100644 --- a/hw/mips/loongson3_virt.c +++ b/hw/mips/loongson3_virt.c @@ -173,7 +173,7 @@ static uint64_t get_cpu_freq_hz(const MIPSCPU *cpu) return DEF_LOONGSON3_FREQ; } -static void init_boot_param(void) +static void init_boot_param(unsigned cpu_count) { static void *p; struct boot_params *bp; @@ -184,8 +184,7 @@ static void init_boot_param(void) bp->efi.smbios.vers = cpu_to_le16(1); init_reset_system(&(bp->reset_system)); p += ROUND_UP(sizeof(struct boot_params), 64); - init_loongson_params(&(bp->efi.smbios.lp), p, - current_machine->smp.cpus, + init_loongson_params(&(bp->efi.smbios.lp), p, cpu_count, loaderparams.cpu_freq, loaderparams.ram_size); rom_add_blob_fixed("params_rom", bp, @@ -642,7 +641,7 @@ static void mips_loongson3_virt_init(MachineState *machine) loaderparams.kernel_entry = load_kernel(&cpu->env); init_boot_rom(); - init_boot_param(); + init_boot_param(machine->smp.cpus); } else { filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, machine->firmware ?: LOONGSON3_BIOSNAME); From patchwork Wed Jan 15 23:29:48 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: 857641 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp2732922wrc; Wed, 15 Jan 2025 15:31:34 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVG7OaQrELlIljlJ+LEhUIJlVnMtd62c3uqauHA6dMx98A/fsTBGQJLPQRF3YnX65cVDptvBw==@linaro.org X-Google-Smtp-Source: AGHT+IGn8+DRpDcZHni1JNCdxPs6Dk1dFx7ICwEoDt6cWyDCZvciUMwAGs58X6fBBzKhlNPnVjed X-Received: by 2002:ac8:7ef3:0:b0:46c:7651:158c with SMTP id d75a77b69052e-46c765115a9mr370206351cf.48.1736983894610; Wed, 15 Jan 2025 15:31:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736983894; cv=none; d=google.com; s=arc-20240605; b=G5JJTDyuPHx9M/+2cT5EgDwlqzlHXO6vceULGIWO0PjyOW/cYw42Jo3nadUySUxzQH FxBnEn4ORafRLKQKEf/hSkE4swparxcA7Bd4pGt/Wcb6KaDgSm7C6fnB8r4gLh/T9+Lu TrYS4K8fnHxAEGYgcskroArh1ni+jEZr05hLJVgUN/BjhJmnzdgxwZzxnJLvFHAI24vO /UAkG8e1fquM9yc9ZPDI4LSQb2U/FCWW+w9JxAdlnoh+fp2I/GqYCR6/+pJi3jw/JR/V MS1RaZWPnWSPXWA3MJ+Xa2nTxq7U2iRv7byy7DjNzLXbyWTNlIj/tPvMpGgiYWvkMU/D ASgA== 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=fM8QVpnVbNxu0PP9F/y6d561pLUgSoGsgnDh4Rg5A+E=; fh=vbC9XRCEPtWLeFY5dMetP0+DZx7J3Hlgl6kGR/4t3xg=; b=St9BraD0MaqD6s7g/xT7Oden3/fRNWSWZIY+15GR4CYnIZjOCaHzObPHX5YopJnsrb NNJj6xYAqlXluW3OPC6x+4Zt5ukTwacLJSrcb4BcJq9QJfbqO3vySsxzdVcpo3Fii0qo rwEL3CDugr/noqYIUBRZRBjFXepJl4zzuF6zVFdtOrCeQWZwGSDLcMMr4Mrij/VThL2I qELsbz7HhjvenO+shkz5PN7Y//FWREnG4KiewlT6zdIZNUIeR8B0t/eF6YWrL+sNpYKk Sg7lrYnq4jjGrD3BIpP0xW+hZQ32B69VerYjpQnTkG79NVvf8grMfbFbC61jzCGYdmoz 50Fg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OnxdvwQj; 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-46c87331570si161797151cf.83.2025.01.15.15.31.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 Jan 2025 15:31:34 -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=OnxdvwQj; 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 1tYCqW-0006nx-AW; Wed, 15 Jan 2025 18:30:48 -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 1tYCqP-0006iB-Vu for qemu-devel@nongnu.org; Wed, 15 Jan 2025 18:30:42 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYCqM-00054y-FQ for qemu-devel@nongnu.org; Wed, 15 Jan 2025 18:30:40 -0500 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-436326dcb1cso1603225e9.0 for ; Wed, 15 Jan 2025 15:30:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736983834; x=1737588634; 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=fM8QVpnVbNxu0PP9F/y6d561pLUgSoGsgnDh4Rg5A+E=; b=OnxdvwQjwE/deAOnM1K7e8f6Umekr7xUzo6Uvh6dsvpRUTePSNQ5g4r0aqhkrMPwnP oU+KZzIcTFCzCBjSuXF7/096Lb3T8h/wZqr8nRDDDkgrGONh3qirRUNMEJhUsVdj5ju9 yChAva72d4oJvYWDriu+OaTj9Yy61E6aDP7tGBIGraYLrGgznP0/w3NScCIRxvvrCQac Snn47jblud2k2J7uk4cb3RhjQ+cmmeZ4/5e4Ub4sSgY1ME1r5YxE9DSLwDFzXeBwS+Xy ZdO2jiiiKTGJ+03gmTLsWm+TtVphVpmo8Izr91wuhGWCqukpmh7pZlFpY+JEduVFWmFW zwBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736983834; x=1737588634; 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=fM8QVpnVbNxu0PP9F/y6d561pLUgSoGsgnDh4Rg5A+E=; b=AfVieOnPaGdTZJZewIAzMwu4neOCCAxKXPl3VUFXxqxFmIphOg3IharQStPmy1HJu9 ku2ddT7pFoN3tutoPmAgzLTDJJda9IFeVYOc83jZKI69zkneRhuZ3rn4CdHHeeBc7Cfc iihqyB8I+RX9RFqrGLkuaqyA1ci6EYm2i6hWESTLO85rG3BimoHs1l0js4kttZ5Q1gjU EP4EKnwdWWUfMbYrUQvcoEUwTyJlUoHFkwqsghMI3K7HyP6ZhAhVYfHLgqFNHw6Y7JFg 8DDYdNd0XW2VXlB74k4Kdjh8AzRsPJ/zgJRnUSnf7R/DKe8s8oY+xscDxNmLauZqAteH SPRg== X-Gm-Message-State: AOJu0Yxo6FrGkU66OVaiXSLDfZoPymkvLGxaOoU6/UKAnnUBtCBC+VzJ hW6+v53L3XtqD5RZnTLeyIUNzrq/+f9RVDO+dGurGvrQU+MnQk6D6ySrLPfRpKOVlYShlQ9+Sth WXaE= X-Gm-Gg: ASbGncsValyjgZZDWQmQCTBbr37H46MhzuzK57HQsNk+0jOuhhOOCQmwOGXz/O4b06x a5D0GWa2L5nSaZJ2CkoLrl+9FEIs4yG2tsJPqfp5I069C2BW2B9GnbbcgZpfJl/jOglpaGJ8Fwx RW0epHiZ4uiTsglqWjYfJl4R2NqjRKRwcoida4p0xBqfcwPfWz8aTy/4ZdssigIEUS928pN6JtY CdmJQ6Q0oDY9Wus1wFkj3GrQ6Al95su1czZN1gL6ZdT+ou6am2QNoX72Ja3KAQgM7HpLaBAqDyP HCCEXWPtV70VLkM0PXLnI38cvVIDP2M= X-Received: by 2002:a05:600c:4744:b0:434:a7e7:a1ca with SMTP id 5b1f17b1804b1-436e26f043dmr261071995e9.20.1736983834635; Wed, 15 Jan 2025 15:30:34 -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-437c753caf3sm38034465e9.38.2025.01.15.15.30.33 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 15 Jan 2025 15:30:34 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Huacai Chen , Richard Henderson Subject: [PATCH v2 08/11] hw/mips/loongson3_bootp: Propagate processor_id to init_cpu_info() Date: Thu, 16 Jan 2025 00:29:48 +0100 Message-ID: <20250115232952.31166-9-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250115232952.31166-1-philmd@linaro.org> References: <20250115232952.31166-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.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 Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/mips/loongson3_bootp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/mips/loongson3_bootp.c b/hw/mips/loongson3_bootp.c index 91b58a71a68..1aab26df69e 100644 --- a/hw/mips/loongson3_bootp.c +++ b/hw/mips/loongson3_bootp.c @@ -27,12 +27,12 @@ #include "hw/mips/loongson3_bootp.h" static void init_cpu_info(void *g_cpuinfo, uint32_t cpu_count, - uint64_t cpu_freq) + uint32_t processor_id, uint64_t cpu_freq) { struct efi_cpuinfo_loongson *c = g_cpuinfo; c->cputype = cpu_to_le32(Loongson_3A); - c->processor_id = cpu_to_le32(MIPS_CPU(first_cpu)->env.CP0_PRid); + c->processor_id = cpu_to_le32(processor_id); if (cpu_freq > UINT_MAX) { c->cpu_clock_freq = cpu_to_le32(UINT_MAX); } else { @@ -115,7 +115,7 @@ void init_loongson_params(struct loongson_params *lp, void *p, uint32_t cpu_count, uint64_t cpu_freq, uint64_t ram_size) { - init_cpu_info(p, cpu_count, cpu_freq); + init_cpu_info(p, MIPS_CPU(first_cpu)->env.CP0_PRid, cpu_count, cpu_freq); lp->cpu_offset = cpu_to_le64((uintptr_t)p - (uintptr_t)lp); p += ROUND_UP(sizeof(struct efi_cpuinfo_loongson), 64); From patchwork Wed Jan 15 23:29:49 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: 857642 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp2732937wrc; Wed, 15 Jan 2025 15:31:37 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUGHp7vZ04+8QcMPcGArVI+gOtTQ4fN2hBya9Svn/ns1xjRh8Htp/7YU3ayGscTXrWrpN6ZOQ==@linaro.org X-Google-Smtp-Source: AGHT+IHbB9zwp4QTIbvCnXvj5UmvZze39ahFzi7HRJYuWp33ugLz0rXjqZxJHIxs6o0Z5Tctd5qF X-Received: by 2002:ad4:4eac:0:b0:6d8:b81c:ecc1 with SMTP id 6a1803df08f44-6e192c82513mr65512306d6.13.1736983896990; Wed, 15 Jan 2025 15:31:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736983896; cv=none; d=google.com; s=arc-20240605; b=KQfLYpPYjILofItEbDk6pt+LSeYQ5/MfRXpWE6dnMT9FyWALoh5v4a9zpVm+0ZgPh/ yNhzSUhkntmr/f9LyHvNBVtPJkcreivV7QfcaCT1rRZ3lNMWUur7lnHiH7V/CM5SDTf2 OUeEpXKngcqMfSjpKCA4nLSr92IWnlx8heeMEFQN+PS9lX5TkEBRG5Po7pGB+ycHxk69 4uwbJX/74oizul0jDNlvcfniS9/99JLYXRCrF4EOHdQXe4RIAWTbwjuH20L8X3A9f+WH ZcWLNFr6lThkAJTV9IZ2HwqVq3697D/7zlhHwRka2eTgmdqtDSfSHeVan/1aZIJYb0TJ 2IOA== 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=LPfEuWSADruS/h30T44F0SKsyqf+Ay7mwCICSC78CDM=; fh=vbC9XRCEPtWLeFY5dMetP0+DZx7J3Hlgl6kGR/4t3xg=; b=G8qX+JNxx5zxf5tmITfrMP6gK65UyuBQq0micm2+2bCFdgreWo/BnqSQRd+JSx8XOh ad32thBY4zW32Yu2di90X8mnXYw9ku/P0t+eS/rfNmZeaAznE/J4fX3Vwl2dxJsLtLon 6UmVV+9La9v6Q5xZjFOreyFS6zsYZ8uZkLHmuIE5kOzvhhcflliOecNDFB75MUt1kk61 5N1Qe37ugL0KtRFUQn4T40VX5/DolpuH1fz7XNkMDIWixSlVHzklGJd7kXriEUqs5hJ8 Meq0//1/GaPYb3znWKLM0VXUEz6TGiFc93S7OzXGoLjGLexxG1Co6kCFN26iwCP9JimL 3t1A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gTuRMLt9; 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-46c87330f56si151135271cf.134.2025.01.15.15.31.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 Jan 2025 15:31:36 -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=gTuRMLt9; 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 1tYCqe-0007KV-6X; Wed, 15 Jan 2025 18:30:56 -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 1tYCqX-0006rN-Ri for qemu-devel@nongnu.org; Wed, 15 Jan 2025 18:30:49 -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 1tYCqV-00057K-DT for qemu-devel@nongnu.org; Wed, 15 Jan 2025 18:30:49 -0500 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-436637e8c8dso2310685e9.1 for ; Wed, 15 Jan 2025 15:30:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736983839; x=1737588639; 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=LPfEuWSADruS/h30T44F0SKsyqf+Ay7mwCICSC78CDM=; b=gTuRMLt939VkP72k11a48XpbFTX0cKKLjK3VcXYqrkvEeXPiTbK2FxwTAVdtU8kg/r WJ0eyZ6tG72KJz7QrFdllx+6/02RJHNlGhE4Lz5ydA/EnQhYTNl+I5urpEHoPXYooMF5 Vw+l9f+2zNDyOWhylCj8M7RUBgqRHjdd4+PpZbJ6El2/4R9rQ1iY0zo3edFCllPccKDf R8Iv0VOOF6SIwb2BIazSWgxl0+PQIb00J6IYC9nHMkRpnHWd5FtmoZBaUvXTOkdOirmo bHf7lrE2AMy+01Fa6iNMwdB8xMv2GCijA4C4vu8SBM6BP1n2N+o/drQQmgRtoa/OMv6H ohTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736983839; x=1737588639; 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=LPfEuWSADruS/h30T44F0SKsyqf+Ay7mwCICSC78CDM=; b=AkWugjzyL5YsBY1baR2mV8x8KuhM48N6QJib1k+fC8XqkjyOluWuQojIdHggLvH99g q6LIAv6KNmr8BMCbVSDxJchtQbvBdJqDsOHuEpDbcWZpUFKLoP2LSv6c0+6YP+6yF7yf IsiTtvZYTe9+uH7ehZmb5/ljDskSPwW0bktjr/mF7qJZ7j7EASCVxuVJJBdDNlYETcRo g6/Cn1DONnaNKb5O9aao36fJdU4dDyADthmUV4wHZCTvLfRLGjBLdy1SxPfT46ykW3VD 9lXxIIEubd8rAjlSjEg2lbCuiKM6V3NTBLd70Y8wolxIkQfFgh06/FEve3zVbfqjUxYt UyoA== X-Gm-Message-State: AOJu0YyvPh2coe9bPtFzTsrCKK8FCeKX/t3672tZ6GoIZ6gdQhQPTQd4 /hzly0pAo6EJkutDDTeaN4uoF/Rc+bU9wlvcApz/ZGjvnlLcg51qRF5V8U8tp4jgpMf4pxntiFn AkgM= X-Gm-Gg: ASbGncuPqXwg6J8v+WYofLuvM1bq5mGjnBcOYBmjBMGihuzmMfvzpwRjYH+Skdfc8gq 1o0FoawRPafNLfKxTO8ih10Bni4n2b6GnTrB4eCFEzPQlHJgQuiG1QPQtOJ1IZL+PNcyPn4DS/B OvJ3ka4AF5lqygv6m5MNau3h8Gg3Jm7fWgF73Y07y1OblgDue9VUUygKYLerCVRDrfsMgkfkUxU UD/7+lcx/gKnQbbCVjoidApDvttLaRjiV+ZnpwMK41f5Ftd1K6jl3NO0VftquzL1MVqK3oIgNtZ WmJw9/rXi8AJ2p6eb73OsKhZJUXjWxw= X-Received: by 2002:a05:600c:4455:b0:434:f623:a004 with SMTP id 5b1f17b1804b1-436e26adfd7mr241108485e9.16.1736983839148; Wed, 15 Jan 2025 15:30: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 5b1f17b1804b1-437c74c4751sm38628335e9.19.2025.01.15.15.30.38 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 15 Jan 2025 15:30:38 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Huacai Chen , Richard Henderson Subject: [PATCH v2 09/11] hw/mips/loongson3_virt: Propagate processor_id to init_loongson_params() Date: Thu, 16 Jan 2025 00:29:49 +0100 Message-ID: <20250115232952.31166-10-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250115232952.31166-1-philmd@linaro.org> References: <20250115232952.31166-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 Remove one &first_cpu use in hw/mips/loongson3_bootp.c. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/mips/loongson3_bootp.h | 2 +- hw/mips/loongson3_bootp.c | 5 ++--- hw/mips/loongson3_virt.c | 1 + 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/mips/loongson3_bootp.h b/hw/mips/loongson3_bootp.h index ee6340e42c1..9dc325a8557 100644 --- a/hw/mips/loongson3_bootp.h +++ b/hw/mips/loongson3_bootp.h @@ -233,7 +233,7 @@ enum { extern const MemMapEntry virt_memmap[]; void init_loongson_params(struct loongson_params *lp, void *p, - uint32_t cpu_count, + uint32_t cpu_count, uint32_t processor_id, uint64_t cpu_freq, uint64_t ram_size); void init_reset_system(struct efi_reset_system_t *reset); diff --git a/hw/mips/loongson3_bootp.c b/hw/mips/loongson3_bootp.c index 1aab26df69e..67812666c5b 100644 --- a/hw/mips/loongson3_bootp.c +++ b/hw/mips/loongson3_bootp.c @@ -23,7 +23,6 @@ #include "qemu/cutils.h" #include "qemu/bswap.h" #include "exec/hwaddr.h" -#include "cpu.h" #include "hw/mips/loongson3_bootp.h" static void init_cpu_info(void *g_cpuinfo, uint32_t cpu_count, @@ -112,10 +111,10 @@ static void init_special_info(void *g_special) } void init_loongson_params(struct loongson_params *lp, void *p, - uint32_t cpu_count, + uint32_t cpu_count, uint32_t processor_id, uint64_t cpu_freq, uint64_t ram_size) { - init_cpu_info(p, MIPS_CPU(first_cpu)->env.CP0_PRid, cpu_count, cpu_freq); + init_cpu_info(p, cpu_count, processor_id, cpu_freq); lp->cpu_offset = cpu_to_le64((uintptr_t)p - (uintptr_t)lp); p += ROUND_UP(sizeof(struct efi_cpuinfo_loongson), 64); diff --git a/hw/mips/loongson3_virt.c b/hw/mips/loongson3_virt.c index 46b298f6d72..4924ea88eda 100644 --- a/hw/mips/loongson3_virt.c +++ b/hw/mips/loongson3_virt.c @@ -185,6 +185,7 @@ static void init_boot_param(unsigned cpu_count) init_reset_system(&(bp->reset_system)); p += ROUND_UP(sizeof(struct boot_params), 64); init_loongson_params(&(bp->efi.smbios.lp), p, cpu_count, + MIPS_CPU(first_cpu)->env.CP0_PRid, loaderparams.cpu_freq, loaderparams.ram_size); rom_add_blob_fixed("params_rom", bp, From patchwork Wed Jan 15 23:29:50 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: 857647 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp2733056wrc; Wed, 15 Jan 2025 15:32:03 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVLj4iPFljopmKGFfFmyoYZtdVi7CruZipju6uRFqMID+oxoiiPMWQrXYRpH3A1M/bMi/CNsA==@linaro.org X-Google-Smtp-Source: AGHT+IHAtJu1u42bSLges/gGeXk349y5eIJOlaom0qVwDusJi/ZKhaCie90/D0pNDyXBJeiRRr+I X-Received: by 2002:a05:6214:4014:b0:6d8:838f:8b54 with SMTP id 6a1803df08f44-6df9b2cf5bamr505247476d6.39.1736983923034; Wed, 15 Jan 2025 15:32:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736983923; cv=none; d=google.com; s=arc-20240605; b=PBYRC5Lf9Ws7aCeh3PY/a6XownuxWKT4GeT8NIrswck90Tg2yAboh25v2YYXiBUbuu xSH9UzaXVYl9MzvgC64dPZyOqEGDfJFlaJXO5anEK1sjiOkZQWQti29GquS/KZ/Vg2HW HEo3T32nLIXMitRF438ihOvuvomcgeRjLiv6z6cw9MNaaTtYXgw/sMFRcSHUdmdwWJeU BZn2UZCc6LwXqWTsW0kgmhIIJFNsYeImJs+NkLgtxaEeaW/gu65YBjSGrd5GwSJNLJvI f/waefIQpd3g2ekJiFsW8tVc3AmYXYaW8dnHhl4Nm9dfZ8uaHLNUiyAsmhDYchqNKY9s CJbA== 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=oBmzOwwa/rqiVq09wwGIeAFFq9Z7MiUbusM3HZSK1Bs=; fh=vbC9XRCEPtWLeFY5dMetP0+DZx7J3Hlgl6kGR/4t3xg=; b=NL5QYMquP7YEXmN89HLhKyFaiTlUFu9ZNNkS94QJVP9D8diyJ1WhBo6iG6gXb3sBcc y9bvZALao7ACPh52NJI1uOepH1wI3jD5r+/PwHsjMnI/zdxIWTSAKa/hRbpIIGKI8OWn VDmvUpsPM/EXGqEcV+68a0+sLbnmrbXEfCDZL/0vMCyxuZR2yykTNVq59JoRQef7riBZ TmGlFcon0SQKDJnXadtF3I5vircw+uHzWUrQqfK69HYS32F+2n5I3Y/uQ+VMtiByZV0p 8mjtz1uf8p1c4hGBcge+VYx6Jpol2nRk13FL+8/9TAjOhipmk61se9xdSLzROyM2pft8 8opA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lryqALIr; 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 6a1803df08f44-6dfadf660fasi162065906d6.350.2025.01.15.15.32.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 Jan 2025 15:32:03 -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=lryqALIr; 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 1tYCqf-0007RM-IM; Wed, 15 Jan 2025 18:30:57 -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 1tYCqY-0006rv-6t for qemu-devel@nongnu.org; Wed, 15 Jan 2025 18:30:50 -0500 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYCqV-00059n-FU for qemu-devel@nongnu.org; Wed, 15 Jan 2025 18:30:49 -0500 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-38632b8ae71so269765f8f.0 for ; Wed, 15 Jan 2025 15:30:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736983844; x=1737588644; 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=oBmzOwwa/rqiVq09wwGIeAFFq9Z7MiUbusM3HZSK1Bs=; b=lryqALIrnpwG61/VosLmHrbIcLUlJEewhsfGiOZPEJ5l1Ak4YFwCmu8n6dTlkBTcxi HK1ZwaEcRTNWXmY7jTIN4TsO01Vovg+TsGCs5yrPKMOKay6RyoBLW2IopxdB50lJF3We 1FaSPkNZnqQ8IWRxOXndZNy/zVrFVY4Pqa0GVU8RwXKLONt4bqiWFTtAvFUAxgbse94m qG5SXHJHObYM4JzyFXXYPforbSj4TdjzO8vA/uLC3j81Tt+lVoRIGqjFCtxtiWlloaxD 5XX2Hw6lrQMxSdLibS2Cc4dnBZuobpNbMqunQRpA8dZd6siG69Ab+59iyo99pxvwJf2D iTpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736983844; x=1737588644; 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=oBmzOwwa/rqiVq09wwGIeAFFq9Z7MiUbusM3HZSK1Bs=; b=q02SgzyvpJscXg00n7xkncyq8hjgWsVwIGoVGBmhO8OaJqBfkonhi/13SH0pFAe8+y 1dGhBRYAMz4IJoUoN2QvpEYTmNJ3wASMLrWl4oPC7/SVQcsWKiZ8Wve/uEfJrkj2j29c 3vFa5lAXjuMASd7M+5rvjWqNjYAM1H0RArXgwmYiJNyVhcY2gFXnzs8lziLz11DbDSMY JXlDs5exjp2HI+k2MO1emfjYj6lndN6IPKghhrYGV8a/ZvOTu5xv+mw9Ad1RfZrs+tHJ Bo0XPrSlQIojF0klzvXRCibKE9zlIX8JiJ8goVEMoqkvnqh5iLSNejpU3jQbS5Fdcspw WHRQ== X-Gm-Message-State: AOJu0YyJnwwitVA6ofgAFxschWGeN2oIrxLsYCW3zZfaSRYEaiEP/ZIt 55BBhSo0PD95klJQFs7yBnPdAfae/xbidwcxA/9kdZDXdqJNKkBqDLx5DGw0p67EaaEZirRYli9 bsa0= X-Gm-Gg: ASbGncszoryALlvEbWlR+/c3uvM+fhTNaKj/gnnAIF/2bCXpsXpHgY6OgYLkmR+Ilpu cTK+lAnk5tP23xGk5WH9ZINHwCxI/7w649WHMq0qR8rSTnGMpwsn3iuFNTfGJObZwliwWdG0l/x 2o16vfPPTyAuBiwbfOGddW68UjU2MnorM8ccwQLhFsGQwUkrr6DP79fojIeGeuckS6nB5iYnWCJ sXHKFUgejfVAO2nZukf5Aw4rt3iEClHX6hqvGQ/RKvBWwnZTJR+JiVxhjNOb4Th0vzScFNrcJMM a6kaEIKhAVYOWbYd3DCQE4a213DThvU= X-Received: by 2002:a05:6000:144d:b0:388:e377:8a1b with SMTP id ffacd0b85a97d-38a8730cc78mr28628549f8f.28.1736983843838; Wed, 15 Jan 2025 15:30:43 -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-437c74aca93sm39607455e9.13.2025.01.15.15.30.42 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 15 Jan 2025 15:30:43 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Huacai Chen , Richard Henderson Subject: [PATCH v2 10/11] hw/mips/loongson3_virt: Propagate %processor_id to init_boot_param() Date: Thu, 16 Jan 2025 00:29:50 +0100 Message-ID: <20250115232952.31166-11-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250115232952.31166-1-philmd@linaro.org> References: <20250115232952.31166-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=philmd@linaro.org; helo=mail-wr1-x433.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 %processor_id from mips_loongson3_virt_init() where we have a reference to the first vCPU, so use it instead of the &first_cpu global. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/mips/loongson3_virt.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hw/mips/loongson3_virt.c b/hw/mips/loongson3_virt.c index 4924ea88eda..7d6369876ba 100644 --- a/hw/mips/loongson3_virt.c +++ b/hw/mips/loongson3_virt.c @@ -173,7 +173,7 @@ static uint64_t get_cpu_freq_hz(const MIPSCPU *cpu) return DEF_LOONGSON3_FREQ; } -static void init_boot_param(unsigned cpu_count) +static void init_boot_param(unsigned cpu_count, uint32_t processor_id) { static void *p; struct boot_params *bp; @@ -184,8 +184,7 @@ static void init_boot_param(unsigned cpu_count) bp->efi.smbios.vers = cpu_to_le16(1); init_reset_system(&(bp->reset_system)); p += ROUND_UP(sizeof(struct boot_params), 64); - init_loongson_params(&(bp->efi.smbios.lp), p, cpu_count, - MIPS_CPU(first_cpu)->env.CP0_PRid, + init_loongson_params(&(bp->efi.smbios.lp), p, cpu_count, processor_id, loaderparams.cpu_freq, loaderparams.ram_size); rom_add_blob_fixed("params_rom", bp, @@ -642,7 +641,7 @@ static void mips_loongson3_virt_init(MachineState *machine) loaderparams.kernel_entry = load_kernel(&cpu->env); init_boot_rom(); - init_boot_param(machine->smp.cpus); + init_boot_param(machine->smp.cpus, cpus[0]->env.CP0_PRid); } else { filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, machine->firmware ?: LOONGSON3_BIOSNAME); From patchwork Wed Jan 15 23:29:51 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: 857645 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp2733004wrc; Wed, 15 Jan 2025 15:31:51 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVWKfGIfIaOLgeBQO/WYU1Nrc18zRTSPFuwM2sU6bMNzxbAGoun3ITercIoWix3JP55cttv1g==@linaro.org X-Google-Smtp-Source: AGHT+IHAjnLmJPA6Ft8iHsFUAiBtRo5dmgWP5FsM9azhhdzcX0Uwzh6wjtY+W/YjUBHs+cd4oSHR X-Received: by 2002:a05:620a:28ca:b0:7b6:eab3:cdce with SMTP id af79cd13be357-7bcd97565ffmr5517226785a.40.1736983911082; Wed, 15 Jan 2025 15:31:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736983911; cv=none; d=google.com; s=arc-20240605; b=ZhQ3WiBwBEst3hooWzt7+zqsZgc4IH7xTcKBSRJo+DDKBEogbrIHZ3uMuYZW7MxXhI oYMvr9HKtpTDZML16WqwtViMs+T4PFN8FKDC1GA3353cgfoiR+uGdVzX1TDRKQOxMgPz sUf08IFmbYQwijm9YAtpD4yr6MkkhQ02ZmyPccsiP5+qr5/GA/0o6oYnylQAiFHLYevT DMsZWQTR5qUzXzXVIO4THefRKMKgsjlQ5eiUlsCV5PJAa1pHgbznsK1gyo3vCLI30PHo CI9dhYZhcbJdVj/4igbkjZ3QQKih9jnuBQDHHIxw8pXuAcuc+2ilt7UqT3LDq+AsyHaS KM0A== 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=7DNHrtCXUBQyNp6czmCeP9tPr+zdqB+MqJBbYxRNIgo=; fh=vbC9XRCEPtWLeFY5dMetP0+DZx7J3Hlgl6kGR/4t3xg=; b=lETWhQroB3T9JVMILw7G3GXpW+MSZ5YTgKvGb7/S+x50PwyjGgxHUSZ5LDoYZP3kr5 d19wCP2HF66fshuOj6F3BaoN4kCEeHmo0WyNutLEbHwsWEqk9QcDLVldtF3sdbbyArfY hcwmcT98mVFQXDHvi7HMZCh9SVcnLSmEEOSEh4V7dpG2N2FQkfeqqqZkChKkFQJi/ynt Me3cfhon9/bZJ+mqPHCwNiA0qPyiVeWz6huem92amadFYBaVEQAAfR/WmjjqM06ObEE/ CuI2YQFwVNu7mZSTa+atlU/NgLFU/U4waAxNyB39343dDJyp445KS8PAc7Bnsupq+XrG +ZKQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hamJ5yiL; 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 af79cd13be357-7bce33078acsi1865624685a.315.2025.01.15.15.31.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 Jan 2025 15:31:51 -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=hamJ5yiL; 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 1tYCqh-0007aZ-2f; Wed, 15 Jan 2025 18:30:59 -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 1tYCqc-0007BS-92 for qemu-devel@nongnu.org; Wed, 15 Jan 2025 18:30:54 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYCqa-0005CY-DT for qemu-devel@nongnu.org; Wed, 15 Jan 2025 18:30:53 -0500 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-437a92d7b96so2243365e9.2 for ; Wed, 15 Jan 2025 15:30:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736983850; x=1737588650; 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=7DNHrtCXUBQyNp6czmCeP9tPr+zdqB+MqJBbYxRNIgo=; b=hamJ5yiL2K5FJXt7utojqV+Mx+ldY8x2X4cVS8CIzEo/fzXHucf0Dd/oGxtWhLo9dc ABE5dn3fYoGaRdim3oLXSPxZ4rrKgj8u26EhV3HKHbaKZiqSpbeYBygKFH0qIS6kzf2l eL8jPyt4fXpRvy/cuSIl+liXtlJiH75oCxkvaXZK/XtUDhQe2mFnZFzrpWuJuTCyiu0A J+L/mrC+DGYwzZFVoNq720waxEoTToJNfv8VkzYT5wzXvQtAF/jdABjcFygY6PXSNg6t fpAK/linUFoXHRq3xCFdg9z+SESnASSgjb+DzuwN6Y30f6j1S6FCKvRHawbM50rckDYB Vtqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736983850; x=1737588650; 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=7DNHrtCXUBQyNp6czmCeP9tPr+zdqB+MqJBbYxRNIgo=; b=R5jkC/Y4aWFmPFGV2Mio2QCDaxPng/ZP9bI0IL5k7xIcVnZDMd95H6g6pGIkdEAO7g EfhrouUcwKa1hs0ZS+Dku3PGvBIi50USMC+YB0kFoSdcSYV7nhLjhjMwzQ7bAmACjoM/ rZcQayQu1iKo8lfOvDvIWdNWWvyZ2RfpZvBgrmGPs62hMo2X9xYZTUIzJfcmjucwd+r0 QriiFWYEJseVAJ35kRz4aYeY9ikxkkfHDNvHOrLemosumpLmuahNddPD74xGiXAvd81I X8exdrQwOmRYdIXWFV4dIPMqp4hT11MM7OrQEKo9RChADu8emlKtlIF61LS0LksAUy+k mu2g== X-Gm-Message-State: AOJu0YyGbRnev1J61TJ7zviARtA4mtoiP16Cwz+i2zEBGYXW4Z0aIdyN hDMA9aBd0YqweeuRij5vC9LePZcco6kkqWa6YCOP7WOoWJ4fzwSpGE9tfQDA8bRXkiu07L3ZDhE +xlc= X-Gm-Gg: ASbGncsesiauDmiSBJHiEoTw+L23unJ1zmNUcE/7K/w27LlygvUwlFeL5dXE/Th+koq XiCw10AVNS00eozpRmeiJKHii/Jm+oPiUjg11ymQhSNiME4Sh86oSYNL132eeedSAlRE8psz60x Ebqbje+b2E5nmCWdeao8yvNZkAlfK0e/FFeslWkjE4yTp8DankYiX44oeR1m4sZhqLEoAAZPn+j AIXy/QM6WoKftfmmSeXXzEdgbCrulvID2AT5KrWkAEFUr46VgLZFXCs7hhkUWUNnZOKmvX5pgd/ jIRWohC50cESCnLATz30sAVMmsur0qg= X-Received: by 2002:a05:600c:5112:b0:434:a386:6cf with SMTP id 5b1f17b1804b1-436e267f77amr270344785e9.2.1736983849976; Wed, 15 Jan 2025 15:30:49 -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-437c74bfa35sm38536625e9.18.2025.01.15.15.30.47 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 15 Jan 2025 15:30:48 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Huacai Chen , Richard Henderson Subject: [PATCH v2 11/11] hw/mips/loongson3_bootp: Move to common_ss[] Date: Thu, 16 Jan 2025 00:29:51 +0100 Message-ID: <20250115232952.31166-12-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250115232952.31166-1-philmd@linaro.org> References: <20250115232952.31166-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.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 loongson3_bootp.c doesn't contain any target-specific code and can be build generically, move it to common_ss[]. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/mips/meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/mips/meson.build b/hw/mips/meson.build index fcbee53bb32..31dbd2bf4d9 100644 --- a/hw/mips/meson.build +++ b/hw/mips/meson.build @@ -1,7 +1,8 @@ mips_ss = ss.source_set() mips_ss.add(files('bootloader.c', 'mips_int.c')) common_ss.add(when: 'CONFIG_FW_CFG_MIPS', if_true: files('fw_cfg.c')) -mips_ss.add(when: 'CONFIG_LOONGSON3V', if_true: files('loongson3_bootp.c', 'loongson3_virt.c')) +common_ss.add(when: 'CONFIG_LOONGSON3V', if_true: files('loongson3_bootp.c')) +mips_ss.add(when: 'CONFIG_LOONGSON3V', if_true: files('loongson3_virt.c')) mips_ss.add(when: 'CONFIG_MALTA', if_true: files('malta.c')) mips_ss.add(when: 'CONFIG_MIPS_CPS', if_true: files('cps.c'))