From patchwork Wed Jan 10 19:53:26 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: 761453 Delivered-To: patch@linaro.org Received: by 2002:a5d:6e02:0:b0:337:62d3:c6d5 with SMTP id h2csp2053290wrz; Wed, 10 Jan 2024 11:55:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IHR/PoPWz774uqeWlked0h9hchOb+OkLagu8LlzFFU56KyVK5TLVswdTZQJwx0c0bkxf8GQ X-Received: by 2002:a05:690c:fc9:b0:5f6:b57e:5e62 with SMTP id dg9-20020a05690c0fc900b005f6b57e5e62mr193946ywb.56.1704916545560; Wed, 10 Jan 2024 11:55:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704916545; cv=none; d=google.com; s=arc-20160816; b=AyCJRwCGWR/0UV7B/aRXo2qW7gDtvXfBIDSKDcjwASbvpmMTDvPQLAUDe1GVFPZJ+u Tsw+9rF3LjJrk/KhhRkpjivaNZrYrhTxpuh+zkAVN1LgMsIhPy5bOz6XcswO3opovSuE IotO4uKqzE4CyvObWzd+Zy/x5Pvnb7NYZq2zevhWrRVVgj3Hba+DWEFvtlaPd4Rxw174 YREkr7KUfDU5xBUNGWQx3o4GJ6EVP93IFF78t47nsqtGapQkvL3IdzGyN/QD4i5U0QHG E0Hl7Hqhh/4Cn/GsvGntItVSSi6KcproRpDh5pCfXvLPxYkIdzLw6NAguG9vIJkl6CQW pDyw== 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=H2YEvqYxr1jwORUy1H416YdJDByH1Bti5dkUqmMcrho=; fh=0Bn9ysFO5uhdOoEvdDNDnkwY7yFMuDt2XLw3k0zcWt8=; b=CtTAkEdtCTqX0rDHjJWsQN923ePjfAZD+0YFZiwmhFVuI77RiJFgVHeKIn9cTPYHA8 oPNVUB5xmq8w+3l7sFxzXYZTxu2p1bpU70rK5yhlk3znwI++ziYA//8qGWfKnoLXoz4f aLUsYA+xuyKvCn1zqiMQkaF3keokICZQzZOA8JbAmmx2gbdNBs75wGFAcow/TkiBPGPC xqCpZXg9dVyD3QJqVJIZGh80jdrDis4bgoA2fRDML+Klk5G8M55T8fznZEl58Pme4ylG NJrgzuZ1+0sqlSBJOVm+GpW/4eRoKd0LMD/iS7xo1+AhKRm01bdZMWPbMTU/GCJwphtL De9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SNPeznJK; 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 pj5-20020a05620a1d8500b0078328b79d39si4595925qkn.427.2024.01.10.11.55.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 10 Jan 2024 11:55:45 -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=SNPeznJK; 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 1rNefL-00027Q-T7; Wed, 10 Jan 2024 14:55:08 -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 1rNefE-00021X-KA for qemu-devel@nongnu.org; Wed, 10 Jan 2024 14:55:00 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rNefD-0002ig-0f for qemu-devel@nongnu.org; Wed, 10 Jan 2024 14:55:00 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-40b5155e154so58940585e9.3 for ; Wed, 10 Jan 2024 11:54:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704916497; x=1705521297; 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=H2YEvqYxr1jwORUy1H416YdJDByH1Bti5dkUqmMcrho=; b=SNPeznJKdn3spxrTaB/AgPVwyQuPeNcrCnHPi81o/HfLc+xiYhsQz5fp3uGPXTBA3d uBmkj3nyh6b/YGz1f034feoQCOvVxWKe7dIOsu7yJMCzAi3rxHN7d5G+AOneAQBMdZFU w/75oQumnLZJRzBMfFD/nS6w8luD02RdEuQBBAS0mCZfGe6+AVrpK1JNsHrdPB10khIo hj3mfjCTt5Qbd/5F0m+uJ+9yzBvlBHwYWiyz256VPSgSEVHn6ZWeR0rDrthgFxpbGG4d 9xlxbE156JeIlv+SXcHfKQtBEYgPFljSSiFX/kEw4WsK13UYprGKhO4WPIOkDQ3BnNfU kdRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704916497; x=1705521297; 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=H2YEvqYxr1jwORUy1H416YdJDByH1Bti5dkUqmMcrho=; b=raPBtt5OczUEwVZDyTFYrUkQKo+dLFxBonOM+q8vHSc6SGkgG+9V30Mapy1WD8h+2P EnOf2CNx+fRIQHadFUWorA4L+Ox74RdBtYzuoQsBe05KkPtrzEUeW6TSsXcskC8cPU5S TFIbWZU1HuSYM1rkzxYEtsS1nSSPmAeDrrKOUGX+qL0BVhnYGavclFBAyrg3Ez4kWfyf qqb2FfxXjnj4KlH4NmVcPp0joL0sOnhs9y7ksvgHvjtBjavixgGgdQ5MuaxTCXxYjHqh rG9mxvAwMfnSW7Z3yeJFaX0LyUQK645WkrdoGA9s/iwCV9j+pyLvFn1R2uRoKS1vCOKn y+NQ== X-Gm-Message-State: AOJu0YxOVrB2Es19zFMivDD5clKFYDOjoCQhhkXbqrB71NwXY9qYkZXd ODWbmFsOJPji2TsWHKZfo2aCCW3RqW1qlKF6+ypwxkS/9A0= X-Received: by 2002:a05:600c:4387:b0:40e:511c:ce85 with SMTP id e7-20020a05600c438700b0040e511cce85mr866737wmn.57.1704916497248; Wed, 10 Jan 2024 11:54:57 -0800 (PST) Received: from m1x-phil.lan (vau06-h02-176-184-43-236.dsl.sta.abo.bbox.fr. [176.184.43.236]) by smtp.gmail.com with ESMTPSA id l17-20020a05600c1d1100b0040e4a2b36bfsm3188298wms.22.2024.01.10.11.54.55 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 10 Jan 2024 11:54:56 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Marcin Juszkiewicz , qemu-arm@nongnu.org, Kevin Wolf , Igor Mitsyanko , =?utf-8?q?Alex_Benn=C3=A9e?= , Radoslaw Biernacki , "Edgar E. Iglesias" , Leif Lindholm , Rob Herring , Markus Armbruster , Alistair Francis , Peter Maydell , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PATCH v3 12/14] hw/arm: Prefer arm_feature(GENERIC_TMR) over 'kvm-no-adjvtime' property Date: Wed, 10 Jan 2024 20:53:26 +0100 Message-ID: <20240110195329.3995-13-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240110195329.3995-1-philmd@linaro.org> References: <20240110195329.3995-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.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 First, the "kvm-no-adjvtime" and "kvm-steal-time" are only available when KVM is available, so guard this block within a 'kvm_enabled()' check. Since the "kvm-steal-time" property is always available under KVM, directly set it. Then, the "kvm-no-adjvtime" property is added to ARMCPU when the ARM_FEATURE_GENERIC_TIMER feature is available. Rather than checking whether the QOM property is present, directly check the feature. Finally, since we are sure the properties are available, we can use &error_abort instead of NULL error. Replace: object_property_set_bool(..., PROPERTY, ..., &error_abort); by: qdev_prop_set_bit(..., PROPERTY, ...); which is a one-to-one replacement. Suggested-by: Markus Armbruster Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/virt.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 6d1cb24a6e..49ed5309ff 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -2150,14 +2150,13 @@ static void machvirt_init(MachineState *machine) object_property_set_bool(cpuobj, "has_el2", false, NULL); } - if (vmc->kvm_no_adjvtime && - object_property_find(cpuobj, "kvm-no-adjvtime")) { - object_property_set_bool(cpuobj, "kvm-no-adjvtime", true, NULL); - } - - if (vmc->no_kvm_steal_time && - object_property_find(cpuobj, "kvm-steal-time")) { - object_property_set_bool(cpuobj, "kvm-steal-time", false, NULL); + if (kvm_enabled()) { + if (arm_feature(cpu_env(cs), ARM_FEATURE_GENERIC_TIMER)) { + qdev_prop_set_bit(DEVICE(cs), "kvm-no-adjvtime", + vmc->kvm_no_adjvtime); + } + qdev_prop_set_bit(DEVICE(cs), "kvm-steal-time", + !vmc->no_kvm_steal_time); } if (arm_feature(cpu_env(cs), ARM_FEATURE_PMU) && vmc->no_pmu) {