From patchwork Mon Aug 17 14:01:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 11718313 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 5B3F114F6 for ; Mon, 17 Aug 2020 14:04:16 +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 31C4D2065D for ; Mon, 17 Aug 2020 14:04:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hf2yhCXz" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 31C4D2065D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:57318 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k7fkF-0007tL-G5 for patchwork-qemu-devel@patchwork.kernel.org; Mon, 17 Aug 2020 10:04:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59424) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k7fhy-0003JC-TZ; Mon, 17 Aug 2020 10:01:55 -0400 Received: from mail-lf1-x141.google.com ([2a00:1450:4864:20::141]:44239) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k7fht-0001W7-Lj; Mon, 17 Aug 2020 10:01:54 -0400 Received: by mail-lf1-x141.google.com with SMTP id x24so8402227lfe.11; Mon, 17 Aug 2020 07:01:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hCmudOOZ9aY/+riJSRrIyYnafB9XQ90ekRagFJVmQlU=; b=hf2yhCXzMnvAgLqxwWgyoQdxFSr7Py3jsCEWqkKTqVnoXZnMjJXne5E4r103GtTsuY +DFSQiAm5KbvivHnpYgVRwh58vNkggpc3GGjqZrqOdCzkZke8uOz/5Cx8msai8rN0moS V6jZo+9hYZOW/uIoa1ekWTnD/qj7DEKwR03q6DMijewOAu4/k7TWBx2Sa6XoLTP8Mrez EjlCAzMCetxkJXQcNX3HJiXIE+JL/yk1wl1tq8gLhXYVgnvniPKA6rQvSn1+3+2+D1S9 iNqX1VkNzJht2kHPJXCd6WgELer4VVzRoIYSZpMty3BtMFP01igNX1grsSK8lxFsfkSv qdXg== 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:mime-version:content-transfer-encoding; bh=hCmudOOZ9aY/+riJSRrIyYnafB9XQ90ekRagFJVmQlU=; b=kWK7Ie7AxOLaorw219i0mtrjAyy4eBWWkjo/xxQ+g/kn5dYTPQGHIiyBzpNAcdUbs/ rfH3Nj8ISmk+vc8wEw1TFXrQ1zNOtclmdpBb+NYVFLOWBc1W9CJ44yl4P+xRZ0DHsbLf 5tIJ+eubk0Vf7cnvjLkd7EaHVgyMBnneXYGcmXJkwBoXNdATTeMcEqJabVzvpf4nH3l5 UpN7avfLtVG2fuat0jeCgKTpF03JK+CrwqkfZY0LDtvDcQnlYXUzFfbyJ8OtE9J+xnkg NCiB4jhH4qOfIkzl/7J7zvjFDdVS6vldBYhFJOC26vO8H1ppgGlbwVUAG9gl/qkQhUu6 rHRg== X-Gm-Message-State: AOAM532SKRtBR41mHOaVjJG99EkEIniuThI3YDWDDX8kKrBIksFowlTJ kr8NqQtE0d2buq25qu3RDbshJaEjkfr6IG58 X-Google-Smtp-Source: ABdhPJxoxwvUMAXqMz5OdfMeYlbDMbtYIjn2xZ33uaN/rkhpAftw7FvIZFUbjFSMDC+3PeWHqjUj6A== X-Received: by 2002:a19:414b:: with SMTP id o72mr7588320lfa.86.1597672907372; Mon, 17 Aug 2020 07:01:47 -0700 (PDT) Received: from gmail.com (81-231-232-130-no39.tbcn.telia.com. [81.231.232.130]) by smtp.gmail.com with ESMTPSA id q189sm5013030ljq.68.2020.08.17.07.01.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 07:01:46 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Subject: [PATCH v1 1/5] target/microblaze: mbar: Transfer dc->rd to mbar_imm Date: Mon, 17 Aug 2020 16:01:40 +0200 Message-Id: <20200817140144.373403-2-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200817140144.373403-1-edgar.iglesias@gmail.com> References: <20200817140144.373403-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::141; envelope-from=edgar.iglesias@gmail.com; helo=mail-lf1-x141.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, FSL_HELO_FAKE=1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action 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: figlesia@xilinx.com, peter.maydell@linaro.org, sstabellini@kernel.org, edgar.iglesias@xilinx.com, sai.pavan.boddu@xilinx.com, frasse.iglesias@gmail.com, alistair@alistair23.me, richard.henderson@linaro.org, frederic.konrad@adacore.com, qemu-arm@nongnu.org, philmd@redhat.com, luc.michel@greensocs.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: "Edgar E. Iglesias" Transfer dc->rd to mbar_imm to improve the readability when comparing to the specs. No functional change. Signed-off-by: Edgar E. Iglesias Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- target/microblaze/translate.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index f6ff2591c3..47637f152b 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -1229,8 +1229,10 @@ static void dec_br(DisasContext *dc) /* Memory barrier. */ mbar = (dc->ir >> 16) & 31; if (mbar == 2 && dc->imm == 4) { + uint16_t mbar_imm = dc->rd; + /* mbar IMM & 16 decodes to sleep. */ - if (dc->rd & 16) { + if (mbar_imm & 16) { TCGv_i32 tmp_hlt = tcg_const_i32(EXCP_HLT); TCGv_i32 tmp_1 = tcg_const_i32(1); @@ -1246,7 +1248,7 @@ static void dec_br(DisasContext *dc) tcg_temp_free_i32(tmp_1); return; } - LOG_DIS("mbar %d\n", dc->rd); + LOG_DIS("mbar %d\n", mbar_imm); /* Break the TB. */ dc->cpustate_changed = 1; return; From patchwork Mon Aug 17 14:01:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 11718307 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 5312013A4 for ; Mon, 17 Aug 2020 14:03:03 +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 29EAE2065D for ; Mon, 17 Aug 2020 14:03:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="YF/rUwhG" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 29EAE2065D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:50138 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k7fj4-00051M-DZ for patchwork-qemu-devel@patchwork.kernel.org; Mon, 17 Aug 2020 10:03:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59396) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k7fhx-0003Hv-J8; Mon, 17 Aug 2020 10:01:53 -0400 Received: from mail-lj1-x242.google.com ([2a00:1450:4864:20::242]:35510) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k7fhv-0001We-0L; Mon, 17 Aug 2020 10:01:53 -0400 Received: by mail-lj1-x242.google.com with SMTP id i10so17606858ljn.2; Mon, 17 Aug 2020 07:01:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YijezSjj37b3KI8DzXtGc07DWsdbUe75Toiwcts1NQA=; b=YF/rUwhGmFUPujnQ7vq2K4GiXayIL+d1C3l7mjkgDdTVho3yD9xIOoiz5U8AM8aqPF 8iWs1m2cK79vVFH+b9yDbmxCRxGBNtcQM8bjztfAKnfnAARhK/3Dzt+vF1d81V2+1gBu P00+ciwOq2zFSFEFVtLccCBpq4eB62qgLDd1BuRVLwLDXjqS4t4OXZvlKAzaOqG3grNO P5mTWOkKvenav7Dkr5p7waOvbjd6CKzY9ocK0NQ5Z1vJRWhI0nZSlmDNPUmZ4znDF+iR UOJaoFql9QYDiwgXznV0bU7QW+iVHUA9x5mIP6sv/FLKcxBCuIlwos6QVUwn9TTvRul4 xIkQ== 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:mime-version:content-transfer-encoding; bh=YijezSjj37b3KI8DzXtGc07DWsdbUe75Toiwcts1NQA=; b=E4G4YHseFqpSG/XoGxzrE7FM+H6RxN8exKWlrXhRKGfGY60GAyEWxztE0dEy7ev0Ds rGmvWwDA07TdR/SMCSlSavyrPWETu4rmkCaSHuG9uz5WU49ptJTXdpdhaz3OMoI4Ptff CLwad5XCrX+gjkHoTvoEYyRHufZcMsL3XdeVt5bvrTv3nyPl0VDp+y+GbZFDgWCuyg43 z+uZX8cao8MhtcT0ETWIJ0JrCmnmdMn3qdkWXPWaMIBLRcIvCYzRuJIiqV2zf+mQVj0/ q7vzfhl31X/w+xosE7W4n7QkJcTp52g+SiAeTx8ulhk+2oClIzN7y0UhtTm0+p+mZwu6 sN9g== X-Gm-Message-State: AOAM5338rwBDlZkwNz93lgHkEZ4nf1rZM1eUWhK71HDgNGdZLYAyxv2q REEoV5F6L3e4ejWnHOKWYv54V3rXidb8cWi6 X-Google-Smtp-Source: ABdhPJzdYWfSc11z4Ar/F9bT0efMtFUq66I4lQZbOv2CKizNS/WvgzZNAb5IpbihimdKGSiVtTKMug== X-Received: by 2002:a05:651c:110:: with SMTP id a16mr7987230ljb.152.1597672908652; Mon, 17 Aug 2020 07:01:48 -0700 (PDT) Received: from gmail.com (81-231-232-130-no39.tbcn.telia.com. [81.231.232.130]) by smtp.gmail.com with ESMTPSA id b16sm5063513ljk.24.2020.08.17.07.01.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 07:01:48 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Subject: [PATCH v1 2/5] target/microblaze: mbar: Move LOG_DIS to before sleep Date: Mon, 17 Aug 2020 16:01:41 +0200 Message-Id: <20200817140144.373403-3-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200817140144.373403-1-edgar.iglesias@gmail.com> References: <20200817140144.373403-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::242; envelope-from=edgar.iglesias@gmail.com; helo=mail-lj1-x242.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, FSL_HELO_FAKE=1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action 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: figlesia@xilinx.com, peter.maydell@linaro.org, sstabellini@kernel.org, edgar.iglesias@xilinx.com, sai.pavan.boddu@xilinx.com, frasse.iglesias@gmail.com, alistair@alistair23.me, richard.henderson@linaro.org, frederic.konrad@adacore.com, qemu-arm@nongnu.org, philmd@redhat.com, luc.michel@greensocs.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: "Edgar E. Iglesias" Move LOG_DIS log to before sleeping handling so that it logs for sleep instructions aswell. Signed-off-by: Edgar E. Iglesias Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- target/microblaze/translate.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index 47637f152b..c1be76d4c8 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -1231,6 +1231,8 @@ static void dec_br(DisasContext *dc) if (mbar == 2 && dc->imm == 4) { uint16_t mbar_imm = dc->rd; + LOG_DIS("mbar %d\n", mbar_imm); + /* mbar IMM & 16 decodes to sleep. */ if (mbar_imm & 16) { TCGv_i32 tmp_hlt = tcg_const_i32(EXCP_HLT); @@ -1248,7 +1250,6 @@ static void dec_br(DisasContext *dc) tcg_temp_free_i32(tmp_1); return; } - LOG_DIS("mbar %d\n", mbar_imm); /* Break the TB. */ dc->cpustate_changed = 1; return; From patchwork Mon Aug 17 14:01:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 11718309 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 F13AD13A4 for ; Mon, 17 Aug 2020 14:03:12 +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 873E52065D for ; Mon, 17 Aug 2020 14:03:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="RhTy0gqh" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 873E52065D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51006 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k7fjD-0005MV-IW for patchwork-qemu-devel@patchwork.kernel.org; Mon, 17 Aug 2020 10:03:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59442) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k7fhz-0003K3-Nk; Mon, 17 Aug 2020 10:01:56 -0400 Received: from mail-lj1-x244.google.com ([2a00:1450:4864:20::244]:38216) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k7fhw-0001XC-LX; Mon, 17 Aug 2020 10:01:55 -0400 Received: by mail-lj1-x244.google.com with SMTP id m22so17575665ljj.5; Mon, 17 Aug 2020 07:01:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BfvYle3AyXZXtRgGPAz105k3QnmpEvKZtYecnlYInTY=; b=RhTy0gqh9Yly0157weuxmBvUxq8VjOW1EFeb1iJeIftEi/dL1SVY4JGprwb8u10vSK AwupqxcTryarWb8I3k1FoDrODibDX42iZknZe0SbL1mk+9eotvQIwQzAIGkViPlQ2y9y Qv4DLyKz4FoJB84Qt3xCgibLN07k3KiOhF37VQCOoXb/7HAb6P2Ge3DzrvDs48yzk/WL lIdqHsusRR3RgUNed5L4MuoAcZoxM8BpqUvwKCXnZecV6obu3u+DTU6cQxReYbVKfqx5 KYJYFTn3agn1coFOTEzy3Kc9lemr/OPwv45tT6JTJA8jHz+MgKz/f7GTDrV+mQ1TgXN1 NKNw== 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:mime-version:content-transfer-encoding; bh=BfvYle3AyXZXtRgGPAz105k3QnmpEvKZtYecnlYInTY=; b=KCHz2As0ABMph1aPgz1zj8EuJG9dF7zjxzfvflmLbvQeaur3dn3GcwNwp8AoLlh/Vw z6CXR27R8/YQ+PnGOiQ/kYjhoNFB87QMfY8SfgPuRCP0Vh2++zO/Gyag1uQJSTfI/JTH oRVcMKRXrKClQ8wydqzY552xzNk2LjzyA7pzD5q8cwxPxlaZpP8b4fcUc2EwBaFZET7x I0EMgf+slSJlKpdfw+4dOs3cjFfqZHDDmE1wTqLEMB+oHZxc9GNPF5BpMEQ6zVgYWi5X lB/T/TcoMlXHrNL3xXhyJ84b/biawxKN7nVm5rGDrLySGcDAOBZrMqzDMevom++WwdUi KssQ== X-Gm-Message-State: AOAM532KzaRTa5qelxjIpzr7GxG9yfdwdwxdE+ocKbWPnVRboYvR6eYZ KXFiz1SWg0Gb/idoXFC7zVcsaFjAfmWopkwx X-Google-Smtp-Source: ABdhPJzMvQzyBO7QqU37PJDf0WR3Xmr8FnD78Al4zAgaPcQx/SWS/a66sBBPHq8CxWEeImqvdMgJMg== X-Received: by 2002:a2e:8e70:: with SMTP id t16mr7975048ljk.81.1597672910407; Mon, 17 Aug 2020 07:01:50 -0700 (PDT) Received: from gmail.com (81-231-232-130-no39.tbcn.telia.com. [81.231.232.130]) by smtp.gmail.com with ESMTPSA id 29sm5111941ljv.72.2020.08.17.07.01.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 07:01:49 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Subject: [PATCH v1 3/5] target/microblaze: mbar: Add support for data-access barriers Date: Mon, 17 Aug 2020 16:01:42 +0200 Message-Id: <20200817140144.373403-4-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200817140144.373403-1-edgar.iglesias@gmail.com> References: <20200817140144.373403-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::244; envelope-from=edgar.iglesias@gmail.com; helo=mail-lj1-x244.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, FSL_HELO_FAKE=1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action 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: figlesia@xilinx.com, peter.maydell@linaro.org, sstabellini@kernel.org, edgar.iglesias@xilinx.com, sai.pavan.boddu@xilinx.com, frasse.iglesias@gmail.com, alistair@alistair23.me, richard.henderson@linaro.org, frederic.konrad@adacore.com, qemu-arm@nongnu.org, philmd@redhat.com, luc.michel@greensocs.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: "Edgar E. Iglesias" Add support for data-access barriers. Signed-off-by: Edgar E. Iglesias Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- target/microblaze/translate.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index c1be76d4c8..c58f334a0f 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -1233,6 +1233,11 @@ static void dec_br(DisasContext *dc) LOG_DIS("mbar %d\n", mbar_imm); + /* Data access memory barrier. */ + if ((mbar_imm & 2) == 0) { + tcg_gen_mb(TCG_BAR_SC | TCG_MO_ALL); + } + /* mbar IMM & 16 decodes to sleep. */ if (mbar_imm & 16) { TCGv_i32 tmp_hlt = tcg_const_i32(EXCP_HLT); From patchwork Mon Aug 17 14:01:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 11718315 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 E3BB113A4 for ; Mon, 17 Aug 2020 14:04:24 +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 B9DB02065D for ; Mon, 17 Aug 2020 14:04:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="snY6vt1C" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B9DB02065D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:57920 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k7fkO-00089W-2B for patchwork-qemu-devel@patchwork.kernel.org; Mon, 17 Aug 2020 10:04:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59448) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k7fi1-0003LT-5s; Mon, 17 Aug 2020 10:01:57 -0400 Received: from mail-lf1-x143.google.com ([2a00:1450:4864:20::143]:44241) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k7fhy-0001Xe-Vx; Mon, 17 Aug 2020 10:01:56 -0400 Received: by mail-lf1-x143.google.com with SMTP id x24so8402389lfe.11; Mon, 17 Aug 2020 07:01:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gRwNidHb/xzDXEvtr3z3PMKv/URa1A0x7rFiibmqh6s=; b=snY6vt1CXWl9LUwqROGVCqaHldkYLhrO/SVpV3q/z4WM0N2XlnhMRL/SzOG9DSPrRc FDoe2FwWKc8XpOmnxFcXytqiQJga++uIwM83vpwTTTBFwEaFcxzkO3M0JXuQxzXasX7V z/z1+M5o87cjnkHmXK3ClPxprKJRxTn3ODdXW4Z6myOd8anyX7wyGARXnPCffLYvKDOe W2rFyG5Hfklphw63swW1CXstQNuGF0qjnH1rA4CFfn8BZyh8fFqConQC27VvBUPhzq5H b4NpfGQNLSWsyJvKmxBOmTyldw17qYRa5y9XBJ4Xugfb9uZkUIzYTcRzVlZxHFTCdGUT bfWQ== 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:mime-version:content-transfer-encoding; bh=gRwNidHb/xzDXEvtr3z3PMKv/URa1A0x7rFiibmqh6s=; b=XLUqk/BgijLTKv70Pv72hXZriobZPAhFwBtAovU9gYj8np53x9GYIbR8b40LjfvztY 7Hf0KvPzWDr8HPD+uT7N4fMYxU74XuMisMG4kc9oRpYyH6tp4OEuInL/bSw4lY9yEVt5 hElaPAxoeG9NBJjFw/zVcTioPjwQFccA6jBIslBI7VvDqQxL4a1Q0UprBFFwtdgfmpNa IAEdj0/uFEIFpcC2RC2xyYoOsCIzkDSqfkEsWmuiH7WEkhDY7NdjxI9QFcksR81eSVH6 +gYlmJHou959RQF47c3RSNKEbCy0+CS4UKkPkQGgK863BiGdGWAGjQEZlCt8+mtqP04W sU3g== X-Gm-Message-State: AOAM531DJzqoSNZh+V48pdkdWKMDExifHoEuWauuk8LHdS0NQLuRiSDR utm7tPwUSEQblJYi8rOhd+fkFF+6zTtxweQf X-Google-Smtp-Source: ABdhPJzJkRodM4UO4geVDmC1nu9978k3vs7vvm1TKrYnC02NfGsRg/jpRFt0W3g8M97xR4h5hAd9Zg== X-Received: by 2002:a19:cb51:: with SMTP id b78mr7459536lfg.130.1597672912623; Mon, 17 Aug 2020 07:01:52 -0700 (PDT) Received: from gmail.com (81-231-232-130-no39.tbcn.telia.com. [81.231.232.130]) by smtp.gmail.com with ESMTPSA id c4sm5040593ljk.70.2020.08.17.07.01.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 07:01:52 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Subject: [PATCH v1 4/5] target/microblaze: swx: Use atomic_cmpxchg Date: Mon, 17 Aug 2020 16:01:43 +0200 Message-Id: <20200817140144.373403-5-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200817140144.373403-1-edgar.iglesias@gmail.com> References: <20200817140144.373403-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::143; envelope-from=edgar.iglesias@gmail.com; helo=mail-lf1-x143.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, FSL_HELO_FAKE=1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action 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: figlesia@xilinx.com, peter.maydell@linaro.org, sstabellini@kernel.org, edgar.iglesias@xilinx.com, sai.pavan.boddu@xilinx.com, frasse.iglesias@gmail.com, alistair@alistair23.me, richard.henderson@linaro.org, frederic.konrad@adacore.com, qemu-arm@nongnu.org, philmd@redhat.com, luc.michel@greensocs.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: "Edgar E. Iglesias" Use atomic_cmpxchg to implement the atomic cmpxchg sequence. Signed-off-by: Edgar E. Iglesias Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- target/microblaze/translate.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index c58f334a0f..530c15e5ad 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -1075,14 +1075,16 @@ static void dec_store(DisasContext *dc) swx_skip = gen_new_label(); tcg_gen_brcond_tl(TCG_COND_NE, env_res_addr, addr, swx_skip); - /* Compare the value loaded at lwx with current contents of - the reserved location. - FIXME: This only works for system emulation where we can expect - this compare and the following write to be atomic. For user - emulation we need to add atomicity between threads. */ + /* + * Compare the value loaded at lwx with current contents of + * the reserved location. + */ tval = tcg_temp_new_i32(); - tcg_gen_qemu_ld_i32(tval, addr, cpu_mmu_index(&dc->cpu->env, false), - MO_TEUL); + + tcg_gen_atomic_cmpxchg_i32(tval, addr, env_res_val, + cpu_R[dc->rd], mem_index, + mop); + tcg_gen_brcond_i32(TCG_COND_NE, env_res_val, tval, swx_skip); write_carryi(dc, 0); tcg_temp_free_i32(tval); @@ -1108,7 +1110,10 @@ static void dec_store(DisasContext *dc) break; } } - tcg_gen_qemu_st_i32(cpu_R[dc->rd], addr, mem_index, mop); + + if (!ex) { + tcg_gen_qemu_st_i32(cpu_R[dc->rd], addr, mem_index, mop); + } /* Verify alignment if needed. */ if (dc->cpu->cfg.unaligned_exceptions && size > 1) { From patchwork Mon Aug 17 14:01:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 11718311 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 0FAF613A4 for ; Mon, 17 Aug 2020 14:03:14 +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 DB3AE2065D for ; Mon, 17 Aug 2020 14:03:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="uL7L7IHm" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DB3AE2065D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51196 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k7fjF-0005R7-3W for patchwork-qemu-devel@patchwork.kernel.org; Mon, 17 Aug 2020 10:03:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59474) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k7fi2-0003Ow-OC; Mon, 17 Aug 2020 10:01:58 -0400 Received: from mail-lj1-x243.google.com ([2a00:1450:4864:20::243]:42834) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k7fi1-0001Xy-89; Mon, 17 Aug 2020 10:01:58 -0400 Received: by mail-lj1-x243.google.com with SMTP id t6so17571688ljk.9; Mon, 17 Aug 2020 07:01:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SlT2ICdzLrnaoALHk1KYrs2UvgiIgkYCqrO895ftDGQ=; b=uL7L7IHmKI2vdrlwkf6ZEfDat3isSF6s8qGdY5mmXT4Rn3KbtB0iBMhiupIoALLebo Bm3olxEPYFIvO9BHDQE4zx3reswsX2luEZfDp1GNRWfBHc3S1uQwAWVA30NkDQgD6goT Hl/4Opv0mPmhgN1nSfpOFe3XbEIFV7asG1fAp+6Mx7H7oSBvop0N2hM9IMiEYNKvGL1c xqhJvQhr5oZXVpSfIqJRNhpMRNBlTaf5hB9ThYO7sDfoSQUmwwRsK6BHREAQ+BYx851V zlECUd3+spNZgTK6ZlwuEMu2WnS4dZ1ngdwKh/oqhDk3GvA8Hvt5uvl6zEnmAiUlyNkq ylcA== 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:mime-version:content-transfer-encoding; bh=SlT2ICdzLrnaoALHk1KYrs2UvgiIgkYCqrO895ftDGQ=; b=RcIMLf2hLRb3ijqVjz8lpPZ20vxbUUAuvZnasplZ7XdI5nz6md2GM+wvU1r3l+/eIG 6j3mwNShMBlgzSoHtm3cm67qDIhJ6LEe5AzrONfrOsFR6NZussO/qlBEfsOabLSohaDG 04RfArP2/BmQ4tNZ9FEocyY6ARgV0rs/glM2+gUzMDRCEFDl6lH1JOe+EOLPwhwi32v0 4tdoYUNsxBefjTMDJzyoLy9Ny6hqwid5bw+3Fe1AcGP3etEd44rVu5bnsaA7/ZchILID 0eI+mbsJtfBjs0P+D2qVsWpIa2y/SvTcYPQulVtW3Fxj+ZQgMcKVlIb2nxNiN03IZwhw y6fQ== X-Gm-Message-State: AOAM531y9ph2VLJ5YCro0ZC02/gTYlwhmB1tIpyRadCg7bc62w5YLEs+ eqo9XtmDNzgSNBZIGsk2gJHH6GkH7/xqp/bh X-Google-Smtp-Source: ABdhPJx5uGT4GruugLwOOG23iNxicSNakj2yRZD4C3e0ZLWc5h29Oeukmbrn5xlTYp5iimHQKuPBBQ== X-Received: by 2002:a2e:85a:: with SMTP id g26mr7652335ljd.319.1597672913915; Mon, 17 Aug 2020 07:01:53 -0700 (PDT) Received: from gmail.com (81-231-232-130-no39.tbcn.telia.com. [81.231.232.130]) by smtp.gmail.com with ESMTPSA id l10sm3436818ljc.65.2020.08.17.07.01.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 07:01:53 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Subject: [PATCH v1 5/5] configure: microblaze: Enable mttcg Date: Mon, 17 Aug 2020 16:01:44 +0200 Message-Id: <20200817140144.373403-6-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200817140144.373403-1-edgar.iglesias@gmail.com> References: <20200817140144.373403-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::243; envelope-from=edgar.iglesias@gmail.com; helo=mail-lj1-x243.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, FSL_HELO_FAKE=1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action 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: figlesia@xilinx.com, peter.maydell@linaro.org, sstabellini@kernel.org, edgar.iglesias@xilinx.com, sai.pavan.boddu@xilinx.com, frasse.iglesias@gmail.com, alistair@alistair23.me, richard.henderson@linaro.org, frederic.konrad@adacore.com, qemu-arm@nongnu.org, philmd@redhat.com, luc.michel@greensocs.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: "Edgar E. Iglesias" Signed-off-by: Edgar E. Iglesias Reviewed-by: Alistair Francis --- configure | 1 + 1 file changed, 1 insertion(+) diff --git a/configure b/configure index 2acc4d1465..2f7adaa6ae 100755 --- a/configure +++ b/configure @@ -8162,6 +8162,7 @@ case "$target_name" in microblaze|microblazeel) TARGET_ARCH=microblaze TARGET_SYSTBL_ABI=common + mttcg="yes" bflt="yes" echo "TARGET_ABI32=y" >> $config_target_mak ;;