Skip to contentSkip to conversation

libxl: correct bug in domain builder regarding page tables for pvh

PATCH In review Juergen Gross 4 participants 4 messages Nov 19, 2015 – Nov 20, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libxl: correct bug in domain builder regarding page tables for pvh

Commit 81a76e4b12961a9f54f5021809074196dfe6dbba ("libxc: rework of domain builder's page table handler") dropped a special case for pvh resulting in page tables being mapped read-only. This led to a panic of the domain in early boot.

Correct this error.

---
 tools/libxc/xc_dom_x86.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/libxc/xc_dom_x86.c +1 -1
index 7279fa2..5ff33ca 100644
@@ -372,7 +372,7 @@ static x86_pgentry_t get_pg_prot_x86(struct xc_dom_image *dom, int l,
     unsigned m;
 
     prot = domx86->params->lvl_prot[l];
-    if ( l > 0 )
+    if ( l > 0 || dom->pvh_enabled )
         return prot;
 
     for ( m = 0; m < domx86->n_mappings; m++ )
Signature · 1 line
2.6.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Juergen Gross

Commit 81a76e4b12961a9f54f5021809074196dfe6dbba ("libxc: rework of domain builder's page table handler") dropped a special case for pvh resulting in page tables being mapped read-only. This led to a panic of the domain in early boot.

Correct this error.

Boris, can you test this as well?

Quoted 20 lines
---
 tools/libxc/xc_dom_x86.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/libxc/xc_dom_x86.c +1 -1
index 7279fa2..5ff33ca 100644
@@ -372,7 +372,7 @@ static x86_pgentry_t get_pg_prot_x86(struct xc_dom_image *dom, int l,
     unsigned m;
 
     prot = domx86->params->lvl_prot[l];
-    if ( l > 0 )
+    if ( l > 0 || dom->pvh_enabled )
         return prot;
 
     for ( m = 0; m < domx86->n_mappings; m++ )
Signature · 1 line
2.6.2
#2 lore raw
Quoted 6 lines · Wei Liu
Quoted 5 lines · Juergen Gross

Commit 81a76e4b12961a9f54f5021809074196dfe6dbba ("libxc: rework of domain builder's page table handler") dropped a special case for pvh resulting in page tables being mapped read-only. This led to a panic of the domain in early boot.

Quoted 6 lines
Quoted 3 lines

Correct this error.

Boris, can you test this as well?

Yes, it's all good.

-boris

#3 lore raw
Quoted 7 lines · Boris Ostrovsky
Quoted 6 lines · Wei Liu
Quoted 5 lines · Juergen Gross

Commit 81a76e4b12961a9f54f5021809074196dfe6dbba ("libxc: rework of domain builder's page table handler") dropped a special case for pvh resulting in page tables being mapped read-only. This led to a panic of the domain in early boot.

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

Correct this error.

Boris, can you test this as well?

Yes, it's all good.

I took this as: Tested-by: Boris Ostrovsky <[email protected]>

and have applied, thanks all.