Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8DC19606A322 for ; Thu, 3 Dec 2026 17:13:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=aBVKTRyv Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xZAMS-0001rU-5o; Thu, 03 Dec 2026 12:12:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xZALL-0008I0-9P for qemu-arm@nongnu.org; Thu, 03 Dec 2026 12:11:41 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xZALJ-0006l0-FI for qemu-arm@nongnu.org; Thu, 03 Dec 2026 12:11:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1796317897; 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=E/Vl11+EdDE/WQK/mKQqgnCx2aw0IBt/iuLHujVObfw=; b=aBVKTRyv8Fv2Dt5Rbr8z+Nux4arvy4c7H6MBV57X60Gn2SLmC7PcOSnRixjtZ+Fajzt6Qd 7wnxlgktFh2ztW9YNZmLg/wq6I3Dk8JAaX9cx6vCI5Wm5c0iFoOCQHEKyK8ZVR7vMELZ4v o5/y7ZVDYdJECjErbXzzkQ4oZqfeoBc= X-MC-Rep: binary re single Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-668-ke0dBdpmOCu0xOUL0L_SqQ-1; Thu, 3 Dec 2026 17:11:32 +0000 X-MC-Unique: ke0dBdpmOCu0xOUL0L_SqQ-1 X-Mimecast-MFC-AGG-ID: ke0dBdpmOCu0xOUL0L_SqQ_1796317890 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 413151920A57; Thu, 3 Dec 2026 17:11:30 +0000 (UTC) Received: from eauger-thinkpadp1gen8.rmtfr.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id CF8671955F7D; Thu, 3 Dec 2026 17:11:26 +0000 (UTC) From: Eric Auger To: eric.auger.pro@gmail.com, eric.auger@redhat.com, qemu-devel@nongnu.org, qemu-arm@nongnu.org, peter.maydell@linaro.org, shaju.abraham@nutanix.com, khushit.shah@nutanix.com, richard.henderson@linaro.org, pbonzini@redhat.com, skolothumtho@nvidia.com, philmd@oss.qualcomm.com Cc: armbru@redhat.com, mbawa@redhat.com, cohuck@redhat.com Subject: [PATCH v11 14/20] target/arm/kvm: Apply SYSREG props Date: Thu, 3 Dec 2026 18:09:03 +0100 Message-ID: <20261203171020.2594683-15-eric.auger@redhat.com> In-Reply-To: <20261203171020.2594683-1-eric.auger@redhat.com> References: <20261203171020.2594683-1-eric.auger@redhat.com> X-Archived-By: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-MFC-PROC-ID: Jk9F5v0hchHtdjb3PF9-vX2_O1C4N9kUvEybf6LCxA4_1796317890 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true Received-SPF: pass client-ip=170.10.133.124; envelope-from=eric.auger@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 3 X-Spam_score: 0.3 X-Spam_bar: / X-Spam_report: (0.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.24, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-arm@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-arm-bounces+qemu-arm=archiver.kernel.org@nongnu.org X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 Now the infrastructure is in place let's trigger the SYSREG prop update in the KVM code. This is done in both kvm_arch_init_vcpu() and kvm_arm_reset_vcpu() after the final vcpu has been initialized with the proper kvm init settings and before kvmstate is synced back to the cpreg list. Signed-off-by: Eric Auger --- v10 -> v11: - get rid of kvm_arm_apply_sysreg_props() and use directly kvm_arm_set_idreg_field v9 -> v10 - use ValueRange --- target/arm/kvm.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/target/arm/kvm.c b/target/arm/kvm.c index c84b304e03..a7f8f0c46b 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -1259,7 +1259,7 @@ bool kvm_arm_cpu_post_load(ARMCPU *cpu) return true; } -static int G_GNUC_UNUSED +static int kvm_arm_set_idreg_field(ARMCPU *cpu, ARM64SysRegField *field, uint64_t newfv, uint64_t *appliedfv, Error **errp) { @@ -1325,6 +1325,9 @@ void kvm_arm_reset_vcpu(ARMCPU *cpu) fprintf(stderr, "kvm_arm_vcpu_init failed: %s\n", strerror(-ret)); abort(); } + + arm_cpu_apply_sysreg_props(cpu, kvm_arm_set_idreg_field, &error_abort); + if (!write_kvmstate_to_list(cpu)) { fprintf(stderr, "write_kvmstate_to_list failed\n"); abort(); @@ -2286,7 +2289,12 @@ int kvm_arch_init_vcpu(CPUState *cs, Error **errp) return ret; } SET_IDREG(&cpu->isar, MPIDR, mpidr); - cpu->mp_affinity = mpidr & ARM64_AFFINITY_MASK; + + ret = arm_cpu_apply_sysreg_props(cpu, kvm_arm_set_idreg_field, errp); + if (ret) { + return ret; + } + cpu->mp_affinity = GET_IDREG(&cpu->isar, MPIDR) & ARM64_AFFINITY_MASK; ret = sync_vcpu_idregs_from_kvm(cpu); if (ret) { -- 2.56.1