From nobody Wed Nov 27 00:47:24 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; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1701947516; cv=none; d=zohomail.com; s=zohoarc; b=GBsyQMBFOq/9Me1xw2Pma838bsnfjFj+wjeezgLkPZ+SiBuluQNgIIp4krxtvvJigXZ7RvyHdLU4L1H6OPOyEokZgvTNgEj5zdAewvewBXcdZR1pjPvVEL9A1dSmktRGSN6x01JhQ87+2tSAQMfL9RH5hlz9YskVc1U/b0SijHE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1701947516; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=dXjSCK34R3h3M/dmvhhSfTZBGg4aHS/PwIXNQt3mFHo=; b=WtmxPmd7HY1TAFLF4cBzknfj1trEp766tKFCvJ1it7gZLQCFtgJY0wOGd9CC7ndPXko2fe08iOkZX6ksI80dWXhHVgp2vzn8mimIxuqoK7WNksTV0GzPhfgML08oGcaTrL7iBhcxF6IIefVgSZeRAK54Z7SDiyvyeEu7vu2yJko= 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; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1701947516495557.9838782779715; Thu, 7 Dec 2023 03:11:56 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rBCHS-0002fK-OS; Thu, 07 Dec 2023 06:10:58 -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 1rBCHO-0002et-SA for qemu-devel@nongnu.org; Thu, 07 Dec 2023 06:10:55 -0500 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rBCHM-0004fc-DM for qemu-devel@nongnu.org; Thu, 07 Dec 2023 06:10:54 -0500 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-33350fcb2c7so554241f8f.2 for ; Thu, 07 Dec 2023 03:10:51 -0800 (PST) Received: from m1x-phil.lan ([176.187.202.111]) by smtp.gmail.com with ESMTPSA id dh8-20020a0560000a8800b00334b3208700sm1163670wrb.49.2023.12.07.03.10.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 07 Dec 2023 03:10:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1701947450; x=1702552250; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=dXjSCK34R3h3M/dmvhhSfTZBGg4aHS/PwIXNQt3mFHo=; b=xCi6Avti5xKEQm9LD9/SfZn/y2orBbrDkWY8PCl2PyFh+dD01GFD1BMxW0rlc3BVJy NtFMiz5OkmEf6i9rVtX0kZes/PXAdqcG6hkODhDU7bwrQPTc1vRhC99bjnTtv7A3ae3c gAw4Acd8ruucS9yKDlsXfeAVEiTGWkT7PBY7KZxv197oxrMRPWyhcCfvOMJIeU/rbusK /t9hVGqfBQjOQPAhRAL57iOK9/bMvCSfMqHeXpydgXfFOs/uLVI5eXeFBzlMDRJ+YP8x 4jkaY9QLOB+YSMlxOwQGyJenC8nXWx+cNI4xVKWLPllhz0op6J9cuBsqVMdfqDGF/6cb 4S8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701947450; x=1702552250; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=dXjSCK34R3h3M/dmvhhSfTZBGg4aHS/PwIXNQt3mFHo=; b=rK4fhlf3OtvwzmAXaOgEAMuGMZCKau8XwPFeDpJOIjlFh7kDj7KUtIxOzVR5Isml7h 9hgrMpUr+GgnJU8PqWOjovALrWCRDCRUVqm6x8y4nw6Y3eWub1w+e0yihlx+PmIT0zzy OIzugZv4bp6fBlUWBf4c/Kw3FPriGb15g44YewU6ICgHupbEAky+r/eJW39G77cQZlZp YLG2PBZ89Ooz6VVRw12W5CXtaO3WnI+LuFe9liNGAAG8CWDoGARWGDCEsW2bdRMDjKeD fYaySyfSBwj0TbeQAcPL3mQ18Cb+nu9QaXFdgB0750XPD2G+DLYXnYrFfSjfYz1vr+xd 8MBA== X-Gm-Message-State: AOJu0YzhRhUBtPoHeA8ZFuo4ErXFihpp8sRTFvFA1iOpRgzoQ5coc5tT CGGMHAUmmIAUDPtk8uKr+UeXbE4H0DFnNcRz0Ho= X-Google-Smtp-Source: AGHT+IGDzvoxJKYv0VrwfJCWpSQOGCJ1BYf3WcTdNe1ai2rwhhVxV93ov5MtzW7LMftESmmiyTzJ+g== X-Received: by 2002:adf:fac2:0:b0:333:2fd2:816a with SMTP id a2-20020adffac2000000b003332fd2816amr1413317wrs.135.1701947450369; Thu, 07 Dec 2023 03:10:50 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH] target/arm: Restrict ARM_FEATURE_PMU to system emulation Date: Thu, 7 Dec 2023 12:10:48 +0100 Message-ID: <20231207111048.50568-1-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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: pass client-ip=2a00:1450:4864:20::429; envelope-from=philmd@linaro.org; helo=mail-wr1-x429.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=ham 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 @linaro.org) X-ZM-MESSAGEID: 1701947518588100001 ARM Performance Monitor Unit is not reachable from user emulation, restrict it to system emulation. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/arm/cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 51f57fd5b4..60cf747fd6 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -1410,6 +1410,7 @@ static Property arm_cpu_pmsav7_dregion_property =3D pmsav7_dregion, qdev_prop_uint32, uint32_t); =20 +#ifndef CONFIG_USER_ONLY static bool arm_get_pmu(Object *obj, Error **errp) { ARMCPU *cpu =3D ARM_CPU(obj); @@ -1432,6 +1433,7 @@ static void arm_set_pmu(Object *obj, bool value, Erro= r **errp) } cpu->has_pmu =3D value; } +#endif =20 unsigned int gt_cntfrq_period_ns(ARMCPU *cpu) { @@ -1592,12 +1594,12 @@ void arm_cpu_post_init(Object *obj) if (arm_feature(&cpu->env, ARM_FEATURE_EL2)) { qdev_property_add_static(DEVICE(obj), &arm_cpu_has_el2_property); } -#endif =20 if (arm_feature(&cpu->env, ARM_FEATURE_PMU)) { cpu->has_pmu =3D true; object_property_add_bool(obj, "pmu", arm_get_pmu, arm_set_pmu); } +#endif =20 /* * Allow user to turn off VFP and Neon support, but only for TCG -- --=20 2.41.0