From nobody Mon Feb 9 08:00:09 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.45 as permitted sender) client-ip=209.85.221.45; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f45.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.45 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1619550716; cv=none; d=zohomail.com; s=zohoarc; b=kIfZqXhcFGpaG2UhDcfXP7VkFXkBYrTelFdkh9qYqTJALtUelX2t7ZNUfZYozwZhZAs2ot0AaLjXn7i6feQpGFR+zCBNHnwV9aGXywZQm7pPPjRcX/cpXHZSSxJBYH5zVr1ChgtFyTIA3EKzZVo6/FZnVfxckzzMfjwt1gj6988= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1619550716; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:MIME-Version:Message-ID:Sender:Subject:To; bh=qu24o0esFGFk85wZi/RmTBhqz+vFHCBsju4uOG1HE5Q=; b=ODIpysdOdFDU+rz9016f5wb5leIQefDmTtH0gr1h/U0+DnXMcdcHkVqEW6J3opCWHPNOiPcz4Oc+9SOgPX5a5Nh19fnxBsQJ7pWPfKZHus8bLla4VnyZ7CvZeVUGAjcZsOjUPRI7LfuHVs3lJCapdPmiPwDe7p5uejPMluAL1ss= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.45 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) by mx.zohomail.com with SMTPS id 1619550716608549.0129240800478; Tue, 27 Apr 2021 12:11:56 -0700 (PDT) Received: by mail-wr1-f45.google.com with SMTP id t18so2978679wry.1 for ; Tue, 27 Apr 2021 12:11:56 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (39.red-81-40-121.staticip.rima-tde.net. [81.40.121.39]) by smtp.gmail.com with ESMTPSA id w22sm3740135wmc.13.2021.04.27.12.11.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Apr 2021 12:11:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=qu24o0esFGFk85wZi/RmTBhqz+vFHCBsju4uOG1HE5Q=; b=G11yu1jqNzUuxUP8hfQ3TlUhBtuytdBG41bgUN9gMJtNX1IlTS2I/zBkT54HmcF+yu jRd5vBGNQMQ8vJt5A6KWn9rM8wtyX4dfVkAIWW1E7FaxVhOvSabCmwcI+TADnhmIrebz btQ1qMwJsNjEjnsl/Ut2L33zeqLQWTl3cOrAlTRqccSG4vSXD67MwK604GNBx62cbgyG yVC7glemY2QQHOGu/PYgEextxWOaXMfqDYoZRESEtZ4T8Rs78DLvcYrwhm/qf2ktCLN9 KvXTsjRURwEJ7UR9ZPBbkh7jSlAAhYUFfDmU18uFyDpvYbl500Nu3KSIKbpC7HHV201x rS/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=qu24o0esFGFk85wZi/RmTBhqz+vFHCBsju4uOG1HE5Q=; b=bw1lmqyQkEL1b6+T/svGO7YzQYzlrS3zP7HhyMVLJFtMeb1OPxG+lJ5ejm2QgXo2lw HfSZjkVegjZSuyod9GmJsqx7iKLwIONFgim5+Eciv7FxVYb+6/BGdgjz2wdXtiuc+IMI 9CFvS4EfAV7Ll8m+eZ1II4xck5bOTff89doiIuhrJYlgbXZnwNK9SL8AgzTIFLduIIUf nyJIzSaY3wdeK+E1AGHbMM8qFhXqqjC466Zx+pCYffaPpx4cg74pfg+ynyI01/97R9Jr 8b18OhthLU7ZeaPC7tFpW4WXScnQB0XOQabOnpLzXza2ydLu8zFKMCEGAsiM3OjxLfgp KYWQ== X-Gm-Message-State: AOAM532UaGNj+gE967YIEsDPMe6oO2gVtDeQfwlqE67UTd5jIE+uzH+9 fyvFomDzUgY8/UHOMbrVS9Q= X-Google-Smtp-Source: ABdhPJyE7aEMdHeVlnaXqe6RI7uMnroest7YD33bKvO0GMP7tf4HSuYIzPgA+aFXuAiHC28XllGaRA== X-Received: by 2002:a05:6000:362:: with SMTP id f2mr31479375wrf.141.1619550714845; Tue, 27 Apr 2021 12:11:54 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aleksandar Rikalo , Peter Maydell , Aurelien Jarno , Jiaxun Yang , Paolo Bonzini Subject: [RFC PATCH] target/mips: Allow building without Inter-Thread Communication hardware Date: Tue, 27 Apr 2021 21:11:52 +0200 Message-Id: <20210427191152.260421-1-f4bug@amsat.org> X-Mailer: git-send-email 2.26.3 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) The Inter-Thread Communication unit (TYPE_MIPS_ITU) is an optional device that is only selected by a few machines. However it goes deep into the translation code, as the MTC0/MTHC0 SAAR helpers call itc_reconfigure(). When building with no machine selecting the ITU component (which is implemented in hw/misc/mips_itu.c), we get the following link failure: /usr/bin/ld: target_mips_cp0_helper.c.o: in function `helper_mtc0_saar': target/mips/cp0_helper.c:1118: undefined reference to `itc_reconfigure' /usr/bin/ld: target_mips_cp0_helper.c.o: in function `helper_mthc0_saar': target/mips/cp0_helper.c:1135: undefined reference to `itc_reconfigure' Fix by adding a stub, built when the ITU isn't selected. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- RFC because too much Meson machinery to my taste. But how to deal with such architectural devices else? To reproduce: $ echo CONFIG_JAZZ=3Dy > default-configs/devices/mips64el-softmmu.mak $ echo CONFIG_SEMIHOSTING=3Dy >> default-configs/devices/mips64el-softmmu.m= ak $ configure --without-default-devices $ ninja qemu-system-mips64el $ ./qemu-system-mips64el -M magnum -S --- target/mips/cp0_itu-stub.c | 15 +++++++++++++++ target/mips/meson.build | 3 +++ 2 files changed, 18 insertions(+) create mode 100644 target/mips/cp0_itu-stub.c diff --git a/target/mips/cp0_itu-stub.c b/target/mips/cp0_itu-stub.c new file mode 100644 index 00000000000..995b5a09ff8 --- /dev/null +++ b/target/mips/cp0_itu-stub.c @@ -0,0 +1,15 @@ +/* + * QEMU Inter-Thread Communication Unit emulation stubs + * + * Copyright (c) 2021 Philippe Mathieu-Daud=C3=A9 + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ +#include "qemu/osdep.h" +#include "cpu.h" +#include "hw/misc/mips_itu.h" + +void itc_reconfigure(MIPSITUState *tag) +{ + /* nothing? */ +} diff --git a/target/mips/meson.build b/target/mips/meson.build index 3b131c4a7f6..a631688fae0 100644 --- a/target/mips/meson.build +++ b/target/mips/meson.build @@ -45,6 +45,9 @@ 'cp0_helper.c', 'mips-semi.c', )) +mips_softmmu_ss.add(when: 'CONFIG_MIPS_ITU', if_false: files( + 'cp0_itu-stub.c', +)) =20 mips_ss.add_all(when: 'CONFIG_TCG', if_true: [mips_tcg_ss]) =20 --=20 2.26.3