From patchwork Tue Dec 19 19:12:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 755958 Delivered-To: patch@linaro.org Received: by 2002:adf:b181:0:b0:336:6142:bf13 with SMTP id q1csp1601591wra; Tue, 19 Dec 2023 11:17:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IFP+jEHmYpNc2TsggdqV7TCQrMiFxR3lRFvwmgTlbg0/avggvKzSNT3c9hrE27nxiRmbXPe X-Received: by 2002:a05:620a:29d6:b0:77d:c890:6b68 with SMTP id s22-20020a05620a29d600b0077dc8906b68mr24310312qkp.32.1703013420977; Tue, 19 Dec 2023 11:17:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703013420; cv=none; d=google.com; s=arc-20160816; b=xxEcjOIvoRBkwxzex8lw0WZnpW/gFAGB/ZR1t6UJVAvmu/VMXXBNa/8+lQNn7Q9ixB C4tuimYLvJ76LVI7IB7wj+SSII01UzqlgMD0CPsZ5aheSnclXRoQNGBW3gR1lJWPPEri 4GEsDlgneizw0JDgj3GGLxe4LrYMnzASl9mMezh2VUpMPNLD1e5cQiq8aHEyHLgq3LUC uAbcjwMHUjpnV20jWHPLfNR1ySfheGucw/Kt1VxUH/+KSl3j+pEEAS1jSaDN6E90HajW LiYqSWVLTZMQDCiEOZMrtKs97y0EfLeeyGi6cdHOJgcDJ2n02GQycjWDwummT+WAYGB8 bLbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=f99Ujt99QMeF21Uqr8srLUFwBNPf96V7ucD7nm9URUA=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=n3nvPhHd83va7THY1ctvYiJHEq0b8RJElKm5dQxJiY0w0z8seRO7NdpiZ8xsobWXL2 z45jIr8xvCrobkQ8pwq3qNO2SwvFMC6SpNYDoC1RIGzvKoGtROzqvshNks1em5m7zEbV 660E+nxLI0BCzE7a08KSj6GqVOq3DG1pTCxot1wNkGnEazJf99B07wl4lt7ghEHnEa9D cqFhJ1nLWA/H6SYY0HJrFnqD2yVq+FSjA5AfALaPznKuzTY+BF82g4Mn/e/FMZpeOT9W +53Xx1WjDYddQaZtD48VIF4y2C6lPUnUH4/2/cmYyc6QGJW0Z29lQK+4L0W8dgxYhHr0 YEmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ctw0gsEQ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id t21-20020a05620a451500b0077573396927si29127349qkp.260.2023.12.19.11.17.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Dec 2023 11:17:00 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ctw0gsEQ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rFfWx-0001x1-L8; Tue, 19 Dec 2023 14:13:27 -0500 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 1rFfWu-0001v4-Qm for qemu-devel@nongnu.org; Tue, 19 Dec 2023 14:13:24 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rFfWr-0001p6-Vz for qemu-devel@nongnu.org; Tue, 19 Dec 2023 14:13:23 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-40c38e292c8so12475e9.0 for ; Tue, 19 Dec 2023 11:13:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1703013200; x=1703618000; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=f99Ujt99QMeF21Uqr8srLUFwBNPf96V7ucD7nm9URUA=; b=ctw0gsEQz/OI5OUdhqO1VphTQJJMqSdtXqksgTZgr+hGT+APbZMxjrJ9mAHc1BpHfu q3mACZiO0Va5bpmejspEobAL2pwwmSQNCgBGQTsq6RIEUFS9CuW+8qv6wCalAu3yJNGu eHxliVE8qK0YX520emnjKpjDbsKPv9jX3kxQj4wkREPX2W2A5FFubdt0VMRPtwqk5FF9 bCIB2pcmnwxpfCGR3akZgnkHyPnE3Ct9DqX6IiSbMmUqal76Dup6u8v4uKXVeN4AzRk2 yv/IS8g51CIY3yDIxB9zVETtmT2fbGDbU3yysT/qmljlEir9SURUw8NId5rIPCP33+LJ ofeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703013200; x=1703618000; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=f99Ujt99QMeF21Uqr8srLUFwBNPf96V7ucD7nm9URUA=; b=YfZI4WD4kecYRoiiNICzvr/s1y/VzUzxlIa48dasdj3st1JnjCoRYGjVeJ5w5UaANV hn70UuvVdQl6B109PKdvACccgUoWO1n/Yg1V5u8hqvDw2/IkdrrwqTIF/9cnUo0LDJ5N CKQmXL36dYtuJkCuLSNFJUMCg5hIwffyZZUPGQohvTHEXC9O1L/Zu10bfaQrFmv2AVZR Qc/23OTKWxokexpmVnkdJ3AwsVRh6oWFuelrmymvSaT8IzTEL6TOdhK22X4zkSTaVi7a 7umwIyr//CBwAPNTAbDeholoTYhwi0CmriLwnxqo+1ErnQMt1310egn6psXaHXW3OSuW Vg8w== X-Gm-Message-State: AOJu0YwIyut0N5lv23/r7ctP1tKvTL0fbqsQAym2OAlj9OZP5YVWukhw AI2xY0XuhClxD0e6y230ixG4rmJS0XRnDLJXWPw= X-Received: by 2002:a05:600c:43c4:b0:40c:5822:133a with SMTP id f4-20020a05600c43c400b0040c5822133amr848826wmn.69.1703013200396; Tue, 19 Dec 2023 11:13:20 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id f5-20020a5d5685000000b0033657376b62sm12007754wrv.105.2023.12.19.11.13.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 11:13:20 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 24/43] target/arm/kvm: Have kvm_arm_add_vcpu_properties take a ARMCPU argument Date: Tue, 19 Dec 2023 19:12:48 +0000 Message-Id: <20231219191307.2895919-25-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231219191307.2895919-1-peter.maydell@linaro.org> References: <20231219191307.2895919-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x333.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@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-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé 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: Richard Henderson Reviewed-by: Gavin Shan Message-id: 20231123183518.64569-4-philmd@linaro.org [PMM: fix parameter name in doc comment too] Signed-off-by: Peter Maydell --- target/arm/kvm_arm.h | 6 +++--- target/arm/cpu.c | 2 +- target/arm/kvm.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h index 50967f4ae9c..3abbef02601 100644 --- a/target/arm/kvm_arm.h +++ b/target/arm/kvm_arm.h @@ -148,12 +148,12 @@ void kvm_arm_set_cpu_features_from_host(ARMCPU *cpu); /** * kvm_arm_add_vcpu_properties: - * @obj: The CPU object to add the properties to + * @cpu: The CPU object to add the properties to * * 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 efb22a87f9e..650e09b29c5 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 41fffef5ef1..e5a2596890b 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -497,10 +497,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;