From patchwork Sat Jun 29 12:50:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 13716923 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EE9AAC41513 for ; Sat, 29 Jun 2024 12:51:53 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sNXXp-0003hh-Vh; Sat, 29 Jun 2024 08:51:10 -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 1sNXXj-0003gn-9M for qemu-devel@nongnu.org; Sat, 29 Jun 2024 08:51:03 -0400 Received: from mail-oi1-x22c.google.com ([2607:f8b0:4864:20::22c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sNXXh-0006gN-NC for qemu-devel@nongnu.org; Sat, 29 Jun 2024 08:51:02 -0400 Received: by mail-oi1-x22c.google.com with SMTP id 5614622812f47-3d566b147ffso1004070b6e.2 for ; Sat, 29 Jun 2024 05:51:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1719665460; x=1720270260; 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=DvpsKqJKseTB8512E3EM/mcg58HxToRdE8EyOPRZHqA=; b=VjuW9nbTRhNSrwF/hZjfgebxWS9UR+kmw5TreB2ZtEdQLZ6gmg81+2UqqtGGet/NUC PY6JWyi2WyxEtXMvx2oWHQHgEF8yNVqkYGOK1kc0Cjs6pRcR3hsQ5y9cM0SRaQPbFsK7 SJnCE7QAmhGVbxutTXqUOX4N45ok7VZ/3vBlmwLH3Nj8fpgekDrTKGyTUkqw2okmH4W6 1Mx9GmRr2CoxJbTPQ3EzeQBy7iet+BKUdAVWuMGwGOW1/D5xVcb5RKbcfqc+qKAl7oyh X7yjtyVisbV0Y6uJ0Hn/TwGplz/ad/fLkz46uoOXrwoGTK9whTIqq9/sGk21kbpkIcMk 9ykw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719665460; x=1720270260; 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=DvpsKqJKseTB8512E3EM/mcg58HxToRdE8EyOPRZHqA=; b=L7AwTp/QOumceMgANJEIsAeIp+mmv1J7030PE4k5ncRVpkQhg/c9DqLLtlKwT59KEo kIuiTo3ZgzXHNTHNUN0hm0sK3HKw7CGDpMnu3jD76+mDA5u/zrIfWa+QmkoNywRyUoAO fCr4bEgpbjwTUOEZR+9s/rP45tIg7fY8KByHjmHeM0z3iRnow3r4JXjaz37W1+XZyRnK NFhUnutLvMK9YVsF/+QG4ZGxXzD5KRMPkm/JZI1yrpO/cOORpPNOkgmAnfFyuysDn/K3 BmRzTwHgrp2haA+mWsLAYgwli4PYw8nCb3JVE6rd86XNOQeBjhcES5pf1UhG9XeDSiul gehw== X-Forwarded-Encrypted: i=1; AJvYcCWzmmBOX8Swig9/xEGBQRL6iBF57kpQhXm0CljXagV+slGpKgWufbAlobw+qHcoJ4AmP8rV1IPT7UKrwFkmmIN1IxLo+AA= X-Gm-Message-State: AOJu0Yw9w6EtBwUByXeN8pT/BhI9aEU2nmjN627h45HNhZ2kalIcyyOz xdaSLQaJRe4PMFcRTA7eu+NP1lNeOqyrRU1EOC+CeTKYW+A6ZDcRNjOiaQ+dfbY= X-Google-Smtp-Source: AGHT+IGnFk33QJj7zRJvjq34kT9S5rKVUvKwNykZ5WrLJUb8d4LshvqBoKRYEFxOAjs4b/IKgR0gEg== X-Received: by 2002:a05:6808:2204:b0:3d1:fc50:1aae with SMTP id 5614622812f47-3d6b2a2f0d4mr1188382b6e.7.1719665460603; Sat, 29 Jun 2024 05:51:00 -0700 (PDT) Received: from localhost ([157.82.204.135]) by smtp.gmail.com with UTF8SMTPSA id d2e1a72fcca58-708043b7145sm3322714b3a.148.2024.06.29.05.50.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 29 Jun 2024 05:51:00 -0700 (PDT) From: Akihiko Odaki Date: Sat, 29 Jun 2024 21:50:32 +0900 Subject: [PATCH 1/3] tests/arm-cpu-features: Do not assume PMU availability MIME-Version: 1.0 Message-Id: <20240629-pmu-v1-1-7269123b88a4@daynix.com> References: <20240629-pmu-v1-0-7269123b88a4@daynix.com> In-Reply-To: <20240629-pmu-v1-0-7269123b88a4@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: none client-ip=2607:f8b0:4864:20::22c; envelope-from=akihiko.odaki@daynix.com; helo=mail-oi1-x22c.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Asahi Linux supports KVM but lacks PMU support. Signed-off-by: Akihiko Odaki --- tests/qtest/arm-cpu-features.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/qtest/arm-cpu-features.c b/tests/qtest/arm-cpu-features.c index 966c65d5c3e4..cfd6f7735354 100644 --- a/tests/qtest/arm-cpu-features.c +++ b/tests/qtest/arm-cpu-features.c @@ -509,6 +509,7 @@ static void test_query_cpu_model_expansion_kvm(const void *data) assert_set_feature(qts, "host", "kvm-no-adjvtime", false); if (g_str_equal(qtest_get_arch(), "aarch64")) { + bool kvm_supports_pmu; bool kvm_supports_steal_time; bool kvm_supports_sve; char max_name[8], name[8]; @@ -537,11 +538,6 @@ static void test_query_cpu_model_expansion_kvm(const void *data) assert_has_feature_enabled(qts, "host", "aarch64"); - /* Enabling and disabling pmu should always work. */ - assert_has_feature_enabled(qts, "host", "pmu"); - assert_set_feature(qts, "host", "pmu", false); - assert_set_feature(qts, "host", "pmu", true); - /* * Some features would be enabled by default, but they're disabled * because this instance of KVM doesn't support them. Test that the @@ -551,11 +547,18 @@ static void test_query_cpu_model_expansion_kvm(const void *data) assert_has_feature(qts, "host", "sve"); resp = do_query_no_props(qts, "host"); + kvm_supports_pmu = resp_get_feature(resp, "pmu"); kvm_supports_steal_time = resp_get_feature(resp, "kvm-steal-time"); kvm_supports_sve = resp_get_feature(resp, "sve"); vls = resp_get_sve_vls(resp); qobject_unref(resp); + if (kvm_supports_pmu) { + /* If we have pmu then we should be able to toggle it. */ + assert_set_feature(qts, "host", "pmu", false); + assert_set_feature(qts, "host", "pmu", true); + } + if (kvm_supports_steal_time) { /* If we have steal-time then we should be able to toggle it. */ assert_set_feature(qts, "host", "kvm-steal-time", false); From patchwork Sat Jun 29 12:50:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 13716926 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 67477C27C4F for ; Sat, 29 Jun 2024 12:52:27 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sNXXs-0003jU-4E; Sat, 29 Jun 2024 08:51:12 -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 1sNXXp-0003hk-1V for qemu-devel@nongnu.org; Sat, 29 Jun 2024 08:51:09 -0400 Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sNXXm-0006vD-Is for qemu-devel@nongnu.org; Sat, 29 Jun 2024 08:51:08 -0400 Received: by mail-pg1-x52e.google.com with SMTP id 41be03b00d2f7-71910dfb8c0so888277a12.3 for ; Sat, 29 Jun 2024 05:51:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1719665465; x=1720270265; 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=p3Ff167L5PnEkX8Hjv5zeODUS2Rm0iaQ73J60qa2lyQ=; b=Y2FyUvxafM1bnRKsHx++CjP5C2v5O3QApX5R8wOWS9CMmgsmpWdyVS8nVVlUe0cCou 7WLcWrhBx6nWI3FXtugjY/BsBuv0RspVEp7gn9J4mCr1P1rfW7alVfjA/x5HTnbIiIm7 lb3qqi7WRn2TdA6Li6nsw+tV3YcmFPnO42VhvNrj9GOe9DOFfe+8i7mkxLArrVxXrnmR 2Pw6jKIMha5Si85vZkbYQBai7lXbzK15QZhRgGZx6GS7HVnutOMMm67arXUGuAe0E/bA m+7YEQYFIGJxHQtqUpoy2Y63QvtUQjtonhi2E5kwa/IQo4U/LvWzD9ZpfPM21eR6Yl6B rbWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719665465; x=1720270265; 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=p3Ff167L5PnEkX8Hjv5zeODUS2Rm0iaQ73J60qa2lyQ=; b=qXwT8BJwBR7xcoUnqN2lb0qnY+V2CD1Ny62SHBt+QXK0UWoPGQpyd20j1H+4/bjT3m s0MyX68E7WK7T1wlFvYpCww6+FQJPRhqWPDBL50FCHk663PUAblVdmroeQOWHG8TJZA1 E24Qjmqi1PWAuSPOxzbSvMqbnRVVS/bCgMlpgZEx0V04k6t9y47VxyLJqXwV/ygbdjl2 daD/88jgUOvveipM9d0lZ2WM9I03LoKLy3Ff63U0qWY3ortA2Q1mWXxqKBGIyJfdTeSM 7NKSrE/CsCn1TeMs+z6lOhuiysoTuduxNDuUjB1TJO7ETqrfxbkGmRDN6u61bRe2ait3 XF0g== X-Forwarded-Encrypted: i=1; AJvYcCX5g5fguk+G+Y8Ufdz4ueyFhWrwJ0Tpq3fQgTrtr58j+zN1y1LDQ5zJizdwlLi32NcvucHbIuOCYamn7H302dJ5YRPnxgc= X-Gm-Message-State: AOJu0Ywl529esgJXTT2tpF5KElKa5bo1kenv67cABIgEII04uC4yRv7k +M7nTl0rWb8Jso908nK3lLRR1jZ/qqEoGy4bTuQaQqDtn/UErlIol3U2Vt0KQEY= X-Google-Smtp-Source: AGHT+IFCiPS0/8zesPRbyIYow94YbPB6IyyS94I3YzDOLPGWwQAW7sXt9gryc2zlfG/1uWsWHnbXag== X-Received: by 2002:a05:6a20:78a6:b0:1bd:2f6:e400 with SMTP id adf61e73a8af0-1bef624626bmr760352637.47.1719665464771; Sat, 29 Jun 2024 05:51:04 -0700 (PDT) Received: from localhost ([157.82.204.135]) by smtp.gmail.com with UTF8SMTPSA id d9443c01a7336-1fac1535b6esm31432145ad.156.2024.06.29.05.51.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 29 Jun 2024 05:51:04 -0700 (PDT) From: Akihiko Odaki Date: Sat, 29 Jun 2024 21:50:33 +0900 Subject: [PATCH 2/3] target/arm: Always add pmu property MIME-Version: 1.0 Message-Id: <20240629-pmu-v1-2-7269123b88a4@daynix.com> References: <20240629-pmu-v1-0-7269123b88a4@daynix.com> In-Reply-To: <20240629-pmu-v1-0-7269123b88a4@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: none client-ip=2607:f8b0:4864:20::52e; envelope-from=akihiko.odaki@daynix.com; helo=mail-pg1-x52e.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org kvm-steal-time and sve properties are added for KVM even if the corresponding features are not available. Always add pmu property too. Signed-off-by: Akihiko Odaki --- target/arm/cpu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 35fa281f1b98..0da72c12a5bd 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -1770,9 +1770,10 @@ void arm_cpu_post_init(Object *obj) if (arm_feature(&cpu->env, ARM_FEATURE_PMU)) { cpu->has_pmu = true; - object_property_add_bool(obj, "pmu", arm_get_pmu, arm_set_pmu); } + object_property_add_bool(obj, "pmu", arm_get_pmu, arm_set_pmu); + /* * Allow user to turn off VFP and Neon support, but only for TCG -- * KVM does not currently allow us to lie to the guest about its From patchwork Sat Jun 29 12:50:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 13716925 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7EEDBC30659 for ; Sat, 29 Jun 2024 12:51:54 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sNXXt-0003kB-Op; Sat, 29 Jun 2024 08:51:13 -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 1sNXXs-0003jY-Jz for qemu-devel@nongnu.org; Sat, 29 Jun 2024 08:51:12 -0400 Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sNXXr-00076j-3H for qemu-devel@nongnu.org; Sat, 29 Jun 2024 08:51:12 -0400 Received: by mail-pg1-x52e.google.com with SMTP id 41be03b00d2f7-7163489149eso1048141a12.1 for ; Sat, 29 Jun 2024 05:51:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1719665468; x=1720270268; 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=BLXk3fVoBHrMXW9NOMmJn9sejRtpsd5b8rXX3PkXa4Y=; b=AJx8zbOllNUQOXTJ4PkEug7fGAKBFzhckgNJ3XvBvGv129FjGjXawDnakpuMK0LDLN yq2sLXdmMuEm7MUfdFeK36LKaFewQoW834mlyEgvNkJ7cGQNtkWqv0mKZJGA3bgiIw+D MRFnAz3YTDzK45S2eE/kvdMnKk1TD8ATAPyzdMT14nwmRAGL+i5K9guTMBY0GecFi/9m Br6xZbkVXrOtk7IRKuCgcOoAcICeviJYgeMUvSphK7v6RlUvq0njnNkXdCn0lL+BhA4W MgoHvrQKXcEbWGBdDGp6snICUImYwa0CrQBGhRlHO+hu/EirukyGsInfYhG+xClEvdzy Vzyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719665468; x=1720270268; 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=BLXk3fVoBHrMXW9NOMmJn9sejRtpsd5b8rXX3PkXa4Y=; b=FcqW4f7bieJsI6yJNu4ZySA2h8tfzbt+B1SMyhVd5Rmne5IAXvnBLk0puQ2OYppoMT OSeefn3chHAwYus4kyk9wP67cC4puEFYVSiTF4Qes8Vqmsz51DDT57B18oG86GAQw7lP /GhjtJTlst94fcULKlICO+QjGN6JvoA2ManEnIFb11qwHp4kJvLQRW6vImGscEeSagnm HcE/wI5vIP7WHBzkYAehnOydHRHSpoqMFp32TLuE5+5cE8BsnxDZ1kO7JP6TgTJHqo3e 3cgPoKFi9Jg/8E8QTtarguillskepmfBCsbgUA1SR7ME1Hlq3MH/013y58INZtglb6Ud O3Fg== X-Forwarded-Encrypted: i=1; AJvYcCUgxuOehpzlPQS7rvtRyWQEra+B+k2r3zVuay9qqZ5YmdH7Tz5HGII2BWW4KeyjLZcx9ngCzW/jwtTCSmspwicKk8wjbEE= X-Gm-Message-State: AOJu0YzlTGS2biM6UOTbVh3kItcVKD7q4y4GQppBjXE78iYRlQryCyyz IPOdApxVz1JYGrS8g4jE1KqK4eQFMsY9cBHztZ885TtJPVQRXH0xbQK2OLr6Pvk= X-Google-Smtp-Source: AGHT+IG7G8Ijr8L2HKdiqhp40sGsy6gKftpsugRXAdDH+909J0VbPSV3RAHeQhyAI/SMsNkSSEd/nA== X-Received: by 2002:a05:6a20:1590:b0:1b5:ae2c:c729 with SMTP id adf61e73a8af0-1bef611bcf7mr1506320637.19.1719665468263; Sat, 29 Jun 2024 05:51:08 -0700 (PDT) Received: from localhost ([157.82.204.135]) by smtp.gmail.com with UTF8SMTPSA id d9443c01a7336-1fac10c8b3fsm31589815ad.5.2024.06.29.05.51.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 29 Jun 2024 05:51:08 -0700 (PDT) From: Akihiko Odaki Date: Sat, 29 Jun 2024 21:50:34 +0900 Subject: [PATCH 3/3] target/arm/kvm: Report PMU unavailability MIME-Version: 1.0 Message-Id: <20240629-pmu-v1-3-7269123b88a4@daynix.com> References: <20240629-pmu-v1-0-7269123b88a4@daynix.com> In-Reply-To: <20240629-pmu-v1-0-7269123b88a4@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: none client-ip=2607:f8b0:4864:20::52e; envelope-from=akihiko.odaki@daynix.com; helo=mail-pg1-x52e.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org target/arm/kvm.c checked PMU availability but claimed PMU is available even if it is not. In fact, Asahi Linux supports KVM but lacks PMU support. Only advertise PMU availability only when it is really available. Fixes: dc40d45ebd8e ("target/arm/kvm: Move kvm_arm_get_host_cpu_features and unexport") Signed-off-by: Akihiko Odaki --- target/arm/kvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/arm/kvm.c b/target/arm/kvm.c index 7cf5cf31dec4..6bb72c09be10 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -280,6 +280,7 @@ static bool kvm_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf) if (kvm_arm_pmu_supported()) { init.features[0] |= 1 << KVM_ARM_VCPU_PMU_V3; pmu_supported = true; + features |= 1ULL << ARM_FEATURE_PMU; } if (!kvm_arm_create_scratch_host_vcpu(cpus_to_try, fdarray, &init)) { @@ -448,7 +449,6 @@ static bool kvm_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf) features |= 1ULL << ARM_FEATURE_V8; features |= 1ULL << ARM_FEATURE_NEON; features |= 1ULL << ARM_FEATURE_AARCH64; - features |= 1ULL << ARM_FEATURE_PMU; features |= 1ULL << ARM_FEATURE_GENERIC_TIMER; ahcf->features = features;