From patchwork Thu Mar 26 19:31:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 11460919 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BE4F41667 for ; Thu, 26 Mar 2020 19:53:45 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 9554F206E6 for ; Thu, 26 Mar 2020 19:53:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="tT9Iurc6" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9554F206E6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:59076 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYZU-0002QU-RL for patchwork-qemu-devel@patchwork.kernel.org; Thu, 26 Mar 2020 15:53:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59348) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYLI-0008Uz-VI for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:39:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYLH-0002Ab-KC for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:39:04 -0400 Received: from mail-qv1-xf44.google.com ([2607:f8b0:4864:20::f44]:46580) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYLH-0002AP-Gs for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:39:03 -0400 Received: by mail-qv1-xf44.google.com with SMTP id m2so3682267qvu.13 for ; Thu, 26 Mar 2020 12:39:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=HScEdvyaqOMlz3W5Sxuj05ntc9QJp9qM3msK7XO5ViU=; b=tT9Iurc6SRrAVnIgemYUSoHwr/iyv2afD6vevGqZDIgJb1C/kERNlaAAI7mYFvv9vX ro8H5JOy6DS3hWaj1crlOEbfeo8IghrkMpJ/GiK2AdPDBSNaw/eDxuHMZSJ1WAb9oPco GfmIHQSFQtXDaDQEJuzkbUFaPKhtOPks27/X7R4OdczDL6pzCCNR8q3Ps9KuIKE5d4FH 1y7BY8OUHYzuyZCMnx0UTFTcxdNpHlLy0MO+bgiil/cdLzDBxknwhPtuL+BQTTFZEYPV va0CnMHscplXU1KRKU5J5nKrCgwlThikQ0tAWAJYNayuiqYzU0l3ArI0fRbmVddPqb4X gOmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=HScEdvyaqOMlz3W5Sxuj05ntc9QJp9qM3msK7XO5ViU=; b=gsNKF4uKBZoiKKeeztbDXTpfruoD3yB7jpf09lLzubN7AtaZh2bV0ZWCiePEUeIPgJ 8NGCKAMco1B5JZFGBU351CPyjhl5I5KqH1+4j3etPX+KsH+ywWC0yqfPIV95Md1e27ZK dLfbVEeeh5i+WgUGNd/Lil7mpZCYtr9Uz9tEmGvLW0tLD/kZtAFvgYapWd0+edtiQg6l Q4dZBMBkutlxzbXOPq/htc9W3+HrHzN4xAtIy+vNXhCUuy8HDUirD9S2h0pqkS9/oTjj 0jS/am4BxL6OuTW5cjB32aLJYgmi27HgRixoBGf2v1uCs3fI28YPFTx2f5aopsdqMtAW cfaA== X-Gm-Message-State: ANhLgQ2XPwS/ZqumIFJ4Pjs7FAYjaH4XWJSVuqNHhVe1KkBJS4hZZrV8 h+0jE9aw58y0/sUy2OUj4i1HaBFNGjEa9A== X-Google-Smtp-Source: ADFU+vu2SnW2BGQ+PhtlspZ4tUoFlzrRz+K6EHLv0U15a1oHKUg+dA7VaQSN7ILSpQpLNu7fEUMwVg== X-Received: by 2002:a0c:9aee:: with SMTP id k46mr9529022qvf.7.1585251542709; Thu, 26 Mar 2020 12:39:02 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.39.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:39:02 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 64/74] ppc: convert to cpu_has_work_with_iothread_lock Date: Thu, 26 Mar 2020 15:31:46 -0400 Message-Id: <20200326193156.4322-65-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::f44 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robert.foley@linaro.org, richard.henderson@linaro.org, "Emilio G. Cota" , qemu-ppc@nongnu.org, peter.puhov@linaro.org, alex.bennee@linaro.org, David Gibson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Soon we will call cpu_has_work without the BQL. Cc: David Gibson Cc: qemu-ppc@nongnu.org Reviewed-by: Richard Henderson Acked-by: David Gibson Signed-off-by: Emilio G. Cota [RF: Converted new code related to POWER10] Signed-off-by: Robert Foley --- target/ppc/translate_init.inc.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/target/ppc/translate_init.inc.c b/target/ppc/translate_init.inc.c index 8d2e668ac5..48094f3a24 100644 --- a/target/ppc/translate_init.inc.c +++ b/target/ppc/translate_init.inc.c @@ -8539,6 +8539,8 @@ static bool cpu_has_work_POWER7(CPUState *cs) PowerPCCPU *cpu = POWERPC_CPU(cs); CPUPPCState *env = &cpu->env; + g_assert(qemu_mutex_iothread_locked()); + if (cpu_halted(cs)) { if (!(cpu_interrupt_request(cs) & CPU_INTERRUPT_HARD)) { return false; @@ -8581,7 +8583,7 @@ POWERPC_FAMILY(POWER7)(ObjectClass *oc, void *data) pcc->pcr_supported = PCR_COMPAT_2_06 | PCR_COMPAT_2_05; pcc->init_proc = init_proc_POWER7; pcc->check_pow = check_pow_nocheck; - cc->has_work = cpu_has_work_POWER7; + cc->has_work_with_iothread_lock = cpu_has_work_POWER7; pcc->insns_flags = PPC_INSNS_BASE | PPC_ISEL | PPC_STRING | PPC_MFTB | PPC_FLOAT | PPC_FLOAT_FSEL | PPC_FLOAT_FRES | PPC_FLOAT_FSQRT | PPC_FLOAT_FRSQRTE | @@ -8701,6 +8703,8 @@ static bool cpu_has_work_POWER8(CPUState *cs) PowerPCCPU *cpu = POWERPC_CPU(cs); CPUPPCState *env = &cpu->env; + g_assert(qemu_mutex_iothread_locked()); + if (cpu_halted(cs)) { if (!(cpu_interrupt_request(cs) & CPU_INTERRUPT_HARD)) { return false; @@ -8751,7 +8755,7 @@ POWERPC_FAMILY(POWER8)(ObjectClass *oc, void *data) pcc->pcr_supported = PCR_COMPAT_2_07 | PCR_COMPAT_2_06 | PCR_COMPAT_2_05; pcc->init_proc = init_proc_POWER8; pcc->check_pow = check_pow_nocheck; - cc->has_work = cpu_has_work_POWER8; + cc->has_work_with_iothread_lock = cpu_has_work_POWER8; pcc->insns_flags = PPC_INSNS_BASE | PPC_ISEL | PPC_STRING | PPC_MFTB | PPC_FLOAT | PPC_FLOAT_FSEL | PPC_FLOAT_FRES | PPC_FLOAT_FSQRT | PPC_FLOAT_FRSQRTE | @@ -8901,6 +8905,8 @@ static bool cpu_has_work_POWER9(CPUState *cs) PowerPCCPU *cpu = POWERPC_CPU(cs); CPUPPCState *env = &cpu->env; + g_assert(qemu_mutex_iothread_locked()); + if (cpu_halted(cs)) { uint64_t psscr = env->spr[SPR_PSSCR]; @@ -8968,7 +8974,7 @@ POWERPC_FAMILY(POWER9)(ObjectClass *oc, void *data) PCR_COMPAT_2_05; pcc->init_proc = init_proc_POWER9; pcc->check_pow = check_pow_nocheck; - cc->has_work = cpu_has_work_POWER9; + cc->has_work_with_iothread_lock = cpu_has_work_POWER9; pcc->insns_flags = PPC_INSNS_BASE | PPC_ISEL | PPC_STRING | PPC_MFTB | PPC_FLOAT | PPC_FLOAT_FSEL | PPC_FLOAT_FRES | PPC_FLOAT_FSQRT | PPC_FLOAT_FRSQRTE | @@ -9117,6 +9123,7 @@ static bool cpu_has_work_POWER10(CPUState *cs) PowerPCCPU *cpu = POWERPC_CPU(cs); CPUPPCState *env = &cpu->env; + g_assert(qemu_mutex_iothread_locked()); if (cpu_halted(cs)) { uint64_t psscr = env->spr[SPR_PSSCR]; @@ -9185,7 +9192,7 @@ POWERPC_FAMILY(POWER10)(ObjectClass *oc, void *data) PCR_COMPAT_2_06 | PCR_COMPAT_2_05; pcc->init_proc = init_proc_POWER10; pcc->check_pow = check_pow_nocheck; - cc->has_work = cpu_has_work_POWER10; + cc->has_work_with_iothread_lock = cpu_has_work_POWER10; pcc->insns_flags = PPC_INSNS_BASE | PPC_ISEL | PPC_STRING | PPC_MFTB | PPC_FLOAT | PPC_FLOAT_FSEL | PPC_FLOAT_FRES | PPC_FLOAT_FSQRT | PPC_FLOAT_FRSQRTE | @@ -10660,6 +10667,8 @@ static bool ppc_cpu_has_work(CPUState *cs) PowerPCCPU *cpu = POWERPC_CPU(cs); CPUPPCState *env = &cpu->env; + g_assert(qemu_mutex_iothread_locked()); + return msr_ee && (cpu_interrupt_request(cs) & CPU_INTERRUPT_HARD); } @@ -10884,7 +10893,7 @@ static void ppc_cpu_class_init(ObjectClass *oc, void *data) cc->class_by_name = ppc_cpu_class_by_name; pcc->parent_parse_features = cc->parse_features; cc->parse_features = ppc_cpu_parse_featurestr; - cc->has_work = ppc_cpu_has_work; + cc->has_work_with_iothread_lock = ppc_cpu_has_work; cc->do_interrupt = ppc_cpu_do_interrupt; cc->cpu_exec_interrupt = ppc_cpu_exec_interrupt; cc->dump_state = ppc_cpu_dump_state;