From nobody Mon Feb 9 10:39:26 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1687181723; cv=none; d=zohomail.com; s=zohoarc; b=Js3TWRVVPBe3V5NBSodz3h9Z78B069m9Cy5H9/GwXQAqCswpOg918b8agj8MP2snEQTYdfwNWQRA1rUUanMZLvlih34b8ZJtsVyYN5gEW5jQNERuQK9SmjF1089EWJyxLasaNhAAlQZexDUnvmERmImc4cizdM3B5941hFUScr4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1687181723; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=D79BErD46lr9bA2msM28xOF0IDn3VryLu7dildSZSiQ=; b=gmll/Ryocp7ev4Hwi0CYwK8qWjc+Q12OeoJqhhVGcZXDIOHVwk3PgC/cwv2POyiuxV66NkVDHYqAt+wLoXtak57PPhJEDAIXXtOod5ZkbXtH7qO4Y/LwJy21ywDf5htod5RBavNHRYi/d5oJdMKADfMXpoLtziSrMVQwRG7escY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1687181723325988.4836436860319; Mon, 19 Jun 2023 06:35:23 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.551091.860429 (Exim 4.92) (envelope-from ) id 1qBF1z-0001QY-4B; Mon, 19 Jun 2023 13:34:55 +0000 Received: by outflank-mailman (output) from mailman id 551091.860429; Mon, 19 Jun 2023 13:34:55 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qBF1z-0001QQ-0a; Mon, 19 Jun 2023 13:34:55 +0000 Received: by outflank-mailman (input) for mailman id 551091; Mon, 19 Jun 2023 13:34:54 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qBF1y-0000wG-2C for xen-devel@lists.xenproject.org; Mon, 19 Jun 2023 13:34:54 +0000 Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [2a00:1450:4864:20::231]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 1202d6e3-0ea6-11ee-b234-6b7b168915f2; Mon, 19 Jun 2023 15:34:52 +0200 (CEST) Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2b46b11051aso26899771fa.3 for ; Mon, 19 Jun 2023 06:34:52 -0700 (PDT) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id f26-20020a2e9e9a000000b002adb0164258sm5222236ljk.112.2023.06.19.06.34.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Jun 2023 06:34:51 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 1202d6e3-0ea6-11ee-b234-6b7b168915f2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687181692; x=1689773692; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=D79BErD46lr9bA2msM28xOF0IDn3VryLu7dildSZSiQ=; b=CiU8FgdpglJH1B2wDzox9elNXnPOGHvSmx8ag4Iu0woaTXZ9X/ui3yu0i8QrlR0mPw o3/0Bd8Uw5YS43cMK1jGN0Wx5m9lQWPaw/yhNlBWTFCbn/F040pn7WW+IiC/mfRIdtNM M9NDGNV2gVysWaXytZyMewSd0IFSmNNbTOZu2QjMxJci68N8Ssisnz8LHxKU4sxRO4jH GOJmUf0fA9m0cbr94B43Lo/TmTjStbg2Mpxelv7FXUoSnXs6TdaXLERWSpz9nV3eVdMh uH2Ut5vF6en9pVMsKRVK/x8L6OMs8XZXQYLYw28mqG5yan1FNs4hzjFUJy4YtLPThz1F F4UA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687181692; x=1689773692; 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:message-id:reply-to; bh=D79BErD46lr9bA2msM28xOF0IDn3VryLu7dildSZSiQ=; b=A925MmXB+bWA5sTrHvNlPcx3A/Iyss0VcU5FQDuHYsOtBlkKCfCCM3Wd/wp02p6NzQ JZ96u/I1YolHoywCB+VnCudYtY3Fw3NlvkZ2Y03WfXN2RNJF1iFWuyFPBuud/DyqQW7M qCRRXGb+1o1KIVxUW0rH+EpEEmkKMaBZdItHRbdYBzMmoupsOfkvvy3DHrBWxiozB6HE pXIuakInLUB+8NL+YNT5YqYhNomQzICB3VR19yJhxRrrr1a5tqDsPwqX1vJTuLjRL/vE WIro+sqwUzjmjXAGxcMqCFDN1v17ppqODn9VrfT+6ZmZtvI/lICx62TqiN6+vN2OjxOE 9qMQ== X-Gm-Message-State: AC+VfDzWLJWfMRW2//6HnMBv6AvJlaByoCw3z2MjP2f1BZjg1W1c0suD qkyARpcgIFvhNwQ8gzid6CqUU6K3PY8= X-Google-Smtp-Source: ACHHUZ5KWo1WLQnAxG/Ix18faBmCWyG6Ft5VzG7rhfuLO4ZVwOJ/WBt520ZwTZj7Kv88Gh3hr40WjQ== X-Received: by 2002:a2e:9e07:0:b0:2b4:5fdd:f588 with SMTP id e7-20020a2e9e07000000b002b45fddf588mr4174106ljk.43.1687181691633; Mon, 19 Jun 2023 06:34:51 -0700 (PDT) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Jan Beulich , Andrew Cooper , Julien Grall , Oleksii Kurochko , Bob Eshleman , Alistair Francis , Connor Davis Subject: [PATCH v2 2/6] xen/riscv: introduce reset_stack() function Date: Mon, 19 Jun 2023 16:34:43 +0300 Message-Id: <6024617719467cd2da8ae03b81ddc899f2ba4311.1687178053.git.oleksii.kurochko@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1687181724432100007 Content-Type: text/plain; charset="utf-8" The reason for reset_stack() introduction is that stack should be reset twice: 1. Before jumping to C world at the start of _start() function. 2. After jumping from 1:1 mapping world. Signed-off-by: Oleksii Kurochko Reviewed-by: Alistair Francis --- Changes in V2: - update the commit message. - move out reset_stack() from .text.header to .text. - add Reviewed-by: Alistair Francis . --- xen/arch/riscv/riscv64/head.S | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/xen/arch/riscv/riscv64/head.S b/xen/arch/riscv/riscv64/head.S index 8887f0cbd4..2c0304646a 100644 --- a/xen/arch/riscv/riscv64/head.S +++ b/xen/arch/riscv/riscv64/head.S @@ -27,8 +27,16 @@ ENTRY(start) add t3, t3, __SIZEOF_POINTER__ bltu t3, t4, .L_clear_bss =20 + jal reset_stack + + tail start_xen + + .section .text, "ax", %progbits + +ENTRY(reset_stack) la sp, cpu0_boot_stack li t0, STACK_SIZE add sp, sp, t0 =20 - tail start_xen + ret + --=20 2.40.1