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: 746503 Delivered-To: patch@linaro.org Received: by 2002:a5d:6706:0:b0:32d:baff:b0ca with SMTP id o6csp1036209wru; Thu, 23 Nov 2023 10:37:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IG6BdtlVIybkdAqpy7KWANz7Wfdwrq3YWMVHotX1TExKrIfS++NUvQi9ueN688FdnWOIEOX X-Received: by 2002:a05:6358:9191:b0:16b:4041:88a2 with SMTP id j17-20020a056358919100b0016b404188a2mr154427rwa.10.1700764624576; Thu, 23 Nov 2023 10:37:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700764624; cv=none; d=google.com; s=arc-20160816; b=bEpq+HTnGT1RygLqgtGcszjCbtDJ0BG88JC9fFUaK7tygyK0CajKv2VdV4NFXppdJ6 YBq+QtSck8Lzj/37oMQ76pZkYEzSFVacDC82Ty2fbvuRlmuI5AYmhcTXvZC4U6Mv+lvh mJ8DjJBAAUoyftFiKJlI7JzrDL+hph6TDpWzQ3AbraXCe2aqGzTe8KfCbgdH1bkWYx5U GwkrTkE/bT+jO3LYamfqy0i7wY+70RGDKGl//7WKsJy9eQex00YppXxZtReJbFDUpdx0 yzzDTapTKh3jB9Jp0XN3DHa+4DEN/ECFre40+UO4VOSxX7Tx2iMQ4WcjtwkcQNi3nOqX 5cDg== 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:cc:to :from:dkim-signature; bh=LUz0XGe6SRMXqOSVJvQiXoUHGpw35/yPoukvsO1/DGo=; fh=vteyIG+vxxCYuwp1F8LdzHfX6jaUSeyJC9WWnpPrzwM=; b=Y3OITILd610Ym1/TujTiTzhYV2yDIXiD9Gwfb+pxlEupp08Q9RbkJp0bfCsZ5lh+oC wMGLeodP+BXpouyloXORN5qTe+ROnT9XAF9KHS16afTUJaApkX/pRtgwuqCAdz2iyXuo pPratcG2/Vlp9XMbq6itvd6lc7NzG2ZKngQDdnh8nzjKYOD0dbyNLBy7ZJsM2caKEaG/ PK9rO6mQ2fGiBt8BwbzuXjHkc4C2p/EqgHoBeRZoqmFuUc3QizlE/FFPBYaFz4WmXz3G Tst3trmewbBS0Z+JSHZ2vYQ1C+v15lvdzMbiMu3oQYjpCXCtPwWpES9nq/SAJUa7QWvL wiow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=quoyJIPc; 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 g15-20020ac85d4f000000b004237b4532c9si1644483qtx.462.2023.11.23.10.37.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 Nov 2023 10:37:04 -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=quoyJIPc; 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 1r6EYE-0008A6-4Z; Thu, 23 Nov 2023 13:35:46 -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 1r6EYA-000812-Ma for qemu-devel@nongnu.org; Thu, 23 Nov 2023 13:35:43 -0500 Received: from mail-lj1-x22b.google.com ([2a00:1450:4864:20::22b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r6EY8-00032G-4a for qemu-devel@nongnu.org; Thu, 23 Nov 2023 13:35:41 -0500 Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2c8880f14eeso14593391fa.3 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=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=LUz0XGe6SRMXqOSVJvQiXoUHGpw35/yPoukvsO1/DGo=; b=quoyJIPcAfapZdut8H3QrV+VIpNOj2pRTRq6bAnVJ+cG+LbnzS5kUJeLk610k5XlvU QRR9630dgl5zed7xbsDVbHw97JI7AUXeWtYXHxAh/8EM9RnyYgJuZrerH7wst73iZQK+ BKYYrEZG8xLnHyulLpgcQCKNU+hSpZsGAy3B59RdSo1BPEY6ETRI3jVGiYKpiSjjsGa9 EyxvK4QWVBCNC6ArMs6RHHU98mkP3JOSq8R5sT3f4U/pvb+RGudiQxWIQ52i3gt896gZ wSuqJVq561ShqejTNhngMWhfvdYl3NAQYqyQcVvpsteNGtJcIsmoPx9ytnTvCoIegR2I irWg== 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=wO9pESa4rk6M324wdLFWMjWoeo76Y2TmPjk0YdjLNYfc/MlvWg121u6z7odm+HmMT5 DpuA2EXDWMHNIyDUz9D1KUZvl+RZh8s33UbZGGRffFKvFLI0e3ylDCPQRxFfwozVTDGO FktTsSkFQUNygXlNm5jDydG88NAMfhvFcrJW0UcihMCUuU7rzRM50RRn/sq7qaPq+HCi aEOpnM/g/MusFT2YFAUwjx7chHvidLkFtb12HWkGLB6LBoiMcJmKHZ6BQ9GoWx8yeZs4 bj7NcV/EJJtrr03/ArHer1Me40fHVcOoFTZz3y4s8rmVCIj6UYEDUkhTuHER7CUzWsB8 OclA== X-Gm-Message-State: AOJu0YzD3NZouLWc1JYUwQ/kbLhftRvnh9N58pPp55u++Y3CAia9rOPB oklKp80g3ZgxL4tBFtqcEBvmHrHWiej70WJONWE= 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> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::22b; envelope-from=philmd@linaro.org; helo=mail-lj1-x22b.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 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;