Re: [PATCH v3 3/3] xen/riscv: introduce identity mapping

2023-07-20 Thread Oleksii
On Thu, 2023-07-20 at 16:06 +0200, Jan Beulich wrote: > On 20.07.2023 15:34, Oleksii wrote: > > On Thu, 2023-07-20 at 12:29 +0200, Jan Beulich wrote: > > > On 20.07.2023 10:28, Oleksii wrote: > > > > On Thu, 2023-07-20 at 07:58 +0200, Jan Beulich wrote: > > > > > On 19.07.2023 18:35, Oleksii wrote:

Re: [PATCH v3 3/3] xen/riscv: introduce identity mapping

2023-07-20 Thread Jan Beulich
On 20.07.2023 15:34, Oleksii wrote: > On Thu, 2023-07-20 at 12:29 +0200, Jan Beulich wrote: >> On 20.07.2023 10:28, Oleksii wrote: >>> On Thu, 2023-07-20 at 07:58 +0200, Jan Beulich wrote: On 19.07.2023 18:35, Oleksii wrote: > Then we will have completely different L0 tables for identity >

Re: [PATCH v3 3/3] xen/riscv: introduce identity mapping

2023-07-20 Thread Oleksii
On Thu, 2023-07-20 at 12:29 +0200, Jan Beulich wrote: > On 20.07.2023 10:28, Oleksii wrote: > > On Thu, 2023-07-20 at 07:58 +0200, Jan Beulich wrote: > > > On 19.07.2023 18:35, Oleksii wrote: > > > > On Tue, 2023-07-18 at 17:03 +0200, Jan Beulich wrote: > > > > > > +    unsigned long load_e

Re: [PATCH v3 3/3] xen/riscv: introduce identity mapping

2023-07-20 Thread Jan Beulich
On 20.07.2023 10:28, Oleksii wrote: > On Thu, 2023-07-20 at 07:58 +0200, Jan Beulich wrote: >> On 19.07.2023 18:35, Oleksii wrote: >>> On Tue, 2023-07-18 at 17:03 +0200, Jan Beulich wrote: > +    unsigned long load_end = LINK_TO_LOAD(_end); > +    unsigned long pt_level_size

Re: [PATCH v3 3/3] xen/riscv: introduce identity mapping

2023-07-20 Thread Oleksii
On Thu, 2023-07-20 at 07:58 +0200, Jan Beulich wrote: > On 19.07.2023 18:35, Oleksii wrote: > > On Tue, 2023-07-18 at 17:03 +0200, Jan Beulich wrote: > > > > +    unsigned long load_end = LINK_TO_LOAD(_end); > > > > +    unsigned long pt_level_size = XEN_PT_LEVEL_SIZE(i > > > > - >

Re: [PATCH v3 3/3] xen/riscv: introduce identity mapping

2023-07-19 Thread Jan Beulich
On 19.07.2023 18:35, Oleksii wrote: > On Tue, 2023-07-18 at 17:03 +0200, Jan Beulich wrote: >>> +    unsigned long load_end = LINK_TO_LOAD(_end); >>> +    unsigned long pt_level_size = XEN_PT_LEVEL_SIZE(i - >>> 1); >>> +    unsigned long xen_size = ROUNDUP(load_end - >>> loa

Re: [PATCH v3 3/3] xen/riscv: introduce identity mapping

2023-07-19 Thread Oleksii
On Wed, 2023-07-19 at 13:38 +0200, Jan Beulich wrote: > On 19.07.2023 12:39, Oleksii wrote: > > On Tue, 2023-07-18 at 17:03 +0200, Jan Beulich wrote: > > > On 17.07.2023 16:40, Oleksii Kurochko wrote: > > > > @@ -35,8 +41,10 @@ unsigned long __ro_after_init phys_offset; > > > >   * > > > >   * It m

Re: [PATCH v3 3/3] xen/riscv: introduce identity mapping

2023-07-19 Thread Oleksii
On Tue, 2023-07-18 at 17:03 +0200, Jan Beulich wrote: > > +    unsigned long load_end = LINK_TO_LOAD(_end); > > +    unsigned long pt_level_size = XEN_PT_LEVEL_SIZE(i - > > 1); > > +    unsigned long xen_size = ROUNDUP(load_end - > > load_start, pt_level_size); > > +

Re: [PATCH v3 3/3] xen/riscv: introduce identity mapping

2023-07-19 Thread Jan Beulich
On 19.07.2023 12:39, Oleksii wrote: > On Tue, 2023-07-18 at 17:03 +0200, Jan Beulich wrote: >> On 17.07.2023 16:40, Oleksii Kurochko wrote: >>> @@ -35,8 +41,10 @@ unsigned long __ro_after_init phys_offset; >>>   * >>>   * It might be needed one more page table in case when Xen load >>> address >>>

Re: [PATCH v3 3/3] xen/riscv: introduce identity mapping

2023-07-19 Thread Oleksii
On Tue, 2023-07-18 at 17:03 +0200, Jan Beulich wrote: > On 17.07.2023 16:40, Oleksii Kurochko wrote: > > The way how switch to virtual address was implemented in the > > commit e66003e7be ("xen/riscv: introduce setup_initial_pages") > > isn't safe enough as: > > * enable_mmu() depends on hooking al

Re: [PATCH v3 3/3] xen/riscv: introduce identity mapping

2023-07-18 Thread Jan Beulich
On 17.07.2023 16:40, Oleksii Kurochko wrote: > The way how switch to virtual address was implemented in the > commit e66003e7be ("xen/riscv: introduce setup_initial_pages") > isn't safe enough as: > * enable_mmu() depends on hooking all exceptions > and pagefault. > * Any exception other than pag

[PATCH v3 3/3] xen/riscv: introduce identity mapping

2023-07-17 Thread Oleksii Kurochko
The way how switch to virtual address was implemented in the commit e66003e7be ("xen/riscv: introduce setup_initial_pages") isn't safe enough as: * enable_mmu() depends on hooking all exceptions and pagefault. * Any exception other than pagefault, or not taking a pagefault causes it to malfunct