On 01/10/2019 12:51, Wei Liu wrote:
On Mon, Sep 30, 2019 at 11:33:14AM +0100, Hongyan Xia wrote:
From: Wei Liu
Signed-off-by: Wei Liu
Signed-off-by: Hongyan Xia
---
Changed since v1:
* use a global mapping for compat_idle_pg_table_l2, otherwise
l2_ro_mpt will unmap it.
Hmmm... I
On 30/09/2019 11:33, Hongyan Xia wrote:
From: Wei Liu
This then requires moving declaration of root page table mfn into mm.h
and modify setup_cpu_root_pgt to have a single exit path.
We also need to force map_domain_page to use direct map when switching
per-domain mappings. This is contrary
On 01/10/2019 16:20, Wei Liu wrote:
On Tue, Oct 01, 2019 at 02:54:19PM +0100, Hongyan Xia wrote:
On 30/09/2019 11:33, Hongyan Xia wrote:
From: Wei Liu
This then requires moving declaration of root page table mfn into mm.h
and modify setup_cpu_root_pgt to have a single exit path.
We also
From: Wei Liu
We are going to switch to using domheap page for page tables.
A new set of APIs is introduced to allocate, map, unmap and free pages
for page tables.
The allocation and deallocation work on mfn_t but not page_info,
because they are required to work even before frame table is set
From: Wei Liu
We will soon need to handle dynamically mapping / unmapping page
tables in the said function.
No functional change.
Signed-off-by: Wei Liu
---
xen/arch/x86/mm.c | 18 +++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/xen/arch/x86/mm.c
From: Wei Liu
We will soon need to clean up mappings whenever the out most loop
is ended. Add a new label and turn relevant continue's into goto's.
No functional change.
Signed-off-by: Wei Liu
---
xen/arch/x86/mm.c | 15 ---
1 file changed, 8 insertions(+), 7 deletions(-)
diff
From: Wei Liu
We will soon rewrite the function to handle dynamically mapping and
unmapping of page tables.
No functional change.
Signed-off-by: Wei Liu
---
xen/arch/x86/mm.c | 34 +++---
1 file changed, 27 insertions(+), 7 deletions(-)
diff --git
From: Wei Liu
They were put into page.h but mm.h is more appropriate.
The real reason is that I will be adding some new functions which
takes mfn_t. It turns out it is a bit difficult to do in page.h.
No functional change.
Signed-off-by: Wei Liu
---
xen/include/asm-x86/mm.h | 5 +
This batch adds an alternative alloc-map-unmap-free Xen PTE API to the
normal alloc-free on the xenheap, in preparation of switching to domheap
for Xen page tables. Since map and unmap are basically no-ops now, and
other changes are cosmetic to ease future patches, this batch does not
introduce
From: Wei Liu
The pl2e and pl1e variables are heavily (ab)used in that function. It
is fine at the moment because all page tables are always mapped so
there is no need to track the life time of each variable.
We will soon have the requirement to map and unmap page tables. We
need to track the
From: Wei Liu
We will soon need to clean up mappings whenever the out most loop is
ended. Add a new label and turn relevant continue's into goto's.
No functional change.
Signed-off-by: Wei Liu
---
xen/arch/x86/mm.c | 9 +
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git
From: Wei Liu
The pl2e and pl1e variables are heavily (ab)used in that function. It
is fine at the moment because all page tables are always mapped so
there is no need to track the life time of each variable.
We will soon have the requirement to map and unmap page tables. We
need to track the
From: Wei Liu
We will need to have a variable named pl*e when we rewrite
virt_to_xen_l*e. Change pl*e to l*t to reflect better its purpose.
This will make reviewing later patch easier.
No functional change.
Signed-off-by: Wei Liu
Signed-off-by: Hongyan Xia
---
xen/arch/x86/mm.c | 42
From: Wei Liu
Signed-off-by: Wei Liu
---
xen/arch/x86/x86_64/mm.c | 9 +++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c
index 1d2ebd642f..e8ed04006f 100644
--- a/xen/arch/x86/x86_64/mm.c
+++ b/xen/arch/x86/x86_64/mm.c
From: Wei Liu
We will need to have a variable named pl2e when we rewrite
virt_to_xen_l2e. Change pl2e to l2t to reflect better its purpose.
This will make reviewing later patch easier.
No functional change.
Signed-off-by: Wei Liu
---
xen/arch/x86/mm.c | 14 +++---
1 file changed, 7
From: Wei Liu
Page tables allocated in that function should be mapped and unmapped
now.
Signed-off-by: Wei Liu
Signed-off-by: Hongyan Xia
---
Changed since v1:
* remove redundant lines
---
xen/arch/x86/mm.c | 33 ++---
1 file changed, 22 insertions(+), 11
From: Wei Liu
Defer the call to clear_page to the point when we're sure the page is
going to become a page table.
This is a minor optimisation. No functional change.
Signed-off-by: Wei Liu
---
xen/arch/x86/mm.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git
From: Wei Liu
We will need to have a variable named pl3e when we rewrite
virt_to_xen_l3e. Change pl3e to l3t to reflect better its purpose.
This will make reviewing later patch easier.
No functional change.
Signed-off-by: Wei Liu
---
xen/arch/x86/mm.c | 14 +++---
1 file changed, 7
From: Wei Liu
Signed-off-by: Wei Liu
---
xen/arch/x86/pv/shim.c | 20 +++-
1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/xen/arch/x86/pv/shim.c b/xen/arch/x86/pv/shim.c
index 324ca27f93..cf638fa965 100644
--- a/xen/arch/x86/pv/shim.c
+++
From: Wei Liu
Signed-off-by: Wei Liu
Signed-off-by: Hongyan Xia
---
Changed since v1:
* use a global mapping for compat_idle_pg_table_l2, otherwise
l2_ro_mpt will unmap it.
---
xen/arch/x86/x86_64/mm.c | 50 +---
1 file changed, 37 insertions(+), 13
From: Wei Liu
Signed-off-by: Wei Liu
---
xen/arch/x86/smpboot.c | 12 +---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index ca8fc6d485..9fe0ef18a1 100644
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@
From: Wei Liu
Signed-off-by: Wei Liu
---
xen/arch/x86/mm.c | 15 +--
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 6fb8c92543..8706dc0174 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -353,19 +353,22 @@ void
From: Wei Liu
Signed-off-by: Wei Liu
---
xen/arch/x86/x86_64/mm.c | 7 +--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c
index c8c71564ba..c1daa04cf5 100644
--- a/xen/arch/x86/x86_64/mm.c
+++ b/xen/arch/x86/x86_64/mm.c
@@
From: Wei Liu
We will soon need to clean up page table mappings in the exit path.
No functional change.
Signed-off-by: Wei Liu
---
xen/arch/x86/smpboot.c | 35 ---
1 file changed, 28 insertions(+), 7 deletions(-)
diff --git a/xen/arch/x86/smpboot.c
From: Wei Liu
Signed-off-by: Wei Liu
---
xen/arch/x86/x86_64/mm.c | 9 +
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c
index 103932720b..f31bd4ffde 100644
--- a/xen/arch/x86/x86_64/mm.c
+++ b/xen/arch/x86/x86_64/mm.c
From: Wei Liu
Introduce pl2e so that we can use l2_ro_mpt to point to the page table
itself.
No functional change.
Signed-off-by: Wei Liu
---
xen/arch/x86/x86_64/mm.c | 18 ++
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/xen/arch/x86/x86_64/mm.c
From: Wei Liu
This requires storing the MFN instead of linear address of the L4
table. Adjust code accordingly.
Signed-off-by: Wei Liu
---
xen/arch/x86/efi/runtime.h | 12 +---
xen/common/efi/boot.c | 8 ++--
xen/common/efi/efi.h | 3 ++-
xen/common/efi/runtime.c |
From: Wei Liu
Rewrite that function to use the new APIs. Modify its callers to unmap
the pointer returned.
Signed-off-by: Wei Liu
---
xen/arch/x86/mm.c | 61 +--
1 file changed, 48 insertions(+), 13 deletions(-)
diff --git a/xen/arch/x86/mm.c
From: Wei Liu
We will soon rewrite the function to handle dynamically mapping and
unmapping of page tables.
No functional change.
Signed-off-by: Wei Liu
---
xen/arch/x86/mm.c | 34 +++---
1 file changed, 27 insertions(+), 7 deletions(-)
diff --git
From: Wei Liu
The pl2e and pl1e variables are heavily (ab)used in that function. It
is fine at the moment because all page tables are always mapped so
there is no need to track the life time of each variable.
We will soon have the requirement to map and unmap page tables. We
need to track the
From: Wei Liu
We will soon need to clean up mappings whenever the out most loop is
ended. Add a new label and turn relevant continue's into goto's.
No functional change.
Signed-off-by: Wei Liu
---
xen/arch/x86/mm.c | 9 +
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git
From: Wei Liu
Signed-off-by: Wei Liu
---
xen/common/efi/boot.c | 39 +++
1 file changed, 27 insertions(+), 12 deletions(-)
diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 64a287690a..1d1420f02c 100644
--- a/xen/common/efi/boot.c
+++
From: Wei Liu
Signed-off-by: Wei Liu
---
xen/arch/x86/x86_64/mm.c | 14 +-
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c
index f31bd4ffde..d452ed3966 100644
--- a/xen/arch/x86/x86_64/mm.c
+++
From: Wei Liu
We will soon switch efi_l4_table to use ephemeral mapping. Make
copy_mapping take a pointer to the mapping instead of using the global
variable.
No functional change intended.
Signed-off-by: Wei Liu
---
xen/common/efi/boot.c | 11 ++-
1 file changed, 6 insertions(+), 5
From: Wei Liu
Signed-off-by: Wei Liu
---
xen/common/efi/boot.c | 10 ++
1 file changed, 10 insertions(+)
diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 1d1420f02c..3868293d06 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -1705,3 +1705,13 @@ void
From: Wei Liu
Signed-off-by: Wei Liu
---
xen/arch/x86/smpboot.c | 10 ++
1 file changed, 10 insertions(+)
diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index 5b3be25f8a..55b99644af 100644
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -1378,3 +1378,13 @@
From: Wei Liu
We will soon need to handle dynamically mapping / unmapping page
tables in the said function.
No functional change.
Signed-off-by: Wei Liu
---
xen/arch/x86/mm.c | 18 +++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/xen/arch/x86/mm.c
From: Wei Liu
We will need to have a variable named pl1e when we rewrite
virt_to_xen_l1e. Change pl1e to l1t to reflect better its purpose.
This will make reviewing later patch easier.
No functional change.
Signed-off-by: Wei Liu
---
xen/arch/x86/mm.c | 14 +++---
1 file changed, 7
From: Wei Liu
Signed-off-by: Wei Liu
---
xen/arch/x86/smpboot.c | 16 +++-
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index 956e1bdbcc..c55aaa65a2 100644
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@
This series is mostly Wei's effort to switch from xenheap to domheap for
Xen page tables. In addition, I have also merged several bug fixes from
my "Remove direct map from Xen" series [1]. As the title suggests, this
series switches from xenheap to domheap for Xen PTEs.
This is needed to achieve
From: Wei Liu
Signed-off-by: Wei Liu
---
xen/arch/x86/x86_64/mm.c | 16
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c
index d452ed3966..c41715cd56 100644
--- a/xen/arch/x86/x86_64/mm.c
+++
From: Wei Liu
Page tables allocated in that function should be mapped and unmapped
now.
Signed-off-by: Wei Liu
Signed-off-by: Hongyan Xia
---
Changed since v1:
* remove redundant lines
---
xen/arch/x86/mm.c | 34 +++---
1 file changed, 23 insertions(+), 11
From: Wei Liu
Signed-off-by: Wei Liu
---
xen/arch/x86/x86_64/mm.c | 31 +++
1 file changed, 23 insertions(+), 8 deletions(-)
diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c
index 8d13c994af..7a02fcee18 100644
--- a/xen/arch/x86/x86_64/mm.c
+++
From: Wei Liu
Rewrite this function to use new APIs. Modify its callers to unmap the
pointer returned.
Signed-off-by: Wei Liu
---
xen/arch/x86/domain_page.c | 10 ++
xen/arch/x86/mm.c | 30 +-
2 files changed, 31 insertions(+), 9 deletions(-)
diff
From: Wei Liu
Modify all the _new APIs to handle domheap pages.
Signed-off-by: Wei Liu
---
xen/arch/x86/mm.c | 13 +++--
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index c9be239d53..a2d2d01660 100644
--- a/xen/arch/x86/mm.c
+++
From: Wei Liu
We are going to switch to using domheap page for page tables.
A new set of APIs is introduced to allocate, map, unmap and free pages
for page tables.
The allocation and deallocation work on mfn_t but not page_info,
because they are required to work even before frame table is set
From: Wei Liu
After inspection ARM doesn't have alloc_xen_pagetable so this function
is x86 only, which means it is safe for us to change.
Signed-off-by: Wei Liu
---
XXX test this in gitlab ci to be sure.
---
xen/common/efi/boot.c | 16 +++-
1 file changed, 11 insertions(+), 5
From: Wei Liu
Signed-off-by: Wei Liu
---
xen/arch/x86/x86_64/mm.c | 18 ++
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c
index 2fff5f9306..1d2ebd642f 100644
--- a/xen/arch/x86/x86_64/mm.c
+++
From: Wei Liu
Rewrite that function to use the new APIs. Modify its callers to unmap
the pointer returned.
Signed-off-by: Wei Liu
---
xen/arch/x86/mm.c | 46 +-
1 file changed, 37 insertions(+), 9 deletions(-)
diff --git a/xen/arch/x86/mm.c
From: Wei Liu
Signed-off-by: Wei Liu
---
xen/arch/x86/x86_64/mm.c | 9 +++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c
index e0d2190be1..2fff5f9306 100644
--- a/xen/arch/x86/x86_64/mm.c
+++ b/xen/arch/x86/x86_64/mm.c
From: Wei Liu
Signed-off-by: Wei Liu
---
xen/arch/x86/smpboot.c | 18 --
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index d327c062b1..956e1bdbcc 100644
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
From: Wei Liu
Signed-off-by: Wei Liu
---
xen/arch/x86/smpboot.c | 22 +++---
1 file changed, 15 insertions(+), 7 deletions(-)
diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index 716dc1512d..db39f5cbb2 100644
--- a/xen/arch/x86/smpboot.c
+++
From: Wei Liu
Signed-off-by: Wei Liu
---
xen/arch/x86/x86_64/mm.c | 24 +---
1 file changed, 17 insertions(+), 7 deletions(-)
diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c
index e8ed04006f..8d13c994af 100644
--- a/xen/arch/x86/x86_64/mm.c
+++
From: Wei Liu
Signed-off-by: Wei Liu
---
xen/arch/x86/x86_64/mm.c | 15 ++-
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c
index 7a02fcee18..a1c69d7f0e 100644
--- a/xen/arch/x86/x86_64/mm.c
+++
From: Wei Liu
The pl2e and pl1e variables are heavily (ab)used in that function. It
is fine at the moment because all page tables are always mapped so
there is no need to track the life time of each variable.
We will soon have the requirement to map and unmap page tables. We
need to track the
From: Wei Liu
Signed-off-by: Wei Liu
---
xen/arch/x86/mm.c | 28 +++-
1 file changed, 19 insertions(+), 9 deletions(-)
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index a812ef0244..6fb8c92543 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -5532,8
From: Wei Liu
Signed-off-by: Wei Liu
---
xen/arch/x86/pv/dom0_build.c | 6 +-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/xen/arch/x86/pv/dom0_build.c b/xen/arch/x86/pv/dom0_build.c
index d7d42568fb..39cb68f7da 100644
--- a/xen/arch/x86/pv/dom0_build.c
+++
From: Wei Liu
Signed-off-by: Wei Liu
Signed-off-by: Hongyan Xia
---
Changed since v1:
- Fix rebase conflicts against new master and other changes since v1.
---
xen/arch/x86/domain.c| 4 +-
xen/arch/x86/domain_page.c | 2 +-
xen/arch/x86/efi/runtime.h | 4 +-
xen/arch/x86
From: Wei Liu
Signed-off-by: Wei Liu
---
xen/arch/x86/x86_64/mm.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c
index c1daa04cf5..103932720b 100644
--- a/xen/arch/x86/x86_64/mm.c
+++ b/xen/arch/x86/x86_64/mm.c
@@ -480,8 +480,6 @@
From: Wei Liu
Now that we've switched all users to the new APIs, the old ones aren't
needed anymore.
Signed-off-by: Wei Liu
---
xen/arch/x86/mm.c | 16
xen/include/asm-x86/mm.h | 2 --
xen/include/asm-x86/page.h | 5 -
3 files changed, 23 deletions(-)
diff
From: Wei Liu
Signed-off-by: Wei Liu
---
xen/arch/x86/smpboot.c | 18 --
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index db39f5cbb2..d327c062b1 100644
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
From: Wei Liu
We will soon need to clean up mappings whenever the out most loop
is ended. Add a new label and turn relevant continue's into goto's.
No functional change.
Signed-off-by: Wei Liu
---
xen/arch/x86/mm.c | 15 ---
1 file changed, 8 insertions(+), 7 deletions(-)
diff
From: Wei Liu
This then requires moving declaration of root page table mfn into mm.h
and modify setup_cpu_root_pgt to have a single exit path.
We also need to force map_domain_page to use direct map when switching
per-domain mappings. This is contrary to our end goal of removing
direct map, but
From: Wei Liu
Signed-off-by: Wei Liu
---
xen/arch/x86/x86_64/mm.c | 31 +++
1 file changed, 23 insertions(+), 8 deletions(-)
diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c
index 5c5b91b785..e0d2190be1 100644
--- a/xen/arch/x86/x86_64/mm.c
+++
From: Wei Liu
Map and unmap page tables where necessary.
Signed-off-by: Wei Liu
---
xen/arch/x86/mm.c | 40 +---
1 file changed, 29 insertions(+), 11 deletions(-)
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 5bb86935f4..08af71a261 100644
---
From: Wei Liu
Signed-off-by: Wei Liu
---
xen/arch/x86/x86_64/mm.c | 22 +++---
1 file changed, 15 insertions(+), 7 deletions(-)
diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c
index c41715cd56..5c5b91b785 100644
--- a/xen/arch/x86/x86_64/mm.c
+++
From: Wei Liu
Properly map and unmap page tables where necessary.
Signed-off-by: Wei Liu
---
xen/arch/x86/setup.c | 10 --
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index dec60d0301..d27bcf1724 100644
---
From: Wei Liu
They were put into page.h but mm.h is more appropriate.
The real reason is that I will be adding some new functions which
takes mfn_t. It turns out it is a bit difficult to do in page.h.
No functional change.
Signed-off-by: Wei Liu
---
xen/include/asm-x86/mm.h | 5 +
From: Wei Liu
Signed-off-by: Wei Liu
---
xen/arch/x86/pv/dom0_build.c | 35 +++
1 file changed, 23 insertions(+), 12 deletions(-)
diff --git a/xen/arch/x86/pv/dom0_build.c b/xen/arch/x86/pv/dom0_build.c
index 1bd53e9c08..d7d42568fb 100644
---
From: Wei Liu
The pl2e and pl1e variables are heavily (ab)used in that function. It
is fine at the moment because all page tables are always mapped so
there is no need to track the life time of each variable.
We will soon have the requirement to map and unmap page tables. We
need to track the
From: Wei Liu
We will need to have a variable named pl*e when we rewrite
virt_to_xen_l*e. Change pl*e to l*t to reflect better its purpose.
This will make reviewing later patch easier.
No functional change.
Signed-off-by: Wei Liu
Signed-off-by: Hongyan Xia
Reviewed-by: Jan Beulich
---
xen
NOTE: My email address has changed due to some HR management. I have
lost all my previous emails and I could only salvage some of the
comments to v3 from the mailing list archive. I will reply to the
comments from v3 in this v4 series.
This batch adds an alternative alloc-map-unmap-free Xen PTE
From: Wei Liu
We will soon need to handle dynamically mapping / unmapping page
tables in the said function.
No functional change.
Signed-off-by: Wei Liu
Signed-off-by: Hongyan Xia
---
Changed since v3:
- remove asserts on rc since it never gets changed to anything else.
---
xen/arch/x86
From: Wei Liu
We will soon need to clean up mappings whenever the out most loop
is ended. Add a new label and turn relevant continue's into goto's.
No functional change.
Signed-off-by: Wei Liu
---
xen/arch/x86/mm.c | 15 ---
1 file changed, 8 insertions(+), 7 deletions(-)
diff
From: Wei Liu
They were put into page.h but mm.h is more appropriate.
The real reason is that I will be adding some new functions which
takes mfn_t. It turns out it is a bit difficult to do in page.h.
No functional change.
Signed-off-by: Wei Liu
Acked-by: Jan Beulich
---
Changed since v3:
From: Wei Liu
We will soon need to clean up mappings whenever the out most loop is
ended. Add a new label and turn relevant continue's into goto's.
No functional change.
Signed-off-by: Wei Liu
---
xen/arch/x86/mm.c | 9 +
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git
From: Wei Liu
The pl2e and pl1e variables are heavily (ab)used in that function. It
is fine at the moment because all page tables are always mapped so
there is no need to track the life time of each variable.
We will soon have the requirement to map and unmap page tables. We
need to track the
From: Wei Liu
We will soon rewrite the function to handle dynamically mapping and
unmapping of page tables.
No functional change.
Signed-off-by: Wei Liu
Signed-off-by: Hongyan Xia
---
Changed since v3:
- remove asserts on rc since rc never gets changed to anything else
- reword commit
to use domheap and dynamic mappings when usage of old APIs
is eliminated.
No functional change intended in this patch.
Signed-off-by: Wei Liu
Signed-off-by: Hongyan Xia
---
Changed since v3:
- const qualify unmap_xen_pagetable_new().
- remove redundant parentheses.
---
xen/arch/x86/mm.c
map_pages_to_xen and modify_xen_mappings are performing almost exactly
the same operations when shattering an l3 PTE, the only difference
being whether we want to flush.
Signed-off-by: Hongyan Xia
---
Changes in v2:
- improve asm.
- re-read pl3e from memory when taking the lock.
- move
it per-level for now.
tree:
https://xenbits.xen.org/git-http/people/hx242/xen.git int_review
---
Changes in v2:
- rebase.
- improve asm code.
- avoid stale values when taking the lock.
- move allocation of PTE tables inside the shatter function.
Hongyan Xia (2):
x86/mm: factor out the code
map_pages_to_xen and modify_xen_mappings are performing almost exactly
the same operations when shattering an l2 PTE, the only difference
being whether we want to flush.
Signed-off-by: Hongyan Xia
---
Changes in v2:
- improve asm.
- re-read pl2e from memory when taking the lock.
- move
The existing code assumes that the first mfn passed to the boot
allocator is mapped, which creates problems when, e.g., we do not have
a direct map, and may create other bootstrapping problems in the
future. Make it static. The size is kept the same as before (1 page).
Signed-off-by: Hongyan Xia
map_pages_to_xen and modify_xen_mappings are performing almost exactly
the same operations when shattering an l2 PTE, the only difference
being whether we want to flush.
Signed-off-by: Hongyan Xia
---
Changes in v3:
- style and indentation changes.
- return -ENOMEM instead of -1.
Changes in v2
.
Hongyan Xia (2):
x86/mm: factor out the code for shattering an l3 PTE
x86/mm: factor out the code for shattering an l2 PTE
xen/arch/x86/mm.c | 194 +++---
1 file changed, 98 insertions(+), 96 deletions(-)
--
2.17.1
map_pages_to_xen and modify_xen_mappings are performing almost exactly
the same operations when shattering an l3 PTE, the only difference
being whether we want to flush.
Signed-off-by: Hongyan Xia
---
Changes in v3:
- style and indentation changes.
- return -ENOMEM instead of -1.
Changes in v2
map_pages_to_xen and modify_xen_mappings are performing almost exactly
the same operations when shattering an l2 PTE, the only difference
being whether we want to flush.
Signed-off-by: Hongyan Xia
---
Changes in v4:
- use false/true instead of -1/0 to indicate failure/success.
- remove
stale values when taking the lock.
- move allocation of PTE tables inside the shatter function.
Hongyan Xia (2):
x86/mm: factor out the code for shattering an l3 PTE
x86/mm: factor out the code for shattering an l2 PTE
xen/arch/x86/mm.c | 194 +++---
1 file
map_pages_to_xen and modify_xen_mappings are performing almost exactly
the same operations when shattering an l3 PTE, the only difference
being whether we want to flush.
Signed-off-by: Hongyan Xia
---
Changes in v4:
- use false/true instead of -1/0 to indicate failure/success.
- remove
map_pages_to_xen and modify_xen_mappings are performing almost exactly
the same operations when shattering an l2 PTE, the only difference
being whether we want to flush.
Signed-off-by: Hongyan Xia
---
xen/arch/x86/mm.c | 81 ++-
1 file changed, 38
it per-level for now.
Hongyan Xia (2):
x86/mm: factor out the code for shattering an l3 PTE
x86/mm: factor out the code for shattering an l2 PTE
xen/arch/x86/mm.c | 166 ++
1 file changed, 78 insertions(+), 88 deletions(-)
--
2.17.1
map_pages_to_xen and modify_xen_mappings are performing almost exactly
the same operations when shattering an l3 PTE, the only difference
being whether we want to flush.
Signed-off-by: Hongyan Xia
---
xen/arch/x86/mm.c | 85 ++-
1 file changed, 40
the UNMAP_DOMAIN_PAGE macro to nullify the
variable after unmapping, and ignore NULL.
Signed-off-by: Wei Liu
Signed-off-by: Hongyan Xia
---
Changed in v2:
- let UNMAP_DOMAIN_PAGE itself check whether the input is NULL to avoid
adding the check in unmap_domain_page.
- reword the commit message
ots.
Signed-off-by: Hongyan Xia
---
Changed in v2:
- reword the commit message.
- code clean-up and style fixes
- avoid initialising the mapcache in NDEBUG build
- move freeing of the maphash into pv_vcpu_destroy because for now only
pv has a mapcache.
- use is_idle and is_hvm in map_domain_p
available,
which is not enough for nested page table walks. We need to increase the
number of slots in config.h.
Signed-off-by: Hongyan Xia
---
xen/arch/x86/domain.c| 5 +-
xen/arch/x86/domain_page.c | 229 +++
xen/include/asm-x86/config.h | 2 +-
xen
Signed-off-by: Hongyan Xia
Reviewed-by: Julien Grall
---
Changed since v5:
- sounds like we are happy to use map_domain_page for Xen PTEs. Remove
map/unmap_xen_pagetable, just use map/unmap_domain_page instead.
- remove redundant logic in free_xen_pagetable.
Changed since v4:
- properly handle
after unmapping, and ignore NULL in unmap_domain_page.
Signed-off-by: Wei Liu
Signed-off-by: Hongyan Xia
---
xen/arch/x86/domain_page.c| 2 +-
xen/arch/x86/mm.c | 14 --
xen/include/xen/domain_page.h | 5 +
3 files changed, 14 insertions(+), 7 deletions(-)
diff
From: Wei Liu
We will need to have a variable named pl*e when we rewrite
virt_to_xen_l*e. Change pl*e to l*t to reflect better its purpose.
This will make reviewing later patch easier.
No functional change.
Signed-off-by: Wei Liu
Signed-off-by: Hongyan Xia
Reviewed-by: Jan Beulich
---
xen
to use domheap and dynamic mappings when usage of old APIs
is eliminated.
No functional change intended in this patch.
Signed-off-by: Wei Liu
Signed-off-by: Hongyan Xia
Reviewed-by: Julien Grall
---
Changed since v4:
- properly handle INVALID_MFN.
- remove the _new suffix for map
From: Wei Liu
They were put into page.h but mm.h is more appropriate.
The real reason is that I will be adding some new functions which
takes mfn_t. It turns out it is a bit difficult to do in page.h.
No functional change.
Signed-off-by: Wei Liu
Acked-by: Jan Beulich
---
Changed since v3:
1 - 100 of 292 matches
Mail list logo