From nobody Tue Feb 10 04:16:03 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1661182931; cv=none; d=zohomail.com; s=zohoarc; b=Kp0TsC+DYy8l1iJbAml/VVdRMizS/hAN0oBF3LP9altY08AnlGaZcXXHn2hezUR5/vUjPLMkeGnZl/32bCbOW4WOJ1O5xWsndp9z1tDqrb4koQlJ5YFKT4LH5DbZ/jNxpQLr3Tv1FvRRP8fR+vMIEIAxBO9HkeNgN+v0kDg7pnU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661182931; 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=Fq6BeF0OgBMMAXIU+f0655F6Gy5qXiYfyygjStThzQI=; b=YGTsJ2qGfuprCRGqRgHXoThixd0GmZsn6dCdf1jUmCFbCbOyCAZomhH68rM7ayWa6+2vidfoAd6mQAcbO7XEqG2VRupQ+j8iI3/XXLDtrZa2LcfoJa7NoYBb8qVsatbMCUoZOes/dl8DGL208p/kgssunaeLVN7zniyhLVOpBSg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1661182931872563.4848016511904; Mon, 22 Aug 2022 08:42:11 -0700 (PDT) Received: from localhost ([::1]:40018 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQ9Z4-00035M-R8 for importer@patchew.org; Mon, 22 Aug 2022 11:42:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50098) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQ9At-0001Az-HY for qemu-devel@nongnu.org; Mon, 22 Aug 2022 11:17:12 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:41865) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQ9Ap-0005SI-3g for qemu-devel@nongnu.org; Mon, 22 Aug 2022 11:17:08 -0400 Received: by mail-wr1-x435.google.com with SMTP id h24so13626594wrb.8 for ; Mon, 22 Aug 2022 08:17:06 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id bh16-20020a05600c3d1000b003a3561d4f3fsm15184908wmb.43.2022.08.22.07.12.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Aug 2022 07:12:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=Fq6BeF0OgBMMAXIU+f0655F6Gy5qXiYfyygjStThzQI=; b=ybgcWLebYif+tBJ6JeqjlOf6b4MHT7ieYFepBqiNgEDC/WXAhw3zWYCzi4Up4v3fT7 IBbxCWuAcugruloARafB5v3rrBS/xUmsITLOHcN8qdoL2FDf+c/BFqyotLT4+62VqzCd /41qm73HhHrdOpLZVpsKcUKbiCGS1DbU5MJQP/LVKU8G43I+kCJf/uImCREeLTJIT+7z GLNbY8oITPsY4yiJA4faFmoACL5lnedjzBlZGidGrwsqq7iFOEUNwag3cOAFbSkvBOQT wQnHVrXsPHIsnaDZeyD14uUTzz2WSCElhkumu9+m4ztk/iRdQ36Ltdfm4uyzpgLzkzab LIhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=Fq6BeF0OgBMMAXIU+f0655F6Gy5qXiYfyygjStThzQI=; b=F7ODC+pInZB7tmyAkn94Xj8p8JvEFshhquK3MAucl2pFzxhkTFaLH8jsYdqEjCVR99 U/B9yu8Kb5GY7h7e0a8WWlYQKxUb8752OC64OqRaSDCR23Bj0BJqwE6QBVjGzJZc87o/ /v3Jdn1JD97J3bZwCPXXBBnU5+TMTUmd1uA/4v3QT7vzF7bcbdqFcPxz82aOzsYsQeUE 9Sczhhq5hE07LK+JeqeAyyq1bR3ypqkPepwrQ+DllPR6BVURKfvXGTsRzJksDSgcy3/G EVFjAFYM24jmkW+QPrvFcCo7pNB8ni3cWEtmerfRfVrT5dpw6VXM1ObA3ZZfrY0ZNT6B nKmQ== X-Gm-Message-State: ACgBeo0+y6h4CARHlvHa7hKMTVbcWzZPH+SPbNnu0PfQsxwpPkG3adgy K056Wtq36i5F5FqiEtlHiX1MbgHJ1NeFvg== X-Google-Smtp-Source: AA6agR4wTbpYRTzDYiZhHZOwhbRWzx/xxvUit48oQze1V5q6x3x6cBCkjsGJIxRcX9dsT6KyUQnJ3w== X-Received: by 2002:adf:e19b:0:b0:225:448c:9ba8 with SMTP id az27-20020adfe19b000000b00225448c9ba8mr6195503wrb.532.1661177557806; Mon, 22 Aug 2022 07:12:37 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Cc: Richard Henderson , qemu-riscv@nongnu.org, Palmer Dabbelt , Bin Meng , Alistair Francis , Furquan Shaikh Subject: [PATCH v2 3/7] target/m68k: Honour -semihosting-config userspace=on Date: Mon, 22 Aug 2022 15:12:26 +0100 Message-Id: <20220822141230.3658237-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220822141230.3658237-1-peter.maydell@linaro.org> References: <20220822141230.3658237-1-peter.maydell@linaro.org> 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::435; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x435.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1661182932699100001 Content-Type: text/plain; charset="utf-8" Honour the commandline -semihosting-config userspace=3Don option, instead of never permitting userspace semihosting calls in system emulation mode, by passing the correct value to the is_userspace argument of semihosting_enabled(), instead of manually checking and always forbidding semihosting if the guest is in userspace. (Note that target/m68k doesn't support semihosting at all in the linux-user build.) Signed-off-by: Peter Maydell Reviewed-by: Laurent Vivier Reviewed-by: Richard Henderson --- target/m68k/op_helper.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/target/m68k/op_helper.c b/target/m68k/op_helper.c index 4b3dfec1306..a96a0340506 100644 --- a/target/m68k/op_helper.c +++ b/target/m68k/op_helper.c @@ -203,8 +203,7 @@ static void cf_interrupt_all(CPUM68KState *env, int is_= hw) cf_rte(env); return; case EXCP_HALT_INSN: - if (semihosting_enabled(false) - && (env->sr & SR_S) !=3D 0 + if (semihosting_enabled((env->sr & SR_S) =3D=3D 0) && (env->pc & 3) =3D=3D 0 && cpu_lduw_code(env, env->pc - 4) =3D=3D 0x4e71 && cpu_ldl_code(env, env->pc) =3D=3D 0x4e7bf000) { --=20 2.25.1