From nobody Sun May 12 17:05:53 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1597685544; cv=none; d=zohomail.com; s=zohoarc; b=jMIYfxqR/L1Iszo7s8h3MgDq7NdJ7Td2Ew1HZ6it6gkUvqHoHd30/VIxdF9sNWdZPC5Gx8WhHaUYym5oiOC6Ve4VxJMOWwxJTi1OQt2pwgsoReWRtDfKqVoZ2xw+jUplox+MoK+TSWW47Zl8BItgWxCsDWEI+wUDJmVWQ+6/u7A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597685544; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=42pNxyFkb8r8xbuSmezRvuZiT8cVhtJo0HiE1dBtcds=; b=cjPuJfnQlSRMbV9rtFDSD8MCWY0XEAiSfFN5nZYlfZUeijjz+N8EuXmGUOrwITHZ0Kkr4KGxnoRNIDIu8bpit4qMyw+l+y6Huym1n/ss6dU1JebtwDArNP5gfNKbr+94TXFxBg/HOs2xRlex+7GpYNr8G4P13YexRTFUodcFgjc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1597685544481463.58918263764065; Mon, 17 Aug 2020 10:32:24 -0700 (PDT) Received: from localhost ([::1]:44464 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k7izf-0002hX-3x for importer@patchew.org; Mon, 17 Aug 2020 13:32:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59980) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k7iyB-0001cz-E3; Mon, 17 Aug 2020 13:30:51 -0400 Received: from mail-lf1-x142.google.com ([2a00:1450:4864:20::142]:41297) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k7iyA-0005w8-4b; Mon, 17 Aug 2020 13:30:51 -0400 Received: by mail-lf1-x142.google.com with SMTP id i19so8774387lfj.8; Mon, 17 Aug 2020 10:30:49 -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 q20sm5165600ljj.42.2020.08.17.10.30.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 10:30:47 -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=42pNxyFkb8r8xbuSmezRvuZiT8cVhtJo0HiE1dBtcds=; b=oMpuKHd7SYY7imaG5TFWU8UTqDv+DCsYgQ9m4AP34y/49Xteck4G6FABd063WfuINo v3DDjUaV421Af8lqpI1YWawTNtIoVGV0vvS5DUwlc9iqWHhtfoLw+ez/iFGedECMlanp 0zhZRZYXN+Egny6Dl3wQg8F0OwxQxTW2k6n/ZDQ+FmtvPzCifalSAOQgV6ZhRdCATMfe 8UQkFhG0R3J/IL/o5LgHAYNRzD/MhABETIfNRGwxueoa/PVf2oNQ8A0uynjYPTfoXS2g 8MDF2INrNfNm9j7kahSWB4IE0M7peBVJXSc56KXeuqu0Xpr9gF2g0+0JcQLaSl+54SH3 U+xA== 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=42pNxyFkb8r8xbuSmezRvuZiT8cVhtJo0HiE1dBtcds=; b=a+DQPKPGTJWBtms34W1jr+HxDYBcIb3YWQNc7jnd3GgJFtH32wuQAZcjGG63mTMvaj gXhaRGcBQToEOIzE1UF9myYweBI7qK8Xr1v5uwRigM2pGFpsXybp2oVA9/vzBSrUN8Mp g1fL8ITiZumY3bVAHeTZ4IpIsZ0qi9lXrXELXwlMw2zI9jThG0EQw60++k51/BsGN9JQ oHKYzmitcgu+ktaVqU4TiZ4hnGG9VKqiXP7KWNAN9ASJC5HoKqLSy0ejg7l+BX6QvMQ0 FdlYpoqMs4MQZ1vuGanZScqkBqiTg1GtAn1aM+rGE9H3o2ABp6/YSDJT9LyYIqNrq9L3 sUOA== X-Gm-Message-State: AOAM531dWtzUplK/xqFjViOuFdJo1zMvHpswK8e8462od294+L34tzgo kflOBxpK08bGeHi76+Q8VpEHeIg+EO8s3g== X-Google-Smtp-Source: ABdhPJyATS4bSCYMlC5IH2uWTHv33fN5bGiTqGlnk5ZmiCDJF0HZUSw9880eorlIbAIKhZe6OAX9bQ== X-Received: by 2002:a19:f207:: with SMTP id q7mr7421316lfh.148.1597685447838; Mon, 17 Aug 2020 10:30:47 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Subject: [PATCH v1 1/1] target/microblaze: mbar: Trap sleeps from user-space Date: Mon, 17 Aug 2020 19:30:45 +0200 Message-Id: <20200817173045.437534-2-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200817173045.437534-1-edgar.iglesias@gmail.com> References: <20200817173045.437534-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::142; envelope-from=edgar.iglesias@gmail.com; helo=mail-lf1-x142.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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: "Edgar E. Iglesias" Trap mbar-sleeps from user-space. Reported-by: Richard Henderson Signed-off-by: Edgar E. Iglesias Reviewed-by: Richard Henderson --- target/microblaze/translate.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index 530c15e5ad..a96cb21d96 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -1250,6 +1250,11 @@ static void dec_br(DisasContext *dc) =20 LOG_DIS("sleep\n"); =20 + if (trap_userspace(dc, true)) { + /* Sleep is a privileged instruction. */ + return; + } + t_sync_flags(dc); tcg_gen_st_i32(tmp_1, cpu_env, -offsetof(MicroBlazeCPU, env) --=20 2.25.1