From patchwork Fri Jan 31 21:04:53 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: 861041 Delivered-To: patch@linaro.org Received: by 2002:adf:fb05:0:b0:385:e875:8a9e with SMTP id c5csp930717wrr; Fri, 31 Jan 2025 13:11:15 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU/WMEKfKC6wlc7PdOKi6y0sZPYOM5MoKG+HvXg42oAdECRng0pQB1p0p2GYJQq1zW1kMVYWQ==@linaro.org X-Google-Smtp-Source: AGHT+IFdOGzIJWx+b/EY3wUdVq9ZPRYFqI/A30Ui4TLpINXwHiX7gSouT+LLP0NwC3Qup2X1HbLB X-Received: by 2002:a05:620a:6081:b0:7b6:f1be:4f68 with SMTP id af79cd13be357-7bffcda57femr2074281985a.46.1738357875489; Fri, 31 Jan 2025 13:11:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1738357875; cv=none; d=google.com; s=arc-20240605; b=Qxc2gtmFemM7AkqtjvPF7F/ONx16MXBnR42syjzDDR0AAERaCFbdD09UpaOHoU4oq8 JvrfWSdUrcPm/sG0ylJytDSFM9HiNIi5CYocXo9nTleZ/Bh6xh/hbZHuanS05VhykuPA YBhiKeIKMismt6maZ6TOs0J6f40M6FoLQuhsgtwOJswH0uwjIAC4/GHAnS95k8Exartx gUWmBgzgk2yP+k8XuMm0lprl2Qv2v1v53U1UiEwUYmIehnlkBQneebKj9xbQcO/T+4WH HqaNe8ZgVEB/zEme3X7b8XMruBOKA/d84bcfpCTzQvxVcq7Lg2Do2TjMtxJT4iAyO2pc 4gxg== 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=fXLlGZJlx/2RsYn2bfi3IVqSbsLVgKErZZDglGqjRI8=; fh=qtn8prgQtzf5IzCNvLChUZDElvNECP6ej9YfjQeBz3I=; b=Narr3wXmcu8/RgK/Yosr5AeuqRGy8pZtMxxGmLbj4yVd7KP/wFhVWwdf7Dl/v2wuwG swSoDGKPLel5oReRetsbBHYUjVOz6QNPZ+majO4NSaa3Ur9buLn8z4hH6hpi5EiSk18i T4zfxgr0PLm323ep75XP/Rf2mvzQq9AvAx4hf4FCTmD9pdOt+KVt0opZH10QuixcPnHe gubDSjV5w4m4DQMEJFnX+x+09Us5S6ztklVh/ME4vio4IjvuXFkBS8BqPMrCV3acUkF6 5/+EYSP2BQ39HCodtJai7vkhEcAKobEjXFVAFJ3MaO/oG1c00912OxvrqeraHVAJysTr So3Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=w4zVlrGt; 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-7c00a904023si480779585a.223.2025.01.31.13.11.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 31 Jan 2025 13:11: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=w4zVlrGt; 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 1tdyDP-0006Oj-Pa; Fri, 31 Jan 2025 16:06:15 -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 1tdyDN-0006DW-Oo for qemu-devel@nongnu.org; Fri, 31 Jan 2025 16:06:13 -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 1tdyDM-0007qH-2H for qemu-devel@nongnu.org; Fri, 31 Jan 2025 16:06:13 -0500 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-38a25d4b9d4so1302711f8f.0 for ; Fri, 31 Jan 2025 13:06:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1738357570; x=1738962370; 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=fXLlGZJlx/2RsYn2bfi3IVqSbsLVgKErZZDglGqjRI8=; b=w4zVlrGt7ZtYHo2BXi5LpieOi257DlIwIwRS5gsX9vbVXPCjQcKisyrR5XMo/De8AV NxQn76y3sNSiu/YM4a+z6eOcP6xtlkxUmLj2MvYJpsSXL3rjnS7IUMlPh26ViWQykJZK yQHmPSKpvBkGK+UT72mpQ1j2wRdOo/hy3ZgxaUeXKL3Lleoz1eeaC9UY9kO3oNdgPiF2 9UyC9QRGoK5CZq72ac581MlMgXa7Gc5Ufi8wG1pWQnVJCDSMeM9oTMqGTGf2+kKFYCyr CEJWOVJ/12KumVhmMr+GgaHr0D0C6XcQRhJTWGuIOIREeunLqt+c6kbqcUiMWjK+xO9d 7lOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738357570; x=1738962370; 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=fXLlGZJlx/2RsYn2bfi3IVqSbsLVgKErZZDglGqjRI8=; b=K6EUgqj/DIvcmdxLItFuUBKALNEJw/MtEupNq+edoJuo6sNpgwM2b52YrgguTZ1eow 85GnF0EsywC0o5mCAdRd2NRqUIFLna+Nm0pL3ZYXKAqahKlq7xLaQaEg7Lm2+dnMJqka uQn7bfOdRMMNoXmLb5VBeJXsrZru9PrWpt9cvUCKwKaI2mH6n5VVlHr0YdcwPYMB8rtv 473e+ctyWTh4ewGX15VJCO9xmJ+5KO0iGDv9P4DlEas5DLFt4N/OvYWosvI+XHdOXiyC pNcqtSKI2BYTbsgKstHHtKGZi6r1sNm/y5IfowG2AHMm6M1vtA5Pk9P4U+4oCGkS2XKD MkAQ== X-Gm-Message-State: AOJu0Yya0q7NB1cji6/DNE8VuPgnUTnj0wx7ksdUAAn3pvq6VLUuuHdr l7jOSs/2kQhe1Iwa05dCn20FMRfENt8WBwx+KU1QfA7RNPM/eYot1MpIBpRTkxGa1AUa1E3k2AC 7JXQ= X-Gm-Gg: ASbGnct+v89kYbWIpJ/iNQeX1GTcdzr+W06zKIA4E/P2DlsGV+YofwwFUSXgkn1Qi6l T2HYAc6FAN9znuNTQnyCEa8cUg8hOK/R71A7Hott/JAXgGipEU6ds/iXL5f7TlbpfyEVV8JTPVa eca4Ej4NYtQli8CBYUDEgXGfWN6fu3svj2HGF9XQmuPnm16IPRH/ZqdOVC7OZHs+VJOdARORLxC 8YuRPpPxT3MRS3Ep9t5oh/JJp+Jzi7c5d4dq+al4CM9FL351Qte4+9L6ogTchR7rPpclw0nMYJI B955rG860aPYH6rO3K80TPW0hZHdLTbCjCyF2waFl3PQeuj2/TzgHzf0JBr+CSxgQA== X-Received: by 2002:a05:6000:1f87:b0:38a:88bc:ace1 with SMTP id ffacd0b85a97d-38c520965abmr10893908f8f.34.1738357570172; Fri, 31 Jan 2025 13:06:10 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c5c122489sm5772540f8f.52.2025.01.31.13.06.09 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 31 Jan 2025 13:06:09 -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?= , Richard Henderson Subject: [PULL 10/36] hw/mips/loongson3_virt: Propagate processor_id to init_loongson_params() Date: Fri, 31 Jan 2025 22:04:53 +0100 Message-ID: <20250131210520.85874-11-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250131210520.85874-1-philmd@linaro.org> References: <20250131210520.85874-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 Remove one &first_cpu use in hw/mips/loongson3_bootp.c. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20250115232952.31166-10-philmd@linaro.org> --- 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 5fe5bc6fc03..ee71fe9e9b5 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,