[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Xen-devel] [RFC PATCH 71/84] x86/setup: start tearing down the direct map.
 
- To: hongyax@xxxxxxxxxx, Wei Liu <wl@xxxxxxx>
 
- From: Julien Grall <julien.grall@xxxxxxx>
 
- Date: Fri, 27 Sep 2019 14:01:46 +0100
 
- Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>, George Dunlap <George.Dunlap@xxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Ian Jackson <ian.jackson@xxxxxxxxxxxxx>, Tim Deegan <tim@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, Roger Pau Monné <roger.pau@xxxxxxxxxx>
 
- Delivery-date: Fri, 27 Sep 2019 13:01:51 +0000
 
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
 
 
 
Hi,
On 27/09/2019 13:54, hongyax@xxxxxxxxxx wrote:
 
On 26/09/2019 15:26, Wei Liu wrote:
 
On Thu, Sep 26, 2019 at 10:46:34AM +0100, hongyax@xxxxxxxxxx wrote:
 
From: Hongyan Xia <hongyax@xxxxxxxxxx>
Signed-off-by: Hongyan Xia <hongyax@xxxxxxxxxx>
---
  xen/arch/x86/setup.c    | 4 ++--
  xen/common/page_alloc.c | 2 +-
  2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index e964c032f6..3dc2fad987 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -1367,7 +1367,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
              if ( map_e < end )
              {
-                map_pages_to_xen((unsigned long)__va(map_e), 
maddr_to_mfn(map_e),
+                map_pages_to_xen((unsigned long)__va(map_e), INVALID_MFN,
                                   PFN_DOWN(end - map_e), PAGE_HYPERVISOR);
 
 
Why don't you just remove the calls to map_pages_to_xen?
 
 
 My intention is to pre-populate the range so that we don't have to do so later 
when there are xenheap allocations. But of course if there is superpage merging 
or shattering, page tables will be removed or allocated anyway. I will remove 
the calls in the next revision.
 
 How about using populate_pt_range() in that case? This will pre-populate the 
page-tables for mapping with small pages.
 I haven't fully read the series yet. But I would assume that only memory 
allocated for Xen internal would be kept mapped. Guest memory would still be 
unmapped, right?
 If so, I don't think we often do big allocation for Xen. So it is probably more 
likely to use small pages. In that case, it would be fine to pre-allocate pages.
 In another hand, Xen doesn't use a lot of memory (if you compare to guest 
memory). So maybe pre-populating the page-tables would be a waste of memory.
Cheers,
--
Julien Grall
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel 
 
    
     |