Message ID | 20240110195329.3995-13-philmd@linaro.org |
---|---|
State | New |
Headers | show
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: <qemu-devel-bounces+patch=linaro.org@nongnu.org> 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 <patch@linaro.org> (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 <qemu-devel-bounces@nongnu.org>) 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 <philmd@linaro.org>) 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 <philmd@linaro.org>) 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 <qemu-devel@nongnu.org>; 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?= <philmd@linaro.org> To: qemu-devel@nongnu.org Cc: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>, qemu-arm@nongnu.org, Kevin Wolf <kwolf@redhat.com>, Igor Mitsyanko <i.mitsyanko@gmail.com>, =?utf-8?q?Alex_Benn=C3=A9e?= <alex.bennee@linaro.org>, Radoslaw Biernacki <rad@semihalf.com>, "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, Leif Lindholm <quic_llindhol@quicinc.com>, Rob Herring <robh@kernel.org>, Markus Armbruster <armbru@redhat.com>, Alistair Francis <alistair@alistair23.me>, Peter Maydell <peter.maydell@linaro.org>, =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= <philmd@linaro.org> 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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org |
Series |
hw/arm: Prefer arm_feature() over object_property_find()
|
expand
|
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) {
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 <armbru@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> --- hw/arm/virt.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)