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 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 2AD5ACCD1BF for ; Thu, 23 Oct 2025 11:51:34 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vBtnI-0007G2-Rz; Thu, 23 Oct 2025 07:47:49 -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 1vBtmk-00068m-4Y for qemu-arm@nongnu.org; Thu, 23 Oct 2025 07:47:15 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vBtmi-00022p-0G for qemu-arm@nongnu.org; Thu, 23 Oct 2025 07:47:13 -0400 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-471075c0a18so7950925e9.1 for ; Thu, 23 Oct 2025 04:47:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1761220030; x=1761824830; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=KkbYxHoIb89CcjxtDzTwkp8toB1u3wHDHZNoatR4q6A=; b=tQ2FD4x7hjWKRq/wvTJV24b1bhtPm9U0aYGy1lDEOAVPQ5Tl1pHZoA3GZJl+uanAjm IJLum+6edCBJ4UFsYrnMWyRt032YQIQV1jRS+/wKh5DEGxmt2XaMy7YJLmKaQ3qy9OPp L7Fyr72P8WqLsqs9ME69RR12t9/D9ZMsm+IMoB1d9jmw2NzL8fxuKFtWWcqcNru78U8U t9X7d0412o8F6qd3gHg9miW54LOxl7XsZj4LTJzjdkxwNZYL5Lw/ymP2mtjZXXS1I+3n T3aM8WieBPv3IETrv2SnWulKzUyYVRSbGbDFECPzOOPxKpZWs5a7jJobm4BDtVQc8vhZ W0OQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761220030; x=1761824830; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KkbYxHoIb89CcjxtDzTwkp8toB1u3wHDHZNoatR4q6A=; b=XYHk14DCMj5KK+3HS1Nl4OA7hvzGw+72F8gKWYNpURi2g4PRpryD1liBoJvQpVJB3u DEqPHmM4ArdNuY3VdALb1eA4OfAaL5rKdRj4E84/GIb/IN2fGi8Nxf0eGLkpZmaqKGLQ ZfpmRmlhha2CV+FguDPzr+ZpRkwH56XLWCfovQSSJowzDVEzqpedbq5uVa12XQ0mxbg8 COKvIuaUpZKmCspmwtl5jdPU96Zta2xYuWbLDkQN+lkrKcpnqyMnDnFXWQDHdetpksVB f8cpxa0vjGR4xz+L00TRMw4aqFrVeIt6qpReJZkpEV9cAZJLU2ieOp9hrqREQOam2H53 5qLw== X-Forwarded-Encrypted: i=1; AJvYcCWJwdXuyWquNnCh0kWrEdFLxk0i7riWE2uVr/4n0jryn2s759xzP3SkWGKSwm1N9shgCvAeeEe6jQ==@nongnu.org X-Gm-Message-State: AOJu0YwoQm2ycUKPNLV3IUSXZNuDI5dfo3L21uAk1ai6bAlhe8yneWwt CyW+tXxAfOyyQ1ok3Ly5JYTNEygiKFu1iv2VNILq2dmNE/TfcvcjXSwbNfqZPga8W7s= X-Gm-Gg: ASbGncvFc2ctfnGNJnUa/Wd9520Tdm5nLwueMtt0FZepePmUWddsLm/appl3UPNDRcP pUVORR6iW57I0sxzTbo2ZCA+ByCYQ1O75Pj0/xlTigotn1Y3Ii5ZJa72SCYotK+cxNL0ACu52WP 8f9TxeM6/MqJDAGYI/E3TXRzHM7W9S+byV3aIt0bdSr9ck3vuK5k4uRIZiAMrGiQ3B7AGwEpmys h++heV6dYVo33IIM7EcBGy7lu/idci5caW7aKIXIwx++qbKhf4OWv5EOtl2CBmXLzggT7F6bQLe mGpWnBIkRzhGgUDE8SRI1poH38ac/Gjpzd/oms/jYW7gKraKnf0yll6qYxIAi6SFwwhRoCgC5nN DEoUv6hNKchZYz8NV7rCJgjKGBe3TzJzoZnC3lyWIddRXFN1JCMZd/KcS9Kq++/UrqqlS3eCxtI AcinzMDOQEA4YNbnKhauTcTGb+XBEMby4zgant1M4VZe0A/AqNbabAFOZUCQyD X-Google-Smtp-Source: AGHT+IEqdT6ZWlTexgzs/QHM9TkoBB+5Z18vsHyBCjD8vD9/1grdDB4Dlk+S91jyQocD4B90fUZwIw== X-Received: by 2002:a05:600c:548c:b0:46e:45ff:5bdb with SMTP id 5b1f17b1804b1-4711787060fmr193393455e9.8.1761220030338; Thu, 23 Oct 2025 04:47:10 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-475c4342946sm93131315e9.10.2025.10.23.04.47.09 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 23 Oct 2025 04:47:09 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Cameron Esfahani , Peter Maydell , Stefan Hajnoczi , Richard Henderson , Roman Bolshakov , Mohamed Mediouni , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Alexander Graf , Paolo Bonzini , Mads Ynddal , qemu-arm@nongnu.org, Peter Collingbourne , Phil Dennis-Jordan Subject: [PATCH v2 06/58] accel/hvf: Rename hvf_put|get_registers -> hvf_arch_put|get_registers Date: Thu, 23 Oct 2025 13:45:43 +0200 Message-ID: <20251023114638.5667-7-philmd@linaro.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251023114638.5667-1-philmd@linaro.org> References: <20251023114638.5667-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-arm-bounces+qemu-arm=archiver.kernel.org@nongnu.org Sender: qemu-arm-bounces+qemu-arm=archiver.kernel.org@nongnu.org hvf_put_registers() and hvf_get_registers() are implemented per target, rename them using the 'hvf_arch_' prefix following the per target pattern. Since they call hv_vcpu_set_reg() / hv_vcpu_get_reg(), mention they must be called on the vCPU. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Mads Ynddal --- include/system/hvf_int.h | 6 ++++-- accel/hvf/hvf-accel-ops.c | 2 +- target/arm/hvf/hvf.c | 8 +++++--- target/i386/hvf/hvf.c | 2 +- target/i386/hvf/x86hvf.c | 4 ++-- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/include/system/hvf_int.h b/include/system/hvf_int.h index 32b32e1d024..8fce627b08c 100644 --- a/include/system/hvf_int.h +++ b/include/system/hvf_int.h @@ -74,12 +74,14 @@ hv_return_t hvf_arch_vm_create(MachineState *ms, uint32_t pa_range); int hvf_arch_init_vcpu(CPUState *cpu); void hvf_arch_vcpu_destroy(CPUState *cpu); hvf_slot *hvf_find_overlap_slot(uint64_t, uint64_t); -int hvf_put_registers(CPUState *); -int hvf_get_registers(CPUState *); void hvf_kick_vcpu_thread(CPUState *cpu); /* Must be called by the owning thread */ int hvf_arch_vcpu_exec(CPUState *); +/* Must be called by the owning thread */ +int hvf_arch_put_registers(CPUState *); +/* Must be called by the owning thread */ +int hvf_arch_get_registers(CPUState *); struct hvf_sw_breakpoint { vaddr pc; diff --git a/accel/hvf/hvf-accel-ops.c b/accel/hvf/hvf-accel-ops.c index 005e2bd891a..3e5feecd8a7 100644 --- a/accel/hvf/hvf-accel-ops.c +++ b/accel/hvf/hvf-accel-ops.c @@ -81,7 +81,7 @@ hvf_slot *hvf_find_overlap_slot(uint64_t start, uint64_t size) static void do_hvf_cpu_synchronize_state(CPUState *cpu, run_on_cpu_data arg) { if (!cpu->vcpu_dirty) { - hvf_get_registers(cpu); + hvf_arch_get_registers(cpu); cpu->vcpu_dirty = true; } } diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c index 9111c1d717b..f0a0e5d1a75 100644 --- a/target/arm/hvf/hvf.c +++ b/target/arm/hvf/hvf.c @@ -424,7 +424,7 @@ static const hv_sys_reg_t hvf_sreg_list[] = { #undef DEF_SYSREG -int hvf_get_registers(CPUState *cpu) +int hvf_arch_get_registers(CPUState *cpu) { ARMCPU *arm_cpu = ARM_CPU(cpu); CPUARMState *env = &arm_cpu->env; @@ -564,7 +564,7 @@ int hvf_get_registers(CPUState *cpu) return 0; } -int hvf_put_registers(CPUState *cpu) +int hvf_arch_put_registers(CPUState *cpu) { ARMCPU *arm_cpu = ARM_CPU(cpu); CPUARMState *env = &arm_cpu->env; @@ -692,11 +692,12 @@ int hvf_put_registers(CPUState *cpu) static void flush_cpu_state(CPUState *cpu) { if (cpu->vcpu_dirty) { - hvf_put_registers(cpu); + hvf_arch_put_registers(cpu); cpu->vcpu_dirty = false; } } +/* Must be called by the owning thread */ static void hvf_set_reg(CPUState *cpu, int rt, uint64_t val) { hv_return_t r; @@ -709,6 +710,7 @@ static void hvf_set_reg(CPUState *cpu, int rt, uint64_t val) } } +/* Must be called by the owning thread */ static uint64_t hvf_get_reg(CPUState *cpu, int rt) { uint64_t val = 0; diff --git a/target/i386/hvf/hvf.c b/target/i386/hvf/hvf.c index b2bf59cb483..76a58cb0350 100644 --- a/target/i386/hvf/hvf.c +++ b/target/i386/hvf/hvf.c @@ -734,7 +734,7 @@ int hvf_arch_vcpu_exec(CPUState *cpu) do { if (cpu->vcpu_dirty) { - hvf_put_registers(cpu); + hvf_arch_put_registers(cpu); cpu->vcpu_dirty = false; } diff --git a/target/i386/hvf/x86hvf.c b/target/i386/hvf/x86hvf.c index a502437c303..afcf737759b 100644 --- a/target/i386/hvf/x86hvf.c +++ b/target/i386/hvf/x86hvf.c @@ -236,7 +236,7 @@ void hvf_get_msrs(CPUState *cs) env->tsc = rdtscp() + rvmcs(cs->accel->fd, VMCS_TSC_OFFSET); } -int hvf_put_registers(CPUState *cs) +int hvf_arch_put_registers(CPUState *cs) { X86CPU *x86cpu = X86_CPU(cs); CPUX86State *env = &x86cpu->env; @@ -280,7 +280,7 @@ int hvf_put_registers(CPUState *cs) return 0; } -int hvf_get_registers(CPUState *cs) +int hvf_arch_get_registers(CPUState *cs) { X86CPU *x86cpu = X86_CPU(cs); CPUX86State *env = &x86cpu->env; -- 2.51.0