From nobody Wed Nov 27 06:52:52 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1700764790; cv=none; d=zohomail.com; s=zohoarc; b=SUj1z216EeEs7vGCUN0ffqajwgXQI0JCO96pSNTpwVZYYG/r0EbnReoy/gmr5qXns02Krw7kPcX5BrP0X73c2p7La/oQO41rGiPuUoGCghobI11br7J77hywEMgQb7/uHC+l49NujltiYW6+WTGWlCJTaVvnRFpEuT/FFN3jQ9g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1700764790; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=l8RzLhxd8bqvmSn68iMRFd2gB17HmY4vJB225vFPDs0=; b=lHj1mXwOse8dzletWf5A2c5C6SafkCK93qK5Lq0OS6C9kObtvA8sy0YCR20GtUqGhGWlF6G7QiMJVAm0U2Zzv8QbeWwUkYAT/iMF7RLQLW6rqEcOA4GYd/LjqGqDA1MPfKPpIPXC3jYxPJN0WIBSG1O9nmg9VYqponcS5/j/6jE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1700764790573500.62507731357505; Thu, 23 Nov 2023 10:39:50 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r6EZ1-0001nd-7y; Thu, 23 Nov 2023 13:36:35 -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 1r6EYz-0001mb-Iy for qemu-devel@nongnu.org; Thu, 23 Nov 2023 13:36:33 -0500 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r6EYj-0003uL-Qd for qemu-devel@nongnu.org; Thu, 23 Nov 2023 13:36:33 -0500 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-331733acbacso763098f8f.1 for ; Thu, 23 Nov 2023 10:36:17 -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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700764576; x=1701369376; 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=l8RzLhxd8bqvmSn68iMRFd2gB17HmY4vJB225vFPDs0=; b=qSYMdogVsR5QF17T/uoqjmVpkOq/cWmd5ku+ldgEebJ+IXH2+r2Etny1oQhuyWrUQ5 5tiV2+somkcBtIsr2wse57y6oDP2TXUSCwOSkZNXpir/OEP1j4UBKmAJsdm1n0NFDDOU D5A3chbynqsrsvNLFKoRGkSpOKgmqChzeiiYXhlL2cKHi2ulnv8FTpTP4AuTZbs+6JJS DsUT8EKgj7Aw6ujhFE/0Fn4dQeADBSTN67y9WxqnoXoLu4WpWm/ONiJ/JnMhp9oEOo0d WOcr93YjM6X6hypsyJU+pji5CDfqfyXGtbZl0dt3coegwhj7h2rmIE/IgVY7dVelI3ax J4hA== 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=XtpyUcRM60qRSrjJfhRyQg0+EpHwr64W4NIvgUO2pS36TbfbzbRW8EJsFji8/Q1J+i DAo8LrP045X8qg9dGdY8cr9lH3xC1vFuqsQpMYt27yEyrT+9TxTJINDt+gYXBv/dl4s+ XFjE0D+Ba8L3S6eZG4CShCw1WyaNK0C+PY92ERGJbYBcVryAzuNG4c/flpPDfXC4wkv+ hz1U1lh2MHINuc6fol/PrKg3wp2vRvYvwwT66HZ7k+MHdlrWDftK/2rn1fLoTO4VgTva rFVV9EOrPMDEuY2AN/e67GouugiWSpF9uYFqXe4gSIv+SSzO+8rKQ5x2zdxQk9feTIhw IH5Q== X-Gm-Message-State: AOJu0YzTRCWz2brBKMhdT2RWa2Gr+MlJXWWjl8iEs2GP1xQI1KZOLICI ntmeuMiwFAPkYHtmoJoMhY/0QrNO9BHPuwdLb2k= 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, kvm@vger.kernel.org, Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-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> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=philmd@linaro.org; helo=mail-wr1-x432.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, SPF_HELO_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_TEMPERROR=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1700764792347100003 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=C3=A9 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; =20 /** * 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 =3D ARM_CPU(cs); struct kvm_vcpu_init init; =20 init.target =3D cpu->kvm_target; memcpy(init.features, cpu->kvm_init_features, sizeof(init.features)); =20 - return kvm_vcpu_ioctl(cs, KVM_ARM_VCPU_INIT, &init); + return kvm_vcpu_ioctl(CPU(cpu), KVM_ARM_VCPU_INIT, &init); } =20 /** @@ -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 =3D kvm_arm_vcpu_init(CPU(cpu)); + ret =3D 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) } =20 /* Do KVM_ARM_VCPU_INIT ioctl */ - ret =3D kvm_arm_vcpu_init(cs); + ret =3D kvm_arm_vcpu_init(cpu); if (ret) { return ret; } --=20 2.41.0