x86/pvh: fix PVHv2 Dom0 memory calculation
PATCH 1/1 x86/pvh: fix PVHv2 Dom0 memory calculation
PVHv2 is always going to require the usage of memory in order to store the p2m page tables, either when using hap or shadow.
Fix the condition so memory is reserved unconditionally when trying to build a PVHv2 Dom0.
---
Cc: Boris Ostrovsky <[email protected]>
Cc: Jan Beulich <[email protected]>
Cc: Andrew Cooper <[email protected]>
--- xen/arch/x86/dom0_build.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
xen/arch/x86/dom0_build.c +1 -2
@@ -263,8 +263,7 @@ unsigned long __init dom0_compute_nr_pages( avail -= max_pdx >> s; } - need_paging =is_hvm_domain (d) && - (!iommu_hap_pt_share || !paging_mode_hap (d)); + need_paging =is_hvm_domain (d);for ( ; ; need_paging = false ) { nr_pages = dom0_nrpages;
Signature · 7 lines
2.13.5 (Apple Git-94) _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
xen/arch/x86/dom0_build.c unsigned long __init dom0_compute_nr_pages( · line 269
Quoted 13 lines
Quoted 1 line
Quoted 1 line · On 27.09.17 at 16:16, <[email protected]> wrote:
xen/arch/x86/dom0_build.c +1
-2@@ -263,8 +263,7 @@ unsigned long __init dom0_compute_nr_pages( avail -= max_pdx >> s; } - need_paging =is_hvm_domain (d) && - (!iommu_hap_pt_share || !paging_mode_hap (d)); + need_paging =is_hvm_domain (d);for ( ; ; need_paging = false ) { nr_pages = dom0_nrpages;
Still in context above is the calculation for IOMMU page tables When iommu_hap_pt_share, why do we need to reserve extra space? If the IOMMU calculation isn't precise enough, perhaps that's what wants changing? Quite possibly it would suffice to simply double the value dom0_paging_pages() returns in that case.
Jan
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 7 lines · Jan Beulich
Quoted 7 lines
Quoted 1 line
Quoted 1 line · On 27.09.17 at 16:16, <[email protected]> wrote:
xen/arch/x86/dom0_build.c +0
-0@@ -263,8 +263,7 @@ unsigned long __init dom0_compute_nr_pages( avail -= max_pdx >> s; }
Quoted 13 lines
xen/arch/x86/dom0_build.c unsigned long __init dom0_compute_nr_pages( · line 269
Quoted 6 lines
xen/arch/x86/dom0_build.c +1
-2- need_paging =is_hvm_domain (d) && - (!iommu_hap_pt_share || !paging_mode_hap (d)); + need_paging =is_hvm_domain (d);for ( ; ; need_paging = false ) { nr_pages = dom0_nrpages;Still in context above is the calculation for IOMMU page tables When
iommu_hap_pt_share, why do we need to reserve extra space? If the IOMMU calculation isn't precise enough, perhaps that's what wants changing? Quite possibly it would suffice to simply double the valuedom0_paging_pages()returns in that case.
I have not seen this issue myself, perhaps Boris can provide a little more context on how to trigger this, so that the cause can be narrowed down.
Thanks, Roger.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 20 lines · Roger Pau Monné
Quoted 7 lines · Jan Beulich
Quoted 7 lines
Quoted 1 line
Quoted 1 line · On 27.09.17 at 16:16, <[email protected]> wrote:
xen/arch/x86/dom0_build.c +0
-0@@ -263,8 +263,7 @@ unsigned long __init dom0_compute_nr_pages( avail -= max_pdx >> s; }Quoted 12 lines
xen/arch/x86/dom0_build.c unsigned long __init dom0_compute_nr_pages( · line 269
Quoted 6 lines
xen/arch/x86/dom0_build.c +1
-2- need_paging =is_hvm_domain (d) && - (!iommu_hap_pt_share || !paging_mode_hap (d)); + need_paging =is_hvm_domain (d);for ( ; ; need_paging = false ) { nr_pages = dom0_nrpages;Still in context above is the calculation for IOMMU page tables When
iommu_hap_pt_share, why do we need to reserve extra space? If the IOMMU calculation isn't precise enough, perhaps that's what wants changing? Quite possibly it would suffice to simply double the valuedom0_paging_pages()returns in that case.
Quoted 3 lines
I have not seen this issue myself, perhaps Boris can provide a little more context on how to trigger this, so that the cause can be narrowed down.
I could only trigger this on one of my machines but essentially the problem was that we reserved memory for page tables (pvh_setup_p2m()->paging_set_allocation()) and this reservation was not accounted for when trying to populate dom0's e820.
-boris
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 22 lines
Quoted 1 line
Quoted 1 line · On 27.09.17 at 19:02, <[email protected]> wrote:
Quoted 20 lines · Roger Pau Monné
Quoted 19 lines · Jan Beulich
xen/arch/x86/dom0_build.c unsigned long __init dom0_compute_nr_pages( · line 269
Quoted 13 lines
Quoted 1 line
Quoted 1 line · On 27.09.17 at 16:16, <[email protected]> wrote:
xen/arch/x86/dom0_build.c +1
-2@@ -263,8 +263,7 @@ unsigned long __init dom0_compute_nr_pages( avail -= max_pdx >> s; } - need_paging =is_hvm_domain (d) && - (!iommu_hap_pt_share || !paging_mode_hap (d)); + need_paging =is_hvm_domain (d);for ( ; ; need_paging = false ) { nr_pages = dom0_nrpages;Still in context above is the calculation for IOMMU page tables When
iommu_hap_pt_share, why do we need to reserve extra space? If the IOMMU calculation isn't precise enough, perhaps that's what wants changing? Quite possibly it would suffice to simply double the valuedom0_paging_pages()returns in that case.
Quoted 8 lines
Quoted 3 lines
I have not seen this issue myself, perhaps Boris can provide a little more context on how to trigger this, so that the cause can be narrowed down.
I could only trigger this on one of my machines but essentially the problem was that we reserved memory for page tables (pvh_setup_p2m()->paging_set_allocation()) and this reservation was not accounted for when trying to populate dom0's e820.
Hmm, but that's a problem which can't be resolved by changing the calculation of how much memory to reserve, I would think. I'm afraid I'm confused.
Jan
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel