From patchwork Tue Jan 9 18:09:29 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: 761065 Delivered-To: patch@linaro.org Received: by 2002:a5d:6e02:0:b0:337:62d3:c6d5 with SMTP id h2csp1495958wrz; Tue, 9 Jan 2024 10:12:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IHTBXkoW0UvvRDDk3+AkD9C+xngviv0YPYeXnL+glAaB2XGA+JePKQ0oTOoTP8fb6KOU3j4 X-Received: by 2002:a05:620a:1792:b0:783:3159:c7a4 with SMTP id ay18-20020a05620a179200b007833159c7a4mr898089qkb.59.1704823947170; Tue, 09 Jan 2024 10:12:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704823947; cv=none; d=google.com; s=arc-20160816; b=Ch3lsvUciXIwcM1tMQPdapEbDeN4rdcRIC0aXBNDBwLQZ4kFKuWBB3QYe+6tAuDhkr /313Ki6/urBBcyaScJ3J/ELh2QgrG9UAcKaAT8yi56D2EfqqVzxaAy6PzGFaiqWsjTsj PMc0TuVWKPQhHeJyyU6QGlByKJiIzvM29AvhOylsWtWOqCw+GppTxK/lYBl6ZcsgykM3 1scqWcmL8Krby7F2LJkMRN5AW9HUmWAiuXiuddtAyrbWujjE1F8ZTHF1lKIowwabC3Fw FJ8RUzprRu5/ow/U98oQBPib9JoXuwJSgXj0yICIcRcbc+fTogC8R92VspsJUeU5UPuQ mluQ== 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=ZHN1WAhVwI6VDlIQMYmKaw16w5C6ru8lwNtKGuzaAIs=; fh=v69mdd+nxs/0WeTIWzLZOPCx0ynE2o0vtvId2fSwkBY=; b=GasZQOIRsITOZL4dBmatPYPvoTZjEbHx8fxI6EiuC8TYDksH/80V0utIyNi531YUYg Wv1eaEfpJUKKUtyNRhQlOSfxMIhcGOkJJzju+I9Q8uJSW/eo38iuKKmyyTTmMP/xrkym hmzsqs2ydy67QZtoVilHWn7BJZAYr7ywGsGIyVEkwoSc77r/SHxzgtBYtdVr0p5Pr6/v 7VGEJec5rUMcjNxc4XH9nXjItkVT9mVOGZiTIOrsh6U57C+IbawZNb4AfKWGDb2NXTAQ jKjcNVLBGLQ/akTF4u0C+wRCbUJ2GiiZyas2Q+4Yz4aj5/oX+LIJHT1QSFfr9hoA2/kM mVvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QyDFv6mb; 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 b9-20020a05620a0cc900b0078326356ab6si2491988qkj.29.2024.01.09.10.12.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 09 Jan 2024 10:12:27 -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=QyDFv6mb; 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 1rNGZP-00050H-BZ; Tue, 09 Jan 2024 13:11:23 -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 1rNGZA-0003qJ-8h for qemu-devel@nongnu.org; Tue, 09 Jan 2024 13:11:08 -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 1rNGZ7-0004Zg-3A for qemu-devel@nongnu.org; Tue, 09 Jan 2024 13:11:08 -0500 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-3374c693f92so2657475f8f.1 for ; Tue, 09 Jan 2024 10:11:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704823863; x=1705428663; 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=ZHN1WAhVwI6VDlIQMYmKaw16w5C6ru8lwNtKGuzaAIs=; b=QyDFv6mbJQoNvRXQrF0Y2qosLHdkQxbY8hgtWNDeOvGpsb98Fw3ixC/qIf+4tBdQEq EL9s2y/XfdLlWbsDf62PRTV4EA/H2R/uMd597fCf0Ye3ILweg9ZpKfqOQTGnd6GHtRKx mdbQvxQgIpJqWtgWT5BqiYMaHgW07noZozAzpZVLd9SOPtr71O5PeODnYyh2xncY5+Ne wbmBxi048zRxcAbtY6einkXKxuptBZ3LYT4Y8BBza7+6j29grYFQ9n4roRDp+2tY041O kQAZchlWg27TAKPFnAoAUEoQ9gu8XjfGRFoycJgg+mMG4AQmMKNgEbAJwh9o3HKCTzqA EpWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704823863; x=1705428663; 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=ZHN1WAhVwI6VDlIQMYmKaw16w5C6ru8lwNtKGuzaAIs=; b=kSG9D+hGNYpM7BhzT0V1vndr1vj7ER9/wL6oZv8DIQoEjUGqyKUv9tPl2MSafKGR4R VEn1IwzLUmcv69ttSEp/Xl4k8rWc/DUT57qD95QMhDbu1AQMRfFyECgRwDelDTwcooAy klN8LZNal477v6nQS5Ak0n2UNSgFykSxzRf9zBPlqnVj8WOidajd6d2kkEaVhTKNilvk CU5Sdvsz6bu4VdvMYWUCDB3fpj/rIcGuxOAwl+j8WP9IQHacdT/4SoFNQ4VoqAhUXnCs CWeFhvscMK2ZKO6p/EmcNqnS9SaBWCkVPFmM9TESBNiwc3E3sB67SEDBwurPnkKtxVgX z3Tw== X-Gm-Message-State: AOJu0YyYbTGYzA5CLxNDdj33YWgE/Ihz2aOc9YMFLLvZqZXzVNbvNBMK cgsn9Q5n8gc3nmMmZszvIb+C7kcxlCura+ilnb5VAJz//uawrA== X-Received: by 2002:a5d:5917:0:b0:337:5d2:f6cb with SMTP id v23-20020a5d5917000000b0033705d2f6cbmr845759wrd.54.1704823863496; Tue, 09 Jan 2024 10:11:03 -0800 (PST) Received: from m1x-phil.lan (rsa59-h02-176-184-32-47.dsl.sta.abo.bbox.fr. [176.184.32.47]) by smtp.gmail.com with ESMTPSA id i6-20020adfe486000000b003368d2e729bsm2988794wrm.43.2024.01.09.10.11.01 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 09 Jan 2024 10:11:02 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Leif Lindholm , Radoslaw Biernacki , Kevin Wolf , Markus Armbruster , "Edgar E. Iglesias" , Igor Mitsyanko , Rob Herring , Alistair Francis , Peter Maydell , Marcin Juszkiewicz , =?utf-8?q?Philippe_Math?= =?utf-8?q?ieu-Daud=C3=A9?= Subject: [PATCH v2 14/14] hw/arm: Prefer arm_feature(GENERIC_TMR) over 'kvm-no-adjvtime' property Date: Tue, 9 Jan 2024 19:09:29 +0100 Message-ID: <20240109180930.90793-15-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240109180930.90793-1-philmd@linaro.org> References: <20240109180930.90793-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 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 2ce4a18d73..6ac8fb19d2 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) {