From patchwork Thu Dec 13 05:04:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emilio Cota X-Patchwork-Id: 1012575 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=braap.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=braap.org header.i=@braap.org header.b="oGvBl6Bs"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="b5VXA+yA"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43Fj5x0gjlz9s9h for ; Thu, 13 Dec 2018 16:33:57 +1100 (AEDT) Received: from localhost ([::1]:50573 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXJdC-0006BF-Fb for incoming@patchwork.ozlabs.org; Thu, 13 Dec 2018 00:33:54 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55699) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXJCn-0007o8-LC for qemu-devel@nongnu.org; Thu, 13 Dec 2018 00:06:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXJCl-0001p2-Ow for qemu-devel@nongnu.org; Thu, 13 Dec 2018 00:06:37 -0500 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:45205) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gXJCl-0001Um-6m for qemu-devel@nongnu.org; Thu, 13 Dec 2018 00:06:35 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 3BB1422209; Thu, 13 Dec 2018 00:05:44 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 13 Dec 2018 00:05:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=braap.org; h= from:to:cc:subject:date:message-id:in-reply-to:references; s= mesmtp; bh=lIoipWyqFCA9nEZPg0Ta04i46d8q3712G3MySDWtgb8=; b=oGvBl 6Bs/beDUWZjbqAY91tV/QxUgjmZCxmdGlCLZcC+Yg24J7gKhP0eocd2gfm+sUab6 amhlYUpmZWhz5nqO1ECEMvO8Qcq/ZPLxdloTFxR2aYEsn4wvsi7UuZMXI2n4lfL+ mCWfclH3cN6EQQDVcpXCGY8vtmS8ymreonsTic= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=lIoipWyqFCA9nEZPg0Ta04i46d8q3 712G3MySDWtgb8=; b=b5VXA+yAFjdUVbxB2Y6bL2SJEfyXI+C+fsEvN/NqqAPQN 2cHhfn4uzMGanA6YKRFbVJgjwdzx/9G72ksi174IXjn3ADt6dhIKDhzsIiKT/MAQ p0WiDiYU7XrU92AeWsQcofoeV/B2hHKdHuGd0siMvbcsTYpb7AKNUlDXvB4NQ4DL nXO7JWbjKCNA1ClpQhXo7xcnmDX209kmCM8q3mAA7FH+P0LwP3UG46VaOX+Fi1wT LdxYPU5GDAaeW/c08+6SDZNFnFpMpL5P4l/fTHbjPSLt18tFiu4sOOwlWCctGT8+ 9KXU5S1d4hEjIOCBRmGN2I/7N3KYQFSbv7JH4MOUw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtkedrudehuddgkedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffufffkof gjfhestddtredtredttdenucfhrhhomhepfdfgmhhilhhiohcuifdrucevohhtrgdfuceo tghothgrsegsrhgrrghprdhorhhgqeenucfkphepuddvkedrheelrddvtddrvdduieenuc frrghrrghmpehmrghilhhfrhhomheptghothgrsegsrhgrrghprdhorhhgnecuvehluhhs thgvrhfuihiivgepge X-ME-Proxy: Received: from localhost (flamenco.cs.columbia.edu [128.59.20.216]) by mail.messagingengine.com (Postfix) with ESMTPA id 9D52C1045B; Thu, 13 Dec 2018 00:05:43 -0500 (EST) From: "Emilio G. Cota" To: qemu-devel@nongnu.org Date: Thu, 13 Dec 2018 00:04:11 -0500 Message-Id: <20181213050453.9677-32-cota@braap.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181213050453.9677-1-cota@braap.org> References: <20181213050453.9677-1-cota@braap.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.111.4.25 Subject: [Qemu-devel] [PATCH v5 31/73] cpu: convert to cpu_halted X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Paolo Bonzini , Richard Henderson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This finishes the conversion to cpu_halted. Signed-off-by: Emilio G. Cota --- cpus.c | 8 ++++---- qom/cpu.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cpus.c b/cpus.c index e85dbbb166..fa66d84bc7 100644 --- a/cpus.c +++ b/cpus.c @@ -204,7 +204,7 @@ static bool cpu_thread_is_idle(CPUState *cpu) if (cpu_is_stopped(cpu)) { return true; } - if (!cpu->halted || cpu_has_work(cpu) || + if (!cpu_halted(cpu) || cpu_has_work(cpu) || kvm_halt_in_kernel()) { return false; } @@ -1686,7 +1686,7 @@ static void *qemu_hax_cpu_thread_fn(void *arg) cpu->thread_id = qemu_get_thread_id(); cpu->created = true; - cpu->halted = 0; + cpu_halted_set(cpu, 0); current_cpu = cpu; hax_init_vcpu(cpu); @@ -1845,7 +1845,7 @@ static void *qemu_tcg_cpu_thread_fn(void *arg) * * cpu->halted should ensure we sleep in wait_io_event */ - g_assert(cpu->halted); + g_assert(cpu_halted(cpu)); break; case EXCP_ATOMIC: qemu_mutex_unlock_iothread(); @@ -2342,7 +2342,7 @@ CpuInfoList *qmp_query_cpus(Error **errp) info->value = g_malloc0(sizeof(*info->value)); info->value->CPU = cpu->cpu_index; info->value->current = (cpu == first_cpu); - info->value->halted = cpu->halted; + info->value->halted = cpu_halted(cpu); info->value->qom_path = object_get_canonical_path(OBJECT(cpu)); info->value->thread_id = cpu->thread_id; #if defined(TARGET_I386) diff --git a/qom/cpu.c b/qom/cpu.c index 2ea5b1da08..4e964255bf 100644 --- a/qom/cpu.c +++ b/qom/cpu.c @@ -261,7 +261,7 @@ static void cpu_common_reset(CPUState *cpu) } cpu->interrupt_request = 0; - cpu->halted = 0; + cpu_halted_set(cpu, 0); cpu->mem_io_pc = 0; cpu->mem_io_vaddr = 0; cpu->icount_extra = 0;