From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38280) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9dDP-0003qa-0V for qemu-devel@nongnu.org; Mon, 29 Jun 2015 13:51:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z9dDL-0005Iu-QD for qemu-devel@nongnu.org; Mon, 29 Jun 2015 13:51:30 -0400 Received: from lhrrgout.huawei.com ([194.213.3.17]:52999) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9dDL-0005GF-Ia for qemu-devel@nongnu.org; Mon, 29 Jun 2015 13:51:27 -0400 Message-ID: <55918593.6090703@huawei.com> Date: Mon, 29 Jun 2015 19:51:15 +0200 From: Claudio Fontana MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] QEMU + KVM PSCI and VCPU creation / destruction List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "qemu-devel@nongnu.org" Cc: Peter Maydell Hello, while heavily testing PSCI on QEMU+KVM during OSv enablement, I encountered, among others, the following issue: I am running a test in which I boot an OS at EL1 under KVM, then boot a secondary VCPU, then immediately call PSCI for a SYSTEM_RESET (reboot). This loops over infinitely, or, as a matter of fact, until I run out of memory in the Foundation Model. Now, before submitting another support request for the Model, I checked the code for the handling of PSCI, and it turns out that KVM handles the HVC and then sets an exit reason for QEMU to check, which again sets the system_reset_requested to true, which causes a qemu_system_reset. Now in there I see the call to qemu_devices_reset() and cpu_synchronize_all_post_reset(), but are actually the VCPU destroyed? Is the VM destroyed? Or are new resources allocated at the next boot whenever PSCI asks for another VCPU to be booted via KVM_CREATE_VCPU etc? If the resources associated to the VCPU (and VM?) are not freed, isn't this always going to cause leak in the host? After around 3 hours of continuous PSCI secondary boot followed by SYSTEM_RESET I run out of memory on the host. Thanks, Claudio