From nobody Sun Nov 24 19:40:44 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=1721118601; cv=none; d=zohomail.com; s=zohoarc; b=RELsUHz41+1zIMrE9RqhqJ39TkLDNpD4riCZbWw2e/CySJaKx7BXjW9WPDYw4Xb5byQqWgHk9sc2yam5/R9lAqoZ6xI8Xgh6DD2bOHzQHHBQ9mzVp5Kd7HpEQNvY/lMlZfearWcAL5Jw4ng+X41aXm/dMjyJ7hWNOjcHLnKAsj4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1721118601; 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=1KxAC9/Pxe3NsDzOqPZpbEql5jfhTTEPjoaJwE6M8sE=; b=LzirpyxmhuSCGy9xpgfFQskyBj/tpNQHITr+jRBqgESs7/07tJOHeAbQkgqvk5+QkTs4wpI1wCVLog3omesyZcsbQo8sqvMCG8x+6VJbHF6QdilWU1JCPi656+0zfuYBx5dESsobWdBM3fcnLMstEjZNRCPdRu7bjolHe5ohjYs= 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 1721118601263956.4952394897335; Tue, 16 Jul 2024 01:30:01 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sTdYD-0006S6-Nf; Tue, 16 Jul 2024 04:28:45 -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 1sTdYB-0006GN-0e for qemu-devel@nongnu.org; Tue, 16 Jul 2024 04:28:43 -0400 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sTdY9-00022B-DL for qemu-devel@nongnu.org; Tue, 16 Jul 2024 04:28:42 -0400 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1fb70169c23so40829995ad.1 for ; Tue, 16 Jul 2024 01:28:40 -0700 (PDT) Received: from localhost ([157.82.128.7]) by smtp.gmail.com with UTF8SMTPSA id d9443c01a7336-1fc0bb6ffdesm54720525ad.53.2024.07.16.01.28.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 16 Jul 2024 01:28:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1721118519; x=1721723319; 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=1KxAC9/Pxe3NsDzOqPZpbEql5jfhTTEPjoaJwE6M8sE=; b=cuJiZasr5IZIIJxFtqh6PnNU875JUyI5Hkn5H94PaMFvxcK/9Tgl8kd+Dq36ZIU9l7 lMyVCmEmBDKMSsj2wSpyJiMqK/QZ4qF6rzapdqnA0RyRYfd1lnxx5vD6ZCmOfta0btUC CeCoG6RM80DP7u0VbPbyEgSrEmlayeM8BSmEso5o8aI9AfV8X+IZunRqqXjp8pSa/lBJ lsHP30FheeGwMbiZfVGSU1eOKjEz7lYzdDbQtm8Gw3DxLG3SSIq3IGzJs3VBfLXeSi4r s5QenjPx7uEbURg6YGuEczFf5h+wRB5wvMh2lzRqOF0zc5hfyFYzhVpyQkBjzTRkPvpd vLNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721118519; x=1721723319; 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=1KxAC9/Pxe3NsDzOqPZpbEql5jfhTTEPjoaJwE6M8sE=; b=vCXNdB47n82j7shFpXI+TBAPyxQ+ghwr1O3ANIjwj5i8jY8wQo8SSCVl+dijzlUWKt Y6JG5UZVn0WtGfd216n8FKH8ZCSaU3LH8EFM7+P55xBNgyRzf+owJcPtJqXeJtY4pbV4 eeZf6ZOsyzNpz74XCVIIdtQORYQmVaETWfouPLe9AHl/uQiQxSJIfba011z2wSXnzrp+ aDBSqmRJU4ZBXE2CJtyfEcVO/k3XLyyl+6g9vEu1IfFJ4Ar9AwbHxdGvf9Fjfv0oCxEl fg2A4IKWSm4xz5KU0uJQpjlfwEEPUDLWNvkdosRfgKg/ZHbwJ3pWIwkusxQhZymHZ+qA V0yg== X-Forwarded-Encrypted: i=1; AJvYcCUe/5hwTTor5hiHXh8dppMS9fO6I9PdHDUONpmmcXr+xt+OrELN6SXZiaU8LESPI1kZshVXaZ3BC79Uhb4qkrMSeG52LCk= X-Gm-Message-State: AOJu0YxDTplmvVYPCxHkulxQtsc23UcMbhq+4VBOa2LKtBbWaU8o+3Or vFtQ+1dakoh1i6DZpN94C9JiDI+PGCazGajeuAq4W3p5z9fY1vkFHS9Oxume5LJ3rxHM26VLbx2 QkMo= X-Google-Smtp-Source: AGHT+IFrqJjHfkW1n1U+uCFdO309idp+NxLuzCYnpw8ARqcXhMW5rN8oEf3Ut488eOfutxc39v5t2g== X-Received: by 2002:a17:903:234e:b0:1fb:b35:2fcb with SMTP id d9443c01a7336-1fc3d92d0c7mr11461215ad.2.1721118519582; Tue, 16 Jul 2024 01:28:39 -0700 (PDT) From: Akihiko Odaki Date: Tue, 16 Jul 2024 17:28:17 +0900 Subject: [PATCH v2 5/5] target/arm/kvm: Report PMU unavailability MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240716-pmu-v2-5-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::62d; envelope-from=akihiko.odaki@daynix.com; helo=mail-pl1-x62d.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+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: 1721118602946116600 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 an= d 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 70f79eda33cd..b20a35052f41 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -280,6 +280,7 @@ static bool kvm_arm_get_host_cpu_features(ARMHostCPUFea= tures *ahcf) if (kvm_arm_pmu_supported()) { init.features[0] |=3D 1 << KVM_ARM_VCPU_PMU_V3; pmu_supported =3D true; + features |=3D 1ULL << ARM_FEATURE_PMU; } =20 if (!kvm_arm_create_scratch_host_vcpu(cpus_to_try, fdarray, &init)) { @@ -448,7 +449,6 @@ static bool kvm_arm_get_host_cpu_features(ARMHostCPUFea= tures *ahcf) features |=3D 1ULL << ARM_FEATURE_V8; features |=3D 1ULL << ARM_FEATURE_NEON; features |=3D 1ULL << ARM_FEATURE_AARCH64; - features |=3D 1ULL << ARM_FEATURE_PMU; features |=3D 1ULL << ARM_FEATURE_GENERIC_TIMER; =20 ahcf->features =3D features; --=20 2.45.2