From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5D639C433B4 for ; Tue, 18 May 2021 04:05:09 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1387D611BD for ; Tue, 18 May 2021 04:05:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1387D611BD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.128588.241379 (Exim 4.92) (envelope-from ) id 1liqyY-0007n2-3U; Tue, 18 May 2021 04:04:58 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 128588.241379; Tue, 18 May 2021 04:04:58 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1liqyY-0007mv-0A; Tue, 18 May 2021 04:04:58 +0000 Received: by outflank-mailman (input) for mailman id 128588; Tue, 18 May 2021 04:04:56 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1liqyW-0007mp-0S for xen-devel@lists.xenproject.org; Tue, 18 May 2021 04:04:56 +0000 Received: from mail-ot1-x32e.google.com (unknown [2607:f8b0:4864:20::32e]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 5c59bddc-d987-4111-98e9-643c8ae21d30; Tue, 18 May 2021 04:04:55 +0000 (UTC) Received: by mail-ot1-x32e.google.com with SMTP id 36-20020a9d0ba70000b02902e0a0a8fe36so7500760oth.8 for ; Mon, 17 May 2021 21:04:55 -0700 (PDT) Received: from [192.168.99.80] (142-79-211-230.starry-inc.net. [142.79.211.230]) by smtp.gmail.com with ESMTPSA id a18sm3657807otp.48.2021.05.17.21.04.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 17 May 2021 21:04:54 -0700 (PDT) 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: 5c59bddc-d987-4111-98e9-643c8ae21d30 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=TuYjVpp13TZsuq7/CADVizMkRzWxPfWgCLP5dnTDveQ=; b=dfI6o7sShjPqqzYHgCa5PMDHdbBtgrfVY/PisFPUA62ayRq0/4e8yLZkj90bgtx0su lNLagUKWC+o/7zcbbrPnCcy7KeuhtDk3Aey2VAame1PchlMWI/WWituK3vBCjy28BF4J lpG4N7JoH/3uKOF5891jnqSO+VzPzxBVGFjUKcIG770OEXuluIYJGHOpD+f8zVDdmFYB kX7bHelMsk4tYQHy7/9YnYEoMbyIvBm+jB6WpEoegRBpo3oPMekgeed3YXpOJLkbeCp1 c2EToXJNGYak8s39fSUTFgy5rzgf2GuKShBHv9oYRZOW6BOEdzaRf1/wjYJGE0jaFvMw udCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=TuYjVpp13TZsuq7/CADVizMkRzWxPfWgCLP5dnTDveQ=; b=RYslNQCi9sjtruR1CeKbUM9OcU3HwjWA/PIDz4HfEyAmPSJpFWCHvczeuHuKduYFm3 QCv3mjt95PAJ3HVTp/FRNWl9eBTDDXBTftikcEg1roZDclnDSyNl3BayYPjgxo9/x6pw XW+GdFa8/xOM2Y+n1uDU8ypplK0o+4nIuTyTd+QsrCTVPE1gQlvIxuF9IbbGnc3MFh6H aIQPDNjJIFXZrR8bb+OjWMO8V8vdn1/To+tsDt++BgitE1simckCOuwFtWWJRVaQ4wz0 eRCp8ZaWyzcf0KIPZ1tqRb7sT0sY8LKT3fVIy7b7frlKSqCY7v3VdWk6rdH06Lbm+7d4 E/Vg== X-Gm-Message-State: AOAM533G4GkabSQoC/uxoRX+AdaZbwHZFNrO4KNX5qUBxnKtd8vgs8kk iDCeMO99jVdoQmoMZUQA+vk= X-Google-Smtp-Source: ABdhPJxXa0u7eT86x6L3KW1czgYdGewExdiIQM6JN+aacEsgaFazI+zk2h2pNmmEjTBJaW9z64g6TA== X-Received: by 2002:a9d:7003:: with SMTP id k3mr2583971otj.351.1621310694862; Mon, 17 May 2021 21:04:54 -0700 (PDT) Subject: Re: [PATCH v3 4/5] xen: Add files needed for minimal riscv build To: Bob Eshleman , xen-devel@lists.xenproject.org Cc: Alistair Francis , Andrew Cooper , George Dunlap , Ian Jackson , Jan Beulich , Julien Grall , Stefano Stabellini , Wei Liu References: <97815ecd-7335-9c85-5df8-802ed119d518@gmail.com> From: Connor Davis Message-ID: <07b22852-5e80-695b-2877-bc6ecd03d35c@gmail.com> Date: Mon, 17 May 2021 22:05:16 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US On 5/17/21 7:43 PM, Bob Eshleman wrote: > On 5/14/21 4:47 PM, Connor Davis wrote: >> On 5/14/21 3:53 PM, Bob Eshleman wrote: >>> On 5/14/21 11:53 AM, Connor Davis wrote: >>> >>>> + >>>> +#ifdef CONFIG_RISCV_64 >>>> + >>>> +/* >>>> + * RISC-V Layout: >>>> + *   0x0000000000000000 - 0x0000003fffffffff (256GB, L2 slots [0-255]) >>>> + *     Unmapped >>>> + *   0x0000004000000000 - 0xffffffbfffffffff >>>> + *     Inaccessible: sv39 only supports 39-bit sign-extended VAs. >>>> + *   0xffffffc000000000 - 0xffffffc0001fffff (2MB, L2 slot [256]) >>>> + *     Unmapped >>>> + *   0xffffffc000200000 - 0xffffffc0003fffff (2MB, L2 slot [256]) >>>> + *     Xen text, data, bss >>>> + *   0xffffffc000400000 - 0xffffffc0005fffff (2MB, L2 slot [256]) >>>> + *     Fixmap: special-purpose 4K mapping slots >>>> + *   0xffffffc000600000 - 0xffffffc0009fffff (4MB, L2 slot [256]) >>>> + *     Early boot mapping of FDT >>>> + *   0xffffffc000a00000 - 0xffffffc000bfffff (2MB, L2 slot [256]) >>>> + *     Early relocation address, used when relocating Xen and later >>>> + *     for livepatch vmap (if compiled in) >>>> + *   0xffffffc040000000 - 0xffffffc07fffffff (1GB, L2 slot [257]) >>>> + *     VMAP: ioremap and early_ioremap >>>> + *   0xffffffc080000000 - 0xffffffc13fffffff (3GB, L2 slots [258..260]) >>>> + *     Unmapped >>>> + *   0xffffffc140000000 - 0xffffffc1bfffffff (2GB, L2 slots [261..262]) >>>> + *     Frametable: 48 bytes per page for 133GB of RAM >>>> + *   0xffffffc1c0000000 - 0xffffffe1bfffffff (128GB, L2 slots [263..390]) >>>> + *     1:1 direct mapping of RAM >>>> + *   0xffffffe1c0000000 - 0xffffffffffffffff (121GB, L2 slots [391..511]) >>>> + *     Unmapped >>>> + */ >>>> + >>> What is the benefit of moving the layout up to 0xffffffc000000000? >> I thought it made the most sense to use the upper half since Xen is privileged >> >> and privileged code is typically mapped in the upper half, at least on x86. I'm happy to >> >> move it down if that would be preferred. >> >> > I do like the idea of following norms, but I think I prefer following the ARM norm > over the x86 norm unless there is a technical reason not to. Just due to > ARM and RISC-V having much more overlap than x86 and RISC-V. In this case, > all things being equal, I'd prefer following the ARM model and use the lower half. > I definitely like adding the note on the inaccessible region. Sounds good, I will move it down. Thanks, Connor