Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F0C9621D591 for ; Thu, 15 May 2025 15:41:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747323668; cv=none; b=VPDVvbFjGkj2baokvKTxfMSSnOz80jZ6y5yMYVNQsR5Sr+t+P2qsh9aaQhiClPNtQDmNFJZ2Xf8cH6sO3c+BOnwoituHKqMPrGvQcWKclx8MeTqA9nXL/hH7ubj3O5TcaiavfHDpsUBmdwdruM2orP/IZRGu8MNtwR9t5pl87g4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747323668; c=relaxed/simple; bh=SYyrNCo3K7R61ZBjsvP8OdXYFeiStpY4MImNSuiOupY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-type; b=sXYOJJQnkUrC+3ascltuITMHwho0H8aJDYnUcJdI13NzTu8qn26BvGgCg9mAXuDAVCIT84gfKfRSclK8bPEwMHExOiUJU3BDrEMkZVnXnzf3biOnbAvIrsjQzS9ClwINh6xhxUVO526yfbuiaOGUYFeOLxQkNDmTq6ah22ufcE0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Stv5aRrD; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Stv5aRrD" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1747323665; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ujhpAeNbvkPuTAuN/7tsjfNaVw5JmoHfwuVyChSTibM=; b=Stv5aRrD4/rkWqRhb6gDl5HHbTviPMePHH16eaKt3OJARNiSDYoRnlYtcc57odgR+HkG9/ JrN6REMlDoFUfijfB2SoNTMlPfKBAjHltmLtW95xz2FUL9lsabtVfwbt8d9slpDF6n8T22 6PjiIyjqwevF9N/qaXdbLTUeEfdjdLw= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-484-pouvp3yCOLKtFsmVIGFRug-1; Thu, 15 May 2025 11:41:02 -0400 X-MC-Unique: pouvp3yCOLKtFsmVIGFRug-1 X-Mimecast-MFC-AGG-ID: pouvp3yCOLKtFsmVIGFRug_1747323660 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9B473180045C; Thu, 15 May 2025 15:41:00 +0000 (UTC) Received: from gondolin.redhat.com (unknown [10.45.225.145]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1EC3C1956066; Thu, 15 May 2025 15:40:53 +0000 (UTC) From: Cornelia Huck To: eric.auger.pro@gmail.com, eric.auger@redhat.com, qemu-devel@nongnu.org, qemu-arm@nongnu.org, kvmarm@lists.linux.dev, peter.maydell@linaro.org, richard.henderson@linaro.org, alex.bennee@linaro.org, maz@kernel.org, oliver.upton@linux.dev, sebott@redhat.com, shameerali.kolothum.thodi@huawei.com, armbru@redhat.com, berrange@redhat.com, abologna@redhat.com, jdenemar@redhat.com, agraf@csgraf.de Cc: shahuang@redhat.com, mark.rutland@arm.com, philmd@linaro.org, pbonzini@redhat.com, Cornelia Huck Subject: [PATCH v7 14/14] arm/kvm: use fd instead of fdarray[2] Date: Thu, 15 May 2025 17:39:07 +0200 Message-ID: <20250515153907.151174-15-cohuck@redhat.com> In-Reply-To: <20250515153907.151174-1-cohuck@redhat.com> References: <20250515153907.151174-1-cohuck@redhat.com> Precedence: bulk X-Mailing-List: kvmarm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-type: text/plain Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 We have fd, so might as well neaten things up. Suggested-by: Eric Auger Reviewed-by: Eric Auger Signed-off-by: Cornelia Huck --- target/arm/kvm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/target/arm/kvm.c b/target/arm/kvm.c index 6c665334658b..a954a08a0fc3 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -348,11 +348,11 @@ static bool kvm_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf) err |= get_host_cpu_reg(fd, ahcf, ID_ISAR6_EL1_IDX); err |= get_host_cpu_reg(fd, ahcf, ID_MMFR4_EL1_IDX); - err |= read_sys_reg32(fdarray[2], &ahcf->isar.mvfr0, + err |= read_sys_reg32(fd, &ahcf->isar.mvfr0, ARM64_SYS_REG(3, 0, 0, 3, 0)); - err |= read_sys_reg32(fdarray[2], &ahcf->isar.mvfr1, + err |= read_sys_reg32(fd, &ahcf->isar.mvfr1, ARM64_SYS_REG(3, 0, 0, 3, 1)); - err |= read_sys_reg32(fdarray[2], &ahcf->isar.mvfr2, + err |= read_sys_reg32(fd, &ahcf->isar.mvfr2, ARM64_SYS_REG(3, 0, 0, 3, 2)); err |= get_host_cpu_reg(fd, ahcf, ID_PFR2_EL1_IDX); err |= get_host_cpu_reg(fd, ahcf, ID_DFR1_EL1_IDX); @@ -390,7 +390,7 @@ static bool kvm_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf) if (pmu_supported) { /* PMCR_EL0 is only accessible if the vCPU has feature PMU_V3 */ - err |= read_sys_reg64(fdarray[2], &ahcf->isar.reset_pmcr_el0, + err |= read_sys_reg64(fd, &ahcf->isar.reset_pmcr_el0, ARM64_SYS_REG(3, 3, 9, 12, 0)); } -- 2.49.0