Message ID | 20230926103654.34424-2-salil.mehta@huawei.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 76C4EE7D27B for <qemu-devel@archiver.kernel.org>; Tue, 26 Sep 2023 10:38:15 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces@nongnu.org>) id 1ql5S4-0004R1-HB; Tue, 26 Sep 2023 06:38:00 -0400 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 <salil.mehta@huawei.com>) id 1ql5S3-0004Ni-EK; Tue, 26 Sep 2023 06:37:59 -0400 Received: from frasgout.his.huawei.com ([185.176.79.56]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <salil.mehta@huawei.com>) id 1ql5S2-0001lO-05; Tue, 26 Sep 2023 06:37:59 -0400 Received: from lhrpeml500001.china.huawei.com (unknown [172.18.147.206]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Rvx4S22lHz6K8s5; Tue, 26 Sep 2023 18:36:40 +0800 (CST) Received: from A190218597.china.huawei.com (10.126.174.16) by lhrpeml500001.china.huawei.com (7.191.163.213) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Tue, 26 Sep 2023 11:37:36 +0100 To: <qemu-devel@nongnu.org>, <qemu-arm@nongnu.org> CC: <salil.mehta@huawei.com>, <maz@kernel.org>, <jean-philippe@linaro.org>, <jonathan.cameron@huawei.com>, <lpieralisi@kernel.org>, <peter.maydell@linaro.org>, <richard.henderson@linaro.org>, <imammedo@redhat.com>, <andrew.jones@linux.dev>, <david@redhat.com>, <philmd@linaro.org>, <eric.auger@redhat.com>, <will@kernel.org>, <ardb@kernel.org>, <oliver.upton@linux.dev>, <pbonzini@redhat.com>, <mst@redhat.com>, <gshan@redhat.com>, <rafael@kernel.org>, <borntraeger@linux.ibm.com>, <alex.bennee@linaro.org>, <linux@armlinux.org.uk>, <darren@os.amperecomputing.com>, <ilkka@os.amperecomputing.com>, <vishnu@os.amperecomputing.com>, <karl.heubaum@oracle.com>, <miguel.luis@oracle.com>, <salil.mehta@opnsrc.net>, <zhukeqian1@huawei.com>, <wangxiongfeng2@huawei.com>, <wangyanan55@huawei.com>, <jiakernel2@gmail.com>, <maobibo@loongson.cn>, <lixianglai@loongson.cn> Subject: [PATCH RFC V2 33/37] target/arm/kvm: Write CPU state back to KVM on reset Date: Tue, 26 Sep 2023 11:36:50 +0100 Message-ID: <20230926103654.34424-2-salil.mehta@huawei.com> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20230926103654.34424-1-salil.mehta@huawei.com> References: <20230926100436.28284-1-salil.mehta@huawei.com> <20230926103654.34424-1-salil.mehta@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.126.174.16] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To lhrpeml500001.china.huawei.com (7.191.163.213) X-CFilter-Loop: Reflected Received-SPF: pass client-ip=185.176.79.56; envelope-from=salil.mehta@huawei.com; helo=frasgout.his.huawei.com X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Reply-to: Salil Mehta <salil.mehta@huawei.com> From: Salil Mehta via <qemu-devel@nongnu.org> Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org |
Series |
Support of Virtual CPU Hotplug for ARMv8 Arch
|
expand
|
diff --git a/target/arm/kvm.c b/target/arm/kvm.c index 0e1d0692b1..8e7c68af6a 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -614,11 +614,12 @@ void kvm_arm_cpu_post_load(ARMCPU *cpu) void kvm_arm_reset_vcpu(ARMCPU *cpu) { int ret; + CPUState *cs = CPU(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(cs); if (ret < 0) { fprintf(stderr, "kvm_arm_vcpu_init failed: %s\n", strerror(-ret)); abort(); @@ -635,6 +636,12 @@ void kvm_arm_reset_vcpu(ARMCPU *cpu) * for the same reason we do so in kvm_arch_get_registers(). */ write_list_to_cpustate(cpu); + + /* + * Ensure we call kvm_arch_put_registers(). The vCPU isn't marked dirty if + * it was parked in KVM and is now booting from a PSCI CPU_ON call. + */ + cs->vcpu_dirty = true; } void kvm_arm_create_host_vcpu(ARMCPU *cpu)