From patchwork Sat Mar 20 13:37:00 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: 405438 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp2189412jai; Sat, 20 Mar 2021 06:43:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxuHneLQ0E5v6uJEE6apNdKT+Vvas+a6FJW93FuUxnqDGBTvxqWmg8uwenrXR9Aq2OsGCmV X-Received: by 2002:a25:d091:: with SMTP id h139mr12407660ybg.437.1616247799185; Sat, 20 Mar 2021 06:43:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616247799; cv=none; d=google.com; s=arc-20160816; b=sOpDMXQ2IYKzCFfiH27k8zWd1LUtyXv+vsvZTAcGNfTLL0Vvf7ihECZf9oYEI0b/if R65ju9bcI/3ejMTG4TATbIW5Mw5Vl6U6szR97zKa6ekbLRvX7f9fvvsCuMpFe5R5WunT cA6UCioQuJwBGPmOc+fRlmmrs/M4bxpQXmo8VmsrPhx/o3oEm4nKZGy7QkcLV4+mF3m/ 9CfiB2yuaMSOZAgIniw0zD8bVo1w0NrJKL6yUUT/9KkUmM/3NESJDVdaA3RrDrnhIKoa 15duSTjwLxP5C3JgQE/rQ8xw1g/yAxJ16/LztMpsIj4tm9geWbkyPRUMFo/gS+cM6sl7 m1gQ== 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=lOTtqQ1GqfCDk2mShrLCLuCwUnyYqPWN4bH2H+UmRI8=; b=dC1I8NkLUwSqAZa2SpoGmFyrIXrtgUpLo/F+iaGqMW5r3OFngTNZww65kIq1yHDypu mvI5wV6GsuU3xvszoeQ8n1O+m61Z9Ewhsu8kmjrmLIY+bhw+fvd3RniWQABlMafcPVjE ljkHWjtdxhmlR+WTI037zzL1y1n4E11L4cDCxYaWuIBzUtfKSQlySShuEKDPwzpoHt+R r/i98i5cb4Nb3Ou1Pz+g48AqOBZZ1bvSCS6xgsxXrwPsj2ExTr18WP6v1fZuWVrO60mL lXwJB6iI528yAUgDTvEJ7Okq1WL0dGKY3cy4ONrlBp/acqd1CDzUrmA8xS3vQOKHXl50 iAQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=d6aEufXY; 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 x16si2690772ybk.224.2021.03.20.06.43.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 20 Mar 2021 06:43:19 -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=d6aEufXY; 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]:34052 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lNbss-0001gb-Jx for patch@linaro.org; Sat, 20 Mar 2021 09:43:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59308) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNbn5-00032X-B0 for qemu-devel@nongnu.org; Sat, 20 Mar 2021 09:37:19 -0400 Received: from mail-ed1-x52c.google.com ([2a00:1450:4864:20::52c]:38634) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lNbn3-0004Fo-QF for qemu-devel@nongnu.org; Sat, 20 Mar 2021 09:37:19 -0400 Received: by mail-ed1-x52c.google.com with SMTP id h13so14028062eds.5 for ; Sat, 20 Mar 2021 06:37:17 -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=lOTtqQ1GqfCDk2mShrLCLuCwUnyYqPWN4bH2H+UmRI8=; b=d6aEufXYSJved5N2un3csV6hO7nw6dV7AH6C5EsjQil81UStphfQfJY4gQ86HYO87J qnB4XmhBD+vVFGC4si866ae8tuqh6Xs0MoZVrwB+HTi+XRN4vIhGQLOoNri5uLSdASJ4 P2KphUGWsg9uWIe5EFJ8A/KZEcDCwJz8CPoxIn/tb4L5vOXC24l4o1qvTDL3DdBmcSZc UVnUr7EV/gBxGRgRaVHFOfnW1AYJv+p2VgIpWCsQA6eiD3+FGq4En2yKwKloozotH2j8 me6Edv6htK6kyScGym8jcmDaOvBrfoFgfMIWI5V6BIcdd9SqMf+RU8VIJuglwbQwYf9o jXwA== 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=lOTtqQ1GqfCDk2mShrLCLuCwUnyYqPWN4bH2H+UmRI8=; b=ZNHEzM+Vwlrfsd86lo7233vcG1tSDaIfJSqk7bA8AF8wCYvJ8vMqxBd2yaWff5YQqX Y7KlaryXxoPoC9/16O1wYff2RuMqaPJVI8oE+TPeCR//yrNxsWQO3DsNswT8r+ZgLVHi rYIL5DrvzB55XeJKX4F53FHZ1Q84NvF4uZbZ43J6o5Ql1pwnVjOE+plJA6M6sLXNNc8a epzSYRip+lp3II7FyGPzVyq3NN117ZV/8/OZSyyQLjR/QO2vfszjU9AlfHWyG1scfSca bw/0RJD5WUBYb6PnHpuVkaJTdAEBPTHz3pHRxuNeaVajgotP2/AIOoP7/Si8j/5HpKZt RK+Q== X-Gm-Message-State: AOAM533qr8TDL0U7V+/qhtVohVHxNG+p/O5I18i3F50SjNxqZUc9blxk NEisqro5atOHx1dpVIMLvPdcZA== X-Received: by 2002:a05:6402:614:: with SMTP id n20mr15344467edv.58.1616247436513; Sat, 20 Mar 2021 06:37:16 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id oy8sm5346287ejb.58.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 80D0F1FF96; 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 08/14] linux-user/riscv: initialise the TaskState heap/stack info Date: Sat, 20 Mar 2021 13:37:00 +0000 Message-Id: <20210320133706.21475-9-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::52c; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x52c.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: =?utf-8?q?Alex_Benn=C3=A9e?= , Laurent Vivier Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Arguably the target_cpu_copy_regs function for each architecture is misnamed as a number of the architectures also take the opportunity to fill out the TaskState structure. This could arguably be factored out into common code but that would require a wider audit of the architectures. For now just replicate for riscv so we can correctly report semihosting information for SYS_HEAPINFO. Signed-off-by: Alex Bennée Message-Id: <20210312102029.17017-5-alex.bennee@linaro.org> --- linux-user/riscv/cpu_loop.c | 5 +++++ 1 file changed, 5 insertions(+) -- 2.20.1 Reviewed-by: Richard Henderson diff --git a/linux-user/riscv/cpu_loop.c b/linux-user/riscv/cpu_loop.c index 6767f941e8..74a9628dc9 100644 --- a/linux-user/riscv/cpu_loop.c +++ b/linux-user/riscv/cpu_loop.c @@ -135,4 +135,9 @@ void target_cpu_copy_regs(CPUArchState *env, struct target_pt_regs *regs) error_report("Incompatible ELF: RVE cpu requires RVE ABI binary"); exit(EXIT_FAILURE); } + + ts->stack_base = info->start_stack; + ts->heap_base = info->brk; + /* This will be filled in on the first SYS_HEAPINFO call. */ + ts->heap_limit = 0; }