From patchwork Wed Sep 14 13:23:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 605737 Delivered-To: patch@linaro.org Received: by 2002:ab3:1c02:0:b0:1e7:4ce8:c350 with SMTP id u2csp752663lth; Wed, 14 Sep 2022 06:46:33 -0700 (PDT) X-Google-Smtp-Source: AA6agR4BWvFm7DlEnCLRy6MQbivc+gXjHezGlo0g1wLFw1e5JTQZ+RhpX76EZ1DbhuDEKEX5xHjm X-Received: by 2002:ad4:4eec:0:b0:4a5:52eb:5cbe with SMTP id dv12-20020ad44eec000000b004a552eb5cbemr31955109qvb.34.1663163193251; Wed, 14 Sep 2022 06:46:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663163193; cv=none; d=google.com; s=arc-20160816; b=m7ydmUpccIx86KW9cAiI5qO9CfG+Chnc0Key6OprUFm+BYIBaTJmuHxHm8H9dROXF4 IJ6zn9U+1odmj24YEmmkfPd+n3pdDs3FNPPSftrolJIbWTXa32hznQsJlv2t6tWBn9um 0V+4/TumAq92Gg9I33tQlJW6WX5EWx+t0fVp/iNdt5W/eTtAv2ZcubaEfuDuTkeCd7XS dV1jLhsFnctjKqltDJOotC2DYlSzxhQ/k6y+c/AAC5M+gLdLSDLlTYnuy1lhlWtKnUGA 7SasioFaj82sE/Z3qqouvOy5Ay38xfHqiAvAhW4aMmD1XYKLm0j4N7AFV+p9Yk5g6Cwy MujA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=rTB12Kd3V2NAFpRhE4AcHzoc+HouSttzxGrYvX7ucFI=; b=vy3fiUlEpa9BMEDxOx3mALaS/WV90Kx6z7r1E9kPGlOTl5UyJwTTPqSKPJXN1EUiT0 JQx0ecVHIV8+7yMWlgLb12ixBwQLfmE/tN0UHMPkdA0X0LkHTSJ7/f+MgAoIieiJ6iV9 kUOh3tfij6t76WGcWj3XZZORI7AW0/8DAKm5HkMqMdCEyQr0ZK5sToHgc6iTL3GxHVz5 j6/xSBS5CmlQU/c9uXNi8+pqa45f++GmxEN5sDbUn0b4wjelr8XvY6zoAg0+6PiIT2Cz f03yxIg1NI5u4/WLckTxy7XgxTthB7EJTjZOHi2jmQHaV+aNHLPiwnIAuoT8MU5HhoUd PNyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tzYAvW5i; 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=pass (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 g7-20020a0562141cc700b0049729e5f831si1347496qvd.49.2022.09.14.06.46.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 14 Sep 2022 06:46:33 -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=pass header.i=@linaro.org header.s=google header.b=tzYAvW5i; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:47232 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oYSil-0006oa-NJ for patch@linaro.org; Wed, 14 Sep 2022 09:46:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48366) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oYSML-00082x-90 for qemu-devel@nongnu.org; Wed, 14 Sep 2022 09:23:22 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:35372) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oYSMI-0000bC-9E for qemu-devel@nongnu.org; Wed, 14 Sep 2022 09:23:20 -0400 Received: by mail-wr1-x432.google.com with SMTP id bz13so25705697wrb.2 for ; Wed, 14 Sep 2022 06:23:17 -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:subject:date; bh=rTB12Kd3V2NAFpRhE4AcHzoc+HouSttzxGrYvX7ucFI=; b=tzYAvW5iYfZYsdDAych860+Uua6bGC02vEOexfyco/ScffNwMR+VMVlEsyoPMJ1g6I mOp0MSfk4EA7M9Z4k1jpslubtE+ZluqEYC/GrhgaCWMnrVH70IheJtXEMvWNpFAqtSg9 C6Ng+rkYn3I1WdNL9p8gC36XLPViVYodi6O2v61oX37vY9sbRz0kDsMwUXU8kCDKZBoY j6ViV7voN7Y/HZ1Imt7wtvZKHr9fQXT4hbx55gZYHPo0hxhekX0m9vkMp4avebu3pZGt Yq+7bjhYpUmCSpHMkFuhhm2BJcTbDvKF2t9hSpqklp0vVL8OjN8fjyDlSYKPS0yFrj+g dncw== 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 :subject:date; bh=rTB12Kd3V2NAFpRhE4AcHzoc+HouSttzxGrYvX7ucFI=; b=H0jXpC0sEfNhlhDAjljLMItNdCuU3vcswJUnUOvBiTNLwtQa5smSlxcVIJbdzLNEVk q5PEOfz1TNhbILnd0sRkr1VAJ8RKFtoI4+Ux4qXULQHXjOf/km6UxCNLn2TC+1KXKJYn o4C98+HILDchmV2gFg9tsM8PrG2WE0fqCDmcRabUwQCjkTQhBESTpjeFtPURU0BchpLF 3TlJ3w/N0gnN331fFw+NewEjkXdr4D3zoCypDDV4ApWJTToTZzNPxcU1YvUzStMh6lMQ /rmi6e+NlIuM5JcX48FA6RPLPJi5Yn5qWonMd/en119N77DjU38hJLkz09bSXP3ageiM OLWg== X-Gm-Message-State: ACgBeo14H4sHxbgptOv951zM46P3qVD5iWb8qRI+EJNdtUbhtRGfr3YQ yZG3Ye8D/BKEuLmOhy/3F0xclVmJfHcT4MYd X-Received: by 2002:a05:6000:82:b0:228:db8c:5308 with SMTP id m2-20020a056000008200b00228db8c5308mr21088535wrx.164.1663161796915; Wed, 14 Sep 2022 06:23:16 -0700 (PDT) Received: from stoup.. ([89.101.193.70]) by smtp.gmail.com with ESMTPSA id p15-20020a5d48cf000000b00226dedf1ab7sm13768244wrs.76.2022.09.14.06.23.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Sep 2022 06:23:16 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell , Laurent Vivier Subject: [PULL 07/11] target/m68k: Honour -semihosting-config userspace=on Date: Wed, 14 Sep 2022 14:23:04 +0100 Message-Id: <20220914132308.118495-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220914132308.118495-1-richard.henderson@linaro.org> References: <20220914132308.118495-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=richard.henderson@linaro.org; helo=mail-wr1-x432.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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell Honour the commandline -semihosting-config userspace=on 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 Message-Id: <20220822141230.3658237-4-peter.maydell@linaro.org> Signed-off-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 4b3dfec130..a96a034050 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) != 0 + if (semihosting_enabled((env->sr & SR_S) == 0) && (env->pc & 3) == 0 && cpu_lduw_code(env, env->pc - 4) == 0x4e71 && cpu_ldl_code(env, env->pc) == 0x4e7bf000) {