From patchwork Thu Dec 13 05:04:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Emilio Cota X-Patchwork-Id: 1012560 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="FeLzxgyK"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="hRdH16TB"; 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 43FhvV1325z9sB5 for ; Thu, 13 Dec 2018 16:24:54 +1100 (AEDT) Received: from localhost ([::1]:50528 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXJUR-0006pV-Jl for incoming@patchwork.ozlabs.org; Thu, 13 Dec 2018 00:24:51 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55830) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXJCq-0007pn-Gl for qemu-devel@nongnu.org; Thu, 13 Dec 2018 00:06:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXJCm-0001qj-N7 for qemu-devel@nongnu.org; Thu, 13 Dec 2018 00:06:40 -0500 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:45029) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gXJCm-00015D-4l for qemu-devel@nongnu.org; Thu, 13 Dec 2018 00:06:36 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 5D086221E2; Thu, 13 Dec 2018 00:05:42 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 13 Dec 2018 00:05:42 -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 :mime-version:content-type:content-transfer-encoding; s=mesmtp; bh=sa0uJtaUiPuXkRouT+VoGW7QdKv+fuAkaWC5YBCq7No=; b=FeLzxgyKCYtV 9QvlhvxXRFLOjM54TLwu9M4NWBrrLCmMjl0I9sIP5t5RrZpPOZDdfEPoFl/ypL0z cc8v77C9R3+zUbDx1T+qQ7JOIP4xpSKgxNYBZ4XxJtbllGOQqSK2gap08IW8q8Q5 8xSp+kUAmes4ZK6vGngxI9Ci+rbHBcU= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=sa0uJtaUiPuXkRouT+VoGW7QdKv+fuAkaWC5YBCq7 No=; b=hRdH16TB7y94bMu90CBaC3JG1kDv7iFhLc24REsqaTm03sMTotUk++pAa olYYobSkxpe3lO52ByZ2hNIKIQ9Sm2V8rzHjoAJlhLz9kYGHirOh5i2V6xbv0XQ0 335S1HcoQtSHcLpG7XvRI6ot8nZ9LBj4Pvrj5231J558ED9jR5g635WGkW5UFtGK tD5vcE5tCBqsahoWS/grFiZCwF3TP2JhXZFf2iNjcnviHOZEm4DsNgAOPRaJ3nad +ER80QVOQQh2JlLsIFT4a/6wRp42TJzCRrl6w4eYs3YLhTo5c/535QuXjxm3sCyW 5Tx/2MgZVz809QDkhnzInaNHvD3/w== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtkedrudehuddgkedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffufffkof gjfhggtgfgsehtkeertdertdejnecuhfhrohhmpedfgfhmihhlihhoucfirdcuvehothgr fdcuoegtohhtrgessghrrggrphdrohhrgheqnecukfhppeduvdekrdehledrvddtrddvud einecurfgrrhgrmhepmhgrihhlfhhrohhmpegtohhtrgessghrrggrphdrohhrghenucev lhhushhtvghrufhiiigvpeeg X-ME-Proxy: Received: from localhost (flamenco.cs.columbia.edu [128.59.20.216]) by mail.messagingengine.com (Postfix) with ESMTPA id E305F10084; Thu, 13 Dec 2018 00:05:41 -0500 (EST) From: "Emilio G. Cota" To: qemu-devel@nongnu.org Date: Thu, 13 Dec 2018 00:04:03 -0500 Message-Id: <20181213050453.9677-24-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> MIME-Version: 1.0 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 23/73] mips: 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: James Hogan , Richard Henderson , Aleksandar Markovic , Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Cc: Aurelien Jarno Cc: Aleksandar Markovic Cc: James Hogan Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota --- hw/mips/cps.c | 2 +- hw/misc/mips_itu.c | 4 ++-- target/mips/kvm.c | 2 +- target/mips/op_helper.c | 8 ++++---- target/mips/translate.c | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/hw/mips/cps.c b/hw/mips/cps.c index 4285d1964e..a8b27eee78 100644 --- a/hw/mips/cps.c +++ b/hw/mips/cps.c @@ -49,7 +49,7 @@ static void main_cpu_reset(void *opaque) cpu_reset(cs); /* All VPs are halted on reset. Leave powering up to CPC. */ - cs->halted = 1; + cpu_halted_set(cs, 1); } static bool cpu_mips_itu_supported(CPUMIPSState *env) diff --git a/hw/misc/mips_itu.c b/hw/misc/mips_itu.c index 43bbec46cf..7c383939a7 100644 --- a/hw/misc/mips_itu.c +++ b/hw/misc/mips_itu.c @@ -162,7 +162,7 @@ static void wake_blocked_threads(ITCStorageCell *c) { CPUState *cs; CPU_FOREACH(cs) { - if (cs->halted && (c->blocked_threads & (1ULL << cs->cpu_index))) { + if (cpu_halted(cs) && (c->blocked_threads & (1ULL << cs->cpu_index))) { cpu_interrupt(cs, CPU_INTERRUPT_WAKE); } } @@ -172,7 +172,7 @@ static void wake_blocked_threads(ITCStorageCell *c) static void QEMU_NORETURN block_thread_and_exit(ITCStorageCell *c) { c->blocked_threads |= 1ULL << current_cpu->cpu_index; - current_cpu->halted = 1; + cpu_halted_set(current_cpu, 1); current_cpu->exception_index = EXCP_HLT; cpu_loop_exit_restore(current_cpu, current_cpu->mem_io_pc); } diff --git a/target/mips/kvm.c b/target/mips/kvm.c index 8e72850962..0b177a7577 100644 --- a/target/mips/kvm.c +++ b/target/mips/kvm.c @@ -156,7 +156,7 @@ MemTxAttrs kvm_arch_post_run(CPUState *cs, struct kvm_run *run) int kvm_arch_process_async_events(CPUState *cs) { - return cs->halted; + return cpu_halted(cs); } int kvm_arch_handle_exit(CPUState *cs, struct kvm_run *run) diff --git a/target/mips/op_helper.c b/target/mips/op_helper.c index d1f1d1aa35..601f5a47f6 100644 --- a/target/mips/op_helper.c +++ b/target/mips/op_helper.c @@ -649,7 +649,7 @@ static bool mips_vpe_is_wfi(MIPSCPU *c) /* If the VPE is halted but otherwise active, it means it's waiting for an interrupt. */ - return cpu->halted && mips_vpe_active(env); + return cpu_halted(cpu) && mips_vpe_active(env); } static bool mips_vp_is_wfi(MIPSCPU *c) @@ -657,7 +657,7 @@ static bool mips_vp_is_wfi(MIPSCPU *c) CPUState *cpu = CPU(c); CPUMIPSState *env = &c->env; - return cpu->halted && mips_vp_active(env); + return cpu_halted(cpu) && mips_vp_active(env); } static inline void mips_vpe_wake(MIPSCPU *c) @@ -674,7 +674,7 @@ static inline void mips_vpe_sleep(MIPSCPU *cpu) /* The VPE was shut off, really go to bed. Reset any old _WAKE requests. */ - cs->halted = 1; + cpu_halted_set(cs, 1); cpu_reset_interrupt(cs, CPU_INTERRUPT_WAKE); } @@ -2605,7 +2605,7 @@ void helper_wait(CPUMIPSState *env) { CPUState *cs = CPU(mips_env_get_cpu(env)); - cs->halted = 1; + cpu_halted_set(cs, 1); cpu_reset_interrupt(cs, CPU_INTERRUPT_WAKE); /* Last instruction in the block, PC was updated before - no need to recover PC and icount */ diff --git a/target/mips/translate.c b/target/mips/translate.c index e9c23a594b..9b2a45963c 100644 --- a/target/mips/translate.c +++ b/target/mips/translate.c @@ -29204,7 +29204,7 @@ void cpu_state_reset(CPUMIPSState *env) env->tcs[i].CP0_TCHalt = 1; } env->active_tc.CP0_TCHalt = 1; - cs->halted = 1; + cpu_halted_set(cs, 1); if (cs->cpu_index == 0) { /* VPE0 starts up enabled. */ @@ -29212,7 +29212,7 @@ void cpu_state_reset(CPUMIPSState *env) env->CP0_VPEConf0 |= (1 << CP0VPEC0_MVP) | (1 << CP0VPEC0_VPA); /* TC0 starts up unhalted. */ - cs->halted = 0; + cpu_halted_set(cs, 0); env->active_tc.CP0_TCHalt = 0; env->tcs[0].CP0_TCHalt = 0; /* With thread 0 active. */