Skip to contentSkip to conversation

libxc: correct max_pfn calculation for saving domain

PATCH In review Juergen Gross 3 participants 4 messages Aug 26, 2016 – Aug 30, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libxc: correct max_pfn calculation for saving domain

Commit 91e204d37f44913913776d0a89279721694f8b32 ("libxc: try to find last used pfn when migrating") introduced a bug for the case of a domain supporting the virtual mapped linear p2m list: the maximum pfn of the domain calculated from the p2m memory allocation might be too low.

Correct this.

---
This is a backport candidate for 4.7

---
 tools/libxc/xc_sr_save_x86_pv.c | 2 ++
 1 file changed, 2 insertions(+)
tools/libxc/xc_sr_save_x86_pv.c +2 -0
index 4a29460..7043409 100644
@@ -430,6 +430,8 @@ static int map_p2m_list(struct xc_sr_context *ctx, uint64_t p2m_cr3)
 
         if ( level == 2 )
         {
+            if ( saved_idx == idx_end )
+                saved_idx++;
             max_pfn = ((xen_pfn_t)saved_idx << 9) * fpp - 1;
             if ( max_pfn < ctx->x86_pv.max_pfn )
             {
Signature · 7 lines
2.6.6


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Tested-by Stefan Bader Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines · Juergen Gross

Commit 91e204d37f44913913776d0a89279721694f8b32 ("libxc: try to find last used pfn when migrating") introduced a bug for the case of a domain supporting the virtual mapped linear p2m list: the maximum pfn of the domain calculated from the p2m memory allocation might be too low.

Correct this.

Saw in <[email protected]>

Quoted 22 lines

---
This is a backport candidate for 4.7

---
 tools/libxc/xc_sr_save_x86_pv.c | 2 ++
 1 file changed, 2 insertions(+)
tools/libxc/xc_sr_save_x86_pv.c +2 -0
index 4a29460..7043409 100644
@@ -430,6 +430,8 @@ static int map_p2m_list(struct xc_sr_context *ctx, uint64_t p2m_cr3)
 
         if ( level == 2 )
         {
+            if ( saved_idx == idx_end )
+                saved_idx++;
             max_pfn = ((xen_pfn_t)saved_idx << 9) * fpp - 1;
             if ( max_pfn < ctx->x86_pv.max_pfn )
             {
Signature · 1 line
2.6.6

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#2 lore raw
Quoted 9 lines · Wei Liu
Quoted 8 lines · Juergen Gross

Commit 91e204d37f44913913776d0a89279721694f8b32 ("libxc: try to find last used pfn when migrating") introduced a bug for the case of a domain supporting the virtual mapped linear p2m list: the maximum pfn of the domain calculated from the p2m memory allocation might be too low.

Correct this.

Quoted 9 lines
Quoted 2 lines

Saw in <[email protected]>

Pushed.

Ian, please backport this to Xen 4.7.

Wei.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel