From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 42CD5CDB46E for ; Thu, 12 Oct 2023 15:02:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: References:Message-ID:In-Reply-To:Subject:cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=J8ZzST0NX420ofOko1A6TXWWkxeXb4KXCymPMsiUamk=; b=su8FwW7Rlp50qOuvgzcTgo4bqE cCkItMxRJ85hbtj3xTeHgDUQi7pXdl51ISilb3b/hXH/oZTykLNBg4XQ4pj7bMRsszPmHUK8zL71N 3IfY+kZEgqlhLXzvy7RbyKtA5ppN86vz+cUrtTkaXGTJOyXgG7DDtkpk/CFrHRJeHGrS/AsKlBSiu O4jPuLZtFbrS4Z7jJoz0HagsaHgst3UnxTKvj/95GONrvxZeVu0GaXcygOc/q/yFbMmhgFYjJzT1H /4A0eipvlgz6QBOJOsdL48P4yThGGkdzRzgePbbARNS8nRT3T0+XPyT23vK6EDebTkcOvxefRY0la WEpFjuWQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qqxCZ-001Ez2-0P; Thu, 12 Oct 2023 15:02:15 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qqxCW-001Ewl-05 for linux-arm-kernel@lists.infradead.org; Thu, 12 Oct 2023 15:02:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697122929; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=jKaXXBt2+qIaeU2ajxDNKYR9u7kL2ReXZiI2k8PWqRI=; b=AJ/hrUuEokFJBCYR7o7as1iS1Rw3POc2Pu2KC8DTZ8SLk/aiDuhFg06Ca6RQQVOi2yrPlb v6e736GtYHDkP9+fEVDHULJ2EGgnVUMaCOgya+DYUaaPW8N8CQ/j69J2Jy7AOViREaFT4E kdNVQ5rbYFcLgNnFWqXAioVEPYZ7AMg= Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-503-M2ze_RisMye1lcXUpYubJw-1; Thu, 12 Oct 2023 11:02:06 -0400 X-MC-Unique: M2ze_RisMye1lcXUpYubJw-1 Received: by mail-qv1-f71.google.com with SMTP id 6a1803df08f44-66d12b547e2so10881246d6.0 for ; Thu, 12 Oct 2023 08:02:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697122922; x=1697727722; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=NqKWWi4N1dQcUV0pCxNw2tgDBfyOJnn+/IdI3vL5BCQ=; b=ldnj8H1Qy01r4SwrCUelZWOzjsNNIUkrfekAiGLlNICjK8HQqS3XQdKXI2Swqs2ljM f5ydt8pbAOqvojFLzYnWWQLgup6GQdo/bsFpNu2oXAuqQjwPpDoWbsMjIquBeIKHEznR +TFKHKuDKX4pM3Q8PR15kbiQsMvCJXTrStMuc9P6+ZoXysQWYWC61sK1Ig3iBjoDyBcb yZYPi9sC2vf+QjpHDPak7EW1czGy3zi7b3B21Hd0oRM0kuv4jPF+nMcRsLUfVxT9Hgex oavuc7ykq0IfBrbY+CiFcGJmdUQXxgNzeG+swXtqrwlJGwCRVS9c3TGjLWnobjXo4G8o phrw== X-Gm-Message-State: AOJu0YykmPbOD8xIq1bHukMgs3x/ga+71V3qhI7t6NNbvutmCcrfDuER t3dyuz5bIu39FIZFwDCAhr9z7JKyac3S58o2vkqoQmmafzm0OHfVOrmn9g2GWtQjbR8VjEnxCA0 htGu49NFRcDs3YGaqlvnJ4b427AMFej7NoqQ= X-Received: by 2002:a05:6214:5b03:b0:65d:1265:48c5 with SMTP id ma3-20020a0562145b0300b0065d126548c5mr25316337qvb.33.1697122921966; Thu, 12 Oct 2023 08:02:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGjRHnSSwx/haWRgrBki1YsFkWJjXmdjCoMi0wMoPVGd/LNcVTz7v5WLv1JGQct9yRT+ZM1Mw== X-Received: by 2002:a05:6214:5b03:b0:65d:1265:48c5 with SMTP id ma3-20020a0562145b0300b0065d126548c5mr25316134qvb.33.1697122919236; Thu, 12 Oct 2023 08:01:59 -0700 (PDT) Received: from rh (p200300c93f266600211746b64b43cdf8.dip0.t-ipconnect.de. [2003:c9:3f26:6600:2117:46b6:4b43:cdf8]) by smtp.gmail.com with ESMTPSA id o15-20020a0cfa8f000000b0066cfbe4e0f4sm2140112qvn.26.2023.10.12.08.01.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 08:01:58 -0700 (PDT) Date: Thu, 12 Oct 2023 17:01:54 +0200 (CEST) From: Sebastian Ott To: Raghavendra Rao Ananta cc: Oliver Upton , Marc Zyngier , Alexandru Elisei , James Morse , Suzuki K Poulose , Paolo Bonzini , Zenghui Yu , Shaoqin Huang , Jing Zhang , Reiji Watanabe , Colton Lewis , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org, kvm@vger.kernel.org Subject: Re: [PATCH v7 10/12] KVM: selftests: aarch64: Introduce vpmu_counter_access test In-Reply-To: <44608d30-c97a-c725-e8b2-0c5a81440869@redhat.com> Message-ID: <65b8bbdb-2187-3c85-0e5d-24befcf01333@redhat.com> References: <20231009230858.3444834-1-rananta@google.com> <20231009230858.3444834-11-rananta@google.com> <44608d30-c97a-c725-e8b2-0c5a81440869@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/mixed; boundary="-1463795790-346822177-1697122918=:6347" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231012_080212_139393_B0AB0FCC X-CRM114-Status: GOOD ( 15.48 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. ---1463795790-346822177-1697122918=:6347 Content-Type: text/plain; charset=ISO-8859-7; format=flowed Content-Transfer-Encoding: 8BIT On Thu, 12 Oct 2023, Sebastian Ott wrote: > On Mon, 9 Oct 2023, Raghavendra Rao Ananta wrote: >> +/* Create a VM that has one vCPU with PMUv3 configured. */ >> +static void create_vpmu_vm(void *guest_code) >> +{ >> + struct kvm_vcpu_init init; >> + uint8_t pmuver, ec; >> + uint64_t dfr0, irq = 23; >> + struct kvm_device_attr irq_attr = { >> + .group = KVM_ARM_VCPU_PMU_V3_CTRL, >> + .attr = KVM_ARM_VCPU_PMU_V3_IRQ, >> + .addr = (uint64_t)&irq, >> + }; >> + struct kvm_device_attr init_attr = { >> + .group = KVM_ARM_VCPU_PMU_V3_CTRL, >> + .attr = KVM_ARM_VCPU_PMU_V3_INIT, >> + }; >> + >> + /* The test creates the vpmu_vm multiple times. Ensure a clean state >> */ >> + memset(&vpmu_vm, 0, sizeof(vpmu_vm)); >> + >> + vpmu_vm.vm = vm_create(1); >> + vm_init_descriptor_tables(vpmu_vm.vm); >> + for (ec = 0; ec < ESR_EC_NUM; ec++) { >> + vm_install_sync_handler(vpmu_vm.vm, VECTOR_SYNC_CURRENT, ec, >> + guest_sync_handler); >> + } >> + >> + /* Create vCPU with PMUv3 */ >> + vm_ioctl(vpmu_vm.vm, KVM_ARM_PREFERRED_TARGET, &init); >> + init.features[0] |= (1 << KVM_ARM_VCPU_PMU_V3); >> + vpmu_vm.vcpu = aarch64_vcpu_add(vpmu_vm.vm, 0, &init, guest_code); >> + vcpu_init_descriptor_tables(vpmu_vm.vcpu); >> + vpmu_vm.gic_fd = vgic_v3_setup(vpmu_vm.vm, 1, 64, >> + GICD_BASE_GPA, GICR_BASE_GPA); >> + >> + /* Make sure that PMUv3 support is indicated in the ID register */ >> + vcpu_get_reg(vpmu_vm.vcpu, >> + KVM_ARM64_SYS_REG(SYS_ID_AA64DFR0_EL1), &dfr0); >> + pmuver = FIELD_GET(ARM64_FEATURE_MASK(ID_AA64DFR0_PMUVER), dfr0); >> + TEST_ASSERT(pmuver != ID_AA64DFR0_PMUVER_IMP_DEF && >> + pmuver >= ID_AA64DFR0_PMUVER_8_0, >> + "Unexpected PMUVER (0x%x) on the vCPU with PMUv3", >> pmuver); >> + >> + /* Initialize vPMU */ >> + vcpu_ioctl(vpmu_vm.vcpu, KVM_SET_DEVICE_ATTR, &irq_attr); >> + vcpu_ioctl(vpmu_vm.vcpu, KVM_SET_DEVICE_ATTR, &init_attr); >> +} > > This one fails to build for me: > aarch64/vpmu_counter_access.c: In function ¡create_vpmu_vm¢: > aarch64/vpmu_counter_access.c:456:47: error: ¡ID_AA64DFR0_PMUVER_MASK¢ > undeclared (first use in this function); did you mean > ¡ID_AA64DFR0_EL1_PMUVer_MASK¢? > 456 | pmuver = FIELD_GET(ARM64_FEATURE_MASK(ID_AA64DFR0_PMUVER), > dfr0); Looks like there's a clash with "KVM: arm64: selftests: Import automatic generation of sysreg defs" from: https://lore.kernel.org/r/20231003230408.3405722-12-oliver.upton@linux.dev ---1463795790-346822177-1697122918=:6347 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ---1463795790-346822177-1697122918=:6347--