From patchwork Fri May 2 21:45:48 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 886650 Delivered-To: patch@linaro.org Received: by 2002:a5d:430f:0:b0:38f:210b:807b with SMTP id h15csp1018429wrq; Fri, 2 May 2025 14:46:41 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVjobHwjTe5Huqg20VPUB1MJ753ZUHzbrv/KuxOuG2TWKNBEwV7qEY4ewd/PccZBxadtOt0lw==@linaro.org X-Google-Smtp-Source: AGHT+IFNQ53ggxfp8fq3xbhRC6PQ725OUmGFJ565Z4BYYGCCElyzgiacPUtfF3fKK8K0rr6WWe+6 X-Received: by 2002:a05:620a:248e:b0:7be:73f6:9e86 with SMTP id af79cd13be357-7cacea24485mr1141257685a.20.1746222401091; Fri, 02 May 2025 14:46:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1746222401; cv=none; d=google.com; s=arc-20240605; b=AJQxEt4CmzjKMLZ/NqYDzKkKeas+CfGTJzyN0cWL4GNoCycFdPzCSeXDZxpuVbMZJj RBaqXYKfFesY7Va4CVfQsgzqTqlQs9j+QVOCYTOYJCChSendBRWvs6BiJsf08bej6Aro qZbSglZJXTS8us0Osrfala1xpQ9JUXHhqhmnSgB/EyroFxtpToah7hDUFu/xN7Bi0v3m uXc8HGA4SyJAcamzjD0LXz3r3kBt9njr44d9WsxbgkI7V+cBxRJKDTlHmUBFXhWlo+KX jIJfaHDsoAkgGYXkzgthrwRm/97ZPWtOQOYuLAAZStu0lLOkUKaE7fYzF6H+32NebB6D q7ig== 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=N7Hzb0w1jlzsKSiFmuI60CliIwDp64ZHh16gYYLKY+A=; fh=w9UtuAm08K0O6DwRXOEWzl92QaS8M3PoE8G3rbCBQ9s=; b=Y+XBYiRzFihSkAm97b3R3qkAShE30H9opHEDzy6Vx7kXFM5YeasEnF4Mu8QdSxqKGE Lo1zovvGYkttG1tJ0UtcNGz1RXXfFPqPRDjbKEgdvT1A4DlbgQVJSzJdat0KOj7TG8fP w3LY7HBRAj9AxhCg6zgquPnaxR3eApRqlVSKIMvngScMQyEorI9EYBt0G0MU5GvURhaH WqFbPup+N4QJ3wYKeksGvdyY5LZXKlAZ5uQQ9X/ddE4HuvKnmS4EcvlzXh3bvQzYGhg2 WL23/xaB60sQVHdHdL6ar8zu8jUQdmCYGj+WoTCyd1k3HpXtNlrsBOL+3beyfYsLtU1I H4JQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FIkrvETV; 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-7cad23c7bc4si370453585a.144.2025.05.02.14.46.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 02 May 2025 14:46:41 -0700 (PDT) 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=FIkrvETV; 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 1uAyCw-0000hm-Kq; Fri, 02 May 2025 17:46:10 -0400 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 1uAyCu-0000hF-VQ for qemu-devel@nongnu.org; Fri, 02 May 2025 17:46:09 -0400 Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uAyCt-0003W0-0B for qemu-devel@nongnu.org; Fri, 02 May 2025 17:46:08 -0400 Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-acb39c45b4eso384454866b.1 for ; Fri, 02 May 2025 14:46:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1746222365; x=1746827165; 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=N7Hzb0w1jlzsKSiFmuI60CliIwDp64ZHh16gYYLKY+A=; b=FIkrvETVpM7/xF+Bqq/Zqmhjna3nhTZpAovxV7z13FoOaLqiC04VzqXoWw4AvDMQgZ NZ9kqKX7j4XqrE3GL3LrlmMXIxK4BJ1g9BNivSxphx5l6r5JMO3COQnTrIbEf3dejUgd WnSoFHuX0sGPGak3rebxlXI6MD07oObUvKVy9TEX99mCNOx2M2EHWC2Wl+X/JcoTHLCg 8I+XjBGRIz4kUlIK7ltDXZau0et3kHMOvhQ+x8lRDH0p3+3yEDnhDUstLI/pESw1B/Av ddsHCC4c0QoxKEGapTPa3OwHjz0nftBYAVDUATrdYRm89ouew05OvdNmjnmwmB+dpedw bOgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746222365; x=1746827165; 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=N7Hzb0w1jlzsKSiFmuI60CliIwDp64ZHh16gYYLKY+A=; b=NUVcudW1LQd3auFwFmbMlo/zohvSpt6kFKIe9B0VToOUIC53dZhCzseXuMcyT8jIZ7 Q3fQOH4Xak0DlC5B2ia7Wsn71EfyXdSO69hD61pPyLm0GuQMX3IZvOBq+WJuIeEPIl1U 2o+1NhiGtl5+p98LHWwpkp0iHlQyddoz8xhyOLrkVu1oA6N22giSEGx9YS8Cer7s4QpW 62EeDx/gS0VyuBES68Tgl7zTAfVn6SgvHbi5Q5Lg/smMrAdnWxFmELHt0LVrw0Fwg+Yi MKT/LA90WoxaOgKOrKRmRrHuCRjzAvuspQ5M9/p3sx9EUuM604TynkBoVcnOvCn19Vtp rVCQ== X-Gm-Message-State: AOJu0YxHWcrxn3OGIOuzOSh2xNdyqJ2g1fYKAEwfTDa5pRrilc0mPD61 OADd4CatYlj+uOLcim/LkMXyz8zUCdoGGaCxqYKIt0kUiWOIUZUue6aXduZC1UKYIkgKwBxcxc9 U X-Gm-Gg: ASbGncs3gae5NVDNs7FSmjQVZ0eZgCk/T5RD/c2PQkIxoSsVvPbgGgUV6WZALWDal2m RKo7K0sdiBbJXX1MtcIeUoeePXjx8A8Nw7qW8r5QeaXjeSBpS2fvIVFmboUYHb0OKVoivnhXQjt w2HwEC7mqNl6kgt+lsNwNg0xvKcI0KzcgRSJjbarwjsrE1Z38wxhUQzBaZgl+556ifnm4RUihq3 VmL2ThQvWMQioxqR2SLlbGryUr6W2dCBzGN68UIzvFrYY2LRVSps5kuuC1HoM8GHauGhT/Hvz7j w5XbRlMujIhcCKQB4JemPdMBi3tIEsVWh/W6GjQhlQlWHOSldOFoIcuVh47rqVCpoZ2zJ39t4KH Xh0z+dhh7O2vNh8E= X-Received: by 2002:a17:907:3fa4:b0:abf:73ba:fd60 with SMTP id a640c23a62f3a-ad17b5dbc19mr446152966b.29.1746222364621; Fri, 02 May 2025 14:46:04 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ad1895402c7sm100512466b.164.2025.05.02.14.46.03 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 02 May 2025 14:46:04 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Eduardo Habkost , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , Zhao Liu , Yanan Wang , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , "Michael S. Tsirkin" , Marcel Apfelbaum , Thomas Huth , David Hildenbrand , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Pierrick Bouvier Subject: [PATCH v3 2/5] qemu/target-info: Add %target_arch field to TargetInfo Date: Fri, 2 May 2025 23:45:48 +0200 Message-ID: <20250502214551.80401-3-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250502214551.80401-1-philmd@linaro.org> References: <20250502214551.80401-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::631; envelope-from=philmd@linaro.org; helo=mail-ej1-x631.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 Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- include/qemu/target-info-impl.h | 4 +++- target-info-stub.c | 1 + target-info.c | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/qemu/target-info-impl.h b/include/qemu/target-info-impl.h index 1b51cbcfe1b..83d584d7dba 100644 --- a/include/qemu/target-info-impl.h +++ b/include/qemu/target-info-impl.h @@ -9,11 +9,13 @@ #ifndef QEMU_TARGET_INFO_IMPL_H #define QEMU_TARGET_INFO_IMPL_H -#include "qemu/target-info.h" +#include "qapi/qapi-types-common.h" typedef struct TargetInfo { /* runtime equivalent of TARGET_NAME definition */ const char *target_name; + /* related to TARGET_ARCH definition */ + SysEmuTarget target_arch; /* runtime equivalent of TARGET_LONG_BITS definition */ unsigned long_bits; /* runtime equivalent of CPU_RESOLVING_TYPE definition */ diff --git a/target-info-stub.c b/target-info-stub.c index fecc0e71286..2e4407ff04b 100644 --- a/target-info-stub.c +++ b/target-info-stub.c @@ -14,6 +14,7 @@ static const TargetInfo target_info_stub = { .target_name = TARGET_NAME, + .target_arch = SYS_EMU_TARGET__MAX, .long_bits = TARGET_LONG_BITS, .cpu_type = CPU_RESOLVING_TYPE, .machine_typename = TYPE_MACHINE, diff --git a/target-info.c b/target-info.c index 8232d488870..5f6096606e4 100644 --- a/target-info.c +++ b/target-info.c @@ -25,6 +25,9 @@ SysEmuTarget target_system_arch(void) { static SysEmuTarget system_arch = SYS_EMU_TARGET__MAX; + if (system_arch == SYS_EMU_TARGET__MAX) { + system_arch = target_info()->target_arch; + } if (system_arch == SYS_EMU_TARGET__MAX) { system_arch = qapi_enum_parse(&SysEmuTarget_lookup, target_name(), -1, &error_abort);