From patchwork Tue Dec 19 19:12:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 755945 Delivered-To: patch@linaro.org Received: by 2002:adf:b181:0:b0:336:6142:bf13 with SMTP id q1csp1600240wra; Tue, 19 Dec 2023 11:14:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IHPyKh6+ionn4u8QBKLZft1xsUbSd2LvKbamXEgLB7zrc+5xiJHspP1p74gu5JYz1etV294 X-Received: by 2002:a05:620a:800a:b0:77f:16e:8df1 with SMTP id ee10-20020a05620a800a00b0077f016e8df1mr24089037qkb.58.1703013279577; Tue, 19 Dec 2023 11:14:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703013279; cv=none; d=google.com; s=arc-20160816; b=vP6BBqxme5eziQP9t5fhRLGhSXdxuuSAM6gCjYlCyTTHWdMYDg8AF4F0cRQgu2nPJ+ il2+dsUi1kLwq/AjdXBqD+WkH+9F0S8c+rwlvEeTn1CS7dcmT8uyMQKldKWb074lEukS N5CUdRubI/yjLY2dScXVI05p4JHL02DIbW7g6pa4y+oWgjGrPBfE0p6ZFeqykHvX8amB 1jPCMikFQIJBNBm32u0VMQ656XY27GuN+pQ9xd+tdJnFA3M6uCCLj1ukZkNUPJNBGWdm 5nJp4gcGbt3MkT+sVVJk4HDLA3KQUIm/IPUVyxjXhq1zmFPTBqNhUwrL2JHYiarE+Phj 63Yg== 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=WTa4ndbkRJ7n5XD1OTvmDhz9DP3vcZ/79akTztoRHzs=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=V6TIApPzDjVI97JqofssgyYTUXMqdWX5BvqCYa1Pe+ErGgTTr093/yEF2YnNL5Malq 8ydV9WEVTGCe6GPphLTHTvvJYpaWhdevxL4/DBJpquZyy1K0V1UY/mJpfEkqx73qGg6q E3faNvO0OtYnm7c8Hxg+Y/oLR2eLnlonNaaW1TMe/y0U8LBFT2VH6Kpq2IFoZauzXTTl MKxSAkkOY3h+j0bl2pOQ+JPwZLAmosEM0DejffISRJNlMUntUS1KJwbp0HkGdBvhLY4U X6AtkKeszNTSM1jo9xLUTX8MGipHqWMy81wB617kwb6znMpWiMOkYXW34IO8bcsYmYQ+ PmWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="sGbsg/U7"; 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 dz6-20020a05620a2b8600b0077fbe2de1bbsi9153064qkb.518.2023.12.19.11.14.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Dec 2023 11:14:39 -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="sGbsg/U7"; 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 1rFfX8-00022x-Ng; Tue, 19 Dec 2023 14:13:39 -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 1rFfWy-0001yG-Hy for qemu-devel@nongnu.org; Tue, 19 Dec 2023 14:13:33 -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 1rFfWu-0001re-SU for qemu-devel@nongnu.org; Tue, 19 Dec 2023 14:13:28 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-40c2308faedso58238635e9.1 for ; Tue, 19 Dec 2023 11:13:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1703013203; x=1703618003; 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=WTa4ndbkRJ7n5XD1OTvmDhz9DP3vcZ/79akTztoRHzs=; b=sGbsg/U7pvR9aNO1v4Rh0A0wMYw2MqtTLlTka/yk3/wC2I1aTYTOvHgKnni1tsiJ7M PBqbKK6AsmhBv6xub4jJu62Nu7sQ9ubXp/U9mx7DP9MCwGK1/hyrGbKIv5MzQ+A7ac6N 4c6ya0tXFTJeKF0WNIrKmDBzESzwz71eJr+ZqU5Xjqt64KW1xQib2yWA3QBSg4mFGa+h 7gccOqvMl6K9mTlaU6lFv03gH+nbvxgSIkan9QLS3sHcxtZxN4wyoQHyGgXnIwrId2GE mtJlfsxLS5t9hFlswpD6Ch0oSyUJRNu2USzgWFwILbD1IukwQrRknE7E+hOfPnqYq5A2 SlLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703013203; x=1703618003; 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=WTa4ndbkRJ7n5XD1OTvmDhz9DP3vcZ/79akTztoRHzs=; b=of0/NW8gJGWyKEc5FWb2qaMI9fkEmFolSg0WOKC38tfGP1bcRxzQJkqVRSldRxRG5k FE8gSQiiPmYe7OPCvYefi/soVrGnJj98ug8tjtJwkuNVS0EKHf1w8gs6d8daV8R7YhsS atnLvqkRQU5W4ECMJK9RC+d7BJDHQhS9PdsFJoxizRaRMpLcIKH99F3WOvho1yehm9UF PGrpHXwgc1I3UrBQkcK0qGJbBQebZdBV27vAwH3pG0vRqWYy1mOSTPiThoaUt96pVmoA 5PzNrXIb+6UkYU+mu+r2gNn+v5kJae9WPTaidNxENd+M0LynmdIAxQyhPsmwM5uGpVLb h24Q== X-Gm-Message-State: AOJu0YyaGw9UqdIef0IsZUlvHLGMhEi8MOkxr7OQmwQBIpgqi8PGrURG JQE6/kWZLBQxC961MeCm5+NzCu2qpipa9eKP+SI= X-Received: by 2002:a05:600c:2296:b0:40c:3103:2ecb with SMTP id 22-20020a05600c229600b0040c31032ecbmr10220394wmf.43.1703013203534; Tue, 19 Dec 2023 11:13:23 -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.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 11:13:23 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 31/43] target/arm/kvm: Have kvm_arm_vcpu_init take a ARMCPU argument Date: Tue, 19 Dec 2023 19:12:55 +0000 Message-Id: <20231219191307.2895919-32-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::32f; envelope-from=peter.maydell@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=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-11-philmd@linaro.org Signed-off-by: Peter Maydell --- 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 45ee491a56b..9540d3cb618 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -62,7 +62,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 @@ -70,15 +70,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); } /** @@ -982,7 +981,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(); @@ -1912,7 +1911,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; }