From: Oleksii <oleksii.kurochko@gmail.com>
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
Stefano Stabellini <sstabellini@kernel.org>,
Gianluca Guida <gianluca@rivosinc.com>,
Bob Eshleman <bobbyeshleman@gmail.com>,
Alistair Francis <alistair.francis@wdc.com>,
Connor Davis <connojdavis@gmail.com>
Subject: Re: [PATCH v1 1/3] xen/riscv: introduce setup_initial_pages
Date: Sun, 05 Mar 2023 23:28:02 +0200 [thread overview]
Message-ID: <cdf18b1be34a623666808764439d50560663c574.camel@gmail.com> (raw)
In-Reply-To: <e0722b2323c78478f8fd07b515bb607ef168ef1e.camel@gmail.com>
>
> >
> > > >
> > > > > +
> > > > > + page_addr = map_start;
> > > > > + while ( page_addr < map_end )
> > > >
> > > > Looking at the loop, it looks like you are assuming that the
> > > > region
> > > > will
> > > > never cross a boundary of a page-table (either L0, L1, L2). I
> > > > am
> > > > not
> > > > convinced you can make such assumption (see below).
> > > >
> > > > But if you really want to make such assumption then you should
> > > > add
> > > > some
> > > > guard (either BUILD_BUG_ON(), ASSERT(), proper check) in your
> > > > code to
> > > > avoid any surprise in the future.
> > > I am not sure that I fully understand what is the problem here.
> > > The address is aligned on (1<<12) boundary and each itearation is
> > > mapped (1<<12) page so all looks fine or I misunderstood you.
> >
> > Let's take an example, imagine the region you want to map is 4MB.
> > AFAICT, you are only passing one L0 page-table. So your code will
> > end
> > up
> > to overwrite the previous entries in the zeroeth page-table and
> > then
> > add
> > another link in the L1 page-table.
> Got it. Then it looks that current approach isn't correct totally...
Or as an option we can add to xen.lds.S something like:
ASSERT(_end - _start <= MB(L0_ENTRIES*PAGE_SIZE), "Xen too large")
~ Oleksii
next prev parent reply other threads:[~2023-03-05 21:28 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-24 15:06 [PATCH v1 0/3] enable MMU for RISC-V Oleksii Kurochko
2023-02-24 15:06 ` [PATCH v1 1/3] xen/riscv: introduce setup_initial_pages Oleksii Kurochko
2023-02-24 15:23 ` Andrew Cooper
2023-02-25 17:53 ` Julien Grall
2023-02-27 16:52 ` Oleksii
2023-02-27 17:36 ` Julien Grall
2023-03-05 16:25 ` Oleksii
2023-03-05 21:28 ` Oleksii [this message]
2023-03-21 16:25 ` Julien Grall
2023-03-22 9:14 ` Oleksii
2023-02-27 15:12 ` Jan Beulich
2023-02-27 15:19 ` Jan Beulich
2023-03-06 6:39 ` Oleksii
2023-03-06 6:38 ` Oleksii
2023-02-24 15:06 ` [PATCH v1 2/3] xen/riscv: setup initial pagetables Oleksii Kurochko
2023-02-25 18:05 ` Julien Grall
2023-02-27 15:17 ` Jan Beulich
2023-02-27 15:36 ` Julien Grall
2023-02-27 17:17 ` Oleksii
2023-02-27 17:45 ` Julien Grall
2023-03-08 14:54 ` Oleksii
2023-03-08 15:17 ` Jan Beulich
2023-03-08 16:16 ` Oleksii
2023-03-09 9:46 ` Jan Beulich
2023-03-09 14:39 ` Oleksii
2023-02-24 15:06 ` [PATCH v1 3/3] automation: update RISC-V smoke test Oleksii Kurochko
2023-02-24 15:27 ` Andrew Cooper
2023-02-24 16:45 ` Oleksii
2023-02-24 15:19 ` [PATCH v1 0/3] enable MMU for RISC-V Oleksii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cdf18b1be34a623666808764439d50560663c574.camel@gmail.com \
--to=oleksii.kurochko@gmail.com \
--cc=alistair.francis@wdc.com \
--cc=andrew.cooper3@citrix.com \
--cc=bobbyeshleman@gmail.com \
--cc=connojdavis@gmail.com \
--cc=gianluca@rivosinc.com \
--cc=julien@xen.org \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.