From patchwork Sat Mar 20 13:36:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 405435 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp2188344jai; Sat, 20 Mar 2021 06:40:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx9z37oGDeaNBWuqpm/KQSm8DpBH+IZeRnniM73Sty/v0N8/xiVffyXGTKiHC20EsXWGpcv X-Received: by 2002:a25:850d:: with SMTP id w13mr13857304ybk.496.1616247655905; Sat, 20 Mar 2021 06:40:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616247655; cv=none; d=google.com; s=arc-20160816; b=C8nnHe53BjvLgX3WAPcNdqTHzdJaJoVntzqKiX42yw+MjrMXgRQZQO+rQT+t371M7Y U719FI8DBYSE1g38aAtp+ICMednQcA5JefRPxMNB8VdScMiXvaScaqbHD2vR10BJMp2/ fCvP+ZR1kyg3/kQ2bhzNU9CBCTcfYIpDThJCo9P3x53HhNNv1hHKpqdq/5kB6W9NZaTH S7mDWJ/pa4nN0sAQgTGlux/XJU9cFzQ+t4WxzjdwS75zYVgL1PTvvY5DBY2pEvm6QuSD BBJooClP2Ea05lygKYPpAUXoifAbkgXUx0ap5A6mn8Rw2zirSQrrlDrFDgX1BqWOTUBf cNjg== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=H/e/SdGSFzWo+xbjndfr99fhe97V2yal8vW6qxaRucA=; b=kBB5CrNZizkXocpRYRo1x92YjJg6+7Z1iLbFXBIcgIEUS2z1bYOKuSUmyOmSOb8k67 PusNThjff2MzStwA9mpGBI5JajaH1qTna0EuO9McmRQM96g4zTJBUtVIzf1CWXsGFFWn IVn9/e31MqdgJducK9iGf+VE/HD+xV/aWSSYOF742FMwK/VXCHnWG2aCC2a0gzB+76+D agCwJWIapqz1k3/XZqTXuXHMmM6XGUifCR1m9JM7sb6wQ76M6pjvZKFDhl4P/dp0GXI4 kr1YqdzCuiInV2ZbPT7sxXeNZi7A34fUSlq3LWLfDwv5hj/RjuIsl26G0BHBQUKc6RBE ikqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=pbpHF2Nt; 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 r80si9115125ybc.88.2021.03.20.06.40.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 20 Mar 2021 06:40:55 -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=pbpHF2Nt; 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]:53762 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lNbqZ-0006e2-4y for patch@linaro.org; Sat, 20 Mar 2021 09:40:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59318) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNbn6-00034M-C9 for qemu-devel@nongnu.org; Sat, 20 Mar 2021 09:37:20 -0400 Received: from mail-ej1-x62b.google.com ([2a00:1450:4864:20::62b]:46024) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lNbn4-0004Gm-Ji for qemu-devel@nongnu.org; Sat, 20 Mar 2021 09:37:20 -0400 Received: by mail-ej1-x62b.google.com with SMTP id kt15so4581703ejb.12 for ; Sat, 20 Mar 2021 06:37:18 -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 :mime-version:content-transfer-encoding; bh=H/e/SdGSFzWo+xbjndfr99fhe97V2yal8vW6qxaRucA=; b=pbpHF2NtDcnU+gVku79AOo669AZh4wmkmNpTzMX+L8Jk4sxlIU3a/2FIuAzU+4Emi2 P0D5isRSDzlP7X1UMxfZdnVivGloRNVegRzeH+mUOozo+f7xhkj87Mr7V6BIW/2Q6eSR qDZJ0HUEkSgO20/16YL4hYe4kfNLqSB6xRWr784e+FLlHehtAnpDYMbu9SojZH2Vpkzi 2aRmBmnVWpSqdYBVwjX48XYu2d+KegtDAr3hjw2wBRHfXe2tKLzVIi6H+UuVYtcOq/Nh blW2uo5DRohmuZaSA2eQh8jTDOvkmlfbNVbQbsL0LOXJ03FHWW3VkAyExDGZTqCrw6EH yYUA== 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=H/e/SdGSFzWo+xbjndfr99fhe97V2yal8vW6qxaRucA=; b=ew1cXW/wXaEC3YoMiP1GbWhlM9vkP9fysZzzYEhEHsaPuJubfYMiMd43P7+cFlijNn cxdOEyDCNUXGN+BAuvCiSMfW900r1t+vt4T3muLiVroRpsJzmaUo4nL6rKiOdmfC/q1x Iz1/Oeh0BfHYeDwpT6NztoycMbuggJaEIeeJO8PK34dNrlEYNAmmz1h3TVZNUMpqISDv GDyzy7FZHG7YivvreWTdT6p510AAv5CrJJlfjeXmY5vq8wfAfxs5Ze6+Gy5RJUCWumys jZ3mPfck60xgmTBbfRTmYAxBwFhKr3RWglnWelMHsmagIioe3kwfjbEPghixi8PmtS8T M5JQ== X-Gm-Message-State: AOAM5328HeXOtKNjpgoNtlhFqVq1O0vFeFAbs+huTDwVaLfizkhhlx91 0GMxKIIyfbbSjp6wvK8xL5H7eogTXEUzk+s+ X-Received: by 2002:a17:906:d554:: with SMTP id cr20mr9859829ejc.61.1616247437251; Sat, 20 Mar 2021 06:37:17 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id c17sm6773579edw.32.2021.03.20.06.37.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 Mar 2021 06:37:10 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 6A8211FF93; Sat, 20 Mar 2021 13:37:07 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 07/14] semihosting/arm-compat-semi: don't use SET_ARG to report SYS_HEAPINFO Date: Sat, 20 Mar 2021 13:36:59 +0000 Message-Id: <20210320133706.21475-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210320133706.21475-1-alex.bennee@linaro.org> References: <20210320133706.21475-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62b; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62b.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 autolearn=ham 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: Peter Maydell , Keith Packard , =?utf-8?q?Alex_Benn=C3=A9e?= , Bug 1915925 <1915925@bugs.launchpad.net> Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" As per the spec: the PARAMETER REGISTER contains the address of a pointer to a four-field data block. So we need to follow arg0 and place the results of SYS_HEAPINFO there. Fixes: 3c37cfe0b1 ("semihosting: Change internal common-semi interfaces to use CPUState *") Signed-off-by: Alex Bennée Reviewed-by: Peter Maydell Cc: Bug 1915925 <1915925@bugs.launchpad.net> Cc: Keith Packard Bug: https://bugs.launchpad.net/bugs/1915925 Message-Id: <20210312102029.17017-4-alex.bennee@linaro.org> --- semihosting/arm-compat-semi.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) -- 2.20.1 diff --git a/semihosting/arm-compat-semi.c b/semihosting/arm-compat-semi.c index 0f0e129a7c..fe079ca93a 100644 --- a/semihosting/arm-compat-semi.c +++ b/semihosting/arm-compat-semi.c @@ -1214,7 +1214,11 @@ target_ulong do_common_semihosting(CPUState *cs) for (i = 0; i < ARRAY_SIZE(retvals); i++) { bool fail; - fail = SET_ARG(i, retvals[i]); + if (is_64bit_semihosting(env)) { + fail = put_user_u64(retvals[i], arg0 + i * 8); + } else { + fail = put_user_u32(retvals[i], arg0 + i * 4); + } if (fail) { /* Couldn't write back to argument block */