From patchwork Sun Jan 12 21:58:25 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: 856763 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1173700wrc; Sun, 12 Jan 2025 14:01:13 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVCXD3NULfoxybjwS8l1VX4YERb7tXed98mCv29t3VeU1/IEVCTxSsNDPTtrRyxRnC2lKGnRw==@linaro.org X-Google-Smtp-Source: AGHT+IECcPcvY6l+0MgvAVKX7KlJDlAdh3eGTN8EfV796elEE2OTTNKosRSzaPsdvAnFoM0TWJ1z X-Received: by 2002:a05:620a:2a08:b0:7b6:cedf:1b4e with SMTP id af79cd13be357-7bcd9761f39mr2847157385a.41.1736719273154; Sun, 12 Jan 2025 14:01:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736719273; cv=none; d=google.com; s=arc-20240605; b=dsA5OYYwiinXH3prGaRw+OrqyPomLdNTduCTAZOQ9x7pW7JefXiTgQP1+2miGwkXU+ D+aP9hrPbb+29EKI63CvfuMolvSAVWAnnP4YUTUWYc2QOokFiwCSkAuA5SD3q6ZKgT3u 1WrlHL8UbBS0vqCR6rOFE8EykogTmE2QBzb5n1Y/No5uSCy9b5tgttb5HB5ygjE9gBvj MBMby2U9YH+0xOd5sWGnmG9Oupf7pKzrME1ShZx24zm8rcuEhmgDDv5XKnledqtX7egT HB/j05pUneQUw0M7XCUio0p94m5G/DKYJVI59ySNy6B8bmVzRnFc47mFjQozO2apD8tf 5AlA== 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=rBkUIrZmRCcMUfKfE/ttgBZhqdpPPCtj+GtXYZ2keik=; fh=Ihmr/tTuI9LlTMRH7V2YLRHtHGMzXPi1O/i78pP9Xl4=; b=MVQOp0VR2nOj+1Ad1PhjNw5V9wiv8sPcD+vtVXOEylU8gHxkzwIYrjstnXPFQmOxG2 2AFjuHKvrCX2imL5acmm/RmQaGw09YrHp2JMKNvWPmIbgb3s7W5FzfTIUofuxZo13Qwa wMdtnqBAqg+w3UxMcIXSL+xYP+C3U01RFibjvljrkkUUVuGXn9H25Px0WqD/DIBXkvec FUspvGeucz3F16GCX6ESOd3odnMpzQXfzQb+g67VCxug9p8pIw2kyA/IBlFT13PmYTRM USTWtbrjEOpQtFkOwa4mtlvhdKzoMnD//kq5ACfIUUvPUA7Qn+8E0fNGmNfRmX5IK8+r afrQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HZ81YkHd; 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-7bce3238627si947016185a.199.2025.01.12.14.01.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:01:13 -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=HZ81YkHd; 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 1tX5yq-0005I7-Fh; Sun, 12 Jan 2025 16:58: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 1tX5yo-0005HL-F2 for qemu-devel@nongnu.org; Sun, 12 Jan 2025 16:58:46 -0500 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tX5ym-0003lR-QF for qemu-devel@nongnu.org; Sun, 12 Jan 2025 16:58:46 -0500 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-436202dd7f6so42715075e9.0 for ; Sun, 12 Jan 2025 13:58:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736719123; x=1737323923; 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=rBkUIrZmRCcMUfKfE/ttgBZhqdpPPCtj+GtXYZ2keik=; b=HZ81YkHd6ZBDNILW4k6trHdBe+yNJLRn8DEAbZUaoRgLVpRfU5VO8sW+h9LM/akZsR +MA12x4Ca3bmq6vtRWFLgxOMtHpmYx/bnnGH6fwafUL1CiSCf1nzTczdy4RB7T+O2wnY ob0a5/3CYd/YwUwUx5iA+HKcykmQ9b/boAtCe6F/ptT+Ah+Wzk78t/FwflAxATkkhslV b9gu6FKuNpXXuqdH4EiNmW2iRFxZnYBdD9s59gGk9HmsqzogSWYC3blAxDbSKPHs8Nxk 3dxaBmh7OfrjYESSgFjhb544cji/02kmHYLlxQCJgns2XE9VNyW/afuXrSVIdklzsraS YHUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736719123; x=1737323923; 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=rBkUIrZmRCcMUfKfE/ttgBZhqdpPPCtj+GtXYZ2keik=; b=cMKAkJNBf7VNF9ZB917mn7B6+cpVICmUf8tkmc+uXzJmnXeBdRsRi7K42sWGxTbK3j lsKp4mZnZ6bN79bA8t4tN0CPPeEUUdpPbPuaaHviYIU9wuuXoJhSrHRPHr+mqefcSJ+D b4Gh6Sl9qSxlLMI7BNkd+/o7iJqojRGgUeLUWwFMcvvEndzh+K4Wyg/zQzc9vvKKyBr4 l7HcaBXWGpj2vWkuJ5mkaVS7OFoaNgF1Wg3ITHfozzgCEG27EO0ql+rs36pWZWlojStP rCL2m097s0YwUEi5xfnUGTFZTJxFaB2wo6C2P3R2ziNSSxJni4dCkdfSefulGCclj/ow wtpA== X-Gm-Message-State: AOJu0Yw3AFJJgtcF5YHmKXzvi22ZbZektPjrR7d+ss7Ojva4gG58s3fA aAtPC/d1nLVoA8jnkSjEAp8FlKEf0WkGByPt82yn8CjVAECwlEM27AyK8gFDH+d94nkdCJOUjTm oVC0= X-Gm-Gg: ASbGncsCxS4dPowxkO5kIf0UwzDshfHuiLJt6mD3tGhXyjHEsPjWx5sv/gnSubn2O4U ZLl+am2DpAX75kD01tY0LxLEsilzD7j67Ho/UPOt7fuRMutRcrJHNLMQiqR15N3OlXOmIauqJNz kBFEUQjpGkMJXuAVvB9hAs8ZoP2Y6b0Mtk1w+jfyLoyB8r6In1N0Z3hw1jIC6hO5vypSs372rvf 18vFE4Ai91NptlGguT0u7AEIqLC9u8lI78U6EyHsMFysRS/HnfRZagDmsyxGavi7Itlge3tdCi2 8X4p/HIFlLZNNM0Xhife6fSRVywg9F4= X-Received: by 2002:a05:600c:1ca5:b0:436:1971:2a4 with SMTP id 5b1f17b1804b1-436e26c3efamr178483945e9.17.1736719122610; Sun, 12 Jan 2025 13:58:42 -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-436e2ddd013sm159325895e9.24.2025.01.12.13.58.41 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 13:58:41 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Huacai Chen , Jiaxun Yang Subject: [PATCH 01/11] hw/mips/loongson3_virt: Factor generic_cpu_reset() out Date: Sun, 12 Jan 2025 22:58:25 +0100 Message-ID: <20250112215835.29320-2-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112215835.29320-1-philmd@linaro.org> References: <20250112215835.29320-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.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é --- 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 Sun Jan 12 21:58:26 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: 856760 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1173397wrc; Sun, 12 Jan 2025 14:00:36 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCX12arHm7bNypSw/7TbTMaOgvG1iuSwzRsW9sEpBNPw+uIUm6E1VsacvwCN68bD/2uYG3QHnA==@linaro.org X-Google-Smtp-Source: AGHT+IEnF2suXPT/c3sJJABJnaOUXibeAjrHGq7N5YvyTrgpuQ/bxNItEoKR2dPgnjUF7wVXeAKm X-Received: by 2002:a05:620a:4310:b0:7b6:ecbb:592 with SMTP id af79cd13be357-7bcd97c4225mr3527084585a.54.1736719235865; Sun, 12 Jan 2025 14:00:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736719235; cv=none; d=google.com; s=arc-20240605; b=FnrqZm02xQQwb2TV5i82sf2LBkFeFZMI+bbbdnkhsYtZYZAHXn3Gb4fOkrBKNz+DUe HkOSu3t3AgtF16dn6khbKnN7WJQIBaNcLWKB10wTNZKNAiu8PliIEAvxXRKRjsLWiLry n8nu98khQ/DScPaeXR0EoKAeFnMhjbGI4snGpFx/f5gYJ/LlHSsvlgp0NSKtP+Y0T6d6 sOOER9w3V9A8tiOIecQi68wrX5Ktjtd1l8C82v4GdyuSM5VCxQX5m0ByVhV83UTOTWsM 1mQR/e5al567ezjrWCWnvumhUxklvCpze1I6UP6fpor0ODgTajXWbvz5Q5Wv8TYnJBhJ GIFg== 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=BYtEthfQnNCOi+UxhhX8J2P0h82CeZqIE84msWKC75k=; fh=Ihmr/tTuI9LlTMRH7V2YLRHtHGMzXPi1O/i78pP9Xl4=; b=ePBhN7K6rbB2C3vo0KEh3QFTwipyqFUsTiWvhZ5v9HI1R3FSxu7Z9gf8NPoBKeLTZS YsPNJivT82x830t5yjYivt3Oh3g96FwTA0ZtJH+Gp+Kt66n1dUxqemhLzo6aFC0jExdb 28h0IKDkzWJOir418VyK9K3u5T6Tlzjyo7zLCqoWAvPuUIdT0chvH8AWzZHJJ7pVkzhK eegtW/MHJ5iwTTr2gax9CvBrCQOPVri2Qiaf1yBe10kT24B1aT17WvY7PXOygHgv3MlY YDdUIil+PdrdjbtcXo081RRP2RTm6gs+P6O/EdfpOHMYFJEPCzKfHPN83FzLFqdQZYaf g/Uw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MmO003ih; 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-7bce3508df8si936695585a.547.2025.01.12.14.00.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:00:35 -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=MmO003ih; 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 1tX5yv-0005Ik-9X; Sun, 12 Jan 2025 16:58:53 -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 1tX5yt-0005IG-D9 for qemu-devel@nongnu.org; Sun, 12 Jan 2025 16:58:51 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tX5yr-0003lo-Mm for qemu-devel@nongnu.org; Sun, 12 Jan 2025 16:58:51 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-4361c705434so26096655e9.3 for ; Sun, 12 Jan 2025 13:58:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736719128; x=1737323928; 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=BYtEthfQnNCOi+UxhhX8J2P0h82CeZqIE84msWKC75k=; b=MmO003ihHQMrDgoW6ZWQi+x8wpry2njg2/YHzE31KW/Hqmhqk/5x3PRgso4o0XAcgn qhGGQLJgujVnMCf0SSrbYsrc22yBipPb+7O9bNANdtor60+3535o2GHsAt8jhDqjCoTA ddORZKFTOLCUYbIqkGxYLE+pmo68BquUsjajPWPXcMYFPXVC/Q8rC1cu7wHk3ujegaNr ZU0ra8dd/vJ/JOYQKnXL30kOmrQXobFryPMUF4qYByv92YBkqEWWfT4R6UXu/xz5U+IJ 3c2rT2Cp677VvK8GeJddSoTQkfDMctCw5fH8BBoRFqu7eAIwPOw63+yh0GnCj+OpHUwT ZRlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736719128; x=1737323928; 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=BYtEthfQnNCOi+UxhhX8J2P0h82CeZqIE84msWKC75k=; b=KLiREg3nxh3ZjtmItnkuU8W987wfJaC0suXpY2r+39fd5jVtFuKHOqakCzruiTpteN I46cl42usymRE27pDJUx5XNBEwbWDAbcKzK20jF9C56wCelhCshCGBqcarR8x2WF0xQJ ON5ZvdgsQIdgGKfZ8G4QrgNmqYvgiXdc5fhJfm+OHFYGaabujuCj5/t3cgHw/nlbzDXr wTQLLyREDM7DKBFTkQMVWh9wV7V+BN1GVUwmxnUJA6FuObpMYwqxK0w9WJU6nEEdy4RC XyGRmHds7i1yfrJXyQjavxayqpwqqflOFzjI5hGo43p6LQoDi/qmYy8gUaXdebcLr2Mn /VVA== X-Gm-Message-State: AOJu0YzttOuZ7gmpMKZMp28ix/PfMTVIrzgqlCPM4DTpXSp14g9lomkj Yp8FqX665lUJ9u2swFtnoLe7updsIQBAOwJrxF8sNiZk5/3uhxdQp2XjcRMDr6iAT3ZY6RRSHLX b6JU= X-Gm-Gg: ASbGnctkLjvJw1SUjxMMEXxCPFXfJVjUobQ0WvUcZ/pcBTeVfKhRUuK9xggG/6RbVJZ Jwg4LTJk1At17Js4bwkUc8bUBeilJ1vBwc7gdVWwsglq/AyRV68P0XPAso9rTzWWz+8npYRam1a taldA3pJxzp0877iGycxWsrAChj3umXIhvKnRkmawGB0xVtEqcfV6iIz1rFHFq0YtsRLBP1Diqp NOlf1oaN5+Yti1Gc7TqI4HMtcT+WjEOMEugXv1a+gdmmS6/IZgRyLan0+Qe9vsKuqo8aSTlo+Wn 0UCeqjPosRx3aNlbjuduNCIS0IOTVaU= X-Received: by 2002:a05:6000:154f:b0:386:373f:47c4 with SMTP id ffacd0b85a97d-38a873579b3mr15575811f8f.49.1736719127908; Sun, 12 Jan 2025 13:58:47 -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-38a8e4b81d7sm10567949f8f.73.2025.01.12.13.58.46 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 13:58:47 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Huacai Chen , Jiaxun Yang Subject: [PATCH 02/11] hw/mips/loongson3_virt: Keep reference of vCPUs in machine_init() Date: Sun, 12 Jan 2025 22:58:26 +0100 Message-ID: <20250112215835.29320-3-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112215835.29320-1-philmd@linaro.org> References: <20250112215835.29320-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.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 Keep references of all vCPUs created. That allows to directly access the first vCPU without using the &first_cpu global. Signed-off-by: Philippe Mathieu-Daudé --- hw/mips/loongson3_virt.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hw/mips/loongson3_virt.c b/hw/mips/loongson3_virt.c index 47d112981a2..4b19941c1dc 100644 --- a/hw/mips/loongson3_virt.c +++ b/hw/mips/loongson3_virt.c @@ -492,9 +492,8 @@ static void mips_loongson3_virt_init(MachineState *machine) { int i; long bios_size; - MIPSCPU *cpu; + g_autofree MIPSCPU **cpus = NULL; Clock *cpuclk; - CPUMIPSState *env; DeviceState *liointc; DeviceState *ipi = NULL; char *filename; @@ -569,13 +568,16 @@ static void mips_loongson3_virt_init(MachineState *machine) cpuclk = clock_new(OBJECT(machine), "cpu-refclk"); clock_set_hz(cpuclk, DEF_LOONGSON3_FREQ); + cpus = g_new(MIPSCPU *, machine->smp.cpus); for (i = 0; i < machine->smp.cpus; i++) { + MIPSCPU *cpu; int node = i / LOONGSON3_CORE_PER_NODE; int core = i % LOONGSON3_CORE_PER_NODE; int ip; /* init CPUs */ cpu = mips_cpu_create_with_clock(machine->cpu_type, cpuclk, false); + cpus[i] = cpu; /* Init internal devices */ cpu_mips_irq_init_cpu(cpu); @@ -609,7 +611,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 +641,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(&cpus[0]->env); init_boot_rom(); init_boot_param(); From patchwork Sun Jan 12 21:58:27 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: 856757 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1173035wrc; Sun, 12 Jan 2025 13:59:31 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWOzIcHRooNqpe+Ope9onVJqqoX5sBYqsXo+T1zp857DLyi/V+hCcBpQbhImuvYPmT2T4VNJg==@linaro.org X-Google-Smtp-Source: AGHT+IGZe19aGaRkIB2wbXvUzI+gDqWM4OAKbh8Z/UoK3oVS0egNwd1Wj4391JucFD0O+NtAzmwI X-Received: by 2002:a05:622a:10e:b0:466:9a61:273a with SMTP id d75a77b69052e-46c710fa75cmr313640971cf.52.1736719170903; Sun, 12 Jan 2025 13:59:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736719170; cv=none; d=google.com; s=arc-20240605; b=hlVSo+fnet1UEjsntw4ne7ZOxVzZ521lJKHtbTIWGXoblQ/diGxrHxLB7uqm54RlEh DhNwV99qx1RbXEBfyNZDDeXZzL4+oadHNQJP6cIjz2XDFrJ9x0nrWzXi3e0tdgTow5U7 QnycGD46BbvDDLWyMoky7m/vFNSoeWn/whupB0PyiZWnc222VlbMSzMo5VQudzbmc4vD /VnpzycQ4qQoW9CzhL3LN03m6EE/5/YL3NcQckiwgMzzZLtjQW57Tx5DvFKshAX4rIp5 AYq+kX+oNgsH8q4McloXrcqdTHB9EaaWxGXS+hrA/AO1WHeh/WymKx6L6EicQmL5gqAn XU+g== 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=mhawxe7kLiUXklv8T3b+XEpZj2QiLlR+X7Tpyy5GJaE=; fh=Ihmr/tTuI9LlTMRH7V2YLRHtHGMzXPi1O/i78pP9Xl4=; b=RnBqDGDREVhQ1Dc7hi3M+q+iV6MFA2TKHFSYBOj0iS6JJJcYTgvHXxgxKjbZhmaRXU kbi04JIT9pQU/ObCx38pMZglnk4Eet48BnXp5UvBnlg72AknvxhIRMuTWqCQHXI/r1fv wbEyM6dfndNeiIraDKnFdsDJE4bZH0XNkGIA/LzRNhJjmNUUT6BPVJCxaWiGEfrqkoKB pzWqFh7HLiPi95jQuo3be2oT6qv3YZenWtH8DD9mhJBh6B1mBI8V5z7BbeRk0TVzU0RT QyxleKwQNFvE87jLBQ8pTE18/K2s5xV8tXZh7NdlqeMFuIEjJ9Wqyt2HJ3kxdMLIp6Ix jr6A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=R8yfK8te; 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-46c87331749si73767871cf.130.2025.01.12.13.59.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 13:59:30 -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=R8yfK8te; 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 1tX5yz-0005JD-R0; Sun, 12 Jan 2025 16:58: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 1tX5yy-0005Im-H1 for qemu-devel@nongnu.org; Sun, 12 Jan 2025 16:58:56 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tX5yw-0003m7-Uk for qemu-devel@nongnu.org; Sun, 12 Jan 2025 16:58:56 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-436281c8a38so25956525e9.3 for ; Sun, 12 Jan 2025 13:58:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736719133; x=1737323933; 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=mhawxe7kLiUXklv8T3b+XEpZj2QiLlR+X7Tpyy5GJaE=; b=R8yfK8teJhnb7sWHLczVyFmitDUylbWV2rWVRv51XsC1oqA/VNNkHqVpkLHVbATEAz G9pDMHu2rBMO65QvOEJMiE8DSZt9x01Bp4Nn/NLJ95Z+xfBlDchR8BWz+dmHzHTA7Jt3 dQz6zUdqm2BkfwM7q7J8rK2HC8hgqWs/XolSEOsWxa3s//K4oDet/w4IxY9QUf5hNw4O ZIl+MSTlAF9TcgoHg2TyR+WqXgpICCPz29PXzHFEGkjaJ+Hlfg7wrTRSNR/nWaNXctqn bDun8lwDwm7PIAkxNx+F0e2+H+/58FeCPSNl8d7dsonBdTa9rPSSLb5xUQQtpIPKhgWs jWgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736719133; x=1737323933; 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=mhawxe7kLiUXklv8T3b+XEpZj2QiLlR+X7Tpyy5GJaE=; b=cAc4D/hNd2iSHwtWk17P6Njqbb8nQI9O3hggiPjZ7q2P/X8iP7LniQjWYVozyyc9zv LgULDZRfbTDgMFQR+NiywKAOfrkQwS/zjgQE2P4Kgum6+dX0wmjo0qwBAnLHwcLniLzI WtkscjOWVAZDz59C7F7ZCjyA6NRhTe1mKPgyT3TdUug0k+RStnXqKlRHqxRLHvn5bNy9 z1a3Ak681Nkqh4KTwbjcpHbb8MZwjTD4KKzgJLzPayYDfEU2hag02fDzlTP9kk05aBCe Wl1euk4kmEAT6TezNgbZv8IjRE72yleVj+sDeSg8wBr6qQLCdbUdTrtXCPuQKyZJfucE Zjag== X-Gm-Message-State: AOJu0YwZo0bTeka7kcK1n8QoH7OXrn0WtBsKmQB6Rg/1uWbFF6qt/8kG hG9wdwpKlvjT2p40+VZXO6vUXKaoSpVnpCvbcP8nduHd+IqmPGNVtNkUko55nKrPRZLpZSRudZP HMIY= X-Gm-Gg: ASbGncsuw/JD0iZXiOUH6RYSb+rDjQuAmj9X9gkQf1X8gzUoZ1jjvpYWTni3/+fUfle 7uNZ+8K+M7FcB+PhmXFZ5onUEaySlqCSIj0EJwKPCJ+R1xY2Y6dBUOa66Vos8XkAL3Sw04xsQlp azhVyGnFjXUiH7264mnbO6YhUb1kpKlSYYMpMqrtDibV8+1XjPYJp5TGC6edf9pCXwWkaTC/UvY y7UvL0LbNFczvjAlllU/ZxLlUnBQDGXU7quWAiYONJsAcpypo+WtR0w4xeojQ3Y5FR45iSMJnZS kujujYlHrSxUJWvgb00Gme+9/UG4aHE= X-Received: by 2002:a05:6000:1a8d:b0:385:ed1e:2105 with SMTP id ffacd0b85a97d-38a8730ae10mr17016510f8f.26.1736719132532; Sun, 12 Jan 2025 13:58:52 -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-38a8e383654sm10731523f8f.30.2025.01.12.13.58.51 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 13:58:52 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Huacai Chen , Jiaxun Yang Subject: [PATCH 03/11] hw/mips/loongson3_virt: Have fw_conf_init() access local loaderparams Date: Sun, 12 Jan 2025 22:58:27 +0100 Message-ID: <20250112215835.29320-4-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112215835.29320-1-philmd@linaro.org> References: <20250112215835.29320-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.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é --- 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 4b19941c1dc..032ff92383e 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)); @@ -635,9 +635,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; @@ -663,7 +663,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 Sun Jan 12 21:58:28 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: 856759 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1173249wrc; Sun, 12 Jan 2025 14:00:15 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV5LDThOKKfHeKQCuMXfq8r9mO+2QZsIztSjHZmIa2YRDblKrclFwcHmicCYb+xd5mVAjF7pw==@linaro.org X-Google-Smtp-Source: AGHT+IEDyUlNlvOdVaEBWrgfZmdVXsds8Rd+btV2X8bCMmnNymOtXkNpzMZHHA5m4QRWrb8NZOAU X-Received: by 2002:a05:6214:3197:b0:6d8:9be9:7d57 with SMTP id 6a1803df08f44-6df9b28be85mr310739536d6.37.1736719215512; Sun, 12 Jan 2025 14:00:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736719215; cv=none; d=google.com; s=arc-20240605; b=SHkQrc9RF90T34d0GtxC28EjOxQ2eHzliQ2aRezWDC1qd8fCTrUJua0nMW4eAQXfai 82fyGP0fAo07fN0FRjGk+07iSrRANzet02jcKkLJ/Tju/WxG13wgLyTboHXvVFVGG77U n+n7Kspvrv+bTrZRUb4zBsE1Ejuvb/RgIHNwzx9ZcPRMfLmFAQMgj+c3g8xPWb5vEMft IE25Np1VGN59BAqm2sDvQjh0zSdFwPiQX89TXhWIv4cQAkDKVCTwSp3ZNWBLol+3O98p v9hnNH8+1FGkbjJw/vdpuTH7NmJMXlNyHnvdXC9SRxQEOA+eEdegodwhpgUKFRZpdXL0 bSww== 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=C8CQfnNBW2aJXtC3lFFPMQMP+NskiuKSnJ/i6XTzflQ=; fh=Ihmr/tTuI9LlTMRH7V2YLRHtHGMzXPi1O/i78pP9Xl4=; b=blUe8PvAI30plukCLwfncnAWP0yqgCyvHy+KNOnn+T6yhlpO1ACzetUQ5kPniRzw9V X49WOUn0pr2kJAfY1lYs6QtXCUI+tlFZzPsPPuV12lwV0wPrEcjvYpOQA1vL1MAuEUOg HPEbh2LBFMW7WxRIFYLdg+f60x1P3sxOvRvgjJYmbLNnr8LMMDoPTpmLvWtpJGM1ydQ6 PZGhl81QUFBuC2JzrwyC42M33xwnD6q5sxLC/+fdIU+NEj+AgT+5ajMjUOmHx9EEQz5i hFHRfkVCDr9x+L9flGOkK2AB5E+NOzOd2PivHXt1h8la0HrnxCUJhQg1FZFRzbHiQALS Vq9w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TlTZOCrF; 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-6dfad8aad77si73677546d6.31.2025.01.12.14.00.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:00:15 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TlTZOCrF; 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 1tX5z4-0005KL-Gy; Sun, 12 Jan 2025 16:59:02 -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 1tX5z2-0005Jq-Cw for qemu-devel@nongnu.org; Sun, 12 Jan 2025 16:59:00 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tX5z1-0003mP-0o for qemu-devel@nongnu.org; Sun, 12 Jan 2025 16:59:00 -0500 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-436a03197b2so25552645e9.2 for ; Sun, 12 Jan 2025 13:58:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736719137; x=1737323937; 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=C8CQfnNBW2aJXtC3lFFPMQMP+NskiuKSnJ/i6XTzflQ=; b=TlTZOCrFk7zmCHIM+ubr8RiQ5gEblKvzp6ioXT8EzfxlDr43I5btiU7X5GG7DmQ2Lf xC/za0bRL3RIoU7E50aW8HLg6sLEMpHHQt4g2emcgvIu5waN4hXXT0PV2Mt4f17/RZQP jSTQA4XH269s9viYnl9vPt2r33/nPA4WgPYw9FgK4N0tko5UW6umj9H+Bygs09HmOmzX woG00cn7WLzT1Z5E2l8D9bf/iJYvnsRQzl667ZA8cB6YXGjgZkhGmAt3gJ2/XqWukYa/ zcJwdFxHGSqpxgIcopaS8yAea6ziE/xjGWJmwaV1VSAj4DdJKJ2EKZ23MesAvTIPNfuR hMCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736719137; x=1737323937; 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=C8CQfnNBW2aJXtC3lFFPMQMP+NskiuKSnJ/i6XTzflQ=; b=vkjc9onrsNg0uRrgi34mS3Y75TRkx+btyjk8EKi6rbDdEF8Ow0iz+Niszwln0sWFvD duJqKi/pwiU0l8khQy0Tw0/0v5PFSXs8OBsz7SeaoZxnu/XLoFVz/Pc88QlocrdqQK5y oCfvDD0sWnGzleAmkCFLx8NykXhElC7z32rc2cOtSjIOWFf4jDm9ACiqBHXoClla8Lsx QwES89H/2gobqrZYiGwwoLeUMhlANu7Ihl8LkFN7itISc9ptrUo5q6F3NrwJkpWpZkhm lZb5ZzGhooGKx798ejd+F0MIitxXhVeC/fANjnNi4ZUetPyJ+SsdweSs8r5WZbijyM1/ S2UQ== X-Gm-Message-State: AOJu0Ywio/492sTZxFAtZm8t//upEHaOp/3tWvbTB/BLdjB+hZncdG6n N5UI2jSeakVbcaOgo7rdQV9TKbAjJGAStc0tLzw51+6kLz9qMLKry68ugK7HSm7kOmFISBuCfMa oQEY= X-Gm-Gg: ASbGncv6TZWQC1lfOryeocnspNd3O0QxKjagqbcFvZRnup+ZhnohQ7F9ah7vtUN15jT mchr5Yd6szF1b26uI8e8MT1+ftDV98snpypbrbXlAhE/JBpnBDctssOjjzHPltbN69GfXAinr3v RuG88Ili476Ow88avR6IfIseGERDl/ipjyZf8ujk+tYnDpgUBI59cN9cDjghFsz7P9qrPcU/Iks gzR7cggkOQooXiLdGkukzBwO2r6HwTK3xtEbPjGoShBJvvntHySBCj2aG4+X3ynvRszCJ8wNiud ljed5QR962uwjJIGq/6/NqfGqWgic40= X-Received: by 2002:adf:b183:0:b0:38a:888c:679c with SMTP id ffacd0b85a97d-38a888c6b21mr11461718f8f.42.1736719137137; Sun, 12 Jan 2025 13:58:57 -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-38a8e4b82a4sm10656350f8f.72.2025.01.12.13.58.56 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 13:58:56 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Huacai Chen , Jiaxun Yang Subject: [PATCH 04/11] hw/mips/loongson3_virt: Pass CPU argument to get_cpu_freq_hz() Date: Sun, 12 Jan 2025 22:58:28 +0100 Message-ID: <20250112215835.29320-5-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112215835.29320-1-philmd@linaro.org> References: <20250112215835.29320-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=philmd@linaro.org; helo=mail-wm1-x32a.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é --- 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 032ff92383e..078ad46174f 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; } @@ -635,7 +635,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 Sun Jan 12 21:58:29 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: 856764 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1174018wrc; Sun, 12 Jan 2025 14:01:55 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUoaan1tn0OlbgA9Gw0hK7W6vVKnBx9J6BhnFfyx6aCiGnVcF4f3Eb4yO/703PMK9x1YBbPag==@linaro.org X-Google-Smtp-Source: AGHT+IGkiU+iOYDQQFBKt9rzs1CVo1fkzN+akdvS/SK2QenHe91e84tjVJKF56gt4josJPfKrxHJ X-Received: by 2002:a05:622a:307:b0:467:8017:4e85 with SMTP id d75a77b69052e-46c7100509fmr309273361cf.19.1736719315571; Sun, 12 Jan 2025 14:01:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736719315; cv=none; d=google.com; s=arc-20240605; b=a52hCwvLd+KJTWmShsluDu8vCKzCRc4dUEk2o/394f3tp0fFx1bt7y2wRU2ay3ZF7i a4270/kz2twZBpS84ROjTiza764jUHTCKHGiv7QiN8g4ksdGKXczEivoS2Z1QH+QUZSQ zTb5j3IkdA1yh/PpewNFjdf8TTAB3ZDTH1yZkc/aawCXCu17+Yi28Mar6YpENwhCMfm1 sBZTwLQCPguj3870FIK69Wc7RIYnj2zORODrn+381O9ZvvN8gQnYwZY8ujkVt6kFcqPA Zbeuo0j3lnyImm9QmbRtGwu1rHtAE4SMFzwBT+Rj1cu3MBXkjMk/QTcNjJ5DvrZFct0E Xdyw== 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=cfr9cRQteCKCUUzw1cda3aUrNzk5bprsudeb9V2vsoc=; fh=Ihmr/tTuI9LlTMRH7V2YLRHtHGMzXPi1O/i78pP9Xl4=; b=DB8+EV0XDbj3dR+YuZd1SG6zS2hAJb+eRkDs2iVIAYq4klHITbwQRVa96kW+YN/WXR wfehG/HF+56tNypR8QwGeTf1SWoyJp5MB+UQZfe/4K1bqdTKVWxPblOQvWqsAhjgnr81 cR7DdTCxEQgdJavQK9R9WyO20RkLL15NGzaF6WZVQeqj4WzNEV3iPJavfgyJg2rQ94CE D0uUQdIHugBM3+F/u8uSx3RoklKWvgbyESZ4GCoYPAweGSi3rWFeSZpxJTFDO0HOCOrv ewxhPudFi7f9GypGQnPhd+OEGqp38ibZfSAH/4firOVLNS1HoDMttirtzFrnSevMsLET lwDw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=O9WdUB75; 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-6dfadef4c1asi73660856d6.300.2025.01.12.14.01.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:01:55 -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=O9WdUB75; 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 1tX5zA-0005Kp-Bj; Sun, 12 Jan 2025 16:59:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tX5z8-0005KX-KS for qemu-devel@nongnu.org; Sun, 12 Jan 2025 16:59:06 -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 1tX5z7-0003mh-6R for qemu-devel@nongnu.org; Sun, 12 Jan 2025 16:59:06 -0500 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-436326dcb1cso25725365e9.0 for ; Sun, 12 Jan 2025 13:59:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736719143; x=1737323943; 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=cfr9cRQteCKCUUzw1cda3aUrNzk5bprsudeb9V2vsoc=; b=O9WdUB759t7xCDpUs9DAb31rMDcsgexYDxWHwuEnjfZvZ7xJzZeDarXcEK01QYYkG3 YNaXsqk8F0/AISezT5uZIHLm1aa16Zxu/8Ca6gBw5rwEgXAx8If+CzVqveTcN5WWIjkJ Dg0Qt3wOc8GeiMFO9jC12JbzzcgkmAhcM2YNeAJMsTglAq1wnNEKS3fw8o2JVHc/DaFf OkroKlhhft67yD4sTUBsK2yTwOAOLocAWnGWWsCjbRIcNwfcJe9XE6yvK3gDfKtnLJD7 nkeGgN1z2MNfhvPDXmbaJt+Oksl+WaPe1mCE2e7+BEXtzBzCSVFbwo4wbmsehd22uMhr 1hbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736719143; x=1737323943; 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=cfr9cRQteCKCUUzw1cda3aUrNzk5bprsudeb9V2vsoc=; b=XrrmOQ7lFcINBYsDP3xHKKv6RxXHowKq9NmzX3rfzfV+xCAyOYX+6jrtPtZYjjn4wV Xn6wYtFNlCE1gqZZnkkKWGiUZSzjLoLLAXrV2VXHptc035OqTveSh/3qZms3NLmHjfAh I6S0Ylfb/vyjZqmCVQQJMHexTYWpKoJBBwMombuUHFW2iCGGpgm4AMGHdyBuJBHZnMdp 1Ejs+bOh2ZcWe1RuG5YGnHio1LFZXQ2lAoSSSBLnprPf8IE/4fX45W36pF8Gj8Vz7i77 lqhzGaoIPkqvmr8ZOZQyGL6dmqRyVjbXMD+M1fKWjqkfZxLzdFA1EvpgkoFAamjgQZf6 UucQ== X-Gm-Message-State: AOJu0Yw9zWzIbNLX7Hn+cOJ2dKCSaObdV0sUdOuOccDKZ9WnjocjIApG bNUWHRoMjzN3PkyOboxwV38832F4WHKJxMl7dKGYlaGQ/QFf+PzcnkmMgtTt6QBoVT1GHWJGsRY NcQM= X-Gm-Gg: ASbGncvns9ISo6C1Z69ah+XpmdYKaIAVWM6Clc9DFTSMhfLEt7txXG1A2N+CNZBnhf2 M7UwQJl9OgGFsoxO7Twdl4sCeAuu8yxWWnXBWMb85rERmFkL/1/khKGjAYrjqY4FhNT1q6xkED9 uYkxDJ2g6EGL5+KgITDarT29R6ClkfcKk7eoui6+CYiOEzwfLG5E0OR/z2Y4RypwRNJuISFshvM Sx6idH2Txp/7f8sQaa+s//OHCZ4afZA8nghYrRy0w2mnX1j49RqG2kBbqfslywXtB+80Y8qfpKt ukZkE7RsC1y2EUgYVlBA/wl7GcObJtE= X-Received: by 2002:a05:600c:500f:b0:436:51bb:7a52 with SMTP id 5b1f17b1804b1-436e2697170mr170863725e9.7.1736719143168; Sun, 12 Jan 2025 13:59:03 -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-436e2dc0069sm158837685e9.11.2025.01.12.13.59.00 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 13:59:01 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Huacai Chen , Jiaxun Yang Subject: [PATCH 05/11] hw/mips/loongson3_bootp: Include missing headers Date: Sun, 12 Jan 2025 22:58:29 +0100 Message-ID: <20250112215835.29320-6-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112215835.29320-1-philmd@linaro.org> References: <20250112215835.29320-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 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é --- 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 Sun Jan 12 21:58:30 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: 856756 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1173036wrc; Sun, 12 Jan 2025 13:59:31 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUL9XUEDFQ+LnR3i+i5lWj09ao9UHlZOzcEBzlgathxQxWr5jqckwoIxCAM4uLglsctQGjpNA==@linaro.org X-Google-Smtp-Source: AGHT+IEJ73vLNw+QFGQecVhyJkTcY90dZicceFgRa2blpqTOQGmjpUNiP7ksA7z50kHWyoKwVInz X-Received: by 2002:a05:622a:490:b0:467:866a:cc2a with SMTP id d75a77b69052e-46c7100330cmr303402391cf.16.1736719170941; Sun, 12 Jan 2025 13:59:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736719170; cv=none; d=google.com; s=arc-20240605; b=gixlCCyjxyQfL7kZBFbEBROAJ1gxS6itFu+FBJxK90b6hTyen0H+F8xYJorvnn7UB/ 6I42DPz9JHzZtidLBDoej/234+YgAKfPdkCxMHt0SSo9UpziNGUDA8w9dl6GL5tWo4FO Xud2SwHQWwH4VOzGKUKG0CCWM/D9L7F5wvVfyL7y4hiKybUee/XBTw1rCQD7vMAj+UyT DdZd4KZ59y9mCtOg8Je0xqO8kIadaiOGom0hrzpHYvVNkWvkd3mKZuN5FtuXsWAcxJGZ H+i3yvH+PKATs7Rv7o0g72h+kOFdM9p7WzdGhD4xQWEgcvP0NGXjOWhLkEzGCaWzbV0b lC3A== 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=wK3KLpGOg+W1VXGWktCJ4kGgWfKhkmwKswKddpX8HX0=; fh=Ihmr/tTuI9LlTMRH7V2YLRHtHGMzXPi1O/i78pP9Xl4=; b=kT9V8c+Bb6rozylnGNe9KDgGTKMnEA0hILFkM79ekabytLi90AVRNZ7XjxfJ0hiwJc ae+22BkyXOsdF75/2gU1ZkH76+HeTdoaHwGY9HDImJ3lQNjFcUJwGljbbhiDVg5jUPgX EriPdozkasUi6xILoR3aFmYwZPYjBinpDEBDMBVJGhBWzPKmmthyvtDSER0vse7GKK8M R1B3pPaplA3CrxVTkWvGe23fWuDz7mO8IUAF9scGHFBKZ8Ygd7SlAzrGDiXIeN78BPeC d9pYlIfOTgZXkkvnBZhAWQHVEnEvbFbCRTgvHXn+qXByYq8NgMn+YC0+fj+IydMs5+6B 44SQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZF5vvIpp; 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-46c87424ce1si80857711cf.609.2025.01.12.13.59.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 13:59:30 -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=ZF5vvIpp; 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 1tX5zG-0005Le-2a; Sun, 12 Jan 2025 16:59:14 -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 1tX5zD-0005LM-U5 for qemu-devel@nongnu.org; Sun, 12 Jan 2025 16:59:11 -0500 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tX5zC-0003my-EB for qemu-devel@nongnu.org; Sun, 12 Jan 2025 16:59:11 -0500 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-38633b5dbcfso3733106f8f.2 for ; Sun, 12 Jan 2025 13:59:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736719148; x=1737323948; 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=wK3KLpGOg+W1VXGWktCJ4kGgWfKhkmwKswKddpX8HX0=; b=ZF5vvIppX8dcxG/ZdFmSQNNa6OzjDuflU0Jg/QNqPfvCMG5MPunXY3G0nIx3Qbdgn2 ILWQtADXHtm4apayxHxXs1oZPvkveqBaYZ9QjPZOvuJLddUV2u/HtFZ2PbQhaOr9J3lX ZVbGomBFe9olTdX0P/eljXVRt/p5uqFcjBER0nnD5vW9tUXXf1js6tvOhYZJq3DE3Wx+ 2YVzDiVd+s0G8f5LaF7Me6QxbH/TbXrfwhfMfxex329FlYgya5L48Kzklec2PXD1HHp6 CP7VaCMSSerhxY/ZycBq//ln1H0quC7wHCaNioQMIHMbbpolfPj3/fffe4dxAEI7d+Mv EoCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736719148; x=1737323948; 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=wK3KLpGOg+W1VXGWktCJ4kGgWfKhkmwKswKddpX8HX0=; b=oza2bR2wEkd5owPUQUxWsQFNZvDSu282nt1/DmRhx/PpdZADDzXvAGBADL86djzmsY r/BTRjhW2HM/0/bwJXfvkaTqWOiN0jmFD5zuKiWiDHgBC7x6ZFfF0dJWHsCqnpmmewBL LOpKu/LYQ0ptyTO1hcVq6SOcySel7A0D3jN+8SHJuI9IUeRwbw9Bc7ckwR2XOeR4Z/b7 UGLe6zL2LtCzrnyUSKRyQor+6pKJfaErXehJU7gp3uS0JBWdDlqnfvsSvXc7G14MWO9p I2kdYshClN0Yb3ptqGD2W3POA+7h5DydALYbUgUKt2qRyTgYHHl0rvlropTrUQBNkHwE U7tg== X-Gm-Message-State: AOJu0YxaG/OxuLAKtupV1O2E8d8h2rU3blXV4U86QpMBCH+OkvnaM27/ W6HvDHdV/MkL2m8TG9/hupk9sitkTSG6Y+TCKMvmIe+iVUWaIKpB0SKdYN1f0SWYmM99+QW9aBm x7mc= X-Gm-Gg: ASbGncs9wXaoiPUgMaNMfNfUbhBWnp10CZXA/rrHT1altA0zXcNc9xLDMzK5TOCwLgt kDesDSKd51ZEtMaFyeqersicIBtdxJ10qyO+78SBuNCxXQI2nqUlvyIuqGVFJ8ZBcDNsEWZPr/i iO1FPwawdGJTPL8Io9lkDio+rUlpiv4BD3wIX5wTJAIW4ycyz+OWgFFJuYURR0YUXTkY9LiA8gl L0diSEPTpDU+chZxHtUgAAq9xZNsGBQge3+7Le10Zi/9Z/+xdnulu0lc0vKlTWhDhmfUrUW5tcF Jd3+68jDzLMrZQVYfjj+qKn7EgvkXmw= X-Received: by 2002:a5d:5f51:0:b0:38a:8e2e:9fe3 with SMTP id ffacd0b85a97d-38a8e2ea20cmr11591714f8f.24.1736719148481; Sun, 12 Jan 2025 13:59:08 -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-38a8e4b80d4sm10295173f8f.85.2025.01.12.13.59.06 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 13:59:07 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Huacai Chen , Jiaxun Yang Subject: [PATCH 06/11] hw/mips/loongson3: Propagate cpu_count to init_loongson_params() Date: Sun, 12 Jan 2025 22:58:30 +0100 Message-ID: <20250112215835.29320-7-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112215835.29320-1-philmd@linaro.org> References: <20250112215835.29320-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=philmd@linaro.org; helo=mail-wr1-x435.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é --- 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 078ad46174f..af1937455b0 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 Sun Jan 12 21:58:31 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: 856766 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1174090wrc; Sun, 12 Jan 2025 14:02:05 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVU51UUkrK1SbFAUSmiqSutB3ck68otRMYXc/1SW+OvgoLvmTUk+dxGyF90f+urXBccICk8zA==@linaro.org X-Google-Smtp-Source: AGHT+IE//Y+L33NQ/cCp6FRQNxb5nq92+pgn+JDyTFdK6+VeRAFOvuFRQADLIy+kyYbwnI1Gh5X6 X-Received: by 2002:a05:6102:3a08:b0:4af:3973:6b22 with SMTP id ada2fe7eead31-4b3d0e8aad4mr16362891137.22.1736719324946; Sun, 12 Jan 2025 14:02:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736719324; cv=none; d=google.com; s=arc-20240605; b=HDPX045g3k60bik15y3+NY9Ao7V3UkRA6Q5fzXjf6q1cKPsuN1NSs5n4cbhfZ6iTCL uBZvKxGo1YnG3cw1hdH/Wl5QL73JHxlgusRLYt4VX32TxJkOWePWDtONWpOGkTrq3Zr6 AEox5ISMjlSzs/cNNzTCWrprjtpjEjlxtCoz4krqSEd7y+C/M/6siLEGHwxCCTnfcSRT WimjO5fg/C9fCgSHWPItIL+nuVwAXhm1KdJlYgwaRPLbSOj75Ea6iwqDF/RsMZk/mhFS CZ83X7yi7TxT5F4ZhVTUag4JaR/Q9qqqh6dr3pF+9CIJJPJIKtywpgyKDDyPPkqUuhdx G2iA== 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=3D5LATmwVIHEkoVYh3B4/BcJbbaKQTKjDGm1VbT9Ey0=; fh=Ihmr/tTuI9LlTMRH7V2YLRHtHGMzXPi1O/i78pP9Xl4=; b=OfkeiHfzaWegO8wG9K1XpPiO0xr5dxR0IQU/7enWWQIAuY4JiPWm1Hqt+NFlPcqgc7 yQeGaXZZGIQeJOG1BlbG/3MZ50N1t4WEP7k7pNdpv66t9a4aoJDr0CC2eM5tQOe1VVIA 5RJh6WIkBnBOuLP98rXXQ3kOAKmGuoIal8fOxNlUE8Y/tOu45LlRLiv/hFis4zpcM5eT 9OS6HYkuTxwKwfgla5Clzf9tsuNPBU7U3FEI6vOm0y+hYCQQa2YbTqMJ49SDOLpFDcvv WkxiI41dYwXuDmzYtbaRu0DMAo5UunER5KN/8Sv7fCO0Aim3OavlNGTZGWvLKYR6dz87 syAA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MvRxNznh; 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-4b608ff65e7si2568530137.163.2025.01.12.14.02.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:02:04 -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=MvRxNznh; 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 1tX5zK-0005MF-L5; Sun, 12 Jan 2025 16:59: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 1tX5zI-0005Lx-F8 for qemu-devel@nongnu.org; Sun, 12 Jan 2025 16:59:16 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tX5zH-0003nJ-0U for qemu-devel@nongnu.org; Sun, 12 Jan 2025 16:59:16 -0500 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-385dece873cso1774714f8f.0 for ; Sun, 12 Jan 2025 13:59:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736719153; x=1737323953; 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=3D5LATmwVIHEkoVYh3B4/BcJbbaKQTKjDGm1VbT9Ey0=; b=MvRxNznhVpaFpY725hhFCm73VcH99fjtA8jpz+Go9u2vS+lKUm1SwMGJctLCyVUYGG +JVY9F99BrI/433M0MAgik8y7GWRsHxnTLrBfnxVtVv89mIKo+OGW0eRGGKrgyz+pVEr 7prTllaWbkoyOWuYevbsdj6fuExKXWfqRIpi0SJ6nVdueBgn1Gt0uKr0AbcP/7FcZWgz FKJNixg12JT5Fhxn6R8/dX5zfzA/7+t5aN40jpfY99k8bzRF+laGe9txZ/xi/U7+N2YC oWtq6jCkCFfkIHAYpdkpgiCfetDlXedyua3J1RTyB331RykRiAKxqfx955XQM1lj/5ly 0MyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736719153; x=1737323953; 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=3D5LATmwVIHEkoVYh3B4/BcJbbaKQTKjDGm1VbT9Ey0=; b=SiHOh9xDyRjEymuxQ8i/iwKtNkHbi7MLiD2lS4mGRiSpidqeJ72UgTPgIL9sfUPG3u VKh2XCI5rngCXLiafVLyT5F83V5kiznZt6o+emWaja7to/8ZXKTQ2Njjvn6h/3U9LsFx OVlS5cIFe99y7Z/sYNlh4sCmu4bpctJLdVAdk+DMVExuCjgHc/3UsubY5llzNvx4+d0F nWBSx15VcMeHp3udWCu6IOYYCw/zTBWyAnLY88jek/umQpDmQQYZ1zmzVKZuOBl5DYp7 2b5aSq53GyLvH9RmxjsOVLojvZyMDSRRITqqeVJJhwW4kC/4V544qRv+VwNmcp7Xa2B1 7JOQ== X-Gm-Message-State: AOJu0YyTYTsBaIDtCTdlfKJm3YgxALiyMtH8Mj1oM7FxVjuctlwSYB0Q hYmN3Sdcpfe3rP/DC0hA2b76OlaczHB3LS7Vv+b2EQ3fzkwj3hNLCs4LO2sWqyrkqwFFh7CGYMi aqgA= X-Gm-Gg: ASbGncsgt1AhyfNvLxluGVgh3mHx7Z5SjmCKMTHsiXkiAJCoD/1f06i2M5oZ0KShLgM F1mCHAnujHvh8oegqKDuPOrsdbMgz5rml5gpxSFIvAbziD8UkdfnHnvWJcXM86qREKG28yYNgdt tFzMl3dIdAjxRvHkTSqQkc+a1LUJwoeJ0KzvPdSX65dDnIokPhcbYVsfUSsD65qtOj5efCUcCsh SgF9X78h1laZvpUBhK3vF9LKAfUr5EMQJILuD3FxoZe8t4XqJNeFxkhJvFvODWOaOTjDlh5vyUY nCS0Kn9Nj6u6CocNetuMNtJCjIeQnn4= X-Received: by 2002:a05:6000:1864:b0:385:f071:a1c9 with SMTP id ffacd0b85a97d-38a87357964mr14534512f8f.50.1736719153040; Sun, 12 Jan 2025 13:59:13 -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-38a9362947dsm9068134f8f.40.2025.01.12.13.59.12 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 13:59:12 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Huacai Chen , Jiaxun Yang Subject: [PATCH 07/11] hw/mips/loongson3_virt: Propagate cpu_count to init_boot_param() Date: Sun, 12 Jan 2025 22:58:31 +0100 Message-ID: <20250112215835.29320-8-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112215835.29320-1-philmd@linaro.org> References: <20250112215835.29320-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=philmd@linaro.org; helo=mail-wr1-x42d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Remove one use of the 'current_machine' global. Signed-off-by: Philippe Mathieu-Daudé --- 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 af1937455b0..a240662016b 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, @@ -645,7 +644,7 @@ static void mips_loongson3_virt_init(MachineState *machine) loaderparams.kernel_entry = load_kernel(&cpus[0]->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 Sun Jan 12 21:58:32 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: 856761 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1173435wrc; Sun, 12 Jan 2025 14:00:39 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVeMK6GOau4tToczS8vMgcpMuQ8MVsuQlvEl5c7JGE/eB9nywzbYIHqPNuJMUiWD0GUaFDu7g==@linaro.org X-Google-Smtp-Source: AGHT+IEGaTN5yVCR5RaCZajVTyRt8nda2zKg9jz1QL6ITMDbgETVosEi2HDBcrwLIHd0PbOd+f0e X-Received: by 2002:a05:6102:3e20:b0:4af:e5fd:77fc with SMTP id ada2fe7eead31-4b3d0d75fcfmr18445973137.3.1736719238897; Sun, 12 Jan 2025 14:00:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736719238; cv=none; d=google.com; s=arc-20240605; b=Vn0ir13UoPrgcDdwZJ7qcynJY9n0/Di/LjrBYNSitkgMiisaVEqCsjvuwr3ZOGbLQK N95GUhf2z7fE8bA4ze41p8eBnxGuA+FPhmI8xpE93jdGiE28/hsBLQsj6J3b6d2Ict1p TeED9TbKHahcAYALYLWHxMbzYSoWm4IIcucj7O2ekWU8L4HVKoxQO0nkvbJZcieL3Hod eZp+MrVbLMTrvLfH0T9VhH9jk/7okM+Zi4jelqhQGD54GKaSBxAlNchsWN4ueBv5dUDi Tp322Jpfea0RZbrWNaF7lTJKPsQTSmQfQmMqalOI8cpOabOC79IXK7FJIaz/9F6eUPXu KSAw== 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=MthpmBZalYKPKBsyZS//nKFY6fWzJ0z//b9OCoUIijI=; fh=Ihmr/tTuI9LlTMRH7V2YLRHtHGMzXPi1O/i78pP9Xl4=; b=B448eQ/E9SCuSNs9f7kFysAKQ2Kgoz38EAzzsInRHy0UVu/BPUeszU4ODUbxMW7lf6 VaBiCqCAER8Nge5V2Sd/g6nh3uvi1sgO+0NXzJGmJ15IYleP1h0Ix8KNzc4C2NMFg7eD D2uSqO7oJ2jXzkgpRCRON2GZpgkfDyhymrVZcL6yKZ5NEJVBf2tUabwKxT3ujlb6wDdY 2lDDP6Uy+Oqya9Kc7l4dpXdRWykQhHpk0ZHKUmYrZNl0UCCrDSD//OmDqpFnHTiRrjLO uEBxgmcFcpqC6SaW6JuUXuPI7misnpc7t6JZkZZiZDtV/tIdJXmncIDKfNj6NU6cCPqv G0qg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="lNPFxp/v"; 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-8623b3ac341si2049982241.124.2025.01.12.14.00.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:00:38 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="lNPFxp/v"; 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 1tX5zP-0005N6-6L; Sun, 12 Jan 2025 16:59:23 -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 1tX5zN-0005MU-Nz for qemu-devel@nongnu.org; Sun, 12 Jan 2025 16:59:21 -0500 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tX5zM-0003ne-Cm for qemu-devel@nongnu.org; Sun, 12 Jan 2025 16:59:21 -0500 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-3862f32a33eso1591854f8f.3 for ; Sun, 12 Jan 2025 13:59:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736719158; x=1737323958; 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=MthpmBZalYKPKBsyZS//nKFY6fWzJ0z//b9OCoUIijI=; b=lNPFxp/v4UbLwaGKBSSB8llebz5Wv1/1f3cBAxih3y0IY4a7EOPx9aSHqg9I5Z3L4a /L0zHr9EKrp2gKIggRn79ygGO7XllcMrHIORNj2npCYqvZ7RxfpF9XO3onEANO2NRBAa iV4rxSOmrsifLCgmZoOgk8p2HwQ6L3XXRLpYuhAQVs8G960QPSkhL0KnbDoUng1shgiz PPAgJ72Oob2Rj35DAzk2FoKiZ6510ip2KhhTSfXQTkwfbSv6OLvh7TGcg5PKcW9W0rEI 1sICo7ixt9GTKLbsPhVpyF/H1ykDhEsEdm6kYht0i/TLqeLqXLfNQ0k1rzvvJyBsSQNx k+5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736719158; x=1737323958; 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=MthpmBZalYKPKBsyZS//nKFY6fWzJ0z//b9OCoUIijI=; b=PeDw9sCOw27jmj1CcEczWOjPKmKBZBm+eMTC9TnlxpzCVe7BjEbRm5JDJppZaHV10j bwUEHn+4HiO4WT9uzdiuD5Anayj9c/71KhEqQ46L06WF/Pr39EoTvyoWef07zZcA9nEh Scw0AoVCyJK5NzhP7h3w4rMGBLD+PLGhOWfQqRQYmru1WGj/XPo2e9ueg9ToKiyr5+rE lwJJWHH8Ifg3iEAUKvgXKkUYInQe8AfudvtPgRyBMT4D9X2B2GZAgIIlVrQxlWwP5Foq QsoXKoy+FPqZ5sO+3Qpz/0boUDG2oyqwUbN+hSvKcd5ZqytrO6dSY95V/z7Avi7meusC vjlg== X-Gm-Message-State: AOJu0YxIuymVO6vvsYmrfNLiBIrbiqPvjs7oUtE/6IheJCtXSkJlMg7O aX8J2iwm9Ou83pWo2Hi6PQQWdGD1sRlvsLDvf9KCfMCaSKrTUThyq4vQs+6jn9MZ6G9WSpceozQ xRTw= X-Gm-Gg: ASbGnct1iIML0vROkBBviXgiVqMe40rgZLVxcmvGW7decPLJJvcx9yuQ7AOblfzeLBH GveLJguHckWYyj4uZwMK0btTfMBu3LL+k89DUgXwSVq9s7cdbIc/ODCg/k/6DOaUKCVpjMOr+SJ wzdF9SL+QuPW8tNsWNo1+cXfdJiYZ1xylWfHfhSjshr4PTzdpX8TrdSF2uystDcaUSnQT6jh0xo pVwuefUrgMKVwUFGGh65x3S8SGBdhlASA1Y3J1w8gcVsxwpCamPHPjxQrREHt1QMK42r1ClkGd0 H/fjTTjxzVJbfK4pcEKy6BDz1KZrx/s= X-Received: by 2002:a5d:6d87:0:b0:385:ef2f:92ad with SMTP id ffacd0b85a97d-38a872f7f80mr16096050f8f.10.1736719158351; Sun, 12 Jan 2025 13:59:18 -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-38a8e37d154sm10793919f8f.10.2025.01.12.13.59.16 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 13:59:17 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Huacai Chen , Jiaxun Yang Subject: [PATCH 08/11] hw/mips/loongson3_bootp: Propagate processor_id to init_cpu_info() Date: Sun, 12 Jan 2025 22:58:32 +0100 Message-ID: <20250112215835.29320-9-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112215835.29320-1-philmd@linaro.org> References: <20250112215835.29320-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=philmd@linaro.org; helo=mail-wr1-x436.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é --- 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 Sun Jan 12 21:58:33 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 856758 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1173179wrc; Sun, 12 Jan 2025 14:00:07 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUE79tNVmho02SI3rzAsaERxsjqZEOCzyDd5j2OrbS17koZraD6fSa8TxERdTc1FNjCTWc8Hw==@linaro.org X-Google-Smtp-Source: AGHT+IFb3LJV1HDSjBHxIZra/SAwJr4FZu6mFGDp6vbJwlHwcdS6EfrW4rtux1uSdhXKAbHFdhWm X-Received: by 2002:a05:6214:3386:b0:6d8:8874:2127 with SMTP id 6a1803df08f44-6df9b1ce252mr294759326d6.5.1736719207363; Sun, 12 Jan 2025 14:00:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736719207; cv=none; d=google.com; s=arc-20240605; b=UTSE6xvdEISxj0PXrWKFXbWR93+TVT9oU/mo2GwzTHEfeN4MoX1g1BfPyH22NEZoyI Cr45UMiagi+doNoRgvZy3wVA45U2PLfq3Ivnq7dXRlRbFtmfB5dpUOaE5p1iGH8xHumn TyuGHU9LyTk/w2ja34wbqBazMKOUy0GSax1b5Es1Tbo/MGtioP3s87tPGK/lLf1VjLLe tQ2pZ7rHUfa79YVp9q8dpSWGBgimQqSsUy49weic5JOz1SLeXKLuadoLdOyhXOK+45hq YC72n/r2Y693YXbb97tOCydKIvVvtVP0yqj6FgrhlE4SqYPSb8YI7QR67lgf1y03v3SX i8LA== 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=8w5ajjS3xBqiW/N1pk3Nwe9kTdtGGtFNBW2HJEEjVmo=; fh=Ihmr/tTuI9LlTMRH7V2YLRHtHGMzXPi1O/i78pP9Xl4=; b=ifV7jy8UxJ+L5k+BsH4OkCt1D2zYruSQcsZeanw0AngT8yGusG9ujrXfDE/RkQsUyr 6xhEOGXXB7lQQd+2grJV06MfSZ33Aq4paKGHGrm0ZE0Io1kgBpcbU4mQhQhfC1+4D/6f cHKT0y8V00LEEu8lpD5IJYsK9vIFE9lrrRGj1N2HxfZV/MoajJieY6JeTRbndXqvEiXC kKy5fNKHQDnLwthuxpwYx94NKZ3TqEh5htD/VK3ta8NIxcgbINsL4kcEr79kSLxLXgfD V4Yxcf5YHGFK9fCkE37VTdr4Jojn5q0N6vN/PpoiLo/qWV6EdjtG2k1aUNXecEkAqFIo aqNg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Jw/292AI"; 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-6dfade996dcsi75954666d6.182.2025.01.12.14.00.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:00:07 -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="Jw/292AI"; 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 1tX5zU-0005NR-Gw; Sun, 12 Jan 2025 16:59:28 -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 1tX5zS-0005ND-24 for qemu-devel@nongnu.org; Sun, 12 Jan 2025 16:59:26 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tX5zQ-0003nw-Je for qemu-devel@nongnu.org; Sun, 12 Jan 2025 16:59:25 -0500 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-4361fe642ddso39227515e9.2 for ; Sun, 12 Jan 2025 13:59:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736719163; x=1737323963; 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=8w5ajjS3xBqiW/N1pk3Nwe9kTdtGGtFNBW2HJEEjVmo=; b=Jw/292AIvNzwHLBg55FYJi43SFBoyJLKjZzqZ9tZdnTTI9HVi2Bpzse9wWKFcQZPJx YRNrnHIY+9kiggJahcVtEkEb6J7S7Pk0QhHeBgRGNhiCpK41zX96iBTUSd6Ayrsjxp54 QxuK7+swZbZzgi96Wfir+/6RZcuzN9zZNxlBujhHfLObldtwzGHBcbIqX8+vMOzgmUeO dvM3gY02mkyiMq3WWfnR323PZ58jzbY9+3JFlRUFDJptFhE2qcnWd9bqWAJfruTTw2jB azpXGC8/qFITG41v3Q3xxpHuMFdGTcj5PfU0CrB55BWDf1KOaUbA+otOnb9hprk55Mv6 flow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736719163; x=1737323963; 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=8w5ajjS3xBqiW/N1pk3Nwe9kTdtGGtFNBW2HJEEjVmo=; b=wPF+RDBX1DOR02sl+vdgaAptSWIDxjHMZK+2/E7FcLDVMBqK/OhWh3pYW/ypIUBrbE AxEkc24TT+iLtgf0rNKBd9+hOIMmygmDDsosZYaJZGC2NqRJ2OUPpJtt8paUXTJhvecl Bj+7XUQiZgCuewuhv1xYyML644ub8i7ZYmdFQUsFMwVw+ACDnjy0pF1weyql0thJ0z4L YSbxnImSnlF2WoXNoEOIUJwadfXKuPy7e1HrxDNfhbYNcPG+Eiea0Isf7MVbgDvkDIpA DmbUccVBIJkmuA2LQdRSCPCkyVdk0X3olnhy6kXVheVQk3yuuuJsiiR/zQTP51id2PBx fz/Q== X-Gm-Message-State: AOJu0Yyx/zWGjTD/GhfxZtyHHC4YJSfoDhiXHP/clNwyjWeWWx5u+vBq oVv0RrenSj9x1dz0HiaXSjteU9yl65TNmCL0MgHQ35DbYcN3Lq4Tv99MaxXl5YvLeAmiSXLnpw2 A2WE= X-Gm-Gg: ASbGncv1rIbFCsZWmsShz59Be4VDLSlnygePx7+LD4rRJsNCVZwgiEomCi6gSyeCtGe xnrE2mM7YFo4zj7G3fBYMdvVRPn+K813NeFbd4ZhcIcAljqMEI6cKOVCsMXJAcoh1b9cd0Pweze sCEWYyS1SCNGETwBXaDIfBTCCyWdao78Ff6Y7Tx/PALqhzBVObiilzxHvxgZ5jVS4gQU0uDDRuH WRRTBAGCREydgwoVv1K606r/gqpUPzbjZoZZt35WI9Ja+uXjOuJTz0ZQ3LT9+Xi/9DpO+sfzyOf HKU6X+eC3YZbbVFcTKSs+VC59z3w2T4= X-Received: by 2002:a7b:c315:0:b0:434:ffb2:f9df with SMTP id 5b1f17b1804b1-436e26adf94mr176915075e9.17.1736719162985; Sun, 12 Jan 2025 13:59:22 -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-436e2e89e14sm157776385e9.33.2025.01.12.13.59.22 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 13:59:22 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Huacai Chen , Jiaxun Yang Subject: [PATCH 09/11] hw/mips/loongson3_virt: Propagate processor_id to init_loongson_params() Date: Sun, 12 Jan 2025 22:58:33 +0100 Message-ID: <20250112215835.29320-10-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112215835.29320-1-philmd@linaro.org> References: <20250112215835.29320-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=philmd@linaro.org; helo=mail-wm1-x32a.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é --- 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 a240662016b..45cd348c14e 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 Sun Jan 12 21:58:34 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: 856762 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1173534wrc; Sun, 12 Jan 2025 14:00:53 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWhxc4CPy3yz3w60LDDc8TMbODUh2fCCj+P7sC6PrQaFmhGpb8PS6r4OxIzof8lO6yN+xe2UQ==@linaro.org X-Google-Smtp-Source: AGHT+IEwdOaCBVCRE/gsk9sDiuDJk7bAZVLGdP3d2cNyNZKg7D6OoMrWCKj1Bx5T4gXUxSePvYXF X-Received: by 2002:a05:6102:374c:b0:4b1:3409:93dd with SMTP id ada2fe7eead31-4b3d0e5f615mr16914640137.18.1736719253249; Sun, 12 Jan 2025 14:00:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736719253; cv=none; d=google.com; s=arc-20240605; b=fC5tiZB1lTp2oOJYc2RTL8VD3Ahal8pd5/Znj8AHLCwjwO3Tt6bBb+gcbYAQCnUxng M/altNkJV2+3UXWSV7zmOEZZzkTmW1wGuCb/x34kXlPFQvo2wVVUxAr6n7+SxPSCFaD7 nMW8nzTQUEv7vQMI6u2Ix/lWl+DxnTWrK/mLWGOsx1VeiTfad8QVOAGoA+hpFnycDq98 yuwoLm3A9HRzV/Jz5D87RUAMva31NTOJpVs26HXAt+dPypK2QXg8wK8brg+aoZwROC6S dOB0vqrjmhp77ebUzwZkhSBkjI0YglgqdDfaiVJGzM0Fif0++AgqRe/lenSWTSlrbyeU 6EfA== 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=GWtYnTZhf5ZsrR5uc4iwtRP3anUbXOom/qnSYQwviRA=; fh=Ihmr/tTuI9LlTMRH7V2YLRHtHGMzXPi1O/i78pP9Xl4=; b=IMD6FDIKCcYyd2ianjA0GslQEAuCubQY4+guHKMENLVgsjK61bWz4TZ9kHXWS0t9WO 8JPu3qKlhWSVQ2JveRRYpVHxIURweTQzsEgMhi96PZuD6InWWlYcX0Qd2XEDo45qtxcW +KtU/4giOfIegj2SuT7OJDwBUpVjNCY1hKMkvjzR5jFUaCRAdXY2ejzrcuhwAgrv1Hdr g3NR5zXTiVNhLo13Vxg151rfqKeebyrBXK4ravIjJmtwXu+gFkwIQ7djJBTnxBBZj1ea LTI/P4c4lRmRFb3jcPLK/511MVtYu85790jEb+eNAcn4jCkpmfrr2A1jAVPavOA2IvgI aFEg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OMmZaOBP; 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-51c7fecf3eesi2711101e0c.236.2025.01.12.14.00.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:00: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=OMmZaOBP; 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 1tX5zZ-0005Wd-7L; Sun, 12 Jan 2025 16:59:33 -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 1tX5zW-0005SJ-RA for qemu-devel@nongnu.org; Sun, 12 Jan 2025 16:59:30 -0500 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tX5zV-0003oC-Bz for qemu-devel@nongnu.org; Sun, 12 Jan 2025 16:59:30 -0500 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-436637e8c8dso39312955e9.1 for ; Sun, 12 Jan 2025 13:59:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736719167; x=1737323967; 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=GWtYnTZhf5ZsrR5uc4iwtRP3anUbXOom/qnSYQwviRA=; b=OMmZaOBPO+mU+2yIlKX2yCpmYVrCgGBZyj5/wHLiAEoSCDytt2a3gC7gqSlAXxlC29 pdubCL/zOPJp4TwguK4g5Okfke52nngucLC7OVndkb0OiHfEpqRAiI1oJdmkus1PnfC/ RB4fcznhbtCWx8EwDlSLzON/bHccOmOMmr9TuEl3YRr0zwWYp1CZTQAobD2ma1lKlufZ ZkEkdOm6z3q3cJhShqFEENn+YibEQ3a1dMc7TtHBigQqArqDLHOKd8K5EEaLWktFMRAa Rtk+oSb3ypZu2A0eWCKQ5wUabzdPdfywmiCHSn6KvuUzqfaVumU7bM18QbiUOhCK2bZ8 AE/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736719167; x=1737323967; 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=GWtYnTZhf5ZsrR5uc4iwtRP3anUbXOom/qnSYQwviRA=; b=lPhheqJsgCkhSZJfqsgV4LjmMzAzhdlv5uyAALb083L6BPQFEKiJ7p8l9jzsOTDWsK E90/ojDe2R0H4ktsPIxPQW1O+2jgWh7MSbLdJ0X2wupmTFE5di1aGlcImdXgDY7kmd0P cjCI+5Yg4TmjEXsWRR2IR6dNkQVd5sP/USlUSVegGwW/vxpb2Q2hTsOjJShJu4XgkOWO 6qdqMOI84g9YVBIN2iyPiVGEx/Il2jvSn6TQzGxPlsBYz5LAb9kSO/hQdX+IfxAqa+kw eTyo8FP+ZUaTa+ioePjO06EnS8gOmTR4RECpJISzYNlxbyLw0KS38Ar2huCrE9Uv0nmq BDOQ== X-Gm-Message-State: AOJu0Yy6gNHRiiH/5XmuQfhMl6cViennaU8MhPGuGELAq2EIr1qfLRJs 3vlt9mt2iDIkwgEKhCf6ZcJJxwp3QwgUNGlcWBu4/X3cJoyjZ9pphEeBsXmOioX0dKPNKpzSeFW wtns= X-Gm-Gg: ASbGncuDj7OWcLaHVCLuU8IrDML1Vk4ouqRN4i7NGIE9POng6WNcNefURlH6FWxtwzQ athFwYEXCh8mzDgU5w4oiWS5Yy0YOZR2xWeIqnx07hWE1Sd3FjF508Enuz14E6BWZkzsAUd+Beu 5wknBO45RTHwzWrSOtF5E5R0qug3Ro62aSH/yT9KF1MMaFscHYVKS7HjNqzDhw6JLQn2JrPcqV3 ORN+/a9Da0lbcXLMPAqcfShLKqyuYnoUYw0V0rUKe/8Jvbuu7zepCXSMlJgwPWXWWjn6O6poKgj mP8LCu0lq8kJmsCepkulOB6ZSCvVC8g= X-Received: by 2002:adf:a312:0:b0:38a:88bc:bae4 with SMTP id ffacd0b85a97d-38a88bcbb29mr10958500f8f.18.1736719167569; Sun, 12 Jan 2025 13:59:27 -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-38a8e4b82a4sm10657075f8f.72.2025.01.12.13.59.26 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 13:59:27 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Huacai Chen , Jiaxun Yang Subject: [PATCH 10/11] hw/mips/loongson3_virt: Propagate %processor_id to init_boot_param() Date: Sun, 12 Jan 2025 22:58:34 +0100 Message-ID: <20250112215835.29320-11-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112215835.29320-1-philmd@linaro.org> References: <20250112215835.29320-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.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é --- 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 45cd348c14e..59b1619df0c 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, @@ -645,7 +644,7 @@ static void mips_loongson3_virt_init(MachineState *machine) loaderparams.kernel_entry = load_kernel(&cpus[0]->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 Sun Jan 12 21:58:35 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: 856765 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1174030wrc; Sun, 12 Jan 2025 14:01:56 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUkSpMS4Z1E6G3VXO53hRZmIsySPA9Prul5twUP5TSuPgX1yFu7fEaOl2nZ3qlI6lts1CkGjQ==@linaro.org X-Google-Smtp-Source: AGHT+IEsCoZhC0580AbyNnXlk7UT7rCAAqy03FU3m4GEuN3SSd+Ovn1i/jQfzQbMmgRcPP3PCGKF X-Received: by 2002:a05:620a:410d:b0:7b6:cef9:4f10 with SMTP id af79cd13be357-7bce11af00emr2168467985a.3.1736719316515; Sun, 12 Jan 2025 14:01:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736719316; cv=none; d=google.com; s=arc-20240605; b=DxuHnDZR9WIOSUrifQkboWkXiMZzIMnv9gGDu3+bLd4s/J5BNRVXnG4Pltx+8nuIZ4 woecGPMp0Yz3KeGpsyYdU+q2VR2ZXBNULYHxayeCKOvmPaJjfNt1qD2vtzEkcbzItuZC 9h3SAtVzTZf/OogguQfjJXK2PhdzNDNFQ8XCm/aKQyST4mBT6lw7WJBSmIyJ5B0D0Iqx 3aXef9PLrz/4a6dpor2fPKLc9Y5Bom1dSCQOaitBkLhFY/TgKS9/qknqXE006VlSh3mA 7fBDxP5v1BnCrhFluy9DYCWYMabCYuzDmmXOtvlLovq5HSmaN3xE3q6m7DLnVBXHMdsn ku4g== 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=kAUArdqNQE+zvrxsV1qj+qeaVTE4xMA3YRlZsT7RA+o=; fh=Ihmr/tTuI9LlTMRH7V2YLRHtHGMzXPi1O/i78pP9Xl4=; b=EArHG9/uTRgb5BIc0LEc5YgOOHyhtZ9MPYLYMQqlcvgPvbotKdG5sSNs/e1gZjyN18 OhO+4ZjySpCISot5OdxRpMW+bGQNXWEzBEWFQw5nKnTxIzDMpvp0fpvpvHIFYyiXywmN 18jzxf0sgKkdPA5ps+A0WyLBNezYu9Fp5cPkh4NIEkbBQ34KoXhgckyl1oqMlAXvXcof losMumeiIklDQsy4jlnB2VRwVTe+rmUSzWu8eZ1Algs0GcBJidnAj0HtExotOeg+4m1D c5R+Gq6G5IpfR1j0hUTWTUK3MYu6mVy5ycenOIouZEG0DQVe2yKZSmWhUlsCwVrVmQS+ 7pAQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OwE2RQXL; 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-7be2a641b1fsi325037385a.562.2025.01.12.14.01.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:01:56 -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=OwE2RQXL; 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 1tX5ze-0005Xy-EO; Sun, 12 Jan 2025 16:59:38 -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 1tX5zb-0005X5-Q2 for qemu-devel@nongnu.org; Sun, 12 Jan 2025 16:59:36 -0500 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tX5za-0003oj-Bg for qemu-devel@nongnu.org; Sun, 12 Jan 2025 16:59:35 -0500 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-385df53e559so2965737f8f.3 for ; Sun, 12 Jan 2025 13:59:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736719172; x=1737323972; 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=kAUArdqNQE+zvrxsV1qj+qeaVTE4xMA3YRlZsT7RA+o=; b=OwE2RQXLkuhsE2mX+qGPyv+S3icsmgIkRJuS+9ZKJ0eFNxwS4t5t1gO7H1c3Z74TYK Mj0cWam0HHU0fsRWp/iYfx+Y2xhO1nwIbjjflFSKpDxbgE5LXi8Q9IHD4e5S0EbQggkr lJkT9QpXO7myMY3X9a6LfNWIQVnCgFzjLIw2Sr34NLQjVHbtAy1Ll/96BlJcl4UZwprH fRm6MGhlWg9Qt4JJGPSQpe1fAZAerWB/lpQiTdhJthp94zEhFJt94I+1omg6yMr2jMOz HafVya1tpkt99c+PROnU64/WSXnlWBUn0LnaxXBTL8DEgff8tt6+OT5uwaV08Vt7R5jZ taDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736719172; x=1737323972; 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=kAUArdqNQE+zvrxsV1qj+qeaVTE4xMA3YRlZsT7RA+o=; b=WSRPRRVaNli002sl8He3XAFGj6r7YQbKSX3jaDCjPtDrH4P1OJRDqmLudaVFKpTCBr eNV/oU4YPPkjnneJO0OUf1u6rdasCW4KzX3O71puMTQgbS8a4oGxG2o561SSsM7jqdNl 9Rlubyyk/CU9Q9CP2geJ5KqmSEF3hu2IW5hjjHoCU2i+rV+yF0zn4CxFRaWLFMsLar2V gZ9D0tjiD2drTSkZ8UkQ2syn4s8LFdN3fX1kGVjd3uOWnypIoEA4nGVyprDBoHFcD4X1 Ipv2mRvN8WiZoh//kxzIy8Lrz1tNeSpyBIkpz31XvnD+O1kwnrFERXpCoMh4na93agPH ii4A== X-Gm-Message-State: AOJu0YzZw9TAwSniu4zbkZehKT7kcaMgCTY2QNTsetKbPzSotsvjLn7y ropmCDsU3ao82U/m4FfZpKpNMPU07a4Z4OGvFdRSoqz4lUxmW0tMReS3fJeYC8qHMtnBcQzkFyV /PKo= X-Gm-Gg: ASbGncsUIOK9ropn6wx2angdt5nrxu95gYZ5mDx1uPajaioTauqKKTNzv/nDZNX5RKQ HqypF1/5zMiXAxRfskpLJdlAvIiNlo+Oi/4Wipc5IidGvaSBUSsbc9DYJe2JEjnc4Az0PgXO+2C /c7BceLV5sPmREccChRrTpa/PArUNDdf4+S/LmX8xREWTjA4wtfc3h4cEPY9IlkC8+evVcIO5ic FJpgCB+t9B5Qs1CaOZSb5yP8j/eXGWGF+1gxkjl0tdRt4EKJfce2TJjUEhdStNLyhoMa9HQvASw av4eo0khCWZ8OoDQoIRHP5ER0sTDETs= X-Received: by 2002:a05:6000:1acb:b0:385:edd1:2249 with SMTP id ffacd0b85a97d-38a87316a81mr15405201f8f.50.1736719172019; Sun, 12 Jan 2025 13:59:32 -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-38a8e4b7f86sm10575765f8f.67.2025.01.12.13.59.31 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 13:59:31 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Huacai Chen , Jiaxun Yang Subject: [PATCH 11/11] hw/mips/loongson3_bootp: Move to common_ss[] Date: Sun, 12 Jan 2025 22:58:35 +0100 Message-ID: <20250112215835.29320-12-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112215835.29320-1-philmd@linaro.org> References: <20250112215835.29320-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=philmd@linaro.org; helo=mail-wr1-x434.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é --- 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'))