From nobody Sun Nov 10 21:35:32 2024 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=1683825027; cv=none; d=zohomail.com; s=zohoarc; b=fPGFL39TfERB3IuBvA21O7FfGDf+6Wy+MqSwh700KCL5CCVFv+WITm7wORBZQWXxc5sszSuLAW/Cu8VwqQsnDapznMQztjoMI8yuSJy9dPkdKYDWhyEdrRd+EP2NB8DYBD0cx45BvyrLcCwCTcqwrRnejnDApv4uesaCbtXBJxA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683825027; 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=a8bc8sBrfSe9Kkfb3sttx5nGDE1LXzDoaGCPR0OUB4U=; b=R7T/n1zgF5any8cbvEEn1EwergrbOQgfgzV08xSHYV0dRnH/H32sHj0itMbgPsa3hxgqGuLyIDv0hgDtRqWwgrqn0xLHbdP1jSli2P+9kHBmW6PSRpimHLf8jFHDvI3p3ye2aYovgVJX7iA5qU46vPiOP+XKoJVIdQyCDVzgG7c= 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 1683825027690640.6524219608174; Thu, 11 May 2023 10:10:27 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.533490.830221 (Exim 4.92) (envelope-from ) id 1px9nQ-0002M1-Mt; Thu, 11 May 2023 17:09:40 +0000 Received: by outflank-mailman (output) from mailman id 533490.830221; Thu, 11 May 2023 17:09:40 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1px9nQ-0002Lu-K2; Thu, 11 May 2023 17:09:40 +0000 Received: by outflank-mailman (input) for mailman id 533490; Thu, 11 May 2023 17:09:39 +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 1px9nP-0002Lh-Mq for xen-devel@lists.xenproject.org; Thu, 11 May 2023 17:09:39 +0000 Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [2a00:1450:4864:20::22b]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 9c949eed-f01e-11ed-b229-6b7b168915f2; Thu, 11 May 2023 19:09:38 +0200 (CEST) Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2ac8c0fbb16so82671261fa.2 for ; Thu, 11 May 2023 10:09:38 -0700 (PDT) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id c9-20020a05651c014900b002aa3cff0529sm2443830ljd.74.2023.05.11.10.09.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 May 2023 10:09:37 -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: 9c949eed-f01e-11ed-b229-6b7b168915f2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683824978; x=1686416978; 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=a8bc8sBrfSe9Kkfb3sttx5nGDE1LXzDoaGCPR0OUB4U=; b=TR1Xt4pS5K4Vz1znogj/0rL73x12kbzbC2UCZyysdZOPd+11rHyWr9kPh8x/llH618 N2/vKAGXJdC6OVTUN9N3Q2FN7iR1bdL3bI9xJCSlHyBokp2DMRrYMEgq5K8AGg06Ape/ 1rezhud1SRMlOd0zXlifugILIPOZV+o6qZg18jseLMqocHWfoObO8BFf2kQLk3oG134l 9wKZilUShYfBD9slOAvNC3RuyPgxWpfNggnc9pdca9igu1/VCr23RrMdOrzcYl65DAA9 3KWc/qCXj0TCue011TpmwW1mM3ZqLS8JfTH04MAQQRD0+yRTmKzPISi7QJCoLtZplI2y SWjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683824978; x=1686416978; 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=a8bc8sBrfSe9Kkfb3sttx5nGDE1LXzDoaGCPR0OUB4U=; b=WBW2JdVzIm30nqU8MXcMYFPT0QfDSPEnNIHfJzgBt9Fz9ZhF1SmZzNSu8vfv0lGe6U +5NSz3dO4njzbMZmBZqYGM1UdyGE2gPK+lrGBiuHMjX0HfE9Yu0Y72QPoMMi2Gmlz7T5 1GI8rmeOp5elHsM6DHwiKQSIxUoSnSMCcmJhfr0nym/X0OTlTPZl+6DDfzz8zkoWXmg/ oNCmqcprb86BM9k8TV5q7tAqRSQhfQwacoRaG5ygHx4tPKl9vLgIaxHdTXXNoTC7XVWO TezjonZMLPpJZ0Tl3QwP4aYxtY8fl+CaSiyIo5jFXszJgngLvNJBmW+sSGyFKnRKY0ua yozg== X-Gm-Message-State: AC+VfDxhVJsWcXYSFk4uD9bjHcF0M67qUxiURTBJyQkT6jRW53OfcKC3 t0pjn70ctF9fK1uIbgVvuoLJnewjbSg= X-Google-Smtp-Source: ACHHUZ5StywoRO9/FVyt83hqn6Wq7FxO91WQxwO81pg8PQemoYjsnLzH82cDNAhPhqX7mtRiQqb5hQ== X-Received: by 2002:a2e:a1c7:0:b0:2a8:c520:da1d with SMTP id c7-20020a2ea1c7000000b002a8c520da1dmr3066201ljm.29.1683824977866; Thu, 11 May 2023 10:09:37 -0700 (PDT) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Julien Grall , Jan Beulich , Andrew Cooper , Stefano Stabellini , Gianluca Guida , Oleksii Kurochko , Bob Eshleman , Alistair Francis , Connor Davis Subject: [PATCH v7 1/5] xen/riscv: add VM space layout Date: Thu, 11 May 2023 20:09:29 +0300 Message-Id: <7b03dbf21718ed9c05859a629f4442167d74553c.1683824347.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: 1683825028793100001 Content-Type: text/plain; charset="utf-8" Also it was added explanation about ignoring of top VA bits Signed-off-by: Oleksii Kurochko --- Changes in V7: - Fix range of frametable range in RV64 layout. - Add ifdef SV39 to the RV64 layout comment to make it explicit that description if for SV39 mode. - Add missed row in the RV64 layout table. --- Changes in V6: - update comment above the RISCV-64 layout table - add Slot column to the table with RISCV-64 Layout - update RV-64 layout table. --- Changes in V5: * the patch was introduced in the current patch series. --- xen/arch/riscv/include/asm/config.h | 36 +++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/xen/arch/riscv/include/asm/config.h b/xen/arch/riscv/include/a= sm/config.h index 763a922a04..a53833afee 100644 --- a/xen/arch/riscv/include/asm/config.h +++ b/xen/arch/riscv/include/asm/config.h @@ -4,6 +4,42 @@ #include #include =20 +/* + * RISC-V64 Layout: + * + * #ifdef SV39 + * + * From the riscv-privileged doc: + * When mapping between narrower and wider addresses, + * RISC-V zero-extends a narrower physical address to a wider size. + * The mapping between 64-bit virtual addresses and the 39-bit usable + * address space of Sv39 is not based on zero-extension but instead + * follows an entrenched convention that allows an OS to use one or + * a few of the most-significant bits of a full-size (64-bit) virtual + * address to quickly distinguish user and supervisor address regions. + * + * It means that: + * top VA bits are simply ignored for the purpose of translating to PA. + * + * =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D + * Start addr | End addr | Size | Slot |area descri= ption + * =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D + * FFFFFFFFC0800000 | FFFFFFFFFFFFFFFF |1016 MB | L2 511 | Unused + * FFFFFFFFC0600000 | FFFFFFFFC0800000 | 2 MB | L2 511 | Fixmap + * FFFFFFFFC0200000 | FFFFFFFFC0600000 | 4 MB | L2 511 | FDT + * FFFFFFFFC0000000 | FFFFFFFFC0200000 | 2 MB | L2 511 | Xen + * ... | 1 GB | L2 510 | Unused + * 0000003200000000 | 0000007f40000000 | 309 GB | L2 200-509 | Direct map + * ... | 1 GB | L2 199 | Unused + * 0000003100000000 | 00000031C0000000 | 3 GB | L2 196-198 | Frametable + * ... | 1 GB | L2 195 | Unused + * 0000003080000000 | 00000030C0000000 | 1 GB | L2 194 | VMAP + * ... | 194 GB | L2 0 - 193 | Unused + * =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D + * + * #endif + */ + #if defined(CONFIG_RISCV_64) # define LONG_BYTEORDER 3 # define ELFSIZE 64 --=20 2.40.1 From nobody Sun Nov 10 21:35:32 2024 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=1683825034; cv=none; d=zohomail.com; s=zohoarc; b=FPy7kF/Rkdjd1YdlazvuWomFLotsn/2bPu9Zu/9H8c5O9Lggb7WH0Dkf2Z4Wm7Gc2wsmE83kulpnzKWbEzQblVHmdJYkkCTFoaYm+8v3UiV0CYoX6f+qpPFLpD6wy2rm9vGGuLoOIkkx1rtqteGvK2wg//xDsluJmaHE0iSZY7I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683825034; 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=vwLD+kKE8NLXZBOAdTX4gIPx6EQsrHZX6eN9m6ta0EI=; b=cXqCuex1KRl2rYCXPnooEQEWFp4HZ6dTD60sH+OyrAYBX8yc3ZXxoGtTMUrWH5xcZfmzutH5jly1bSq/+VAUmsDGR6M5vCwMRRAArZYlAGQjPGswdbTIz2hd7hpFcCg/XV73mXRrO1mD6C/cpgYCDPmf1MYXuHxtshUa/5LBB84= 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 1683825034316382.70942904046467; Thu, 11 May 2023 10:10:34 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.533492.830236 (Exim 4.92) (envelope-from ) id 1px9nS-0002df-7B; Thu, 11 May 2023 17:09:42 +0000 Received: by outflank-mailman (output) from mailman id 533492.830236; Thu, 11 May 2023 17:09:42 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1px9nS-0002dA-15; Thu, 11 May 2023 17:09:42 +0000 Received: by outflank-mailman (input) for mailman id 533492; Thu, 11 May 2023 17:09:41 +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 1px9nR-0002Lh-3g for xen-devel@lists.xenproject.org; Thu, 11 May 2023 17:09:41 +0000 Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [2a00:1450:4864:20::22b]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 9d54c99e-f01e-11ed-b229-6b7b168915f2; Thu, 11 May 2023 19:09:39 +0200 (CEST) Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2ac8c0fbb16so82671501fa.2 for ; Thu, 11 May 2023 10:09:39 -0700 (PDT) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id c9-20020a05651c014900b002aa3cff0529sm2443830ljd.74.2023.05.11.10.09.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 May 2023 10:09:38 -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: 9d54c99e-f01e-11ed-b229-6b7b168915f2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683824979; x=1686416979; 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=vwLD+kKE8NLXZBOAdTX4gIPx6EQsrHZX6eN9m6ta0EI=; b=e7lb4FZv2O4Ig0A7pDKIpcy5DRfh+htlcl787kBs1VGjAJkSj2U1fFG/TFtTI+JOQw hEfzU8z4VOf9+w6LDiiHqT6WKx40OTob42n2EPqR4Lxzz9IMStTYZAMDOnJHCzsqojXU 0mDmA44xVFkZ7hGEKiqeJf3u7wPJux/pur1/JKWyHkUH6/C1ruEL5pZBAvIdSJ5sw6cs ka1KgpvjG2kki6Jin4b/MlCP1xLctuWeKJ9b7FnGkiO2C0yvFDTBq8S1iN8UPPEWWf7t 2Cyojv+eLSQTM8qmf/bdtKT8diOVQOEki4DY1/+cPrwjBmuhuOQPaylSYZXsm2YJRYyI /u2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683824979; x=1686416979; 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=vwLD+kKE8NLXZBOAdTX4gIPx6EQsrHZX6eN9m6ta0EI=; b=EHFvnbUL2goxw3GKuicldrFOPFxvuRqTpT05qAroB3FXsttHvykOjfKAKBS24538Lc bap2zHOhGoi23v9pXAKH+etKEA3tCu1C/w6SB3tg1AKdrgb8URDCpC0hFslv6l9EcDvq CewZ/rCQ2XVZDd5XyvQEKFi0iQRSvKQne3w1JT7dVYBoi+kslGDoxfmM/QI5EtBRG8Je 4gdZqmOWVL9d+IYVdXvugjOoaxtYRf7vgV66bzI26Ez32PhaN/kpCsUBU5rq+UXcTjRd 0Prs/+DghVJQlDq75qWU+vdwWUbm8hh86vnNqnklBzyQEJcex5q7WGaIEAAqzwwDRNso nnqQ== X-Gm-Message-State: AC+VfDzhA7zKNQ4OHFD3QVDYX4J+eIx82ZMb1VLHsyrTHbnduoWXLAIZ KPLYyAoWZocyYK3QpPNt1/T6v+OY7yw= X-Google-Smtp-Source: ACHHUZ7uaG/9bFOJCEloPDk593SHBHPtihf5PvGSscZmr7THXwvexalXKaHPH4nnuWcNziE+IQGNVg== X-Received: by 2002:a2e:9aca:0:b0:2a8:bc05:ab4 with SMTP id p10-20020a2e9aca000000b002a8bc050ab4mr3872501ljj.34.1683824978828; Thu, 11 May 2023 10:09:38 -0700 (PDT) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Julien Grall , Jan Beulich , Andrew Cooper , Stefano Stabellini , Gianluca Guida , Oleksii Kurochko , Bob Eshleman , Alistair Francis , Connor Davis Subject: [PATCH v7 2/5] xen/riscv: introduce setup_initial_pages Date: Thu, 11 May 2023 20:09:30 +0300 Message-Id: <632384e200b7de0fb4e2dae500a058c2a27628be.1683824347.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: 1683825035639100001 Content-Type: text/plain; charset="utf-8" The idea was taken from xvisor but the following changes were done: * Use only a minimal part of the code enough to enable MMU * rename {_}setup_initial_pagetables functions * add an argument for setup_initial_mapping to have an opportunity to make set PTE flags. * update setup_initial_pagetables function to map sections with correct PTE flags. * Rewrite enable_mmu() to C. * map linker addresses range to load addresses range without 1:1 mapping. It will be 1:1 only in case when load_start_addr is equal to linker_start_addr. * add safety checks such as: * Xen size is less than page size * linker addresses range doesn't overlap load addresses range * Rework macros {THIRD,SECOND,FIRST,ZEROETH}_{SHIFT,MASK} * change PTE_LEAF_DEFAULT to RW instead of RWX. * Remove phys_offset as it is not used now * Remove alignment of {map, pa}_start &=3D XEN_PT_LEVEL_MAP_MASK(0); in setup_inital_mapping() as they should be already aligned. Make a check that {map_pa}_start are aligned. * Remove clear_pagetables() as initial pagetables will be zeroed during bss initialization * Remove __attribute__((section(".entry")) for setup_initial_pagetables() as there is no such section in xen.lds.S * Update the argument of pte_is_valid() to "const pte_t *p" * Add check that Xen's load address is aligned at 4k boundary * Refactor setup_initial_pagetables() so it is mapping linker address range to load address range. After setup needed permissions for specific section ( such as .text, .rodata, etc ) otherwise RW permission will be set by default. * Add function to check that requested SATP_MODE is supported Origin: git@github.com:xvisor/xvisor.git 9be2fdd7 Signed-off-by: Oleksii Kurochko --- Changes in V7: - define CONFIG_PAGING_LEVELS=3D2 for SATP_MODE_SV32. - update switch_stack_and_jump macros(): add constraint 'X' for fn, memory clobber and wrap into do {} while ( false ). - add noreturn to definition of enable_mmu(). - update pt_index() to "(pt_linear_offset(lvl, (va)) & VPN_MASK)". - expand macros pte_to_addr()/addr_to_pte() in paddr_to_pte() and pte_to_paddr() functions and after drop them. - remove inclusion of . - update commit message around definition of PGTBL_INITIAL_COUNT. - remove PGTBL_ENTRY_AMOUNT and use PAGETABLE_ENTRIES instead. - code style fixes - remove permission argument of setup_initial_mapping() function - remove calc_pgtbl_lvls_num() as it's not needed anymore after definition of CONFIG_PAGING_LEVELS. - introduce sfence_vma(). - remove satp_mode argument from check_pgtbl_mode_support() and use RV_STAGE1_MODE directly instead. - change .align to .p2align. - drop inclusion of from head.S. This change isn't necessary for the current patch series. --- Changes in V6: - move PAGE_SHIFT, PADDR_BITS to the top of page-bits.h - cast argument x of pte_to_addr() macros to paddr_t to avoid risk of ove= rflow for RV32 - update type of num_levels from 'unsigned long' to 'unsigned int' - define PGTBL_INITIAL_COUNT as ((CONFIG_PAGING_LEVELS - 1) + 1) - update type of permission arguments. changed it from 'unsgined long' to= 'unsigned int' - fix code style - switch while 'loop' to 'for' loop - undef HANDLE_PGTBL - clean root page table after MMU is disabled in check_pgtbl_mode_support= () function - align __bss_start properly - remove unnecesssary const for paddr_to_pte, pte_to_paddr, pte_is_valid = functions - add switch_stack_and_jump macros and use it inside enable_mmu() before = jump to cont_after_mmu_is_enabled() function --- Changes in V5: * Indent fields of pte_t struct * Rename addr_to_pte() and ppn_to_paddr() to match their content --- Changes in V4: * use GB() macros instead of defining SZ_1G * hardcode XEN_VIRT_START and add comment (ADDRESS_SPACE_END + 1 - GB(1)) * remove unnecessary 'asm' word at the end of #error * encapsulate pte_t definition in a struct * rename addr_to_ppn() to ppn_to_paddr(). * change type of paddr argument from const unsigned long to paddr_t * pte_to_paddr() update prototype. * calculate size of Xen binary based on an amount of page tables * use unsgined int instead of 'uint32_t' instead of uint32_t as their use isn't warranted. * remove extern of bss_{start,end} as they aren't used in mm.c anymore * fix code style * add argument for HANDLE_PGTBL macros instead of curr_lvl_num variable * make enable_mmu() as noinline to prevent under link-time optimization because of the nature of enable_mmu() * add function to check that SATP_MODE is supported. * update the commit message * update setup_initial_pagetables to set correct PTE flags in one pass instead of calling setup_pte_permissions after setup_initial_pagetables= () as setup_initial_pagetables() isn't used to change permission flags. --- Changes in V3: - update definition of pte_t structure to have a proper size of pte_t in case of RV32. - update asm/mm.h with new functions and remove unnecessary 'extern'. - remove LEVEL_* macros as only XEN_PT_LEVEL_* are enough. - update paddr_to_pte() to receive permissions as an argument. - add check that map_start & pa_start is properly aligned. - move defines PAGETABLE_ORDER, PAGETABLE_ENTRIES, PTE_PPN_SHIFT to - Rename PTE_SHIFT to PTE_PPN_SHIFT - refactor setup_initial_pagetables: map all LINK addresses to LOAD addres= ses and after setup PTEs permission for sections; update check that linker and load addresses don't overlap. - refactor setup_initial_mapping: allocate pagetable 'dynamically' if it is necessary. - rewrite enable_mmu in C; add the check that map_start and pa_start are aligned on 4k boundary. - update the comment for setup_initial_pagetable funcion - Add RV_STAGE1_MODE to support different MMU modes - set XEN_VIRT_START very high to not overlap with load address range - align bss section --- Changes in V2: * update the commit message: * Remove {ZEROETH,FIRST,...}_{SHIFT,MASK, SIZE,...} and introduce instead of them XEN_PT_LEVEL_*() and LEVEL_* * Rework pt_linear_offset() and pt_index based on XEN_PT_LEVEL_*() * Remove clear_pagetables() functions as pagetables were zeroed during .bss initialization * Rename _setup_initial_pagetables() to setup_initial_mapping() * Make PTE_DEFAULT equal to RX. * Update prototype of setup_initial_mapping(..., bool writable) ->=20 setup_initial_mapping(..., UL flags) =20 * Update calls of setup_initial_mapping according to new prototype * Remove unnecessary call of: _setup_initial_pagetables(..., load_addr_start, load_addr_end, load_addr= _start, ...) * Define index* in the loop of setup_initial_mapping * Remove attribute "__attribute__((section(".entry")))" for setup_initial_= pagetables() as we don't have such section * make arguments of paddr_to_pte() and pte_is_valid() as const. * make xen_second_pagetable static. * use instead of declaring extern unsigned long _stext, 0et= ext, _srodata, _erodata * update 'extern unsigned long __init_begin' to 'extern unsigned long __i= nit_begin[]' * use aligned() instead of "__attribute__((__aligned__(PAGE_SIZE)))" * set __section(".bss.page_aligned") for page tables arrays * fix identatations * Change '__attribute__((section(".entry")))' to '__init' * Remove phys_offset as it isn't used now. * Remove alignment of {map, pa}_start &=3D XEN_PT_LEVEL_MAP_MASK(0); in setup_inital_mapping() as they should be already aligned. * Remove clear_pagetables() as initial pagetables will be zeroed during bss initialization * Remove __attribute__((section(".entry")) for setup_initial_pagetables() as there is no such section in xen.lds.S * Update the argument of pte_is_valid() to "const pte_t *p" --- xen/arch/riscv/Makefile | 1 + xen/arch/riscv/include/asm/config.h | 14 +- xen/arch/riscv/include/asm/current.h | 11 + xen/arch/riscv/include/asm/mm.h | 9 + xen/arch/riscv/include/asm/page-bits.h | 10 + xen/arch/riscv/include/asm/page.h | 58 ++++++ xen/arch/riscv/include/asm/processor.h | 5 + xen/arch/riscv/mm.c | 277 +++++++++++++++++++++++++ xen/arch/riscv/setup.c | 11 + xen/arch/riscv/xen.lds.S | 3 + 10 files changed, 398 insertions(+), 1 deletion(-) create mode 100644 xen/arch/riscv/include/asm/current.h create mode 100644 xen/arch/riscv/include/asm/mm.h create mode 100644 xen/arch/riscv/include/asm/page.h create mode 100644 xen/arch/riscv/mm.c diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile index 443f6bf15f..956ceb02df 100644 --- a/xen/arch/riscv/Makefile +++ b/xen/arch/riscv/Makefile @@ -1,5 +1,6 @@ obj-$(CONFIG_EARLY_PRINTK) +=3D early_printk.o obj-y +=3D entry.o +obj-y +=3D mm.o obj-$(CONFIG_RISCV_64) +=3D riscv64/ obj-y +=3D sbi.o obj-y +=3D setup.o diff --git a/xen/arch/riscv/include/asm/config.h b/xen/arch/riscv/include/a= sm/config.h index a53833afee..01fd6a2818 100644 --- a/xen/arch/riscv/include/asm/config.h +++ b/xen/arch/riscv/include/asm/config.h @@ -75,12 +75,24 @@ name: #endif =20 -#define XEN_VIRT_START _AT(UL, 0x80200000) +#ifdef CONFIG_RISCV_64 +#define XEN_VIRT_START 0xFFFFFFFFC0000000 /* (_AC(-1, UL) + 1 - GB(1)) */ +#else +#error "RV32 isn't supported" +#endif =20 #define SMP_CACHE_BYTES (1 << 6) =20 #define STACK_SIZE PAGE_SIZE =20 +#ifdef CONFIG_RISCV_64 +#define CONFIG_PAGING_LEVELS 3 +#define RV_STAGE1_MODE SATP_MODE_SV39 +#else +#define CONFIG_PAGING_LEVELS 2 +#define RV_STAGE1_MODE SATP_MODE_SV32 +#endif + #endif /* __RISCV_CONFIG_H__ */ /* * Local variables: diff --git a/xen/arch/riscv/include/asm/current.h b/xen/arch/riscv/include/= asm/current.h new file mode 100644 index 0000000000..d87e6717e0 --- /dev/null +++ b/xen/arch/riscv/include/asm/current.h @@ -0,0 +1,11 @@ +#ifndef __ASM_CURRENT_H +#define __ASM_CURRENT_H + +#define switch_stack_and_jump(stack, fn) do { \ + asm volatile ( \ + "mv sp, %0\n" \ + "j " #fn :: "r" (stack), "X" (fn) : "memory" ); \ + unreachable(); \ +} while ( false ) + +#endif /* __ASM_CURRENT_H */ diff --git a/xen/arch/riscv/include/asm/mm.h b/xen/arch/riscv/include/asm/m= m.h new file mode 100644 index 0000000000..e16ce66fae --- /dev/null +++ b/xen/arch/riscv/include/asm/mm.h @@ -0,0 +1,9 @@ +#ifndef _ASM_RISCV_MM_H +#define _ASM_RISCV_MM_H + +void setup_initial_pagetables(void); + +void enable_mmu(void); +void cont_after_mmu_is_enabled(void); + +#endif /* _ASM_RISCV_MM_H */ diff --git a/xen/arch/riscv/include/asm/page-bits.h b/xen/arch/riscv/includ= e/asm/page-bits.h index 1801820294..4a3e33589a 100644 --- a/xen/arch/riscv/include/asm/page-bits.h +++ b/xen/arch/riscv/include/asm/page-bits.h @@ -4,4 +4,14 @@ #define PAGE_SHIFT 12 /* 4 KiB Pages */ #define PADDR_BITS 56 /* 44-bit PPN */ =20 +#ifdef CONFIG_RISCV_64 +#define PAGETABLE_ORDER (9) +#else /* CONFIG_RISCV_32 */ +#define PAGETABLE_ORDER (10) +#endif + +#define PAGETABLE_ENTRIES (1 << PAGETABLE_ORDER) + +#define PTE_PPN_SHIFT 10 + #endif /* __RISCV_PAGE_BITS_H__ */ diff --git a/xen/arch/riscv/include/asm/page.h b/xen/arch/riscv/include/asm= /page.h new file mode 100644 index 0000000000..68ebe0b7b3 --- /dev/null +++ b/xen/arch/riscv/include/asm/page.h @@ -0,0 +1,58 @@ +#ifndef _ASM_RISCV_PAGE_H +#define _ASM_RISCV_PAGE_H + +#include +#include + +#define VPN_MASK ((unsigned long)(PAGETABLE_ENTRIES - 1= )) + +#define XEN_PT_LEVEL_ORDER(lvl) ((lvl) * PAGETABLE_ORDER) +#define XEN_PT_LEVEL_SHIFT(lvl) (XEN_PT_LEVEL_ORDER(lvl) + PAGE_SHIFT) +#define XEN_PT_LEVEL_SIZE(lvl) (_AT(paddr_t, 1) << XEN_PT_LEVEL_SHIFT= (lvl)) +#define XEN_PT_LEVEL_MAP_MASK(lvl) (~(XEN_PT_LEVEL_SIZE(lvl) - 1)) +#define XEN_PT_LEVEL_MASK(lvl) (VPN_MASK << XEN_PT_LEVEL_SHIFT(lvl)) + +#define PTE_VALID BIT(0, UL) +#define PTE_READABLE BIT(1, UL) +#define PTE_WRITABLE BIT(2, UL) +#define PTE_EXECUTABLE BIT(3, UL) +#define PTE_USER BIT(4, UL) +#define PTE_GLOBAL BIT(5, UL) +#define PTE_ACCESSED BIT(6, UL) +#define PTE_DIRTY BIT(7, UL) +#define PTE_RSW (BIT(8, UL) | BIT(9, UL)) + +#define PTE_LEAF_DEFAULT (PTE_VALID | PTE_READABLE | PTE_WRITAB= LE) +#define PTE_TABLE (PTE_VALID) + +/* Calculate the offsets into the pagetables for a given VA */ +#define pt_linear_offset(lvl, va) ((va) >> XEN_PT_LEVEL_SHIFT(lvl)) + +#define pt_index(lvl, va) (pt_linear_offset(lvl, (va)) & VPN_MASK) + +/* Page Table entry */ +typedef struct { +#ifdef CONFIG_RISCV_64 + uint64_t pte; +#else + uint32_t pte; +#endif +} pte_t; + +static inline pte_t paddr_to_pte(paddr_t paddr, + unsigned int permissions) +{ + return (pte_t) { .pte =3D (paddr >> PAGE_SHIFT) << PTE_PPN_SHIFT | per= missions }; +} + +static inline paddr_t pte_to_paddr(pte_t pte) +{ + return ((paddr_t)pte.pte >> PTE_PPN_SHIFT) << PAGE_SHIFT; +} + +static inline bool pte_is_valid(pte_t p) +{ + return p.pte & PTE_VALID; +} + +#endif /* _ASM_RISCV_PAGE_H */ diff --git a/xen/arch/riscv/include/asm/processor.h b/xen/arch/riscv/includ= e/asm/processor.h index a71448e02e..187782bc75 100644 --- a/xen/arch/riscv/include/asm/processor.h +++ b/xen/arch/riscv/include/asm/processor.h @@ -69,6 +69,11 @@ static inline void die(void) wfi(); } =20 +static inline void sfence_vma(void) +{ + __asm__ __volatile__ ("sfence.vma" ::: "memory"); +} + #endif /* __ASSEMBLY__ */ =20 #endif /* _ASM_RISCV_PROCESSOR_H */ diff --git a/xen/arch/riscv/mm.c b/xen/arch/riscv/mm.c new file mode 100644 index 0000000000..f2039db618 --- /dev/null +++ b/xen/arch/riscv/mm.c @@ -0,0 +1,277 @@ +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +struct mmu_desc { + unsigned int num_levels; + unsigned int pgtbl_count; + pte_t *next_pgtbl; + pte_t *pgtbl_base; +}; + +extern unsigned char cpu0_boot_stack[STACK_SIZE]; + +#define PHYS_OFFSET ((unsigned long)_start - XEN_VIRT_START) +#define LOAD_TO_LINK(addr) ((addr) - PHYS_OFFSET) +#define LINK_TO_LOAD(addr) ((addr) + PHYS_OFFSET) + + +/* + * It is expected that Xen won't be more then 2 MB. + * The check in xen.lds.S guarantees that. + * At least 3 page tables (in case of Sv39 ) are needed to cover 2 MB. + * One for each page level table with PAGE_SIZE =3D 4 Kb. + * + * One L0 page table can cover 2 MB(512 entries of one page table * PAGE_S= IZE). + * + * It might be needed one more page table in case when Xen load address + * isn't 2 MB aligned. + */ +#define PGTBL_INITIAL_COUNT ((CONFIG_PAGING_LEVELS - 1) + 1) + +pte_t __section(".bss.page_aligned") __aligned(PAGE_SIZE) +stage1_pgtbl_root[PAGETABLE_ENTRIES]; + +pte_t __section(".bss.page_aligned") __aligned(PAGE_SIZE) +stage1_pgtbl_nonroot[PGTBL_INITIAL_COUNT * PAGETABLE_ENTRIES]; + +#define HANDLE_PGTBL(curr_lvl_num) = \ + index =3D pt_index(curr_lvl_num, page_addr); = \ + if ( pte_is_valid(pgtbl[index]) ) = \ + { = \ + /* Find L{ 0-3 } table */ = \ + pgtbl =3D (pte_t *)pte_to_paddr(pgtbl[index]); = \ + } = \ + else = \ + { = \ + /* Allocate new L{0-3} page table */ = \ + if ( mmu_desc->pgtbl_count =3D=3D PGTBL_INITIAL_COUNT ) = \ + { = \ + early_printk("(XEN) No initial table available\n"); = \ + /* panic(), BUG() or ASSERT() aren't ready now. */ = \ + die(); = \ + } = \ + mmu_desc->pgtbl_count++; = \ + pgtbl[index] =3D paddr_to_pte((unsigned long)mmu_desc->next_pgtbl,= \ + PTE_VALID); = \ + pgtbl =3D mmu_desc->next_pgtbl; = \ + mmu_desc->next_pgtbl +=3D PAGETABLE_ENTRIES; = \ + } + +static void __init setup_initial_mapping(struct mmu_desc *mmu_desc, + unsigned long map_start, + unsigned long map_end, + unsigned long pa_start) +{ + unsigned int index; + pte_t *pgtbl; + unsigned long page_addr; + + if ( (unsigned long)_start % XEN_PT_LEVEL_SIZE(0) ) + { + early_printk("(XEN) Xen should be loaded at 4k boundary\n"); + die(); + } + + if ( map_start & ~XEN_PT_LEVEL_MAP_MASK(0) || + pa_start & ~XEN_PT_LEVEL_MAP_MASK(0) ) + { + early_printk("(XEN) map and pa start addresses should be aligned\n= "); + /* panic(), BUG() or ASSERT() aren't ready now. */ + die(); + } + + for ( page_addr =3D map_start; + page_addr < map_end; + page_addr +=3D XEN_PT_LEVEL_SIZE(0) ) + { + pgtbl =3D mmu_desc->pgtbl_base; + + switch ( mmu_desc->num_levels ) + { + case 4: /* Level 3 */ + HANDLE_PGTBL(3); + case 3: /* Level 2 */ + HANDLE_PGTBL(2); + case 2: /* Level 1 */ + HANDLE_PGTBL(1); + case 1: /* Level 0 */ + { + unsigned long paddr =3D (page_addr - map_start) + pa_start; + unsigned int permissions =3D PTE_LEAF_DEFAULT; + pte_t pte_to_be_written; + + index =3D pt_index(0, page_addr); + + if ( is_kernel_text(LINK_TO_LOAD(page_addr)) || + is_kernel_inittext(LINK_TO_LOAD(page_addr)) ) + permissions =3D + PTE_EXECUTABLE | PTE_READABLE | PTE_VALID; + + if ( is_kernel_rodata(LINK_TO_LOAD(page_addr)) ) + permissions =3D PTE_READABLE | PTE_VALID; + + pte_to_be_written =3D paddr_to_pte(paddr, permissions); + + if ( !pte_is_valid(pgtbl[index]) ) + pgtbl[index] =3D pte_to_be_written; + else + { + if ( (pgtbl[index].pte ^ pte_to_be_written.pte) & + ~(PTE_DIRTY | PTE_ACCESSED) ) + { + early_printk("PTE overridden has occurred\n"); + /* panic(), aren't ready now. */ + die(); + } + } + } + } + } +} +#undef HANDLE_PGTBL + +static bool __init check_pgtbl_mode_support(struct mmu_desc *mmu_desc, + unsigned long load_start) +{ + bool is_mode_supported =3D false; + unsigned int index; + unsigned int page_table_level =3D (mmu_desc->num_levels - 1); + unsigned level_map_mask =3D XEN_PT_LEVEL_MAP_MASK(page_table_level); + + unsigned long aligned_load_start =3D load_start & level_map_mask; + unsigned long aligned_page_size =3D XEN_PT_LEVEL_SIZE(page_table_level= ); + unsigned long xen_size =3D (unsigned long)(_end - start); + + if ( (load_start + xen_size) > (aligned_load_start + aligned_page_size= ) ) + { + early_printk("please place Xen to be in range of PAGE_SIZE " + "where PAGE_SIZE is XEN_PT_LEVEL_SIZE( {L3 | L2 | L1}= ) " + "depending on expected SATP_MODE \n" + "XEN_PT_LEVEL_SIZE is defined in \n"); + die(); + } + + index =3D pt_index(page_table_level, aligned_load_start); + stage1_pgtbl_root[index] =3D paddr_to_pte(aligned_load_start, + PTE_LEAF_DEFAULT | PTE_EXECUTA= BLE); + + sfence_vma(); + csr_write(CSR_SATP, + PFN_DOWN((unsigned long)stage1_pgtbl_root) | + RV_STAGE1_MODE << SATP_MODE_SHIFT); + + if ( (csr_read(CSR_SATP) >> SATP_MODE_SHIFT) =3D=3D RV_STAGE1_MODE ) + is_mode_supported =3D true; + + csr_write(CSR_SATP, 0); + + sfence_vma(); + + /* Clean MMU root page table */ + stage1_pgtbl_root[index] =3D paddr_to_pte(0x0, 0x0); + + return is_mode_supported; +} + +/* + * setup_initial_pagetables: + * + * Build the page tables for Xen that map the following: + * 1. Calculate page table's level numbers. + * 2. Init mmu description structure. + * 3. Check that linker addresses range doesn't overlap + * with load addresses range + * 4. Map all linker addresses and load addresses ( it shouldn't + * be 1:1 mapped and will be 1:1 mapped only in case if + * linker address is equal to load address ) with + * RW permissions by default. + * 5. Setup proper PTE permissions for each section. + */ +void __init setup_initial_pagetables(void) +{ + struct mmu_desc mmu_desc =3D { CONFIG_PAGING_LEVELS, 0, NULL, NULL }; + + /* + * Access to _start, _end is always PC-relative thereby when access + * them we will get load adresses of start and end of Xen. + * To get linker addresses LOAD_TO_LINK() is required to use. + */ + unsigned long load_start =3D (unsigned long)_start; + unsigned long load_end =3D (unsigned long)_end; + unsigned long linker_start =3D LOAD_TO_LINK(load_start); + unsigned long linker_end =3D LOAD_TO_LINK(load_end); + + if ( (linker_start !=3D load_start) && + (linker_start <=3D load_end) && (load_start <=3D linker_end) ) + { + early_printk("(XEN) linker and load address ranges overlap\n"); + die(); + } + + if ( !check_pgtbl_mode_support(&mmu_desc, load_start) ) + { + early_printk("requested MMU mode isn't supported by CPU\n" + "Please choose different in \n"); + die(); + } + + mmu_desc.pgtbl_base =3D stage1_pgtbl_root; + mmu_desc.next_pgtbl =3D stage1_pgtbl_nonroot; + + setup_initial_mapping(&mmu_desc, + linker_start, + linker_end, + load_start); +} + +void __init noreturn noinline enable_mmu() +{ + /* + * Calculate a linker time address of the mmu_is_enabled + * label and update CSR_STVEC with it. + * MMU is configured in a way where linker addresses are mapped + * on load addresses so in a case when linker addresses are not equal + * to load addresses, after MMU is enabled, it will cause + * an exception and jump to linker time addresses. + * Otherwise if load addresses are equal to linker addresses the code + * after mmu_is_enabled label will be executed without exception. + */ + csr_write(CSR_STVEC, LOAD_TO_LINK((unsigned long)&&mmu_is_enabled)); + + /* Ensure page table writes precede loading the SATP */ + sfence_vma(); + + /* Enable the MMU and load the new pagetable for Xen */ + csr_write(CSR_SATP, + PFN_DOWN((unsigned long)stage1_pgtbl_root) | + RV_STAGE1_MODE << SATP_MODE_SHIFT); + + asm volatile ( ".p2align 2" ); + mmu_is_enabled: + /* + * Stack should be re-inited as: + * 1. Right now an address of the stack is relative to load time + * addresses what will cause an issue in case of load start address + * isn't equal to linker start address. + * 2. Addresses in stack are all load time relative which can be an + * issue in case when load start address isn't equal to linker + * start address. + * + * We can't return to the caller because the stack was reseted + * and it may have stash some variable on the stack. + * Jump to a brand new function as the stack was reseted + */ + + switch_stack_and_jump((unsigned long)cpu0_boot_stack + STACK_SIZE, + cont_after_mmu_is_enabled); +} + diff --git a/xen/arch/riscv/setup.c b/xen/arch/riscv/setup.c index 3786f337e0..315804aa87 100644 --- a/xen/arch/riscv/setup.c +++ b/xen/arch/riscv/setup.c @@ -2,6 +2,7 @@ #include =20 #include +#include =20 /* Xen stack for bringing up the first CPU. */ unsigned char __initdata cpu0_boot_stack[STACK_SIZE] @@ -26,3 +27,13 @@ void __init noreturn start_xen(unsigned long bootcpu_id, =20 unreachable(); } + +void __init noreturn cont_after_mmu_is_enabled(void) +{ + early_printk("All set up\n"); + + for ( ;; ) + asm volatile ("wfi"); + + unreachable(); +} diff --git a/xen/arch/riscv/xen.lds.S b/xen/arch/riscv/xen.lds.S index 31e0d3576c..fe475d096d 100644 --- a/xen/arch/riscv/xen.lds.S +++ b/xen/arch/riscv/xen.lds.S @@ -172,3 +172,6 @@ ASSERT(IS_ALIGNED(__bss_end, POINTER_ALIGN), "__= bss_end is misaligned") =20 ASSERT(!SIZEOF(.got), ".got non-empty") ASSERT(!SIZEOF(.got.plt), ".got.plt non-empty") + +ASSERT(_end - _start <=3D MB(2), "Xen too large for early-boot assumptions= ") + --=20 2.40.1 From nobody Sun Nov 10 21:35:32 2024 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=1683825020; cv=none; d=zohomail.com; s=zohoarc; b=a+vZuPFsStOF7uX2scTs+wr2DXoLrSFOeKEmuUMK2xUies1BlD1g8PCbVo2sV9oNzUZDRMt5eWh4nD7S0EaUaAxNU/VEeWnRaeh0PEPuX8ogaSA+QqvoQiQmv+TXK13+obm/CrDBLZMYcShbUMtKfztRZvdJWjjyLifII88D6hk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683825020; 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=nWsC0H8EDMmSieqZ7gOMXlH4Th+2i/GWuOb1eb4Ax/M=; b=dAdWSVONhY6fReR8fX50ej+tfnd4TYjBpJRpG+h/ALQ5xUr5UDcuH7g4bBAWiEWnfseO1DC7p/VAcD/ej93df1/8RD8eQ2TGUcaGLtub7n5ikNoqS9YS/KHsheyEjlO+jdqdtJFZoj25aEqMZb98rRZbTb4YGbZmLdKR3sK0Ths= 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 1683825020246411.12717302768465; Thu, 11 May 2023 10:10:20 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.533493.830250 (Exim 4.92) (envelope-from ) id 1px9nT-00035W-In; Thu, 11 May 2023 17:09:43 +0000 Received: by outflank-mailman (output) from mailman id 533493.830250; Thu, 11 May 2023 17:09:43 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1px9nT-00035K-Fz; Thu, 11 May 2023 17:09:43 +0000 Received: by outflank-mailman (input) for mailman id 533493; Thu, 11 May 2023 17:09:42 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1px9nS-0002Li-24 for xen-devel@lists.xenproject.org; Thu, 11 May 2023 17:09:42 +0000 Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [2a00:1450:4864:20::22a]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 9dc7fa0c-f01e-11ed-8611-37d641c3527e; Thu, 11 May 2023 19:09:40 +0200 (CEST) Received: by mail-lj1-x22a.google.com with SMTP id 38308e7fff4ca-2ac81d2bfbcso95684911fa.3 for ; Thu, 11 May 2023 10:09:40 -0700 (PDT) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id c9-20020a05651c014900b002aa3cff0529sm2443830ljd.74.2023.05.11.10.09.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 May 2023 10:09:39 -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: 9dc7fa0c-f01e-11ed-8611-37d641c3527e DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683824980; x=1686416980; 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=nWsC0H8EDMmSieqZ7gOMXlH4Th+2i/GWuOb1eb4Ax/M=; b=RJ+GzWd2+M/UA2GASGdkSGFGLNbF7ILUaarJLuLahmcAmZLwXJBwplyASaKMNJL4wo 8cy3Jw7hg/5gzdrZKh8iAceEJHbz3qZ7+8jwpX/g6qVBog732QR9JelzCULQm37M06Pm h0pE+D6mrelzUAcZFzkXdH1WuNu26DRlR8CaRy1APiDm6/K651UAKmt7EuoZy/YPRnGE /mbHWvFMFZdOOu8A2n3RCOWhjeTLABgLlNiOFWh0gGVv9qDV1uSFM6nM0iX2wBVUe5nK I6bOtd5P8x0G0D2q4LE/j5uHoElPe5G+bMfabqVDqQk092oFWOomTwtb5SrAK8l9SHsX WlXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683824980; x=1686416980; 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=nWsC0H8EDMmSieqZ7gOMXlH4Th+2i/GWuOb1eb4Ax/M=; b=HBMXjZ6YlaBdMi8wHZbCHbwYTDdT/A8L/7FTZyVZvJwyD/Xg9rM1N1IG0u+AcbSKJI IlFlb/5MCzL+cfVc75E9gNNAfZ89N2nUhtNQUesEON3WC/9UNfxRt/0r15Qe+K9pReD8 zyGiRMr7KzgBf2O8M6Ij5bdfOa3fXznfXaMc8NzSyx/sWlMXvlZCoet+NRGrBYj2caFJ XOZBkQLF79HFBlYAFWBVWAQBjYeqXZLjRRDc7XI/ghjCWvRxRTgh9kXq5defmlELTC/7 1jBMunerRob/jWPtNqmqqJDoWvyzo8ECbcVq4cJxwe7GIAxOb7O6IduhtEPCi3Jqag17 HLEw== X-Gm-Message-State: AC+VfDz55vA1Ze00v/5dxOxoZXN5CkUCvL/O+TacM39/Tk5qBefIj5Bp L/xkdI7RCwHOh0+L2OkuGJQTWCuHMsM= X-Google-Smtp-Source: ACHHUZ5t9Db1MsuXcfjj1l/E9PFrYldTbbi+EUASpKkr9atGawlHMITYeexvQlrD8+JnnfEbd2hQLA== X-Received: by 2002:a2e:8456:0:b0:2a7:b163:6a40 with SMTP id u22-20020a2e8456000000b002a7b1636a40mr3441558ljh.12.1683824979545; Thu, 11 May 2023 10:09:39 -0700 (PDT) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Julien Grall , Jan Beulich , Andrew Cooper , Stefano Stabellini , Gianluca Guida , Oleksii Kurochko , Bob Eshleman , Alistair Francis , Connor Davis Subject: [PATCH v7 3/5] xen/riscv: align __bss_start Date: Thu, 11 May 2023 20:09:31 +0300 Message-Id: <2e9018989c628a519aadeae150786efe5e8054ab.1683824347.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: 1683825022241100003 Content-Type: text/plain; charset="utf-8" bss clear cycle requires proper alignment of __bss_start. Signed-off-by: Oleksii Kurochko Reviewed-by: Jan Beulich --- Changes in V7: * the patch was introduced in the current patch series. --- xen/arch/riscv/xen.lds.S | 1 + 1 file changed, 1 insertion(+) diff --git a/xen/arch/riscv/xen.lds.S b/xen/arch/riscv/xen.lds.S index fe475d096d..f9d89b69b9 100644 --- a/xen/arch/riscv/xen.lds.S +++ b/xen/arch/riscv/xen.lds.S @@ -137,6 +137,7 @@ SECTIONS __init_end =3D .; =20 .bss : { /* BSS */ + . =3D ALIGN(POINTER_ALIGN); __bss_start =3D .; *(.bss.stack_aligned) . =3D ALIGN(PAGE_SIZE); --=20 2.40.1 From nobody Sun Nov 10 21:35:32 2024 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=1683825029; cv=none; d=zohomail.com; s=zohoarc; b=nN/UIRunL5EA3IQvMxQlDiEhT2pFJ/mYFDvoHDVUM7KkKM0opxvnsYnZnw0JANL40eZ490InxBVyiKThIqaDguiV5fzp8s3DfXfEyWeGCHCD9qXrsXKieA01xjxe0cqPzi8/3VFsbczmaPoZhMFT1vMLaU9iACijZO+JMlhorhU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683825029; 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=/UWycGli8sXbmjgB8uls+zGw7KkS5qUAPDnnmK+Uofw=; b=F6vyYtVCGU2jHaEWcxotziGFsr8jWNJLhUigl89CE6aF29APmVRoINPbNTZwbcZCTGbZpGd/NkBv9hoGaOmHKTAdDICxw1T3QXcoOqZgFtn8JMtuOjdU4/jCi1AvSWpP3vlExvx0F/o8OsyyR/PvL3d4MZaXFQ0l7zpuHundM8k= 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 1683825029257819.3681808111842; Thu, 11 May 2023 10:10:29 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.533495.830256 (Exim 4.92) (envelope-from ) id 1px9nT-00038s-WB; Thu, 11 May 2023 17:09:43 +0000 Received: by outflank-mailman (output) from mailman id 533495.830256; Thu, 11 May 2023 17:09:43 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1px9nT-00037l-OV; Thu, 11 May 2023 17:09:43 +0000 Received: by outflank-mailman (input) for mailman id 533495; Thu, 11 May 2023 17:09:42 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1px9nS-0002Li-9Y for xen-devel@lists.xenproject.org; Thu, 11 May 2023 17:09:42 +0000 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [2a00:1450:4864:20::12d]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 9dea8256-f01e-11ed-8611-37d641c3527e; Thu, 11 May 2023 19:09:40 +0200 (CEST) Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-4f139de8cefso47444669e87.0 for ; Thu, 11 May 2023 10:09:40 -0700 (PDT) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id c9-20020a05651c014900b002aa3cff0529sm2443830ljd.74.2023.05.11.10.09.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 May 2023 10:09:40 -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: 9dea8256-f01e-11ed-8611-37d641c3527e DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683824980; x=1686416980; 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=/UWycGli8sXbmjgB8uls+zGw7KkS5qUAPDnnmK+Uofw=; b=CFr0ljiWtQtZURNRmK+W0rNds1/uOMmxJC64s61zAMi4+24iYrCn4FBZr99w2rtNIk o8ufeYa4NDlXjF6jI0M6HxG8/AbLuv9RIo9quOjL+KaUQ7yMr3pqxoKbMgqu+uHJXevF E7JvsyetWYBiqvXzgmtX+OwL/4uekO/CO8421ruyQ7kOmZ3JacNaoPxm6U37bOHvnKDQ jPsq0uj+PxYf8+89xWHDtPoEM2mkbvK2rIvXgYC/sWYrqNBjnYf34Kv41wGBeroFbYOO LTwU+0OAXvPhCyXanDAK82CqYNUHuRVYStm9GB8Q/yWUEvxUbRCzvp3jFKdbnR0ZGAs+ R2Sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683824980; x=1686416980; 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=/UWycGli8sXbmjgB8uls+zGw7KkS5qUAPDnnmK+Uofw=; b=iwhNNct8dT9J5yOTjK63g1JDw7h59uhZrM8pi/nheSkCfsv38tSX0qx4v9OJz7kzI6 3edu+GZ6xyfIsdnj2/FyCeCK36jGc2dQPL9gmrZTvKCHkHJiM9osuv5XBvgqgyBEfaMn kl3iENRngm/UAWmQ83X+o1G7U2UztmG1W8jUkNKMoJ0UNo+9m+Jli6jYmElaVVjA9hB6 Yr/kdyUIDVgHWojlt1AXGlfJc6z+eS1JT3+sE6eYz16/Elit6CNO2pVGM3KPQeI0q5ds V7WPmIw3q7OkzC6knnrQ0EJFhCld0fbILR/fNjwSIggWoPB95ZaIdvnvWmjjXoxtiemG +mZw== X-Gm-Message-State: AC+VfDzLNYiITQzNdjaYdqNtHYacwC3ZWj4BaRZCS2jOjVf5H5jpMOAq A/0soarl8CWrsJ2zZO6R2+XgK3yNv+E= X-Google-Smtp-Source: ACHHUZ4WsiO6Zk3o1Dla3fKJOAOJt6pH061LDn1vWRyukcylQsuRZeFs8TO6qz8yfwniP+D95fSNGw== X-Received: by 2002:a2e:94cf:0:b0:2a7:6b40:7ea2 with SMTP id r15-20020a2e94cf000000b002a76b407ea2mr3084289ljh.14.1683824980238; Thu, 11 May 2023 10:09:40 -0700 (PDT) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Julien Grall , Jan Beulich , Andrew Cooper , Stefano Stabellini , Gianluca Guida , Oleksii Kurochko , Bob Eshleman , Alistair Francis , Connor Davis Subject: [PATCH v7 4/5] xen/riscv: setup initial pagetables Date: Thu, 11 May 2023 20:09:32 +0300 Message-Id: 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: 1683825030688100003 Content-Type: text/plain; charset="utf-8" The patch does two thing: 1. Setup initial pagetables. 2. Enable MMU which end up with code in cont_after_mmu_is_enabled() Signed-off-by: Oleksii Kurochko --- Changes in V7: - Nothing changed. Only rebase --- Changes in V6: - Nothing changed. Only rebase --- Changes in V5: - Nothing changed. Only rebase --- Changes in V4: - Nothing changed. Only rebase --- Changes in V3: - update the commit message that MMU is also enabled here - remove early_printk("All set up\n") as it was moved to cont_after_mmu_is_enabled() function after MMU is enabled. --- Changes in V2: * Update the commit message --- xen/arch/riscv/setup.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xen/arch/riscv/setup.c b/xen/arch/riscv/setup.c index 315804aa87..cf5dc5824e 100644 --- a/xen/arch/riscv/setup.c +++ b/xen/arch/riscv/setup.c @@ -21,7 +21,10 @@ void __init noreturn start_xen(unsigned long bootcpu_id, { early_printk("Hello from C env\n"); =20 - early_printk("All set up\n"); + setup_initial_pagetables(); + + enable_mmu(); + for ( ;; ) asm volatile ("wfi"); =20 --=20 2.40.1 From nobody Sun Nov 10 21:35:32 2024 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=1683825030; cv=none; d=zohomail.com; s=zohoarc; b=I0vkxhX6tPtBkROOdt684f511QhIjI3eFxdlGUXLrzaFvivMa6ydSOXBL2E9Nd8vMTlq98vw+6IGwbrP81O7vs/6mHeYhmvzLGRH1v+9wk+Ju7y/1vrV/Vgc5IS+4fwsdch3e+UkZE1VybexcbJTZ4zbS+K958OP4eZMHP1W7sY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683825030; 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=sf2FBCUITLNv92K79Iv4iXww3Xtu3EP3+kJgTTV/WyQ=; b=P4xfaJunNK7NGBc09AKZcBg//RfVfISXmexIad1XTEhMEuDUdsA1Mb7uaLZhSXoyyESD1/1YmTBMzw9Od2KvJDp7UsfBY3c1nbSJsnWV1FW1D9R0i0QUqzjWhGbkgR4f3Tz+KyQg94S4+uNCTHGZAnBjs5Qw3GQAq29UNIXzT5M= 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 1683825030839565.3074803343043; Thu, 11 May 2023 10:10:30 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.533494.830262 (Exim 4.92) (envelope-from ) id 1px9nU-0003FN-A9; Thu, 11 May 2023 17:09:44 +0000 Received: by outflank-mailman (output) from mailman id 533494.830262; Thu, 11 May 2023 17:09:44 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1px9nU-0003Dm-5S; Thu, 11 May 2023 17:09:44 +0000 Received: by outflank-mailman (input) for mailman id 533494; Thu, 11 May 2023 17:09:42 +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 1px9nS-0002Lh-7i for xen-devel@lists.xenproject.org; Thu, 11 May 2023 17:09:42 +0000 Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [2a00:1450:4864:20::230]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 9e5329c5-f01e-11ed-b229-6b7b168915f2; Thu, 11 May 2023 19:09:41 +0200 (CEST) Received: by mail-lj1-x230.google.com with SMTP id 38308e7fff4ca-2ac90178fdaso72974961fa.3 for ; Thu, 11 May 2023 10:09:41 -0700 (PDT) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id c9-20020a05651c014900b002aa3cff0529sm2443830ljd.74.2023.05.11.10.09.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 May 2023 10:09:40 -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: 9e5329c5-f01e-11ed-b229-6b7b168915f2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683824981; x=1686416981; 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=sf2FBCUITLNv92K79Iv4iXww3Xtu3EP3+kJgTTV/WyQ=; b=C+0/yYQ/2pH7HIj1RH6MaN0sFqlcocZq3ErT3et2CrJb2vdQyi5GSMRCD4S1GjeLRM y2JFyo9CZuyEoxBWR0WQczTPUXNZNAkRqf9HZfArg+tFVY5jC56RsezQEuCBNTFx2jqA nq6zHBSc2hhxyTTwySCsxljuAazrqhXiY+7ELuTVYU8hmfsetnCJUUiAkz2H/zPQ6+z8 C5z/Cnt2hm+Y+ymhw0MVgX6IXD0mr1rdhPo5TSc11lp+xjnd+vWl1fMw/TXMoef2Sk0C OI+es7txnV3+hXIQHQ5J9Sf2d28PKARiQ0e75hgmY5TeFIH08rpziXwaLxsBhvfyTSaG DA3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683824981; x=1686416981; 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=sf2FBCUITLNv92K79Iv4iXww3Xtu3EP3+kJgTTV/WyQ=; b=Zyg9rcpFwGFdRn2E+uz1jE18YGaSa2WwJWYtzoqgpeASCb++LCXxwEDguvOZNHAhMn msslw9WfxS0L6v1ojDjpT/i9s9sI/mXtLcWMkKy4nDjeWiipQc1+t3BYF6kjX9mR8QF6 PryoVYoJiifDm/ezWazfJfPdV4xC4iQY5Mr6O+GrP3XuyBDA6zwJBEFflkymOXclCjHJ MJ8uOlP2laOt9A8S9U6r/iHj4KiT/3YrJjBKPgmFK7pRZfC1IPlmTf2hdCC8ZxkkK85f 8VzuTpCbixUia8v384aFV0C+po/TBbxMQtfnGKkpgFgVUxf506aP0Y9r4SqutWGYoGL0 dhQA== X-Gm-Message-State: AC+VfDxMa5wkisn9G1gajT06T2tDO2vzEhEpUHLTyqt0fC0Q8Ixda9YD iTO/a66sBZ2xMuhxsrMLLdIDeHSLWj0= X-Google-Smtp-Source: ACHHUZ4EyFu8mwEU1QYN86KZyNdN0+84ERXHNRwWS2bKpDaLjYjmYkAZX6xNdgA/4cykJvE19Bs+AA== X-Received: by 2002:a2e:7004:0:b0:2a7:7055:97f5 with SMTP id l4-20020a2e7004000000b002a7705597f5mr3382400ljc.0.1683824980936; Thu, 11 May 2023 10:09:40 -0700 (PDT) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Julien Grall , Jan Beulich , Andrew Cooper , Stefano Stabellini , Gianluca Guida , Oleksii Kurochko , Bob Eshleman , Alistair Francis , Connor Davis Subject: [PATCH v7 5/5] xen/riscv: remove dummy_bss variable Date: Thu, 11 May 2023 20:09:33 +0300 Message-Id: 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: 1683825032480100005 Content-Type: text/plain; charset="utf-8" After introduction of initial pagetables there is no any sense in dummy_bss variable as bss section will not be empty anymore. Signed-off-by: Oleksii Kurochko --- Changes in V6: - Nothing changed. Only rebase --- Changes in V5: - Nothing changed. Only rebase --- Changes in V4: - Nothing changed. Only rebase --- Changes in V3: * patch was introduced in the current one patch series (v3). --- Changes in V2: * patch was introduced in the current one patch series (v2). --- xen/arch/riscv/setup.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/xen/arch/riscv/setup.c b/xen/arch/riscv/setup.c index cf5dc5824e..845d18d86f 100644 --- a/xen/arch/riscv/setup.c +++ b/xen/arch/riscv/setup.c @@ -8,14 +8,6 @@ unsigned char __initdata cpu0_boot_stack[STACK_SIZE] __aligned(STACK_SIZE); =20 -/* =20 - * To be sure that .bss isn't zero. It will simplify code of - * .bss initialization. - * TODO: - * To be deleted when the first real .bss user appears - */ -int dummy_bss __attribute__((unused)); - void __init noreturn start_xen(unsigned long bootcpu_id, paddr_t dtb_addr) { --=20 2.40.1