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: 746513 Delivered-To: patch@linaro.org Received: by 2002:a5d:6706:0:b0:32d:baff:b0ca with SMTP id o6csp1037354wru; Thu, 23 Nov 2023 10:40:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IGw9JMUNtIPreKcxm3E5Cju5xVD2p3htdHdSihET9y2uSOQrjDSwiSFm3gQVhTVmP2oxk0z X-Received: by 2002:a05:620a:118b:b0:77d:784f:1951 with SMTP id b11-20020a05620a118b00b0077d784f1951mr269008qkk.1.1700764804005; Thu, 23 Nov 2023 10:40:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700764803; cv=none; d=google.com; s=arc-20160816; b=M1PRopscts48UepkarBGyQfKmampTgFYm8ndOyAQRljWxe2TWcLO8XrmHK+7UJVsh0 BL/VBfJpIl0Twx+azlqF/7FCuCXZU9Em3Z9/RDpYMeXoKrqffi/AWBMuxwyz15UI7d29 7x26zK+kuhaghWoH/osi+1x0R83aEWItQkaOTmK50XCH/NptY8yRWISF4cWUuzOlUDoj taj+2YutfjG7R9m3KLCPVXLg0xsTrr1ySbfpcqtCsu4+z7RK3lXZr/dVYxttxfpzqkZv i+rCnDmbayZMTjmd+9pbDAOlb7Gdh72SJFECUD1A5fMvEKS+LAaojpdAmEB63su/LxKA Q/9w== 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=+UF32mbiOniogqxmnEO/G/4hA+3MFqbkOICeJQxcwIQ=; fh=vteyIG+vxxCYuwp1F8LdzHfX6jaUSeyJC9WWnpPrzwM=; b=Oh2xakDTv01xJg32jvCrvbUMZoBBL4OfQAavl9sqxSfp2r+aGzTz6KP8tR2cAbIRjC EJKha1auK0S/z2Amr+lgn2AYRR+Z5OA7mlKXbocD/jcbE0+lYmcL12E9gxeIhkTTpdMK SVKq0jc7vJscJ6fXak5+r07HU8W2IKD8Jh2Ujmt9eoP/yQPSNrPfQfhdqbQkWwYaxxDr mx4T5Nao1dkM2x+T7QVYxYgjzNAo847CuephWjNVuXq2jevOTAdHE16bOqiJza3cULmR 8LIy3KOoqrjgHFBtI9fkwuJR2RkchnrmxZ9o7I4eWcBIPlMTG4MYVUknf+26e3jqS6AY yE4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Vnn7iKeZ; 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 b7-20020a05620a270700b0077d79a9ce11si656271qkp.552.2023.11.23.10.40.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 Nov 2023 10:40:03 -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=Vnn7iKeZ; 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 1r6EYH-0008E6-0E; Thu, 23 Nov 2023 13:35:49 -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 1r6EYG-0008Dp-06 for qemu-devel@nongnu.org; Thu, 23 Nov 2023 13:35:48 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r6EYD-00038Q-6T for qemu-devel@nongnu.org; Thu, 23 Nov 2023 13:35:47 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-40b399a6529so437185e9.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=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=+UF32mbiOniogqxmnEO/G/4hA+3MFqbkOICeJQxcwIQ=; b=Vnn7iKeZrXS1iwb59lu64o7mg1AY1LIi/CBkCgOReeR5D2fYm/DgRKgmiXlB0jCJq2 G/6O+KZbRqpc8mFunZOYjTLppQ5et7pdO4RYGGj70HyHqvMlUVLhwU3vOEYza4ihtcB8 FrxLpuEuJXuNYZZTaGmB4hlonyFO3HBOUT8hrXYkDi1ol49HtZmoSG0Oo5mlw3CO6EKZ keBBr6hFkh9wRLjQcIeZKTK1LkHpfC0b+n4Sz6GOzdNL78TDjCfK/P2r833UXEMYRxk2 P2uNQYndYDn6tJiWKezknt18QrxtyvEkrRYrUhI4+cZhCAnx2Wp/lES58UBeaH2dUMQo BHyg== 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=FCaLeX3ReXk8CvplieNz8sOSXPTVbUtjujevW2GzgBoQLLWXKfFVoLDp3faxxk53IM y88sOf2DmxDI6ZAmtv8MGV7Vd46GUR/eFTxHuXGq4hZePKhjLvmWDwQGUJRmeOddBK8R nhF9/D9LB2y8LxRXuTAp1gD/6m2KtjbWnYPg7O5NN4iUtzXtjn9jIIcwSH8SWbs/k/Ud j6ZZwAqIH50HUV8KzVKXcviW2vYDsauTRborf42DDbrRy1eGBFBNwWolS65StvSUS2D/ PLFGllTVzBMlCrxMsJbFepCkShlO4WtpT+sL/nE7+7yIl955jpvfccEyhQiNOs13nv67 wM+Q== X-Gm-Message-State: AOJu0YyJ5NYqOpe7mamvqgeBlFXlmzg1q4mL3JZsqhAX7r73oP1eB9wa TV6fBvkpS7eulppWP3VIAApCJ+vXAc5CWFiLgiA= 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> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.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=unavailable 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.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; }