From patchwork Wed Mar 5 15:39:19 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: 870561 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:178f:b0:38f:210b:807b with SMTP id e15csp849441wrg; Wed, 5 Mar 2025 07:41:15 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWifyrFXoHdxI7Lz4xWV2mSgH3SKjad/PbfPiRbTsyfaoNA25oMc4GIWOt4Wfx0AArfKCHXXw==@linaro.org X-Google-Smtp-Source: AGHT+IHLWl3ZGl/Z8hcibYuD8+klEC9LAGgWKDseZTlWr5AQZWZbLqMyYiw+difoM7tnn0bI2315 X-Received: by 2002:a05:620a:2626:b0:7c3:c500:ca96 with SMTP id af79cd13be357-7c3d9172203mr477634585a.9.1741189275169; Wed, 05 Mar 2025 07:41:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1741189275; cv=none; d=google.com; s=arc-20240605; b=dxFzZyKf8iTWBwfgv49Y6miTl4MkQICcNcF6cKeVK0+NAhNYezpOnFkkMEVR9Q8ATN ciG5A81R/1JFcUuayDcZsRUWJniT9+9KCyG0awayIRwe3Nn037O0QnUPSjx5SW11ES30 dw5HOv08EZAgI4WIhToWd+MpbNjG4s8MTvWLeyE47y+LZ2kDvI7hYvpxEp4HrYGfW3l3 JvrqWIUDqBNwNqrJQd3Q5Y7JQO8JssEWpmR4KTQ281eKXZJr0bhuBEJ5+n3DPJ3EbDwa pgPVq5XtIBqbFoqC0p8l9UNF4pBtaZWeltM2if9M0pZK2g+GGS5UAUiZPlXK0V8LJK1e r+aw== 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=tm6pJ8fvWIoYf16fHvVGbN/phK9k4HNSdSWeslgNhR4=; fh=iYS+U9AiAK/hVpJiag4U+eV/XPHIFc9y9I+tcL8yyYE=; b=ZmY+AqWhIzDAwH3gr0vHuTwMetxtQblyAzfV7UZbSzugcPf/Pv0n8qSSH7rnmaLcTm ta7pTdpSty4D3PyUBs8yd2Vcsw4t5k0iJRDfA/yQI7q1ZyRUDdi+Z56wsKmVZ82nanEl OpGW+DitaSWtxuQwY3dRz6SBc9FlKBFg7UYntLSqa0iDFzOErLeWUMv5Llk12AKhHncR TQPRgb06AtLBbFOJIrZRcmWpi9QO6ufQQuxD8pjRLxCIx8gzpmjBcscy8IK7jzS/wWP4 cv6TZKFhaRhmJ8b6Qu+a77wEK9ju+eQ2In5cmZPON7M6W4LBmrM13MYnZfbc2wsDOSz+ lHkw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Q4jbc19s; 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-7c3cef1e292si348149785a.609.2025.03.05.07.41.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 05 Mar 2025 07:41: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=Q4jbc19s; 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 1tpqr7-00005o-Ri; Wed, 05 Mar 2025 10:40:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tpqr5-0008Tg-Ct for qemu-devel@nongnu.org; Wed, 05 Mar 2025 10:40:19 -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 1tpqr3-0002XU-FM for qemu-devel@nongnu.org; Wed, 05 Mar 2025 10:40:19 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-43948f77f1aso45795595e9.0 for ; Wed, 05 Mar 2025 07:40:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741189215; x=1741794015; 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=tm6pJ8fvWIoYf16fHvVGbN/phK9k4HNSdSWeslgNhR4=; b=Q4jbc19sjQr5hko3qHpe2APNeLFTCPO8Qxi66cWV+cKcTn0xf/RTXKc2p3b1QN3VQG nu4QfDfGxWu6D/9qQ1NBEAzL9VgtYBLaLed8mvfGCDfWTb1Id618cL8snIskq/ssH5oW U30f2bEiCeFpz4qqlVLZIlKX9ULn1jBs4hCGFWSLKmSxJHgKgAQle58O0TJlA1PrphPA 3JW0uBmrKBylRxg2rJvjWt8NrH+w70ZFi/OCYgmmuIhi5m2g9feNjjeB3pYKXnzT6V// Bkskv14Kv1ItpJ/Kj8IwZVyWEqbNGYeeLudYd3KTTQKgggtAKQeSxm6PHn9X8RE7/s8y vEGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741189215; x=1741794015; 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=tm6pJ8fvWIoYf16fHvVGbN/phK9k4HNSdSWeslgNhR4=; b=B4OclVK/unT65JvQtr8W1TceOCt4RQJ36A+ewr8fekJToCTjUVUxWv+ymcuhEK+aui +2KL9SoceU5n+vFrXYIaR5S4XWbvzSkYVi/UK4DoQOy5MhtkRkqeFinih4ZJJMSeJ6gk kDdiPAJ6wanBKhu/LbKyYGm5BqmlRsxzeYzY/e5whPbD5PfqlIK4UHQVKzyIQomBv/sq LVdBY0sKeF3HgmsiHmeSDDuKvDsrzgvJkgGApSY3oU7ad7X4WML6+OqVqzKa8zoird86 g+WEqb9mau3vWpp7dp51OZTHh2AAl9QP/JuCWEjco8HRIdCiJ/YzxkIJ2vSKtptVUNFa wikQ== X-Gm-Message-State: AOJu0Yzxaz6UumBPDzAPgDIC1qU1xU3wYspodj5ofNBubJM98c2Zapeg ExF3C4+kvwsa2ZyKOrqN4tzy2Z3wUIEY528vxnS5t/XSHjLR6DzpKJzK7vJHdfT3bBDvFqTg9Gr Eoec= X-Gm-Gg: ASbGncuVoZVLc/Kps0dPIJX6kv5ESz+jpUP9CDsUk5bgSZLL3amBBcTcXjXmu9CQJav QPZOXN90iZUz04Y6It6Z8eUfr5ASegYQ8AY4PKgbOQbIorz0AY31csSjs9JsDI+PA40Rs4MAN2R vRFiHIE5gaigsYsQnTRmG9V+cx/NzMPQEF9bhpIrAQvU6BAXPAhdw2G2+Aq1WU/SigUk5j2hLz4 7glpHVVb+0WAZzMhC9mXnNFliUDQDw9MKvRcbhZwr+Ya62VDR6th9XX3kz0w6XNJ6gWbrvlA4h8 LyMQMS6e8qv7IPD9guZxf7mhl3B37WyyciT97SAcv8LWL02Z0k8iZVAe15IFXYM9sjdBpAFDDR5 hcHogBnbWKBb+WnfS9hA= X-Received: by 2002:a05:600c:444c:b0:43b:ce36:7574 with SMTP id 5b1f17b1804b1-43bd29c6a29mr32248475e9.11.1741189215238; Wed, 05 Mar 2025 07:40:15 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43bd42e51e8sm20650775e9.26.2025.03.05.07.40.13 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 05 Mar 2025 07:40:14 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Paolo Bonzini , Richard Henderson , Pierrick Bouvier , Thomas Huth , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= Subject: [RFC PATCH 09/18] hw/ppc/mac: Replace TARGET_PPC64 by legacy_binary_is_64bit() Date: Wed, 5 Mar 2025 16:39:19 +0100 Message-ID: <20250305153929.43687-10-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250305153929.43687-1-philmd@linaro.org> References: <20250305153929.43687-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 For legacy PowerPC binaries, legacy_binary_is_64bit() is equivalent of the compile time TARGET_PPC64 definition. Signed-off-by: Philippe Mathieu-Daudé --- hw/ppc/mac_newworld.c | 9 ++++----- hw/ppc/mac_oldworld.c | 5 ++--- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c index cb3dc3ab482..60cca313b10 100644 --- a/hw/ppc/mac_newworld.c +++ b/hw/ppc/mac_newworld.c @@ -49,6 +49,7 @@ #include "qemu/osdep.h" #include "qemu/datadir.h" #include "qemu/units.h" +#include "qemu/legacy_binary_info.h" #include "qapi/error.h" #include "hw/ppc/ppc.h" #include "hw/qdev-properties.h" @@ -581,11 +582,9 @@ static void core99_machine_class_init(ObjectClass *oc, void *data) mc->default_display = "std"; mc->default_nic = "sungem"; mc->kvm_type = core99_kvm_type; -#ifdef TARGET_PPC64 - mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("970fx_v3.1"); -#else - mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("7400_v2.9"); -#endif + mc->default_cpu_type = legacy_binary_is_64bit() + ? POWERPC_CPU_TYPE_NAME("970fx_v3.1") + : POWERPC_CPU_TYPE_NAME("7400_v2.9"); mc->default_ram_id = "ppc_core99.ram"; mc->ignore_boot_device_suffixes = true; fwc->get_dev_path = core99_fw_dev_path; diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c index 0dbcea035c3..a8515778e2d 100644 --- a/hw/ppc/mac_oldworld.c +++ b/hw/ppc/mac_oldworld.c @@ -27,6 +27,7 @@ #include "qemu/osdep.h" #include "qemu/datadir.h" #include "qemu/units.h" +#include "qemu/legacy_binary_info.h" #include "qapi/error.h" #include "hw/ppc/ppc.h" #include "hw/qdev-properties.h" @@ -416,9 +417,7 @@ static void heathrow_class_init(ObjectClass *oc, void *data) mc->block_default_type = IF_IDE; /* SMP is not supported currently */ mc->max_cpus = 1; -#ifndef TARGET_PPC64 - mc->is_default = true; -#endif + mc->is_default = !legacy_binary_is_64bit(); /* TOFIX "cad" when Mac floppy is implemented */ mc->default_boot_order = "cd"; mc->kvm_type = heathrow_kvm_type;