From patchwork Tue Jan 2 16:04:52 2024 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: 759370 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp6113600wrw; Tue, 2 Jan 2024 08:07:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IHAhYBSRUK4d9hqXrzttKnJZYDBcXuULMdREqC6hSwmQkyV3HAWQ9cRYqewEXmCQHVEQVNG X-Received: by 2002:a05:622a:1715:b0:427:7e53:15ec with SMTP id h21-20020a05622a171500b004277e5315ecmr25832202qtk.64.1704211637284; Tue, 02 Jan 2024 08:07:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704211637; cv=none; d=google.com; s=arc-20160816; b=v8qETVEoowrtnqTyTwJ+/GUbV7Qi4ntj6Nyqma35TZ2KhqIioH8O2h4U3AhgAUzhzx dRHSb7qefUJ+H/uOi5FnvflbCs0BQzY9Fw8Ye08TmFHTrPAggxjeblnHNSXJ8Q7FJmpj zLm3rPoJfRM80HyTOm7XIRIElfLCgRzZaaSMsU/MFMEib1OOl5CL4agLk/c4+YXRUOpA SJN2pKcRauDGCzFyiuqKmWuDqUjJvW8+IKDIgYm8V55nmIL/m5hPpgarlR8SE10uiDp8 ZgymTkZxzJ4ALqLXVsObhGL5xdV76M8eou6BIcjJb6JqaGq2Qk/TuD0tVI7OeQnYSCRA 0XAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=J38P+ankfUbUztT5GJCTo6FfwFdn7YoTpHgRI5fDY8Q=; fh=Fbl4rt7vNadFyu+mhE5sPZ2m5GJmVL0UTbP+h3uuTlY=; b=RnTLzYHQJgiGUxrXdP6hrpEpdJC2BGa2s40OGWYP0Sofqk5c9sLszT55IibDEQT161 g3ujnvWnYILhHgN3xsJsJL0dTQyvRgiLj4NUTavgAQzqSdnoQKmHdbqpdnr+aeLt+gbA FsTbVbcaHweJ+btu8lEGI/vPGpMEoLfsEV4qGgQgbPYog7vub7wO8DglEA9fPwanZtay J0fMDBGFb32YcNTi0qKyv3gD0fn1CKt9BAzeMID+MhMoFpZzlgh7TbyxN9OU8BmuZyxG SmvJ/MKpPQQhtL7K7LFsuR3iQP3GdgqpF+oC35YUtsxvEb0w29uFaQewNfgvKSIxS6U0 nZTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Kh0/g3pW"; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id u11-20020a05622a010b00b0042830650bafsi1282436qtw.67.2024.01.02.08.07.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 02 Jan 2024 08:07:17 -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="Kh0/g3pW"; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rKhGn-0006NG-Fv; Tue, 02 Jan 2024 11:05:34 -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 1rKhGc-0006HB-GJ for qemu-devel@nongnu.org; Tue, 02 Jan 2024 11:05:24 -0500 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rKhGa-0002dS-4T for qemu-devel@nongnu.org; Tue, 02 Jan 2024 11:05:22 -0500 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-3367632ce7bso8283814f8f.2 for ; Tue, 02 Jan 2024 08:05:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704211518; x=1704816318; 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=J38P+ankfUbUztT5GJCTo6FfwFdn7YoTpHgRI5fDY8Q=; b=Kh0/g3pWmtcjNrg2GA+ugfeewPTLorGSMcQtucfc0dK86ejPhvL8cAAgZTqvDKUVl5 p/uXgdMDSrEY85KGPdwoQECS0/qG98VIrE9x3kObWu29mSleCdUOM7+8AvapXPT9xeVn kjPLi5E1zm3CsFxYozi4kK73PGXvBbNoKEOZB/fECvArh7KciYy4UAAJnhPE04OOKWE+ CdZfJPy7CcHp8L3cElNUFwRXf1E6gN9CzFbvlGlY2xIQUYpY1xDPBQEPVjIhb1y4ce5t 96ji0Ip9YsSR/G83ZJ/Q/3JAQi6nMBjZ5Xsz88GGnevAgGt+DVxOPKChrE5olH198mga 0FYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704211518; x=1704816318; 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=J38P+ankfUbUztT5GJCTo6FfwFdn7YoTpHgRI5fDY8Q=; b=GYg6uweQpgAc7/UUjly63AX3TiBtBl12dnvM1fvP/cFES/NsJZQ1dRRCstdoJoTn6N JtyLhecOKSqhqMToa+QKmxB58friS9a5LG9Om1bvFi4FC7K4f4A9qwXkxNryTWf1Zh83 qKW9F3rQoFg7HA499JgFJHC7YgAWhVNq84kORN3/Uhk0/aeBh1v8MOCUwZNn/UyhavsA 2QgqYS1Nql9fGReS/wh2YqjsR6Bk2HpCmD8KwfBwPZfMAwnHuLRMVQ+8pcqbKoaXoTA1 Pl4eoauRFL5cKCz+PjznS1ZMEXMGDhvmMgQHnKOYm0bztM+zGz+d/ggGv7aCG4SBiAAK 46Cg== X-Gm-Message-State: AOJu0Yxg18DrG8SeZ+wlG/wH+twAr9YsvhT+quUfnfTsIeGmFB4s7akA c2FYIoX7pBOTuzvkE5SH/nMhN+PsPI6gGDkBlSG8W4mq9qg= X-Received: by 2002:adf:ec82:0:b0:337:37c2:fc57 with SMTP id z2-20020adfec82000000b0033737c2fc57mr2610183wrn.106.1704211518286; Tue, 02 Jan 2024 08:05:18 -0800 (PST) Received: from m1x-phil.lan (sal63-h02-176-184-16-71.dsl.sta.abo.bbox.fr. [176.184.16.71]) by smtp.gmail.com with ESMTPSA id b16-20020a056000055000b003372dcd739csm9582956wrf.86.2024.01.02.08.05.15 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 02 Jan 2024 08:05:17 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , Eric Blake , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , qemu-arm@nongnu.org, Luc Michel , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , Mark Cave-Ayland , Eduardo Habkost , Frederic Konrad , Markus Armbruster , Paolo Bonzini , Kevin Wolf , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [RFC PATCH 3/5] hw/arm/armv7m: Convert ARMv7MState::vfp from bool to OptionalBool Date: Tue, 2 Jan 2024 17:04:52 +0100 Message-ID: <20240102160455.68612-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240102160455.68612-1-philmd@linaro.org> References: <20240102160455.68612-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=philmd@linaro.org; helo=mail-wr1-x42f.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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 We want to know if the 'vfp' property has been initialized. Convert it from boolean to OptionalBool (which contain the 'unset' enum). Note the monitor output is changed as: (qemu) info qtree ... dev: armv7m, id "" gpio-in "NMI" 1 gpio-out "SYSRESETREQ" 1 gpio-in "" 96 clock-in "cpuclk" freq_hz=40 MHz clock-in "refclk" freq_hz=0 Hz cpu-type = "cortex-m33-arm-cpu" init-svtor = 270532608 (0x10200000) init-nsvtor = 0 (0x0) enable-bitband = false start-powered-off = false - vfp = false + vfp = "false" dsp = false mpu-ns-regions = 8 (0x8) mpu-s-regions = 8 (0x8) Signed-off-by: Philippe Mathieu-Daudé --- include/hw/arm/armv7m.h | 2 +- hw/arm/armsse.c | 2 +- hw/arm/armv7m.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/hw/arm/armv7m.h b/include/hw/arm/armv7m.h index e2cebbd15c..6c9e65b644 100644 --- a/include/hw/arm/armv7m.h +++ b/include/hw/arm/armv7m.h @@ -105,7 +105,7 @@ struct ARMv7MState { uint32_t mpu_s_regions; bool enable_bitband; bool start_powered_off; - bool vfp; + OptionalBool vfp; bool dsp; }; diff --git a/hw/arm/armsse.c b/hw/arm/armsse.c index 31acbf7347..472b16fc30 100644 --- a/hw/arm/armsse.c +++ b/hw/arm/armsse.c @@ -1028,7 +1028,7 @@ static void armsse_realize(DeviceState *dev, Error **errp) } } if (!s->cpu_fpu[i]) { - if (!object_property_set_bool(cpuobj, "vfp", false, errp)) { + if (!object_property_set_str(cpuobj, "vfp", "false", errp)) { return; } } diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c index d10abb36a8..3610f6f4a1 100644 --- a/hw/arm/armv7m.c +++ b/hw/arm/armv7m.c @@ -548,7 +548,7 @@ static Property armv7m_properties[] = { DEFINE_PROP_BOOL("enable-bitband", ARMv7MState, enable_bitband, false), DEFINE_PROP_BOOL("start-powered-off", ARMv7MState, start_powered_off, false), - DEFINE_PROP_BOOL("vfp", ARMv7MState, vfp, true), + DEFINE_PROP_BOOL_NODEFAULT("vfp", ARMv7MState, vfp), DEFINE_PROP_BOOL("dsp", ARMv7MState, dsp, true), DEFINE_PROP_UINT32("mpu-ns-regions", ARMv7MState, mpu_ns_regions, UINT_MAX), DEFINE_PROP_UINT32("mpu-s-regions", ARMv7MState, mpu_s_regions, UINT_MAX),