From patchwork Thu Mar 26 19:31:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 184923 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp480788ilr; Thu, 26 Mar 2020 13:13:16 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuNvle7BPY5oGfQKZR7pkqKQYoVnuUo0PM4cSn5HVjIuajaj64gyeO705nboteEpm2moQ17 X-Received: by 2002:a0c:b757:: with SMTP id q23mr10302043qve.213.1585253596193; Thu, 26 Mar 2020 13:13:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585253596; cv=none; d=google.com; s=arc-20160816; b=zH0lvcXz6vttFIqvATjaxh6AecSMxEuqFl1StC6fMQQrOsZlBXtDt6sx5Pu0hz5htJ 3U0am21huepTdcY/xOkuYZ5FjeaOroIIbq5Kb/TA2d4vosMWVND61qWAi6ZRUJL7SX6s SDuU3+zqvwN9hfT3B/wBTFE8rddMKYxAMEzt55emIGRJ6FuE1fO4fQzBoHXuZ9GB1b3R Lh11AoLKlQi0Trj9K0LyQLL7HIZCWO65glgzuOzLN5iXEDnw6JiQJ/gOTHk6WYRig/oN BjUfEBK4rzvCSI/O7H0SfgKLbBujl2eS0KCp1nx7XKXlPSMftpPCHSOSW/+l3vrPIgrE Lx3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=eeSLak8+K7WugRHnssmk7+JwZVy31ZcBf2Dmq4ryGYA=; b=OY5KHssH0pjKEzieNgpuA7tqcjR/2flmFgsxRuu+gAf7gvb+1a2UMa3cAN56EbhWkg 84L87zgUA3Fb8UJB84EMw+YDsQ9/IwjN41ovgPztjjKMydWtKzoo/ImXDQrBji15PmKU lCRaNCasPJ/xjDpvd/NUStwwxVMtHhta9WfRljuC7D51OpsYh1pnEpjszMn6YirCNP+H 1O27QsSkFoyyPPc2typxc6mKoHTZqQjvfFWD9AUC0SA/TAwjYPeCWrvyRuCG3U0goUCD tUw1i+yZ50B5TcXxCd81IoqiV7EayN0MaHJZMc9/kFOXO26LD5gVCk4j0Kg2U/Fanchf /SYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=IQCr56Tp; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id g11si777672qvw.179.2020.03.26.13.13.16 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 13:13:16 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=IQCr56Tp; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:59606 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYsN-0001g4-OJ for patch@linaro.org; Thu, 26 Mar 2020 16:13:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59400) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYLN-0000H7-6D for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:39:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYLM-0002D0-0p for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:39:09 -0400 Received: from mail-qv1-xf41.google.com ([2607:f8b0:4864:20::f41]:40828) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYLL-0002Cq-Sg for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:39:07 -0400 Received: by mail-qv1-xf41.google.com with SMTP id cy12so3696541qvb.7 for ; Thu, 26 Mar 2020 12:39:07 -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=eeSLak8+K7WugRHnssmk7+JwZVy31ZcBf2Dmq4ryGYA=; b=IQCr56TpmVCBKEnOe0s36sZGQuJYgCJw5F4xi+RQQAzQ+IZx0OdCfZkFaSJLP+ktv5 paGiFf+cOLUK4GiecYBIKNiKo+ZmfYzmRhThgZ5EwY1SKwA8WsqsRzFlb5iXxXDATam9 hE9yHABChK1IAiJ0DnO3j3xPBHh6fTJeYm5HUco2Rs9I5kEqgOJXit9/EPe5jZGF9DG3 DnsmVA1Bs0bFKLzxHNFDqXFpFlbA80wANd0c/pIxYoDOiofANASYdcsSAash2zrVT9/J PYYkjGKpNNxPbETvOnKH6DH5a0zjeoSuGm7mSXnPkuC33i6nF1Vv+v7EouP1gln/RqEF J11g== 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=eeSLak8+K7WugRHnssmk7+JwZVy31ZcBf2Dmq4ryGYA=; b=jbu6s7fzFiY8V7Vt6ODZe/jJG+oq2Kpt6SsfcHeY9sZXXxh+d9EVWQrkQ30Z/XmC1s 39dsdItaANFsm7k2LjsMA7jbp/uyJ/fxOLwRXW9ojq1zxAtLkr2Kp6dP4s0peYrA0GNe 1mdx5RV+gvdCRYly8wWo6xHV1RjHi3q/e+eqMh7y8L6vFgrgNI/dq8iZiyIp0m3VxGzx gxAW1R7NtPq+Mqy2F4RTRH1PTNMJPT8nSFocqO2B8jL4k3Rf96rS9a/zp/QBqPyK4m5F ibuVaHMaKGorABmVO9fuwX0HSkOgfIfemEm7/FH+cSLU2OSgg7bHe99FdM7eij5BJThs v4Lg== X-Gm-Message-State: ANhLgQ2a9YcEgnnH3Y7yEuE2gWGF8/nsUN116YcLdEa3Yq0MngG6R436 xmn0G56KlLgeSx1MIooThnlZkxLhubjIzw== X-Received: by 2002:ad4:45e9:: with SMTP id q9mr10083008qvu.199.1585251547072; Thu, 26 Mar 2020 12:39:07 -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.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:39:06 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 67/74] riscv: convert to cpu_has_work_with_iothread_lock Date: Thu, 26 Mar 2020 15:31:49 -0400 Message-Id: <20200326193156.4322-68-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::f41 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, Sagar Karandikar , Bastian Koppelmann , richard.henderson@linaro.org, "Emilio G. Cota" , Palmer Dabbelt , peter.puhov@linaro.org, alex.bennee@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Soon we will call cpu_has_work without the BQL. Cc: Palmer Dabbelt Cc: Sagar Karandikar Cc: Bastian Koppelmann Reviewed-by: Palmer Dabbelt Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- target/riscv/cpu.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 4e578239d3..ebc2483bec 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -314,6 +314,9 @@ static bool riscv_cpu_has_work(CPUState *cs) #ifndef CONFIG_USER_ONLY RISCVCPU *cpu = RISCV_CPU(cs); CPURISCVState *env = &cpu->env; + + g_assert(qemu_mutex_iothread_locked()); + /* * Definition of the WFI instruction requires it to ignore the privilege * mode and delegation registers, but respect individual enables @@ -515,7 +518,7 @@ static void riscv_cpu_class_init(ObjectClass *c, void *data) device_class_set_parent_reset(dc, riscv_cpu_reset, &mcc->parent_reset); cc->class_by_name = riscv_cpu_class_by_name; - cc->has_work = riscv_cpu_has_work; + cc->has_work_with_iothread_lock = riscv_cpu_has_work; cc->do_interrupt = riscv_cpu_do_interrupt; cc->cpu_exec_interrupt = riscv_cpu_exec_interrupt; cc->dump_state = riscv_cpu_dump_state;