From nobody Sun Nov 24 20:08:11 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1721118585; cv=none; d=zohomail.com; s=zohoarc; b=CILW6s+/zY1yXhKCxq1UulzHwesBnYvWpYRSPGskzM3pht3P8/3n///Kb9Y8k+jXT/DyRfOP/mrzD3elInecL4+foT3iNyHKIuWD9W09e8CENK9FC/8zox9ziOsP0AOsC4qTI9XDfAvNY0UgeLZYusdOfV/M19JL6k3xYEtObe4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1721118585; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=RYXhIuhb5B0Jyjgf4vjtjqsff5UW6UTsThhjedH3LOU=; b=Zh/xO9CI5NudeDNYVQ8Hil7fP6Nlp19auQq/5lsJiUiQnrR1IOEz8xXgeYmiNJDtredWGGBKMANvytjNa6RoLCicQ/FQqwFXUulHgx5rT+zhk+iU2JUbD8aY/vRAyCv3D/DFN6m+mftgnCgKxFiaK6l+f0GkS3NqsdLIbX1/N7Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1721118585952648.9203486349425; Tue, 16 Jul 2024 01:29:45 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sTdYF-0006Yh-Eb; Tue, 16 Jul 2024 04:28:47 -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 1sTdYD-0006QZ-Bc for qemu-devel@nongnu.org; Tue, 16 Jul 2024 04:28:45 -0400 Received: from mail-oo1-xc34.google.com ([2607:f8b0:4864:20::c34]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sTdXw-0001yr-GM for qemu-devel@nongnu.org; Tue, 16 Jul 2024 04:28:45 -0400 Received: by mail-oo1-xc34.google.com with SMTP id 006d021491bc7-5c69848ca98so2793534eaf.2 for ; Tue, 16 Jul 2024 01:28:28 -0700 (PDT) Received: from localhost ([157.82.128.7]) by smtp.gmail.com with UTF8SMTPSA id 41be03b00d2f7-7910f291ee4sm3222889a12.86.2024.07.16.01.28.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 16 Jul 2024 01:28:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1721118506; x=1721723306; darn=nongnu.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=RYXhIuhb5B0Jyjgf4vjtjqsff5UW6UTsThhjedH3LOU=; b=X9kybmC3AyQ2/cancZTdKtxp3H6o3s0kTBH8qZ+j9ERBYLH7TH7cRmowT5NkMZSpmo c7mv46aCR0eVUD1mMhpQHMfoE+2MQmFh2THIDH10uerVFjk8WdWgf6UF47rF/6tCkzcH GCi4v+UK6ff18J7w+YZyfH4dQ8Kwti+jPJPHWDpVYAKKoyhJ1TqAQH+x/PRPij8uB8js RioTmC4BosNK7r0L/7FAAPr+F8EvwOCwSEeKbJ+9xsC2GL9te9R3elYbpYmtjs46AVC5 H+uxLvlnogvwiMREFsmb3PUukDCh7Sk0NG9f+xfNJDJqh7FQdoAGjnMt9ZcAJ/autbsJ rfBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721118506; x=1721723306; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RYXhIuhb5B0Jyjgf4vjtjqsff5UW6UTsThhjedH3LOU=; b=BRifR9+pDSRf633ZnBIY2o/kUGmXBHk1YavdsXXg+FUJa4MffWVTlfboWHH/LEzZ7k GrEtfWLZwjeOovMrPyXQamMAKHtFFfwhzDl1MvNtPqm2n5fciLHCJrO903OxcyS7SH92 8k3/vwt2iLeBIzB1Xrd5glpUq1jZNQ2nLv2/NwOBcyAzF3764mooj+Ns7hC0ZPv2BLaB Nqs+jqBpmgIMuYQ3GS9pDMWYCg/fhMwM6GmYclyb6ripIQr0Oe7eLdhAACOK/WBLn1kN zoUXaUB+E+jrpzcbNpAR95SKgm+MqLSnmznt9XJ7u9Y6FF5GRgEWYZV4zekJkdZEIfXe +JMw== X-Forwarded-Encrypted: i=1; AJvYcCVZZVofZ+8jYAO6tjz1LlmP24jEGJwC9NEJSW29dvdjEFQEor9dtAZeHYhS0SPKtFqcNb1yQggGNdCvFknjHjVfRPlhngs= X-Gm-Message-State: AOJu0YzwvYJ3Y0twlSaPdONpj82XCymcaFFruZEqK4dykBeWB94FLLk4 zHJu5p9OWFEG9LFearys0S0J7vA79yLNpaMIh87hA4/PWynRluED8fjouAhPUJ4FaDvGj3849yS Fb1c= X-Google-Smtp-Source: AGHT+IEX8BPbI+Uspvd6hlS1L6kD1r/n31SaoBBK7fdOERooqOo9yLQcoozSvCe+X8hABG0SUUEteQ== X-Received: by 2002:a05:6358:9486:b0:1a6:7af3:22ce with SMTP id e5c5f4694b2df-1ac901cd215mr127136755d.2.1721118505875; Tue, 16 Jul 2024 01:28:25 -0700 (PDT) From: Akihiko Odaki Date: Tue, 16 Jul 2024 17:28:14 +0900 Subject: [PATCH v2 2/5] target/arm: Allow setting 'pmu' only for host and max MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240716-pmu-v2-2-f3e3e4b2d3d5@daynix.com> References: <20240716-pmu-v2-0-f3e3e4b2d3d5@daynix.com> In-Reply-To: <20240716-pmu-v2-0-f3e3e4b2d3d5@daynix.com> To: Peter Maydell , Thomas Huth , Laurent Vivier , Paolo Bonzini Cc: qemu-arm@nongnu.org, qemu-devel@nongnu.org, kvm@vger.kernel.org, Akihiko Odaki X-Mailer: b4 0.14-dev-fd6e3 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::c34; envelope-from=akihiko.odaki@daynix.com; helo=mail-oo1-xc34.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, SPF_HELO_NONE=0.001, SPF_NONE=0.001 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20230601.gappssmtp.com) X-ZM-MESSAGEID: 1721118586873116600 Setting 'pmu' does not make sense for CPU types emulating physical CPUs. Signed-off-by: Akihiko Odaki --- target/arm/cpu.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 14d4eca12740..8c180c679ce2 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -1594,6 +1594,13 @@ static bool arm_get_pmu(Object *obj, Error **errp) static void arm_set_pmu(Object *obj, bool value, Error **errp) { ARMCPU *cpu =3D ARM_CPU(obj); + const char *typename =3D object_get_typename(obj); + + if (strcmp(typename, ARM_CPU_TYPE_NAME("host")) && + strcmp(typename, ARM_CPU_TYPE_NAME("max"))) { + error_setg(errp, "Setting 'pmu' is only supported by host and max"= ); + return; + } =20 if (value) { if (kvm_enabled() && !kvm_arm_pmu_supported()) { --=20 2.45.2