From patchwork Thu Nov 23 18:35:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13466557 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="SKtrpCam" Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F4A1D6C for ; Thu, 23 Nov 2023 10:35:28 -0800 (PST) Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-4083f61312eso8901405e9.3 for ; Thu, 23 Nov 2023 10:35:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700764526; x=1701369326; darn=vger.kernel.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=EggnDxiS3lb3CDYKGlg1a7WOxUSv7txLuyeSgPzo5Gg=; b=SKtrpCamdd1fKC6FcsHrqFmRgsCYr3lryf0X9TlczoLckiUIShfSYx1GsY7BqTG03Y mNoyAHCIDQDaM/yZji0uFwpvj00/t6mAT70PCAI7jobE0zNSQ3/qfULqOHkgcoXMzSqJ czwBZ4kxEf8l4RkSHSfcV8P3cGwRD82tdlDzh9topuglmOkWGzxel38MesgSEtjOCpAE P5RmTPBRW/51dS5Dh4W/LWJGkxx8hXCMcIQ+x4vsmaSatSM9h6H//XB2HCYq/rTSjopk iDWBUOcpgSVtKmAtER0mfYlStA6id3Arb2MnpbYSu+ShGWyL5J20L9VBhrGw9mWdV+d+ ivMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700764526; x=1701369326; 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=EggnDxiS3lb3CDYKGlg1a7WOxUSv7txLuyeSgPzo5Gg=; b=NxuxoJW65USN+DQSyF+nTnbP+KGlHPpTGfiIUdkSoqVd/9EfoUseow3PQM8R2I9ubq l1ARZiXLdfUJgwYCTruDuMCLkT54vtvw13Cl10JIAtt4dGHqqajo/kl2vJ/LIF4BVWvT SMTZgHIJHPxZQUo1MGOL+0fCjpWfdt+gw2Gk9gSCdbTPI6lHDZ9xE9RcHMXBWxN4yp3m +BysTV5aIZQlrg/QCEn4gH8xzLHvK1DdXHHKjuqwOTl8gWlsPvaPMWFjoOqu4S+NBS// Fqjw/UIVSsEeyg86uJov009zWQkAio47vVlolC4E4sGFdIYsL4SBsObeGDYnTDPf1QzZ QXVQ== X-Gm-Message-State: AOJu0YzEDJmllSs+wRaa61s6jYi1fr0xlxFqAvWH26/C1eIQHePfyvcA lBh1Y/fCb6jthqMbexLwdPknQQ== X-Google-Smtp-Source: AGHT+IFvWOwOd7e1Y5lDPZTFF3Xq4nOUA9yN5q2GNMAzYiEapwPBFpCHPMn1UoTV4j1koXw+yTkL1A== X-Received: by 2002:a7b:c8cc:0:b0:40b:346c:f3f5 with SMTP id f12-20020a7bc8cc000000b0040b346cf3f5mr345640wml.30.1700764526586; Thu, 23 Nov 2023 10:35:26 -0800 (PST) Received: from m1x-phil.lan ([176.176.165.237]) by smtp.gmail.com with ESMTPSA id t17-20020a05600c451100b0040b379e8526sm2034152wmo.25.2023.11.23.10.35.25 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 23 Nov 2023 10:35:26 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, kvm@vger.kernel.org, Paolo Bonzini , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-9.0 01/16] hw/intc/arm_gicv3: Include missing 'qemu/error-report.h' header Date: Thu, 23 Nov 2023 19:35:02 +0100 Message-ID: <20231123183518.64569-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231123183518.64569-1-philmd@linaro.org> References: <20231123183518.64569-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 kvm_arm_its_reset_hold() calls warn_report(), itself declared in "qemu/error-report.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Gavin Shan --- hw/intc/arm_gicv3_its_kvm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/intc/arm_gicv3_its_kvm.c b/hw/intc/arm_gicv3_its_kvm.c index f7df602cff..3befc960db 100644 --- a/hw/intc/arm_gicv3_its_kvm.c +++ b/hw/intc/arm_gicv3_its_kvm.c @@ -21,6 +21,7 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "qemu/module.h" +#include "qemu/error-report.h" #include "hw/intc/arm_gicv3_its_common.h" #include "hw/qdev-properties.h" #include "sysemu/runstate.h" From patchwork Thu Nov 23 18:35:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13466558 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="UnDT9DEm" Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 922D21B3 for ; Thu, 23 Nov 2023 10:35:33 -0800 (PST) Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-40b394f13b1so941455e9.0 for ; Thu, 23 Nov 2023 10:35:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700764532; x=1701369332; darn=vger.kernel.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=BmQzUMP7VYVa7fjT/YSlrE9ib44vaPa3uhyPvwmHEck=; b=UnDT9DEmJL4iyDTrxQUT6/Q/XH4yQm1oXmf0i3lYbdd0Xbl/RsQfKOOcNuUoc0yftu eMnQL8jNYOZGC8R2o+OEXOg9ruF18O8ZbAE+gYAI8Y59g2utMkGDamvXQeHoHx+VI6P0 P9NxjKieWe0LeBQ1E94AxHEiuZdIRSRJQ9NZ7j4FQm8uAXtwsxumfrnlwkZr4B7MeYdM +qtMrTfZySnZqD3fjieDDZlnEuf27YOAfUVRtL+cx9zZd3fBeX+E7Yn6aEDQ/E+xMGOE gUxzHsfanp9Dy8/9SNjz4Diws2mzZF3M8qlv47mpXdcjo1+b2WjQaVjh04KM2cNDPfMZ oYEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700764532; x=1701369332; 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=BmQzUMP7VYVa7fjT/YSlrE9ib44vaPa3uhyPvwmHEck=; b=oivx6EvP1PeYZNqQFygI+zODky+rZ2LeAoM/lCmDVtEhECNxVlBoHtOZ7yJKvWTFyx CoKj+b7nZk5O1C594mA7aD64qcck/nd4F5+Au+Wr+byLKVsfUu0gQPVC0kVCjbOPaegR mP9sq1UV6fuU97TFCB5dKX2LG0Gpq8Xp1Ij0lcH7YeYUwhP61IKWdXs2bui1HZuTrFd3 bNtVcd4/FGei/g7nwC+OpdWsa6YK77V2Bckv8upInMvvRdogKw+L60NCl2MO597LCeEt wKFDRMAYfhcwKXSRu9QyRPsiOE0Y8agGKjabS31RNlLgMxUx+mCPCehrcZYAGnXwqSdG yoWw== X-Gm-Message-State: AOJu0YzAEWa4FpMZaSB5PVm+hI1KaKgf63ehWu95LqGpB5O5ObQ6R05s F/xQhIg2Ds4Uqb3zn2P34bCDAg== X-Google-Smtp-Source: AGHT+IHUaninjtMft4ooDyc4hnH3umDC4N+Bf3mITGO5bL3XKGyp7f1b/sTY697AHiIj2YfXI4zDtg== X-Received: by 2002:adf:ec03:0:b0:332:c723:12ad with SMTP id x3-20020adfec03000000b00332c72312admr176313wrn.66.1700764532048; Thu, 23 Nov 2023 10:35:32 -0800 (PST) Received: from m1x-phil.lan ([176.176.165.237]) by smtp.gmail.com with ESMTPSA id o10-20020adfcf0a000000b00332cda91c85sm2327141wrj.12.2023.11.23.10.35.30 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 23 Nov 2023 10:35:31 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, kvm@vger.kernel.org, Paolo Bonzini , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-9.0 02/16] target/arm/kvm: Remove unused includes Date: Thu, 23 Nov 2023 19:35:03 +0100 Message-ID: <20231123183518.64569-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231123183518.64569-1-philmd@linaro.org> References: <20231123183518.64569-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Both MemoryRegion and Error types are forward declared in "qemu/typedefs.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Gavin Shan --- target/arm/kvm_arm.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h index 2037b2d7ea..50967f4ae9 100644 --- a/target/arm/kvm_arm.h +++ b/target/arm/kvm_arm.h @@ -12,8 +12,6 @@ #define QEMU_KVM_ARM_H #include "sysemu/kvm.h" -#include "exec/memory.h" -#include "qemu/error-report.h" #define KVM_ARM_VGIC_V2 (1 << 0) #define KVM_ARM_VGIC_V3 (1 << 1) From patchwork Thu Nov 23 18:35:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13466559 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="xeql+3OG" Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 947D1D7E for ; Thu, 23 Nov 2023 10:35:39 -0800 (PST) Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2c8879a1570so14777801fa.1 for ; Thu, 23 Nov 2023 10:35:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700764538; x=1701369338; darn=vger.kernel.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=LUz0XGe6SRMXqOSVJvQiXoUHGpw35/yPoukvsO1/DGo=; b=xeql+3OGCWL9t/v0cQ6IvIDYEpA2Jir4JD63qBWyXMIxp6b5zX5HHEydg8vACcK5bu /S6yvxapukhTn//OhCo7+ihtHkwL6AaQSDxkdrJK+g3A7FsTAkhOz/uUANoldJU99v35 T+amRZ9jNbSnNOjVTUbd4HfHaS0W5XqPn+sdzVW2vbcf7z20TfTmnINOwtfJKWDHklyh ls5OJd6hJhB+pRPYp+RDZIRRgYWNl3GEPYcFK0vBeJBIQhO0xFivsnoAFLVMBvevJwSl C8Em//p2aEoMLOTunRMdKcwRhNUrH7K943PHjednMHsGt5ZbtVaMvbl0XGqplm70V/ag 9F0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700764538; x=1701369338; 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=LUz0XGe6SRMXqOSVJvQiXoUHGpw35/yPoukvsO1/DGo=; b=AIijd5NESVI4+oJbaNnaZfrwIZHyqEFWJfWLL0E/pEotJwb7GLM9EKGEzrBkaLdqZL DfiiUMDeHNgXWUWJ9IPQf+w92lHQ9coqE2HWSjH+rdt/sjaeW37Rw6jocdxZiKn4kHlm 0eien7AuEiPY5QU+6Me9UgEd7/WdRH7etT5okSOfiNif7L1uGlbGdUDzD/RRMa9Gft+B NvCl7AagdLVb3ZA/DnKbJJSPYWC3Q3X/rKvf7egCH1AS1sNFuRxWTWKmkjlu/Vg/wJ/K Qkwgx/bLksLYBOgDHsY5RG1rTD2l7xjxEQHCiaJS+C56UJldC0OqsGXKXvjMSGZ1LNOm njmA== X-Gm-Message-State: AOJu0Yzr89zvCAd8jnUI9Gg8zD8Atil2KXeC4Vn+l2ba4qaB74Ng4Lk6 B1YiZo495X7NtaTWgwqv/+ewDpTRAc4/nHXg4aw= X-Google-Smtp-Source: AGHT+IEuvPz5wMMJnFnPWouwjZrhQZklg8n8Qlh0fxAWkPyyLyC5CqCfflm8sHoGFAVFUlWKAA2E+Q== X-Received: by 2002:a2e:b00e:0:b0:2c5:70f:614a with SMTP id y14-20020a2eb00e000000b002c5070f614amr155623ljk.17.1700764537845; Thu, 23 Nov 2023 10:35:37 -0800 (PST) Received: from m1x-phil.lan ([176.176.165.237]) by smtp.gmail.com with ESMTPSA id o7-20020a5d6847000000b0032dab20e773sm2268980wrw.69.2023.11.23.10.35.36 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 23 Nov 2023 10:35:37 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, kvm@vger.kernel.org, Paolo Bonzini , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-9.0 03/16] target/arm/kvm: Have kvm_arm_add_vcpu_properties take a ARMCPU argument Date: Thu, 23 Nov 2023 19:35:04 +0100 Message-ID: <20231123183518.64569-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231123183518.64569-1-philmd@linaro.org> References: <20231123183518.64569-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Unify the "kvm_arm.h" API: All functions related to ARM vCPUs take a ARMCPU* argument. Use the CPU() QOM cast macro When calling the generic vCPU API from "sysemu/kvm.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Gavin Shan --- target/arm/kvm_arm.h | 4 ++-- target/arm/cpu.c | 2 +- target/arm/kvm.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h index 50967f4ae9..6fb8a5f67e 100644 --- a/target/arm/kvm_arm.h +++ b/target/arm/kvm_arm.h @@ -153,7 +153,7 @@ void kvm_arm_set_cpu_features_from_host(ARMCPU *cpu); * Add all KVM specific CPU properties to the CPU object. These * are the CPU properties with "kvm-" prefixed names. */ -void kvm_arm_add_vcpu_properties(Object *obj); +void kvm_arm_add_vcpu_properties(ARMCPU *cpu); /** * kvm_arm_steal_time_finalize: @@ -243,7 +243,7 @@ static inline void kvm_arm_set_cpu_features_from_host(ARMCPU *cpu) g_assert_not_reached(); } -static inline void kvm_arm_add_vcpu_properties(Object *obj) +static inline void kvm_arm_add_vcpu_properties(ARMCPU *cpu) { g_assert_not_reached(); } diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 25e9d2ae7b..97081e0c70 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -1686,7 +1686,7 @@ void arm_cpu_post_init(Object *obj) } if (kvm_enabled()) { - kvm_arm_add_vcpu_properties(obj); + kvm_arm_add_vcpu_properties(cpu); } #ifndef CONFIG_USER_ONLY diff --git a/target/arm/kvm.c b/target/arm/kvm.c index 6e3fea1879..03195f5627 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -495,10 +495,10 @@ static void kvm_steal_time_set(Object *obj, bool value, Error **errp) } /* KVM VCPU properties should be prefixed with "kvm-". */ -void kvm_arm_add_vcpu_properties(Object *obj) +void kvm_arm_add_vcpu_properties(ARMCPU *cpu) { - ARMCPU *cpu = ARM_CPU(obj); CPUARMState *env = &cpu->env; + Object *obj = OBJECT(cpu); if (arm_feature(env, ARM_FEATURE_GENERIC_TIMER)) { cpu->kvm_adjvtime = true; From patchwork Thu Nov 23 18:35:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13466560 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="YyrwSaN4" Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93A88D43 for ; Thu, 23 Nov 2023 10:35:44 -0800 (PST) Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-332e545e852so427821f8f.1 for ; Thu, 23 Nov 2023 10:35:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700764543; x=1701369343; darn=vger.kernel.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=+UF32mbiOniogqxmnEO/G/4hA+3MFqbkOICeJQxcwIQ=; b=YyrwSaN4m+Bo00dgBGmFuwh5ojnY3DiQ5GNFCT9N7xWySYBsbsWddc2WD192Myiyd0 jTuDX+Pj4Rm7U3/5RGGo/PgvI4ayM0E/hruE/Ipw42qVzPhIZSgRDSmPRC//vmrRavaU vj/0O+ZlO0M7OkZzt2mx4VkG/VbV2jPtR0cmjUJwjPyxB87LcU+ji/CvbtH+9/tuimTe sCbtCIaZQDnp8ijrX8nvQtMQeGgZqkgcaf1MphPpMbLC0wkei7OhQ+kTjhGg05LndJlF 8gj5nGC2KeQN6xMIt+CanCDpl0yYbGkdlLU1HxXKV4qGwKCac1bCJkPXlZLGRhD2vplo bt2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700764543; x=1701369343; 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=+UF32mbiOniogqxmnEO/G/4hA+3MFqbkOICeJQxcwIQ=; b=gfooypR7cJ7yxA9fc1kLWwCkGRIXxsO4TXSaGmbIgCO/c93al+GL9KzAIoL7hNern+ p2NFXan8B4+EfigGAWSwlWE+qHJEg9hOspdr0DoHv3t1xMjAiPiIp1SP870ZPPUmFQTb C1oieDVjCSxw1Y7bWqCOttaVHyg71yOpBaGAdGz/ODdjr1feAv3NtdfBKU737GE2akIj 1/jZdYN+usUmtfZ7Ytbek7XwFN+Uv3bAlwk+SUc0fXwIyyzPNUEQqlTphOqHPcE1ArUY bX2/3+RN5332c4c1sDdQQcf7qdKexRG9sRy3RxtTmJshC3hkbX03A2U1i2sWV8Ig4F6P ThzA== X-Gm-Message-State: AOJu0YxPMh4AVfTz2q5ALelpVX4kiUCi75iNQFiJA5hkFW85ieggJ8Qo x8TJy5tinOUjuql/JiOIpf8Qww== X-Google-Smtp-Source: AGHT+IGltS3KwJOeq5TCm3ydg30w+N35sZn3hV62TeTHE6Z8rqYBJAB1D8TeLnzmMQ7S92iGYMJJ4Q== X-Received: by 2002:adf:e981:0:b0:332:c9f5:e5b5 with SMTP id h1-20020adfe981000000b00332c9f5e5b5mr54137wrm.0.1700764543126; Thu, 23 Nov 2023 10:35:43 -0800 (PST) Received: from m1x-phil.lan ([176.176.165.237]) by smtp.gmail.com with ESMTPSA id k15-20020a5d628f000000b0031ad5fb5a0fsm2315722wru.58.2023.11.23.10.35.42 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 23 Nov 2023 10:35:42 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, kvm@vger.kernel.org, Paolo Bonzini , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-9.0 04/16] target/arm/kvm: Have kvm_arm_sve_set_vls take a ARMCPU argument Date: Thu, 23 Nov 2023 19:35:05 +0100 Message-ID: <20231123183518.64569-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231123183518.64569-1-philmd@linaro.org> References: <20231123183518.64569-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Unify the "kvm_arm.h" API: All functions related to ARM vCPUs take a ARMCPU* argument. Use the CPU() QOM cast macro When calling the generic vCPU API from "sysemu/kvm.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Gavin Shan --- target/arm/kvm.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/target/arm/kvm.c b/target/arm/kvm.c index 03195f5627..71833a845a 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -1857,14 +1857,13 @@ uint32_t kvm_arm_sve_get_vls(CPUState *cs) return vls[0]; } -static int kvm_arm_sve_set_vls(CPUState *cs) +static int kvm_arm_sve_set_vls(ARMCPU *cpu) { - ARMCPU *cpu = ARM_CPU(cs); uint64_t vls[KVM_ARM64_SVE_VLS_WORDS] = { cpu->sve_vq.map }; assert(cpu->sve_max_vq <= KVM_ARM64_SVE_VQ_MAX); - return kvm_set_one_reg(cs, KVM_REG_ARM64_SVE_VLS, &vls[0]); + return kvm_set_one_reg(CPU(cpu), KVM_REG_ARM64_SVE_VLS, &vls[0]); } #define ARM_CPU_ID_MPIDR 3, 0, 0, 0, 5 @@ -1921,7 +1920,7 @@ int kvm_arch_init_vcpu(CPUState *cs) } if (cpu_isar_feature(aa64_sve, cpu)) { - ret = kvm_arm_sve_set_vls(cs); + ret = kvm_arm_sve_set_vls(cpu); if (ret) { return ret; } From patchwork Thu Nov 23 18:35:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13466561 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="cHDmArgC" Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 923CCD68 for ; Thu, 23 Nov 2023 10:35:50 -0800 (PST) Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-3316d3d11e1so698119f8f.0 for ; Thu, 23 Nov 2023 10:35:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700764549; x=1701369349; darn=vger.kernel.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=BbxwUSVkjdWQxr0WbjMFM/ALqAenG4WEeRbrPnMTydM=; b=cHDmArgChxL4e9KGlI4yt/GHEqbJcByrUZDPPxMF6SIfRoZ3gKYwKKWcvBBGotElcV +fdQm5imOgkZn5YdaA2mGMhgWtMu2ypQ+pvLOCSlM+wSs9xGYMoB9TQwNmL/AKRFNhkZ yzC2a/1E+UjAg/sqaQWJnZkwaOUgG3/KaRzH+bA4ND7cfWQAuVClzgHBwJqoAwsMT4a/ tuOMHdft661fV1dSwUofhApE08FE4Rf1WBJcbc5I1U5nZLvA0UuSQuIyCdr3JuxzZJ9z 6SJQbJuVM7CnmuZYdRYdstX+J2Lq/nsx61/z7tVkxZ0ZVDmbSwZojNK6RwKHNomhSTxQ vwQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700764549; x=1701369349; 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=BbxwUSVkjdWQxr0WbjMFM/ALqAenG4WEeRbrPnMTydM=; b=mFm2qodl4AaVusbIZ8vmAw6kDX5AfpAJucprJM9CcU884Ia+NhVH97THG582Uyiifp zip8S4eu/Sp7hz45wqZduwqft8sw4xAmnfIH4qzPs9TfYSy7JPmIfsIe+cuVpUwDIvnZ cOh2s1yGy0OXy2011UPK6H+r3TCrsIPVghX9Dj3lzwQKQjxoGVwMPkj+lCYiSmublDEX NbKYlnULF1S2H0shGECdruDl3fT7LSfHTqUREPkml8DwiBv6Udgm+ls1B8po32zXB63l Z8IfVO8Sl4mUjms6rZAYyJnj0/L438e4cwIDvM4yD/4KMJssgn1cNeRgJ8HF4MVOkvf+ YkEg== X-Gm-Message-State: AOJu0YzQQjSwzFEvQ6Btvi2Hj2KDUTZgYDfjH2FsUsF0VFCGcW7qpI2e 1kS3OruAe7pQ/9IDsSPCubKJKA== X-Google-Smtp-Source: AGHT+IHVpBW+fxUIX3fX8nnHCAT1wph7WRPj0AJYgOhwR4F2XpN2KJZ++ptoCV/AV5CvKejHxGVv1Q== X-Received: by 2002:a5d:4ac8:0:b0:332:e2e5:46a5 with SMTP id y8-20020a5d4ac8000000b00332e2e546a5mr37511wrs.7.1700764549059; Thu, 23 Nov 2023 10:35:49 -0800 (PST) Received: from m1x-phil.lan ([176.176.165.237]) by smtp.gmail.com with ESMTPSA id f6-20020adfc986000000b0032d829e10c0sm2293981wrh.28.2023.11.23.10.35.47 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 23 Nov 2023 10:35:48 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, kvm@vger.kernel.org, Paolo Bonzini , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-9.0 05/16] target/arm/kvm: Have kvm_arm_sve_get_vls take a ARMCPU argument Date: Thu, 23 Nov 2023 19:35:06 +0100 Message-ID: <20231123183518.64569-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231123183518.64569-1-philmd@linaro.org> References: <20231123183518.64569-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Unify the "kvm_arm.h" API: All functions related to ARM vCPUs take a ARMCPU* argument. Use the CPU() QOM cast macro When calling the generic vCPU API from "sysemu/kvm.h". Signed-off-by: Philippe Mathieu-Daudé --- target/arm/kvm_arm.h | 6 +++--- target/arm/cpu64.c | 2 +- target/arm/kvm.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h index 6fb8a5f67e..84f87f5ed7 100644 --- a/target/arm/kvm_arm.h +++ b/target/arm/kvm_arm.h @@ -129,13 +129,13 @@ void kvm_arm_destroy_scratch_host_vcpu(int *fdarray); /** * kvm_arm_sve_get_vls: - * @cs: CPUState + * @cpu: ARMCPU * * Get all the SVE vector lengths supported by the KVM host, setting * the bits corresponding to their length in quadwords minus one * (vq - 1) up to ARM_MAX_VQ. Return the resulting map. */ -uint32_t kvm_arm_sve_get_vls(CPUState *cs); +uint32_t kvm_arm_sve_get_vls(ARMCPU *cpu); /** * kvm_arm_set_cpu_features_from_host: @@ -278,7 +278,7 @@ static inline void kvm_arm_steal_time_finalize(ARMCPU *cpu, Error **errp) g_assert_not_reached(); } -static inline uint32_t kvm_arm_sve_get_vls(CPUState *cs) +static inline uint32_t kvm_arm_sve_get_vls(ARMCPU *cpu) { g_assert_not_reached(); } diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index 1e9c6c85ae..8e30a7993e 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c @@ -66,7 +66,7 @@ void arm_cpu_sve_finalize(ARMCPU *cpu, Error **errp) */ if (kvm_enabled()) { if (kvm_arm_sve_supported()) { - cpu->sve_vq.supported = kvm_arm_sve_get_vls(CPU(cpu)); + cpu->sve_vq.supported = kvm_arm_sve_get_vls(cpu); vq_supported = cpu->sve_vq.supported; } else { assert(!cpu_isar_feature(aa64_sve, cpu)); diff --git a/target/arm/kvm.c b/target/arm/kvm.c index 71833a845a..766a077bcf 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -1803,7 +1803,7 @@ bool kvm_arm_sve_supported(void) QEMU_BUILD_BUG_ON(KVM_ARM64_SVE_VQ_MIN != 1); -uint32_t kvm_arm_sve_get_vls(CPUState *cs) +uint32_t kvm_arm_sve_get_vls(ARMCPU *cpu) { /* Only call this function if kvm_arm_sve_supported() returns true. */ static uint64_t vls[KVM_ARM64_SVE_VLS_WORDS]; From patchwork Thu Nov 23 18:35:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13466562 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ZuezVE+4" Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 222A6D43 for ; Thu, 23 Nov 2023 10:35:56 -0800 (PST) Received: by mail-lj1-x22d.google.com with SMTP id 38308e7fff4ca-2c875207626so14111761fa.1 for ; Thu, 23 Nov 2023 10:35:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700764554; x=1701369354; darn=vger.kernel.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=APkzUJ5V8QYL4MOU/zl88wqY6eeEqD/ibNzL1bZO05g=; b=ZuezVE+4ZaCw9ZaZlShhg1h5p67an0qTAKQQ4poUfV2GNxne7Cn8vnxoFf3KtfK4Pn qt3by1CS2MbCNlngk20BwpMbpiwhBUMU9KGk/4faMnoV5hlq0O/1WbKPFltD4rQugUY9 ZdAwSp2WZweto+nlSu6BL8T12+s8RP1a+Z3Li2CS5rzS1+m6GF6hIowlClic9r0j9oWn TnJXy9DU/eE+9nf6ELfNw7MD5sFURNQqccysb24vi9usq4QLAxvad1+0lAI8JyoXkT9/ r8k+Wm0Fw9qyOrH8l8HPJAfdrdV6R46uzuXRaPbWD5aAP773XxJ1SvM+Ssws79bExy4g xj1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700764554; x=1701369354; 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=APkzUJ5V8QYL4MOU/zl88wqY6eeEqD/ibNzL1bZO05g=; b=iukLrNAL4zVVZ2N9n7u0DqJpY7Cyf453y3HHAJUJOgdoT5RAdcPyNUMtJG3WKBFjr/ ufFuOUE2nLKNLyWDUEyFzo0QXyH+4rVidX9CgBkvjhfRTp0XQE4SNKD0WTJfn/4om+KE hLDJpxAD3Zx7vVoYoWSgdiZ/Cx0KClURKI5PlIudPGSL6xhfulAfq/4mYLEdMzUC0iqV CQ+Ymm9E2Jn5EEJki/gzt74EPsBDq0E57I6LCIiQyQ9W4fNDq1zEYIk2mJHDEPHHQ36J lu1Fph/bhOigMDGgN5R+VATAoj0oRVdRhrORuA2X/g6OSiHVE+LOF1JpnvKralKzXDjx QMIQ== X-Gm-Message-State: AOJu0YxfaUDHKK3jJTVv2v/GhJdKsUNKbl/5v3f9xDaBma+o4BSN9YDz Rr0Fmgaov2Gp7aKA0N1CGZDbzQ== X-Google-Smtp-Source: AGHT+IEMHSuxheCHpy3+JITp+0heG5juBUPBJg9h7cDu77hpzkqvd1orzB6IYTMkszJ7lWDnZPfVaA== X-Received: by 2002:a2e:9e09:0:b0:2bc:e330:660b with SMTP id e9-20020a2e9e09000000b002bce330660bmr180065ljk.9.1700764554485; Thu, 23 Nov 2023 10:35:54 -0800 (PST) Received: from m1x-phil.lan ([176.176.165.237]) by smtp.gmail.com with ESMTPSA id bg11-20020a05600c3c8b00b0040b2c195523sm3477497wmb.31.2023.11.23.10.35.53 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 23 Nov 2023 10:35:54 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, kvm@vger.kernel.org, Paolo Bonzini , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-9.0 06/16] target/arm/kvm: Have kvm_arm_set_device_attr take a ARMCPU argument Date: Thu, 23 Nov 2023 19:35:07 +0100 Message-ID: <20231123183518.64569-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231123183518.64569-1-philmd@linaro.org> References: <20231123183518.64569-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Unify the "kvm_arm.h" API: All functions related to ARM vCPUs take a ARMCPU* argument. Use the CPU() QOM cast macro When calling the generic vCPU API from "sysemu/kvm.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Gavin Shan --- target/arm/kvm.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/target/arm/kvm.c b/target/arm/kvm.c index 766a077bcf..73f4e5a0fa 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -1691,18 +1691,18 @@ void kvm_arch_remove_all_hw_breakpoints(void) } } -static bool kvm_arm_set_device_attr(CPUState *cs, struct kvm_device_attr *attr, +static bool kvm_arm_set_device_attr(ARMCPU *cpu, struct kvm_device_attr *attr, const char *name) { int err; - err = kvm_vcpu_ioctl(cs, KVM_HAS_DEVICE_ATTR, attr); + err = kvm_vcpu_ioctl(CPU(cpu), KVM_HAS_DEVICE_ATTR, attr); if (err != 0) { error_report("%s: KVM_HAS_DEVICE_ATTR: %s", name, strerror(-err)); return false; } - err = kvm_vcpu_ioctl(cs, KVM_SET_DEVICE_ATTR, attr); + err = kvm_vcpu_ioctl(CPU(cpu), KVM_SET_DEVICE_ATTR, attr); if (err != 0) { error_report("%s: KVM_SET_DEVICE_ATTR: %s", name, strerror(-err)); return false; @@ -1721,7 +1721,7 @@ void kvm_arm_pmu_init(CPUState *cs) if (!ARM_CPU(cs)->has_pmu) { return; } - if (!kvm_arm_set_device_attr(cs, &attr, "PMU")) { + if (!kvm_arm_set_device_attr(ARM_CPU(cs), &attr, "PMU")) { error_report("failed to init PMU"); abort(); } @@ -1738,7 +1738,7 @@ void kvm_arm_pmu_set_irq(CPUState *cs, int irq) if (!ARM_CPU(cs)->has_pmu) { return; } - if (!kvm_arm_set_device_attr(cs, &attr, "PMU")) { + if (!kvm_arm_set_device_attr(ARM_CPU(cs), &attr, "PMU")) { error_report("failed to set irq for PMU"); abort(); } @@ -1755,7 +1755,7 @@ void kvm_arm_pvtime_init(CPUState *cs, uint64_t ipa) if (ARM_CPU(cs)->kvm_steal_time == ON_OFF_AUTO_OFF) { return; } - if (!kvm_arm_set_device_attr(cs, &attr, "PVTIME IPA")) { + if (!kvm_arm_set_device_attr(ARM_CPU(cs), &attr, "PVTIME IPA")) { error_report("failed to init PVTIME IPA"); abort(); } From patchwork Thu Nov 23 18:35:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13466563 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="C0q+YThR" Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86DE810C6 for ; Thu, 23 Nov 2023 10:36:01 -0800 (PST) Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-507c5249d55so1658072e87.3 for ; Thu, 23 Nov 2023 10:36:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700764560; x=1701369360; darn=vger.kernel.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=znNmY7edfJI2fYiqN/HJeKsLDF9NhHOuefv0PghAu5M=; b=C0q+YThRk8Jj049ZITDnrVzHv0D18jT5lJbkRoXeB3mbE5JWhVz1LZ1KB82KjAIE3S HxnVnnJBRa/Xz9KiqaN3tNAEFODXErwd81kTlj81il5WDwOmjwzla2YnAxSodikND3/u iRLfD8VbTxsHbfp+V/Emk1g0XNKyERfmn69DAKNvtCiIAda+EBjmAmYWXwXhZdiEuHUc dOZuNxWgmagIHAlHU2wZE5PkSj3Yb5eZJfFkScxM3lU4oGI2MUuf/r5HWTGHSlTuN0B1 dfxc5HQjhM0Zp/NWlNg/YIo7HMF2RJ5uSZORBv1bucLbdDe1CIp9syB4zQWhNnFNX6OP OTtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700764560; x=1701369360; 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=znNmY7edfJI2fYiqN/HJeKsLDF9NhHOuefv0PghAu5M=; b=CGJK1VsyIUVGmlP4fNhqaO/c2ThMA5cC7GIJGGua+MNhuSlHpffXCqGJLnqxfqJfir cNC9vzxmJGwr9f26HRIxq5Xim3hwLtflC0eW5TwLzgU0LXikIlnYNbnOVzKld9Kn5hC3 eSldHRbw5Luw2dl1EiGss1oB4LSHgW+aGK6jCWM+zO5pLGpJU17Yy1ovtBrIJuRyk8uo V2CI7QDIkUaJ72Bq6nyzvAD9NuggEw9KcV//0fY3kNXWtoJzfYSg2bxuA+LSCQCixvKB V52zosacvC+xAcpYV2TjqR1mQ/xygJyQxgXmbeQY+x/F11qU2efmphdrUeLhRRjMTdOU rOpA== X-Gm-Message-State: AOJu0Yzr5B3p56Rgll6FS23QE4LqRi6jyNOBrCTWnvpjaMfh/bbeNeio RURouUVuzY1Q/n0WQhNjfVpH5w== X-Google-Smtp-Source: AGHT+IHwNsCUBI8C+HAtmr6ne5j7ja7Y9f5/nmCmQj8iQdnpHgN1KUrN2rXfn6mGSeu6MN85RsnNzQ== X-Received: by 2002:a05:6512:39c4:b0:509:4655:d8d5 with SMTP id k4-20020a05651239c400b005094655d8d5mr92555lfu.11.1700764559795; Thu, 23 Nov 2023 10:35:59 -0800 (PST) Received: from m1x-phil.lan ([176.176.165.237]) by smtp.gmail.com with ESMTPSA id f9-20020a0560001b0900b0032196c508e3sm2352293wrz.53.2023.11.23.10.35.58 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 23 Nov 2023 10:35:59 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, kvm@vger.kernel.org, Paolo Bonzini , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-9.0 07/16] target/arm/kvm: Have kvm_arm_pvtime_init take a ARMCPU argument Date: Thu, 23 Nov 2023 19:35:08 +0100 Message-ID: <20231123183518.64569-8-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231123183518.64569-1-philmd@linaro.org> References: <20231123183518.64569-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Unify the "kvm_arm.h" API: All functions related to ARM vCPUs take a ARMCPU* argument. Use the CPU() QOM cast macro When calling the generic vCPU API from "sysemu/kvm.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Gavin Shan --- target/arm/kvm_arm.h | 6 +++--- hw/arm/virt.c | 5 +++-- target/arm/kvm.c | 6 +++--- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h index 84f87f5ed7..0e12a008ab 100644 --- a/target/arm/kvm_arm.h +++ b/target/arm/kvm_arm.h @@ -205,12 +205,12 @@ void kvm_arm_pmu_init(CPUState *cs); /** * kvm_arm_pvtime_init: - * @cs: CPUState + * @cpu: ARMCPU * @ipa: Per-vcpu guest physical base address of the pvtime structures * * Initializes PVTIME for the VCPU, setting the PVTIME IPA to @ipa. */ -void kvm_arm_pvtime_init(CPUState *cs, uint64_t ipa); +void kvm_arm_pvtime_init(ARMCPU *cpu, uint64_t ipa); int kvm_arm_set_irq(int cpu, int irqtype, int irq, int level); @@ -268,7 +268,7 @@ static inline void kvm_arm_pmu_init(CPUState *cs) g_assert_not_reached(); } -static inline void kvm_arm_pvtime_init(CPUState *cs, uint64_t ipa) +static inline void kvm_arm_pvtime_init(ARMCPU *cpu, uint64_t ipa) { g_assert_not_reached(); } diff --git a/hw/arm/virt.c b/hw/arm/virt.c index be2856c018..b6efe9da4d 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -2003,8 +2003,9 @@ static void virt_cpu_post_init(VirtMachineState *vms, MemoryRegion *sysmem) kvm_arm_pmu_init(cpu); } if (steal_time) { - kvm_arm_pvtime_init(cpu, pvtime_reg_base + - cpu->cpu_index * PVTIME_SIZE_PER_CPU); + kvm_arm_pvtime_init(ARM_CPU(cpu), pvtime_reg_base + + cpu->cpu_index + * PVTIME_SIZE_PER_CPU); } } } else { diff --git a/target/arm/kvm.c b/target/arm/kvm.c index 73f4e5a0fa..82c5924ab5 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -1744,7 +1744,7 @@ void kvm_arm_pmu_set_irq(CPUState *cs, int irq) } } -void kvm_arm_pvtime_init(CPUState *cs, uint64_t ipa) +void kvm_arm_pvtime_init(ARMCPU *cpu, uint64_t ipa) { struct kvm_device_attr attr = { .group = KVM_ARM_VCPU_PVTIME_CTRL, @@ -1752,10 +1752,10 @@ void kvm_arm_pvtime_init(CPUState *cs, uint64_t ipa) .addr = (uint64_t)&ipa, }; - if (ARM_CPU(cs)->kvm_steal_time == ON_OFF_AUTO_OFF) { + if (cpu->kvm_steal_time == ON_OFF_AUTO_OFF) { return; } - if (!kvm_arm_set_device_attr(ARM_CPU(cs), &attr, "PVTIME IPA")) { + if (!kvm_arm_set_device_attr(cpu, &attr, "PVTIME IPA")) { error_report("failed to init PVTIME IPA"); abort(); } From patchwork Thu Nov 23 18:35:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13466564 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ac8Lp4ik" Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AAD9310C2 for ; Thu, 23 Nov 2023 10:36:06 -0800 (PST) Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-40790b0a224so7659915e9.0 for ; Thu, 23 Nov 2023 10:36:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700764565; x=1701369365; darn=vger.kernel.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=sJjfIOalwsvZmq2fy7v7JKs3hNC/WaTRJ81yhz4vDXw=; b=ac8Lp4ikWZipDOzTWtJLNlV/ZwuUjhpZVf61In80JWbLRpsUz9wLLDl1ep6f58ECn2 NgfDjJdeb4ru59to/CX8XbMRyLmhLJhuXNsvGX8e1cT+mjtXK+YCO5WWo+p0ueDe09DP ypNwyb6ILqW73xpkYino8nC+2136n5+HfIrGcmH4bX/ckCIaDmKyz5yE+v6efjlomjVf wHQc8RnFUXp40liNbpF3lmKZJxEu6ZGbXhmTOT3MVTKZ4twCznBLlXeQ4S0DIduDCCKY lAiOUkeSEqIZvfFz/G4cn0hkoxxxWARcJjcY80th1/io2CepXscAHbDXF8IW8Mj/znNp ITBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700764565; x=1701369365; 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=sJjfIOalwsvZmq2fy7v7JKs3hNC/WaTRJ81yhz4vDXw=; b=HTiyUqa7L3KbxS7qp507bYWM3MxlG43B2lKNZv0Vor/XpR+/KOfRfd9bMZf4o6q76z XQp9GjYCfhVvfiGp2NgESa7C7qhraPgyz+tfKO07gGahU/TDOK98HL4DqmFXXl6NGJz7 OpwwgflDiIvVgVYrk29gNmcvAkTaDgObq+QlB2UZXR3mi+i6UogddC+gIIodowfQYOeR f35vtC80MGCBxle9RQluJG2snoYCDtvkCQlr/Go+tCJW5X7aX45725tc+Lzfs1jsvlMv dFPKM/N0y8UptFyn4VBoSD4s7H5NK+b3ViGijiDej98oa+DRwwDx98XF2d+Tyf6sMyIe myGQ== X-Gm-Message-State: AOJu0YzISmjR9alMaKDJTLjveEiGxT0CDRjtfXhhdihrf2DzxLVvb/fS puW0jTLNCxF6h1vm7YMe4p8hoQ== X-Google-Smtp-Source: AGHT+IELE79MyLBbOsT4/Sz7U570tGHdhzEvWk2p61WIGplYDA6HA/ukUNXBzijqXiExJ/9+xOAMnQ== X-Received: by 2002:a05:600c:1c12:b0:407:612b:91fb with SMTP id j18-20020a05600c1c1200b00407612b91fbmr290352wms.30.1700764565221; Thu, 23 Nov 2023 10:36:05 -0800 (PST) Received: from m1x-phil.lan ([176.176.165.237]) by smtp.gmail.com with ESMTPSA id u11-20020a05600c19cb00b0040a507f546fsm3526409wmq.8.2023.11.23.10.36.04 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 23 Nov 2023 10:36:04 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, kvm@vger.kernel.org, Paolo Bonzini , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-9.0 08/16] target/arm/kvm: Have kvm_arm_pmu_init take a ARMCPU argument Date: Thu, 23 Nov 2023 19:35:09 +0100 Message-ID: <20231123183518.64569-9-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231123183518.64569-1-philmd@linaro.org> References: <20231123183518.64569-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Unify the "kvm_arm.h" API: All functions related to ARM vCPUs take a ARMCPU* argument. Use the CPU() QOM cast macro When calling the generic vCPU API from "sysemu/kvm.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Gavin Shan --- target/arm/kvm_arm.h | 4 ++-- hw/arm/virt.c | 2 +- target/arm/kvm.c | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h index 0e12a008ab..fde1c45609 100644 --- a/target/arm/kvm_arm.h +++ b/target/arm/kvm_arm.h @@ -200,8 +200,8 @@ int kvm_arm_get_max_vm_ipa_size(MachineState *ms, bool *fixed_ipa); int kvm_arm_vgic_probe(void); +void kvm_arm_pmu_init(ARMCPU *cpu); void kvm_arm_pmu_set_irq(CPUState *cs, int irq); -void kvm_arm_pmu_init(CPUState *cs); /** * kvm_arm_pvtime_init: @@ -263,7 +263,7 @@ static inline void kvm_arm_pmu_set_irq(CPUState *cs, int irq) g_assert_not_reached(); } -static inline void kvm_arm_pmu_init(CPUState *cs) +static inline void kvm_arm_pmu_init(ARMCPU *cpu) { g_assert_not_reached(); } diff --git a/hw/arm/virt.c b/hw/arm/virt.c index b6efe9da4d..63f3c0b750 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -2000,7 +2000,7 @@ static void virt_cpu_post_init(VirtMachineState *vms, MemoryRegion *sysmem) if (kvm_irqchip_in_kernel()) { kvm_arm_pmu_set_irq(cpu, VIRTUAL_PMU_IRQ); } - kvm_arm_pmu_init(cpu); + kvm_arm_pmu_init(ARM_CPU(cpu)); } if (steal_time) { kvm_arm_pvtime_init(ARM_CPU(cpu), pvtime_reg_base diff --git a/target/arm/kvm.c b/target/arm/kvm.c index 82c5924ab5..e7cbe1ff05 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -1711,17 +1711,17 @@ static bool kvm_arm_set_device_attr(ARMCPU *cpu, struct kvm_device_attr *attr, return true; } -void kvm_arm_pmu_init(CPUState *cs) +void kvm_arm_pmu_init(ARMCPU *cpu) { struct kvm_device_attr attr = { .group = KVM_ARM_VCPU_PMU_V3_CTRL, .attr = KVM_ARM_VCPU_PMU_V3_INIT, }; - if (!ARM_CPU(cs)->has_pmu) { + if (!cpu->has_pmu) { return; } - if (!kvm_arm_set_device_attr(ARM_CPU(cs), &attr, "PMU")) { + if (!kvm_arm_set_device_attr(cpu, &attr, "PMU")) { error_report("failed to init PMU"); abort(); } From patchwork Thu Nov 23 18:35:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13466565 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="maypWj+j" Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1AC8ED7F for ; Thu, 23 Nov 2023 10:36:12 -0800 (PST) Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-332ce50450dso741801f8f.1 for ; Thu, 23 Nov 2023 10:36:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700764570; x=1701369370; darn=vger.kernel.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=OSjIUExNNTZZyxxju0j+hfpNF1ayVJnEfjEBE24u3Js=; b=maypWj+jCI8QOcisbWlycpw9eP27PfEcCwmGMz5iAipvwOv2ti6MNFLxFzSSia6vEU XduogVFqrzRHf5PeWSkFoo4yRUi+KTl1pFNpZpD5t2HJn1uDX7YCk6Y9zRzZReZefmOZ KYTO1bBd+x90CO8h4VfyyBSV/sq3KS+HK/dpDr5NEb2+vzTc/SIQaxt8seAi3yZYK4kY 2qBKj8bsdkD88ikp9G4snQXFCHlLWRmryjzAs0nF4dzKkF7cSErmF1Ns6lK2OS4Ti0wV vid0pb/tFccYnTIcUrVAAA+Szx8naz0AoB9u6CSgFkl2i8qRJXVmfWBuTFBDxuN9ycjl +iCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700764570; x=1701369370; 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=OSjIUExNNTZZyxxju0j+hfpNF1ayVJnEfjEBE24u3Js=; b=WoJC11zO0vl+W0x3EI3BSeuLnRsGojt619AG1+v7aYPAD8kzpzODhObFnaFeZYgi/W +y9zv1rZqOBn+Js7CwG4XIbKtvVZHZBhLbF6BuTR9u053X/eG0W7JutBvGFUgWK+dVSR T8MhqZPrHSW0d1S8gxuk/xQcpuiVnBPnIY5bNjaXgyqer3W7iYEIveSKp7x8cPljSI5L MgYaawzxj+jwMOKwwY3WWJnk/s1CKdV46brwqW0w+Vlf9CJ058Oes/HIml9uFPeB5mAR 5ZHpxlVofk2bmfyOF4PH6gQlLN8XzJ4WBFtdzBtFOKkuuqABoIfCWMHyScfCfI33xNAC /cIA== X-Gm-Message-State: AOJu0Yw9l94Af23WB5oOS7uK98puezQR9UABDstnVARGd+mSG0gSMYQZ XFEwyogX/vm1RVUxXnjWfmMD0w== X-Google-Smtp-Source: AGHT+IFgzxS1rMr+4vJyVHw8yTL7+XlGZ+6k9Z3h/Y0p6Y8WoWsGCe6GudKC213LdZDrUfDjX2soLA== X-Received: by 2002:a5d:6152:0:b0:332:e75e:f39a with SMTP id y18-20020a5d6152000000b00332e75ef39amr228741wrt.35.1700764570576; Thu, 23 Nov 2023 10:36:10 -0800 (PST) Received: from m1x-phil.lan ([176.176.165.237]) by smtp.gmail.com with ESMTPSA id n8-20020a5d67c8000000b00332e84210c2sm259285wrw.88.2023.11.23.10.36.09 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 23 Nov 2023 10:36:10 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, kvm@vger.kernel.org, Paolo Bonzini , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-9.0 09/16] target/arm/kvm: Have kvm_arm_pmu_set_irq take a ARMCPU argument Date: Thu, 23 Nov 2023 19:35:10 +0100 Message-ID: <20231123183518.64569-10-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231123183518.64569-1-philmd@linaro.org> References: <20231123183518.64569-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Unify the "kvm_arm.h" API: All functions related to ARM vCPUs take a ARMCPU* argument. Use the CPU() QOM cast macro When calling the generic vCPU API from "sysemu/kvm.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Gavin Shan --- target/arm/kvm_arm.h | 4 ++-- hw/arm/virt.c | 2 +- target/arm/kvm.c | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h index fde1c45609..55fcc35ed7 100644 --- a/target/arm/kvm_arm.h +++ b/target/arm/kvm_arm.h @@ -201,7 +201,7 @@ int kvm_arm_get_max_vm_ipa_size(MachineState *ms, bool *fixed_ipa); int kvm_arm_vgic_probe(void); void kvm_arm_pmu_init(ARMCPU *cpu); -void kvm_arm_pmu_set_irq(CPUState *cs, int irq); +void kvm_arm_pmu_set_irq(ARMCPU *cpu, int irq); /** * kvm_arm_pvtime_init: @@ -258,7 +258,7 @@ static inline int kvm_arm_vgic_probe(void) g_assert_not_reached(); } -static inline void kvm_arm_pmu_set_irq(CPUState *cs, int irq) +static inline void kvm_arm_pmu_set_irq(ARMCPU *cpu, int irq) { g_assert_not_reached(); } diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 63f3c0b750..040ca2d794 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -1998,7 +1998,7 @@ static void virt_cpu_post_init(VirtMachineState *vms, MemoryRegion *sysmem) if (pmu) { assert(arm_feature(&ARM_CPU(cpu)->env, ARM_FEATURE_PMU)); if (kvm_irqchip_in_kernel()) { - kvm_arm_pmu_set_irq(cpu, VIRTUAL_PMU_IRQ); + kvm_arm_pmu_set_irq(ARM_CPU(cpu), VIRTUAL_PMU_IRQ); } kvm_arm_pmu_init(ARM_CPU(cpu)); } diff --git a/target/arm/kvm.c b/target/arm/kvm.c index e7cbe1ff05..f17e706e48 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -1727,7 +1727,7 @@ void kvm_arm_pmu_init(ARMCPU *cpu) } } -void kvm_arm_pmu_set_irq(CPUState *cs, int irq) +void kvm_arm_pmu_set_irq(ARMCPU *cpu, int irq) { struct kvm_device_attr attr = { .group = KVM_ARM_VCPU_PMU_V3_CTRL, @@ -1735,10 +1735,10 @@ void kvm_arm_pmu_set_irq(CPUState *cs, int irq) .attr = KVM_ARM_VCPU_PMU_V3_IRQ, }; - if (!ARM_CPU(cs)->has_pmu) { + if (!cpu->has_pmu) { return; } - if (!kvm_arm_set_device_attr(ARM_CPU(cs), &attr, "PMU")) { + if (!kvm_arm_set_device_attr(cpu, &attr, "PMU")) { error_report("failed to set irq for PMU"); abort(); } From patchwork Thu Nov 23 18:35:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13466566 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="exiDkDFU" Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7094DD7E for ; Thu, 23 Nov 2023 10:36:17 -0800 (PST) Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-32f8441dfb5so768778f8f.0 for ; Thu, 23 Nov 2023 10:36:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700764576; x=1701369376; darn=vger.kernel.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=l8RzLhxd8bqvmSn68iMRFd2gB17HmY4vJB225vFPDs0=; b=exiDkDFUpWR0vV47oW3+xlrNrSJwKxsNMU2CvEdolynoqhJT6Qv6ICvKt8pvfq0+nM 6ik8Qw7j5BhYHk+Ri38hHoH8jMTCZIztoYz8+3hMbHTQ4JdQ9eQXNRhQIA6DQFjFY6yO ridREy2E0nEADjpxmVmwn/l3kxmT5uWwNvYUUKhLZLY7mhDqjY5GOAowx/8NxsAAP13Z IkTYAw3A6TFH4enLIOh2whITseFGW81/cvbxH2WIYyU+x8625rk0Hqx0hXUkssHwOien N+/jCVa8e+KUD5bT2HeDYA8TNZY3tbgDj/0iWBVoLEMSFyjcaC8qfPNYI1yYbRSkdi50 Lazw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700764576; x=1701369376; 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=l8RzLhxd8bqvmSn68iMRFd2gB17HmY4vJB225vFPDs0=; b=T2vp9T7nOYA1VL161/5DH6B12zOnuTeZPA61L7QVBqG1B7UDNBPlorApU+kITxsfnn 4UFuTo8O0yu5jKUB/2DNKudQQPsEbGeeKOZaIv+O5rfAp2dE6unUzOQILyNKasbLC2du 1Z6Rqcr/9litGNFrRrjdCB5yVFI9vZbkly1AUh8Q/uTUQVPhXlO/WJqqZtrkt5w3So2p BFsLgL1tiYPjdgY4Mw/fIyih4KcAkZMCLV/qKF6jfsr+xH/tPqEHRG282enqlmiTWV0w RjQkWpRViW6Rapx+xPy+LMLaql2XdYRgBzDzw4KwC/N+8SCjWbZI6wUXEj7U4sMs4vhu NiyQ== X-Gm-Message-State: AOJu0YxgYxr786n5V7mXgs7m/et4Dm9+UKDoa8E1xPu98/879WmN1SNi 8u6mg9afDtbARjrzJfhN7A7u1g== X-Google-Smtp-Source: AGHT+IG5GC8HVJIZKPKWSlma3WIDntOcBcKs3KAgQTxK2CctJ0Mz0JEghM6PU+RJlDjJ80AiGWLb9g== X-Received: by 2002:adf:e692:0:b0:332:e4fd:3263 with SMTP id r18-20020adfe692000000b00332e4fd3263mr195947wrm.62.1700764575984; Thu, 23 Nov 2023 10:36:15 -0800 (PST) Received: from m1x-phil.lan ([176.176.165.237]) by smtp.gmail.com with ESMTPSA id df2-20020a5d5b82000000b003317796e0e3sm2280492wrb.65.2023.11.23.10.36.14 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 23 Nov 2023 10:36:15 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, kvm@vger.kernel.org, Paolo Bonzini , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-9.0 10/16] target/arm/kvm: Have kvm_arm_vcpu_init take a ARMCPU argument Date: Thu, 23 Nov 2023 19:35:11 +0100 Message-ID: <20231123183518.64569-11-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231123183518.64569-1-philmd@linaro.org> References: <20231123183518.64569-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Unify the "kvm_arm.h" API: All functions related to ARM vCPUs take a ARMCPU* argument. Use the CPU() QOM cast macro When calling the generic vCPU API from "sysemu/kvm.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Gavin Shan Reviewed-by: Gavin Shan --- target/arm/kvm.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/target/arm/kvm.c b/target/arm/kvm.c index f17e706e48..854e423135 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -60,7 +60,7 @@ static ARMHostCPUFeatures arm_host_cpu_features; /** * kvm_arm_vcpu_init: - * @cs: CPUState + * @cpu: ARMCPU * * Initialize (or reinitialize) the VCPU by invoking the * KVM_ARM_VCPU_INIT ioctl with the CPU type and feature @@ -68,15 +68,14 @@ static ARMHostCPUFeatures arm_host_cpu_features; * * Returns: 0 if success else < 0 error code */ -static int kvm_arm_vcpu_init(CPUState *cs) +static int kvm_arm_vcpu_init(ARMCPU *cpu) { - ARMCPU *cpu = ARM_CPU(cs); struct kvm_vcpu_init init; init.target = cpu->kvm_target; memcpy(init.features, cpu->kvm_init_features, sizeof(init.features)); - return kvm_vcpu_ioctl(cs, KVM_ARM_VCPU_INIT, &init); + return kvm_vcpu_ioctl(CPU(cpu), KVM_ARM_VCPU_INIT, &init); } /** @@ -984,7 +983,7 @@ void kvm_arm_reset_vcpu(ARMCPU *cpu) /* Re-init VCPU so that all registers are set to * their respective reset values. */ - ret = kvm_arm_vcpu_init(CPU(cpu)); + ret = kvm_arm_vcpu_init(cpu); if (ret < 0) { fprintf(stderr, "kvm_arm_vcpu_init failed: %s\n", strerror(-ret)); abort(); @@ -1914,7 +1913,7 @@ int kvm_arch_init_vcpu(CPUState *cs) } /* Do KVM_ARM_VCPU_INIT ioctl */ - ret = kvm_arm_vcpu_init(cs); + ret = kvm_arm_vcpu_init(cpu); if (ret) { return ret; } From patchwork Thu Nov 23 18:35:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13466567 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="l2tNxw7E" Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83BD9D7E for ; Thu, 23 Nov 2023 10:36:23 -0800 (PST) Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-32faea0fa1fso685821f8f.1 for ; Thu, 23 Nov 2023 10:36:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700764582; x=1701369382; darn=vger.kernel.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=h+SHiNudBaJoVQ05FaR4tXQE9WbV9fq8fmbm8eyNxHM=; b=l2tNxw7E2Ci0yc0E2BlGhCDFTMISd7lV5r8Pfvvt227jvsvFHSDj0jML5xZ3ONKqmK EPMM3wtvfQFhKn+gB56UXl0jODeTmy9bQkNsbZEgzwW6BJ3Qd1isqazyutDcvb3Ypf08 /ZnSRbrw8a01JiCqHygwxfyaUUct0D5n+GzKaoxVjivrBvl051g7iHCxOOLHBZ+Sf2Aq EpGGAgZIIGY3eZ4nRD/O9gx3tfkiSVl1LlsXCWpGhGr8A+ixE1tFNXSqepRdnNZKIhMb 2d7nce0dSgZ+LfZjOAgYh/aWYI/IbNnp0Y++wUvxne/R3GC84U8puepojFllF5jZBkJO K3Xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700764582; x=1701369382; 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=h+SHiNudBaJoVQ05FaR4tXQE9WbV9fq8fmbm8eyNxHM=; b=H8gKLwN5I1m3KUDBhDT1t2hUqhF4dxC3LrrVVb9v4R+5/o0vdCcg/Ue86kKlefHyNG zbyO2CHi02sPU1+RCobY+6k8K6tR0cAkMAXlm/yhInQbFEXIDtgwkecAbNzub0FxLFDw ashe32hZ6BQI/bYov2XT2xcreSJvKiGvhvaFGYIi+wjYjkWegT+zWdFY0SsIrq9RUocF /NhvpNO+kvb5ZIEa8mKIGNhFz8qIJDp9REqZR5c/yUA/Q0gTyDvvi2Yc3gwT8bd298Ud uergOu6cPil8ThzaMxCsyn71nGXcPjHMJryQl7Y1VaFX8yYb69kqTRkfd4X02En/tgr0 3BTg== X-Gm-Message-State: AOJu0YyC+PyliZAiGhzmzo6Y80jCYpvlGBvfYXQKMrWLwEbLRlbM0hI9 hvYniA+lZ/6a8JJG5Ys4lwTG9LkOzxgj38Ij/nU= X-Google-Smtp-Source: AGHT+IGQXfk+qml3Ss0hlOkQY//xmWL0biF8uHQpwCUZdUFgs8ebq6vM/C+/PFHbdhDwvJD77doXJg== X-Received: by 2002:a05:6000:1ccd:b0:32d:c792:fcaf with SMTP id bf13-20020a0560001ccd00b0032dc792fcafmr2898941wrb.26.1700764581996; Thu, 23 Nov 2023 10:36:21 -0800 (PST) Received: from m1x-phil.lan ([176.176.165.237]) by smtp.gmail.com with ESMTPSA id d1-20020adfe881000000b00332c4055faesm2259393wrm.87.2023.11.23.10.36.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 23 Nov 2023 10:36:21 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, kvm@vger.kernel.org, Paolo Bonzini , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-9.0 11/16] target/arm/kvm: Have kvm_arm_vcpu_finalize take a ARMCPU argument Date: Thu, 23 Nov 2023 19:35:12 +0100 Message-ID: <20231123183518.64569-12-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231123183518.64569-1-philmd@linaro.org> References: <20231123183518.64569-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Unify the "kvm_arm.h" API: All functions related to ARM vCPUs take a ARMCPU* argument. Use the CPU() QOM cast macro When calling the generic vCPU API from "sysemu/kvm.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Gavin Shan --- 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 854e423135..dba2c9c6a9 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -80,7 +80,7 @@ static int kvm_arm_vcpu_init(ARMCPU *cpu) /** * kvm_arm_vcpu_finalize: - * @cs: CPUState + * @cpu: ARMCPU * @feature: feature to finalize * * Finalizes the configuration of the specified VCPU feature by @@ -90,9 +90,9 @@ static int kvm_arm_vcpu_init(ARMCPU *cpu) * * Returns: 0 if success else < 0 error code */ -static int kvm_arm_vcpu_finalize(CPUState *cs, int feature) +static int kvm_arm_vcpu_finalize(ARMCPU *cpu, int feature) { - return kvm_vcpu_ioctl(cs, KVM_ARM_VCPU_FINALIZE, &feature); + return kvm_vcpu_ioctl(CPU(cpu), KVM_ARM_VCPU_FINALIZE, &feature); } bool kvm_arm_create_scratch_host_vcpu(const uint32_t *cpus_to_try, @@ -1923,7 +1923,7 @@ int kvm_arch_init_vcpu(CPUState *cs) if (ret) { return ret; } - ret = kvm_arm_vcpu_finalize(cs, KVM_ARM_VCPU_SVE); + ret = kvm_arm_vcpu_finalize(cpu, KVM_ARM_VCPU_SVE); if (ret) { return ret; } From patchwork Thu Nov 23 18:35:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13466568 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="bqYlY8re" Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C35CCD7F for ; Thu, 23 Nov 2023 10:36:28 -0800 (PST) Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-4083f61312eso8915275e9.3 for ; Thu, 23 Nov 2023 10:36:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700764587; x=1701369387; darn=vger.kernel.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=wFeYHB+Hwgz28c/uPKH/ogtnPZczZab/kLjBCnJSUvs=; b=bqYlY8reVeYil46OJM6uDATdE/T/zlyvRotneINQVgATLSsynfJCcKdoxleNoLrSkx jujpLPUFykYL6lqOjIZnYgOd8XXoyvrFhbbJXvKAo/cGy7SBUZYudUreOosuf0HzYsXH vyi/oA1Q7LGKSqhQ7S40Mp8pSyzK3p3L2gpLgZEp1ApWIgHmedu7BznxyAdSVD1gAQ6h Y/GGOEVD5Wv7nGfLV/504LYlK0p8vzxAUJsWP1SPVayBvOTZ7HiTeL7n74SXMqz9w4Jm QTr7I465vUSmVfNcqKLkJfcflzbggIXFpoLGVfidsVdFKmwyvVHWasMEPYchc9FOr0xF qgAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700764587; x=1701369387; 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=wFeYHB+Hwgz28c/uPKH/ogtnPZczZab/kLjBCnJSUvs=; b=SK31ockZ3esoCF/cAoOCcjcWgeTN17EIZcrIDMBOg+HJKA0Z2Julc0XJd+qgRptBDp U7nhnm0MulqM3zTIz2hKiS8NVdYlp4BHR05hJydOJkBwEEmB0KTDLc3i6UPrCZTebvVS u510SnuQ35aaG+0Ov3D/zvkpN0AMLewmun/OTeC5zfuHztEzQ0/onm6KHySmn1BKL9Q9 ljf6yKS9GiAL5xiJXRmpqXC87vJm211QwoJ/J4G8xwbOvN1Y9Q7WDu0gH/GnCouwY024 UuuP+2bNWm+mjZ6URBXmMginpiQnzIlS2CDzqhrU6cJX0E4xEQ/FnCx/nNHGF6bU+Of5 lIog== X-Gm-Message-State: AOJu0YyRwfpA5gRAtTebmQM1p7LL0NP6i2Oaqz4qieNitVj2n/bP6s1Q muzSki07i6+7WEaI5d/y4yyTZD1+ymTRWMTcNBE= X-Google-Smtp-Source: AGHT+IELxbckK8uZXazOGgHv1fiTUgL1Ik/QjVMUZesvDWJ1t4LowVH54N1HBPUHto+6Kfzb13zJ1g== X-Received: by 2002:a5d:5690:0:b0:332:e65a:4a07 with SMTP id f16-20020a5d5690000000b00332e65a4a07mr231040wrv.32.1700764587343; Thu, 23 Nov 2023 10:36:27 -0800 (PST) Received: from m1x-phil.lan ([176.176.165.237]) by smtp.gmail.com with ESMTPSA id s11-20020adfeccb000000b00332c6c5ce82sm2325696wro.94.2023.11.23.10.36.26 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 23 Nov 2023 10:36:26 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, kvm@vger.kernel.org, Paolo Bonzini , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-9.0 12/16] target/arm/kvm: Have kvm_arm_[get|put]_virtual_time take ARMCPU argument Date: Thu, 23 Nov 2023 19:35:13 +0100 Message-ID: <20231123183518.64569-13-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231123183518.64569-1-philmd@linaro.org> References: <20231123183518.64569-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Unify the "kvm_arm.h" API: All functions related to ARM vCPUs take a ARMCPU* argument. Use the CPU() QOM cast macro When calling the generic vCPU API from "sysemu/kvm.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Gavin Shan --- target/arm/kvm.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/target/arm/kvm.c b/target/arm/kvm.c index dba2c9c6a9..57615ef4d1 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -1036,20 +1036,19 @@ static int kvm_arm_sync_mpstate_to_qemu(ARMCPU *cpu) /** * kvm_arm_get_virtual_time: - * @cs: CPUState + * @cpu: ARMCPU * * Gets the VCPU's virtual counter and stores it in the KVM CPU state. */ -static void kvm_arm_get_virtual_time(CPUState *cs) +static void kvm_arm_get_virtual_time(ARMCPU *cpu) { - ARMCPU *cpu = ARM_CPU(cs); int ret; if (cpu->kvm_vtime_dirty) { return; } - ret = kvm_get_one_reg(cs, KVM_REG_ARM_TIMER_CNT, &cpu->kvm_vtime); + ret = kvm_get_one_reg(CPU(cpu), KVM_REG_ARM_TIMER_CNT, &cpu->kvm_vtime); if (ret) { error_report("Failed to get KVM_REG_ARM_TIMER_CNT"); abort(); @@ -1060,20 +1059,19 @@ static void kvm_arm_get_virtual_time(CPUState *cs) /** * kvm_arm_put_virtual_time: - * @cs: CPUState + * @cpu: ARMCPU * * Sets the VCPU's virtual counter to the value stored in the KVM CPU state. */ -static void kvm_arm_put_virtual_time(CPUState *cs) +static void kvm_arm_put_virtual_time(ARMCPU *cpu) { - ARMCPU *cpu = ARM_CPU(cs); int ret; if (!cpu->kvm_vtime_dirty) { return; } - ret = kvm_set_one_reg(cs, KVM_REG_ARM_TIMER_CNT, &cpu->kvm_vtime); + ret = kvm_set_one_reg(CPU(cpu), KVM_REG_ARM_TIMER_CNT, &cpu->kvm_vtime); if (ret) { error_report("Failed to set KVM_REG_ARM_TIMER_CNT"); abort(); @@ -1291,16 +1289,15 @@ MemTxAttrs kvm_arch_post_run(CPUState *cs, struct kvm_run *run) static void kvm_arm_vm_state_change(void *opaque, bool running, RunState state) { - CPUState *cs = opaque; - ARMCPU *cpu = ARM_CPU(cs); + ARMCPU *cpu = opaque; if (running) { if (cpu->kvm_adjvtime) { - kvm_arm_put_virtual_time(cs); + kvm_arm_put_virtual_time(cpu); } } else { if (cpu->kvm_adjvtime) { - kvm_arm_get_virtual_time(cs); + kvm_arm_get_virtual_time(cpu); } } } @@ -1881,7 +1878,7 @@ int kvm_arch_init_vcpu(CPUState *cs) return -EINVAL; } - qemu_add_vm_change_state_handler(kvm_arm_vm_state_change, cs); + qemu_add_vm_change_state_handler(kvm_arm_vm_state_change, cpu); /* Determine init features for this CPU */ memset(cpu->kvm_init_features, 0, sizeof(cpu->kvm_init_features)); From patchwork Thu Nov 23 18:35:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13466569 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="dyyZspK3" Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B56DDD for ; Thu, 23 Nov 2023 10:36:34 -0800 (PST) Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-40b399314aaso636625e9.0 for ; Thu, 23 Nov 2023 10:36:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700764593; x=1701369393; darn=vger.kernel.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=Otvbi712uFgYyup+pTZVJRpTHa74RGjJF86YXo2+tew=; b=dyyZspK3Mi5vUh/CQrIe24PXJAewY/syQyhlttao41E4RWUf7mZjgCV3bNksXB1uUi WNJ0aghSGpIJfM1sPdL3zu518VDLd0mf1jcFlIXoFBuWn526vCbHBtVj02F92GoSoNrk kjlJdXFT3/cGxbq59HohZvuA5I6ir3gL8uLxTaoYuWDVD/JKnjfhA0q6SFZRzZmHhE/S Z3k/cAJyR0u59RiJ4k0Ik2dvOGbc/mYWl9zg11AQzkBMX0ngvGb5u7pIAdB4VKH79nrH CQufPP0HQJdX7xDLtLsAtr9PWOoHG59bmqhdIKUwjAzRsUolLBqanGK5OZK1YQD+lVMr GeAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700764593; x=1701369393; 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=Otvbi712uFgYyup+pTZVJRpTHa74RGjJF86YXo2+tew=; b=s0XD1/KZEeXWRLCjdhuqnY4acN66cqPuGbvcFj55eJQ/QSATeC9xj+3Q1ZIm6FdDp7 NajKJzxn5sKD5NLfB9/3Qgbo4eQH2R5lwM0EZLOrAnqGOG2zBgdShqYAXy+/ALdGEwRu Wwt+/PXHDFjwGnR2Ej8rNWh6I3q/avWk0JmVQ4sOdS8BIKIQgeZiJz7WnYxU2bD6Lvdy 6+t7xdXrvaE4MPZWdysqK/ZCb4olJMDc+W+9B2e7jcmoKCSX3/eSsBbTefc2yIW/W5od 4cYc62KzLPuG433BLdk50n8cTsfhNRLwDwONNjCFIC4euXwX84yM1r2zzAu8UnE4j15z c1kQ== X-Gm-Message-State: AOJu0YySqHvXTWTSjchpz4I7jAVfVTCJr0NJGmhOixP/6pWf/GDWsCsN dp+0PYnH3z5wJpyT09S2hNociw== X-Google-Smtp-Source: AGHT+IEUBNzl5yBDCfKyFqc+ys+ZzNDGN5X1VuZj0wqdqnY4mEGUORfFfHklyOF+YrYSPYd7f1KZag== X-Received: by 2002:a05:600c:1ca6:b0:40b:2a69:6c1d with SMTP id k38-20020a05600c1ca600b0040b2a696c1dmr367611wms.4.1700764592790; Thu, 23 Nov 2023 10:36:32 -0800 (PST) Received: from m1x-phil.lan ([176.176.165.237]) by smtp.gmail.com with ESMTPSA id f9-20020a0560001b0900b003143867d2ebsm2344690wrz.63.2023.11.23.10.36.31 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 23 Nov 2023 10:36:32 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, kvm@vger.kernel.org, Paolo Bonzini , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-9.0 13/16] target/arm/kvm: Have kvm_arm_verify_ext_dabt_pending take a ARMCPU arg Date: Thu, 23 Nov 2023 19:35:14 +0100 Message-ID: <20231123183518.64569-14-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231123183518.64569-1-philmd@linaro.org> References: <20231123183518.64569-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Unify the "kvm_arm.h" API: All functions related to ARM vCPUs take a ARMCPU* argument. Use the CPU() QOM cast macro When calling the generic vCPU API from "sysemu/kvm.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Gavin Shan --- 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 57615ef4d1..91773c767b 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -1172,18 +1172,18 @@ static int kvm_get_vcpu_events(ARMCPU *cpu) /** * kvm_arm_verify_ext_dabt_pending: - * @cs: CPUState + * @cpu: ARMCPU * * Verify the fault status code wrt the Ext DABT injection * * Returns: true if the fault status code is as expected, false otherwise */ -static bool kvm_arm_verify_ext_dabt_pending(CPUState *cs) +static bool kvm_arm_verify_ext_dabt_pending(ARMCPU *cpu) { + CPUState *cs = CPU(cpu); uint64_t dfsr_val; if (!kvm_get_one_reg(cs, ARM64_REG_ESR_EL1, &dfsr_val)) { - ARMCPU *cpu = ARM_CPU(cs); CPUARMState *env = &cpu->env; int aarch64_mode = arm_feature(env, ARM_FEATURE_AARCH64); int lpae = 0; @@ -1220,7 +1220,7 @@ void kvm_arch_pre_run(CPUState *cs, struct kvm_run *run) * an IMPLEMENTATION DEFINED exception (for 32-bit EL1) */ if (!arm_feature(env, ARM_FEATURE_AARCH64) && - unlikely(!kvm_arm_verify_ext_dabt_pending(cs))) { + unlikely(!kvm_arm_verify_ext_dabt_pending(cpu))) { error_report("Data abort exception with no valid ISS generated by " "guest memory access. KVM unable to emulate faulting " From patchwork Thu Nov 23 18:35:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13466570 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="EBFlK/dV" Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91E0A10C3 for ; Thu, 23 Nov 2023 10:36:39 -0800 (PST) Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-40b2a8c7ca9so8919355e9.2 for ; Thu, 23 Nov 2023 10:36:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700764598; x=1701369398; darn=vger.kernel.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=q9UsbPHxQcdfZLTnOccu24vjYBcOtxtHjR4chUoHDsY=; b=EBFlK/dV0IFOkyVDn2y8BuLph4K9v72muUPXHtqjnQNbAH/BK8Hp6UKgmL769HqbHS rEQNspmbn+u1wSdfj1qmb/BeBshR4JiIiB59mFR/vkNfinErd/RSp8rQt1l9x302wQiI DBbp/MLrHfHFGjfJA08lKU81Adr2KRWEAbgcptQZTpT/NzkF0Z/HizE7FD3aGOph4IO6 ASk5eq9gz3jLvKHGy56wgwSM5U2T5jWjN45FofJmDmxBmExyf4FqEw10SlUMmbVIe2Hi irpYAusZcMmrCtkr4omTI5PgbG/klasKmncTLVwUig8+rj8lS910NoaKQ9jtvtl5FTvS zYoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700764598; x=1701369398; 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=q9UsbPHxQcdfZLTnOccu24vjYBcOtxtHjR4chUoHDsY=; b=DnmgU6j5WxG/fAwqsZ/Q2odraftKeW8wgwR1hiIDScQzPSsQxbEBjH7U7dTAGsY7LV dmKdYz3abUyt3Oed9kMIb9yPfvHDiNT7DzWlyQtKg7nz0XBdqulT1eI9ZGcBVPUhcvdm k9wOjTITkIhh8WLznFYBUr5HZcrkEUAvOZ6yDYroRDCQoTUUhhtsZQxazsKio2s6QTeW 7GHlZzOHKqhMjdmXAOfobblBdsG5FWJIDSKhimkVxE4f+5td+t5rvtr4J4WC26a5aGQn gXkN8uHAZnfaeQd4oYFAZVjSDlfdIFSEgBtWLhfZjmwom6gj/BY62Wop2XB1fTyl6Xyh Kcog== X-Gm-Message-State: AOJu0YzrpKtgrchn4YTrFAkSylkNhJaJnfPNfogoAAHtXrdLysLPQVpK YRiUQ/58EBP9owkgijjKzERv6g== X-Google-Smtp-Source: AGHT+IEJ2lh8WurQcqnItjOupFjCOAnMT36WCiJMaD5yOR1INcukHMgwcm3UIh/Q5/8UZwJUKg3ttA== X-Received: by 2002:a05:600c:3110:b0:3f5:fff8:d4f3 with SMTP id g16-20020a05600c311000b003f5fff8d4f3mr326179wmo.7.1700764598088; Thu, 23 Nov 2023 10:36:38 -0800 (PST) Received: from m1x-phil.lan ([176.176.165.237]) by smtp.gmail.com with ESMTPSA id n16-20020a05600c4f9000b0040b38292253sm1316405wmq.30.2023.11.23.10.36.37 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 23 Nov 2023 10:36:37 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, kvm@vger.kernel.org, Paolo Bonzini , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-9.0 14/16] target/arm/kvm: Have kvm_arm_handle_dabt_nisv take a ARMCPU argument Date: Thu, 23 Nov 2023 19:35:15 +0100 Message-ID: <20231123183518.64569-15-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231123183518.64569-1-philmd@linaro.org> References: <20231123183518.64569-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Unify the "kvm_arm.h" API: All functions related to ARM vCPUs take a ARMCPU* argument. Use the CPU() QOM cast macro When calling the generic vCPU API from "sysemu/kvm.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Gavin Shan --- target/arm/kvm.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/target/arm/kvm.c b/target/arm/kvm.c index 91773c767b..9f58a08710 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -1304,17 +1304,16 @@ static void kvm_arm_vm_state_change(void *opaque, bool running, RunState state) /** * kvm_arm_handle_dabt_nisv: - * @cs: CPUState + * @cpu: ARMCPU * @esr_iss: ISS encoding (limited) for the exception from Data Abort * ISV bit set to '0b0' -> no valid instruction syndrome * @fault_ipa: faulting address for the synchronous data abort * * Returns: 0 if the exception has been handled, < 0 otherwise */ -static int kvm_arm_handle_dabt_nisv(CPUState *cs, uint64_t esr_iss, +static int kvm_arm_handle_dabt_nisv(ARMCPU *cpu, uint64_t esr_iss, uint64_t fault_ipa) { - ARMCPU *cpu = ARM_CPU(cs); CPUARMState *env = &cpu->env; /* * Request KVM to inject the external data abort into the guest @@ -1330,7 +1329,7 @@ static int kvm_arm_handle_dabt_nisv(CPUState *cs, uint64_t esr_iss, */ events.exception.ext_dabt_pending = 1; /* KVM_CAP_ARM_INJECT_EXT_DABT implies KVM_CAP_VCPU_EVENTS */ - if (!kvm_vcpu_ioctl(cs, KVM_SET_VCPU_EVENTS, &events)) { + if (!kvm_vcpu_ioctl(CPU(cpu), KVM_SET_VCPU_EVENTS, &events)) { env->ext_dabt_raised = 1; return 0; } @@ -1422,6 +1421,7 @@ static bool kvm_arm_handle_debug(CPUState *cs, int kvm_arch_handle_exit(CPUState *cs, struct kvm_run *run) { + ARMCPU *cpu = ARM_CPU(cs); int ret = 0; switch (run->exit_reason) { @@ -1432,7 +1432,7 @@ int kvm_arch_handle_exit(CPUState *cs, struct kvm_run *run) break; case KVM_EXIT_ARM_NISV: /* External DABT with no valid iss to decode */ - ret = kvm_arm_handle_dabt_nisv(cs, run->arm_nisv.esr_iss, + ret = kvm_arm_handle_dabt_nisv(cpu, run->arm_nisv.esr_iss, run->arm_nisv.fault_ipa); break; default: From patchwork Thu Nov 23 18:35:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13466571 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="zJQrToCs" Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E3F710C3 for ; Thu, 23 Nov 2023 10:36:45 -0800 (PST) Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-332cb136335so755724f8f.0 for ; Thu, 23 Nov 2023 10:36:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700764603; x=1701369403; darn=vger.kernel.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=cqp56K59q3umRruYVBhFmPPZuHH1N9xP5Bn9Um8qZmE=; b=zJQrToCsTDxMnJ/juvr24vHRdBUdC+hWakKWO0CsesWt7wX+OiCLfFkZBi9qgM5b2y 0LGwnaOZ0A0Nvepj4yPWsyh4n7zhkmzIPDEaIdub+dMumGnBxuRtYuypLfTT/5H/IcWd DqHOMb0Gfdtl+1ZDvvP5WJjWVQkeVBX92DiqhS8ZOON+cCB+DDenJboxmWgJimVaIJjd fbLrZcJYj1VUD1n7KGQvDsdo9KafvYrfGmhAwRc+dEU8IDYbobJkuBBV6vnxA9WTss/6 xcK3MQldrQB9xXt8kxopo5Nkml1fh0/prpFaUFAwNlnsRbBvaXEWfFn6Ch5A2EmoOYZa tWhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700764603; x=1701369403; 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=cqp56K59q3umRruYVBhFmPPZuHH1N9xP5Bn9Um8qZmE=; b=wEoyQN/Yq7IgLPT9IBxoJTxV8sQcwTMAfiH5oIpADc+mhqC6xHQ27YegV73Yl+U640 pfL1EJBLdb7y4w+g89YPBXSsqpJZgvmF51EsfwC4/bX9+brGwwdH+ubrIAi+lF3wwWm+ eA7FpH2noCvYE1n0pVK93Et3w4n8J+oseRjuXMSUzTjzU9MCaNFuo30D8HVrzl8Owaam 2NnY0UsJhdr+cZlQ+hWg+xgNei0cd2QJNOQAjX0kafn+kLGoKWvnIBvEMmymSFwJ/A7L m9GcQTIY2UgbK1isWx78M+mY4utgE/HFlO8Rtr1sTT1Unwfvxb7DQ4wzGx+8ah2KmteU 73HQ== X-Gm-Message-State: AOJu0Yw9R9de5FRUYXaFpJpXDIzxdsKx0BY37PWLDsN0o8fwWnLK+kPz h/q4V859EVUG+O9E5IS3wKYv8w== X-Google-Smtp-Source: AGHT+IHytQoZi9KH8CyFExLRcgAcv8tHyMDkToDBwOGPZdW9JwNZM10ep/0eQg9tIrJxtcYAlwyL4w== X-Received: by 2002:adf:f88c:0:b0:319:7c0f:d920 with SMTP id u12-20020adff88c000000b003197c0fd920mr198305wrp.57.1700764603697; Thu, 23 Nov 2023 10:36:43 -0800 (PST) Received: from m1x-phil.lan ([176.176.165.237]) by smtp.gmail.com with ESMTPSA id h4-20020adfa4c4000000b0032d8eecf901sm2346025wrb.3.2023.11.23.10.36.42 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 23 Nov 2023 10:36:43 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, kvm@vger.kernel.org, Paolo Bonzini , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-9.0 15/16] target/arm/kvm: Have kvm_arm_handle_debug take a ARMCPU argument Date: Thu, 23 Nov 2023 19:35:16 +0100 Message-ID: <20231123183518.64569-16-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231123183518.64569-1-philmd@linaro.org> References: <20231123183518.64569-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Unify the "kvm_arm.h" API: All functions related to ARM vCPUs take a ARMCPU* argument. Use the CPU() QOM cast macro When calling the generic vCPU API from "sysemu/kvm.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Gavin Shan --- 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 9f58a08710..1f6da5529f 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -1344,7 +1344,7 @@ static int kvm_arm_handle_dabt_nisv(ARMCPU *cpu, uint64_t esr_iss, /** * kvm_arm_handle_debug: - * @cs: CPUState + * @cpu: ARMCPU * @debug_exit: debug part of the KVM exit structure * * Returns: TRUE if the debug exception was handled. @@ -1355,11 +1355,11 @@ static int kvm_arm_handle_dabt_nisv(ARMCPU *cpu, uint64_t esr_iss, * ABI just provides user-space with the full exception syndrome * register value to be decoded in QEMU. */ -static bool kvm_arm_handle_debug(CPUState *cs, +static bool kvm_arm_handle_debug(ARMCPU *cpu, struct kvm_debug_exit_arch *debug_exit) { int hsr_ec = syn_get_ec(debug_exit->hsr); - ARMCPU *cpu = ARM_CPU(cs); + CPUState *cs = CPU(cpu); CPUARMState *env = &cpu->env; /* Ensure PC is synchronised */ @@ -1426,7 +1426,7 @@ int kvm_arch_handle_exit(CPUState *cs, struct kvm_run *run) switch (run->exit_reason) { case KVM_EXIT_DEBUG: - if (kvm_arm_handle_debug(cs, &run->debug.arch)) { + if (kvm_arm_handle_debug(cpu, &run->debug.arch)) { ret = EXCP_DEBUG; } /* otherwise return to guest */ break; From patchwork Thu Nov 23 18:35:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13466572 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="r0KyoDmi" Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFB3CDD for ; Thu, 23 Nov 2023 10:36:50 -0800 (PST) Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-332e40315bdso490849f8f.1 for ; Thu, 23 Nov 2023 10:36:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700764609; x=1701369409; darn=vger.kernel.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=jApUa9NwPbQ48ykKJDUlLJN0yCBFVC5cyFHqkJvQSW4=; b=r0KyoDmiKEjbDZhXrzjeEUL4JxZTN9U45r871EpS5rMZgL3YnhI9CvCdYLqRvgc8UT APwyvHPr7tkTMUwGaZAxtfrC8O9I2uMAb1e1ep2P4c4lpyCCl8ib/BKKoClIEyrVkycA aNkLMxp+QhcFhuw/vplnL0INVVdPaluB4zou81xhTHrNBEFia5rt8D92FUD8SUzZ1CZk pnfeZeAhSb36YnYGPq9v/zzswYlmqHgNxUd7VG2OiYG6U+uVreE6ijNlmn+iBaUWTf+B 3AThABwZNkyn3XScKE++5c9RR5P9eTBCtRi8KhsrSKKDjK0OTLDFKj95d6YM4SrTJxdB V77g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700764609; x=1701369409; 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=jApUa9NwPbQ48ykKJDUlLJN0yCBFVC5cyFHqkJvQSW4=; b=YQr76cXMnO4zym4KAz+HR/JAuU6Xin6d5r/tsGl+MQngsnMaI76cGZcAAGyaAVFvVJ m1Tzo8ocNbjnRY1ChK6dPmcOPCn+XyBsLj764ztM4Lqhpf19v7J4wUNh9rNwzyUeNwBa KE5sU8bldJkog5JkBNmc3yocsUmtGqYsUpVSGQ05Luh1LhaDSQsvx6ppvTw4HBMZ8v1x 4jSt7v7shgDWgN0DbKrweHhHeCemlQbYDVcNDS2ZHckiZFPc5+RD7Jpj3jYx4dk2MhPn +mt3UaQJOEwKxk24I2bZpn/wBgeCMAKeUAeEWSXKpkpX25iCJifYR/OUN0YDFIK/vpAi 6kKA== X-Gm-Message-State: AOJu0YxQTJWzZLfbCF9U1CurtWpUb3rtMgQC5fm98v162oPf8mBqMYQb 7de4g1VRsY5PdP5RCJpTzARzyA== X-Google-Smtp-Source: AGHT+IGoH3/+9lMqDaE3gMOPiF0vZZLwfEqa9I1S+IVqZ94k9dU4tzrTTd1DiK72Wv7UvsKyi6Tjeg== X-Received: by 2002:adf:efca:0:b0:332:cfbc:cb44 with SMTP id i10-20020adfefca000000b00332cfbccb44mr191483wrp.43.1700764609133; Thu, 23 Nov 2023 10:36:49 -0800 (PST) Received: from m1x-phil.lan ([176.176.165.237]) by smtp.gmail.com with ESMTPSA id i2-20020adffc02000000b0032f7f4089b7sm2318145wrr.43.2023.11.23.10.36.48 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 23 Nov 2023 10:36:48 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, kvm@vger.kernel.org, Paolo Bonzini , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-9.0 16/16] target/arm/kvm: Have kvm_arm_hw_debug_active take a ARMCPU argument Date: Thu, 23 Nov 2023 19:35:17 +0100 Message-ID: <20231123183518.64569-17-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231123183518.64569-1-philmd@linaro.org> References: <20231123183518.64569-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Unify the "kvm_arm.h" API: All functions related to ARM vCPUs take a ARMCPU* argument. Use the CPU() QOM cast macro When calling the generic vCPU API from "sysemu/kvm.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Gavin Shan --- target/arm/kvm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/target/arm/kvm.c b/target/arm/kvm.c index 1f6da5529f..cbfea689cc 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -1455,11 +1455,11 @@ int kvm_arch_process_async_events(CPUState *cs) /** * kvm_arm_hw_debug_active: - * @cs: CPU State + * @cpu: ARMCPU * * Return: TRUE if any hardware breakpoints in use. */ -static bool kvm_arm_hw_debug_active(CPUState *cs) +static bool kvm_arm_hw_debug_active(ARMCPU *cpu) { return ((cur_hw_wps > 0) || (cur_hw_bps > 0)); } @@ -1493,7 +1493,7 @@ void kvm_arch_update_guest_debug(CPUState *cs, struct kvm_guest_debug *dbg) if (kvm_sw_breakpoints_active(cs)) { dbg->control |= KVM_GUESTDBG_ENABLE | KVM_GUESTDBG_USE_SW_BP; } - if (kvm_arm_hw_debug_active(cs)) { + if (kvm_arm_hw_debug_active(ARM_CPU(cs))) { dbg->control |= KVM_GUESTDBG_ENABLE | KVM_GUESTDBG_USE_HW; kvm_arm_copy_hw_debug_data(&dbg->arch); }