diff mbox series

mini-os: fix do_map_frames() for pvh

Message ID 20200815111257.29302-1-jgross@suse.com (mailing list archive)
State New, archived
Headers show
Series mini-os: fix do_map_frames() for pvh | expand

Commit Message

Jürgen Groß Aug. 15, 2020, 11:12 a.m. UTC
In case ov PVH dom_map_frames() is missing to increment the virtual
address. This leads to writing only the first page table entry multiple
times.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 arch/x86/mm.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Samuel Thibault Aug. 15, 2020, 9:43 p.m. UTC | #1
Juergen Gross, le sam. 15 août 2020 13:12:57 +0200, a ecrit:
> In case ov PVH dom_map_frames() is missing to increment the virtual
> address. This leads to writing only the first page table entry multiple
> times.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>

Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

> ---
>  arch/x86/mm.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/x86/mm.c b/arch/x86/mm.c
> index ea58444..8ba14a5 100644
> --- a/arch/x86/mm.c
> +++ b/arch/x86/mm.c
> @@ -695,6 +695,7 @@ int do_map_frames(unsigned long va,
>          pgt[l1_table_offset(va)] = (pgentry_t)
>              (((mfns[done * stride] + done * incr) << PAGE_SHIFT) | prot);
>          done++;
> +        va += PAGE_SIZE;
>  #endif
>      }
>  
> -- 
> 2.26.2
>
Wei Liu Aug. 17, 2020, 9:55 a.m. UTC | #2
On Sat, Aug 15, 2020 at 11:43:21PM +0200, Samuel Thibault wrote:
> Juergen Gross, le sam. 15 août 2020 13:12:57 +0200, a ecrit:
> > In case ov PVH dom_map_frames() is missing to increment the virtual
> > address. This leads to writing only the first page table entry multiple
> > times.
> > 
> > Signed-off-by: Juergen Gross <jgross@suse.com>
> 
> Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

Applied.
diff mbox series

Patch

diff --git a/arch/x86/mm.c b/arch/x86/mm.c
index ea58444..8ba14a5 100644
--- a/arch/x86/mm.c
+++ b/arch/x86/mm.c
@@ -695,6 +695,7 @@  int do_map_frames(unsigned long va,
         pgt[l1_table_offset(va)] = (pgentry_t)
             (((mfns[done * stride] + done * incr) << PAGE_SHIFT) | prot);
         done++;
+        va += PAGE_SIZE;
 #endif
     }