From patchwork Fri May 26 22:16:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oliver Upton X-Patchwork-Id: 13257374 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8E16DC77B7C for ; Fri, 26 May 2023 22:17:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244368AbjEZWRq (ORCPT ); Fri, 26 May 2023 18:17:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244379AbjEZWRl (ORCPT ); Fri, 26 May 2023 18:17:41 -0400 Received: from out-39.mta0.migadu.com (out-39.mta0.migadu.com [IPv6:2001:41d0:1004:224b::27]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 19C241BD for ; Fri, 26 May 2023 15:17:37 -0700 (PDT) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1685139456; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Yl7AlAoXPf4ogaPws4+d6wv4PIMGGuKWDBSXk06gWVU=; b=MJsAa+U1EJB7/zfjGw0AjUO0gC6tk0IWuCL+RVTtZDCE2aQZAFVdFU0ho0IuNUWc81umLV XbPpzT8J4lKpNliZuJo+iG2Y6EkbCawIQ/4KIbtyV3amQuFRf0wTybH0jh2og8YlKoiFFV UxIrLa1MVOVfcojMTO/7YmX0tIrExDI= From: Oliver Upton To: kvmarm@lists.linux.dev Cc: kvm@vger.kernel.org, Marc Zyngier , James Morse , Suzuki K Poulose , Zenghui Yu , Will Deacon , Julien Thierry , Salil Mehta , Oliver Upton Subject: [PATCH kvmtool 07/21] arm: Stash kvm_vcpu_init for later use Date: Fri, 26 May 2023 22:16:58 +0000 Message-ID: <20230526221712.317287-8-oliver.upton@linux.dev> In-Reply-To: <20230526221712.317287-1-oliver.upton@linux.dev> References: <20230526221712.317287-1-oliver.upton@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org A subsequent change will add support for resetting a vCPU, which requires reissuing the KVM_ARM_VCPU_INIT ioctl. Save the kvm_vcpu_init worked out for later use. Signed-off-by: Oliver Upton --- arm/include/arm-common/kvm-cpu-arch.h | 2 +- arm/kvm-cpu.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arm/include/arm-common/kvm-cpu-arch.h b/arm/include/arm-common/kvm-cpu-arch.h index 923d2c4c7ad3..bf5223eaa851 100644 --- a/arm/include/arm-common/kvm-cpu-arch.h +++ b/arm/include/arm-common/kvm-cpu-arch.h @@ -11,7 +11,7 @@ struct kvm_cpu { pthread_t thread; unsigned long cpu_id; - unsigned long cpu_type; + struct kvm_vcpu_init init; const char *cpu_compatible; struct kvm *kvm; diff --git a/arm/kvm-cpu.c b/arm/kvm-cpu.c index 98bc5fdf0418..0ac488a93eef 100644 --- a/arm/kvm-cpu.c +++ b/arm/kvm-cpu.c @@ -115,7 +115,7 @@ struct kvm_cpu *kvm_cpu__arch_init(struct kvm *kvm, unsigned long cpu_id) /* Populate the vcpu structure. */ vcpu->kvm = kvm; vcpu->cpu_id = cpu_id; - vcpu->cpu_type = vcpu_init.target; + vcpu->init = vcpu_init; vcpu->cpu_compatible = target->compatible; vcpu->is_running = true;