diff mbox series

[RFC,67/84] x86/domain_page: remove direct map code and initialise idle mapcache.

Message ID 10c0b97f3f378af07012628afc685905af43148f.1569489002.git.hongyax@amazon.com (mailing list archive)
State New, archived
Headers show
Series Remove direct map from Xen | expand

Commit Message

Xia, Hongyan Sept. 26, 2019, 9:46 a.m. UTC
From: Hongyan Xia <hongyax@amazon.com>

These are found in the NDEBUG build.

Signed-off-by: Hongyan Xia <hongyax@amazon.com>
---
 xen/arch/x86/domain_page.c | 10 ----------
 1 file changed, 10 deletions(-)

Comments

Wei Liu Sept. 26, 2019, 2:14 p.m. UTC | #1
On Thu, Sep 26, 2019 at 10:46:30AM +0100, hongyax@amazon.com wrote:
> From: Hongyan Xia <hongyax@amazon.com>
> 
> These are found in the NDEBUG build.
> 
> Signed-off-by: Hongyan Xia <hongyax@amazon.com>
> ---
>  xen/arch/x86/domain_page.c | 10 ----------
>  1 file changed, 10 deletions(-)
> 
> diff --git a/xen/arch/x86/domain_page.c b/xen/arch/x86/domain_page.c
> index f4f53a2a33..f606677ae6 100644
> --- a/xen/arch/x86/domain_page.c
> +++ b/xen/arch/x86/domain_page.c
> @@ -78,11 +78,6 @@ void *map_domain_page(mfn_t mfn)
>      struct mapcache_vcpu *vcache;
>      struct vcpu_maphash_entry *hashent;
>  
> -#ifdef NDEBUG
> -    if ( mfn_x(mfn) <= PFN_DOWN(__pa(HYPERVISOR_VIRT_END - 1)) )
> -        return mfn_to_virt(mfn_x(mfn));
> -#endif
> -

Again, this is dropping a fast path. Where is the corresponding change
to unamp_domain_page?

>      v = mapcache_current_vcpu();
>      if ( !v )
>      {
> @@ -257,11 +252,6 @@ int mapcache_domain_init(struct domain *d)
>      struct mapcache_domain *dcache = &d->arch.mapcache;
>      unsigned int bitmap_pages;
>  
> -#ifdef NDEBUG
> -    if ( !mem_hotplug && max_page <= PFN_DOWN(__pa(HYPERVISOR_VIRT_END - 1)) )
> -        return 0;
> -#endif
> -

This should be in its own commit with justification.

Wei.

>      BUILD_BUG_ON(MAPCACHE_VIRT_END + PAGE_SIZE * (3 +
>                   2 * PFN_UP(BITS_TO_LONGS(MAPCACHE_ENTRIES) * sizeof(long))) >
>                   MAPCACHE_VIRT_START + (PERDOMAIN_SLOT_MBYTES << 20));
> -- 
> 2.17.1
>
diff mbox series

Patch

diff --git a/xen/arch/x86/domain_page.c b/xen/arch/x86/domain_page.c
index f4f53a2a33..f606677ae6 100644
--- a/xen/arch/x86/domain_page.c
+++ b/xen/arch/x86/domain_page.c
@@ -78,11 +78,6 @@  void *map_domain_page(mfn_t mfn)
     struct mapcache_vcpu *vcache;
     struct vcpu_maphash_entry *hashent;
 
-#ifdef NDEBUG
-    if ( mfn_x(mfn) <= PFN_DOWN(__pa(HYPERVISOR_VIRT_END - 1)) )
-        return mfn_to_virt(mfn_x(mfn));
-#endif
-
     v = mapcache_current_vcpu();
     if ( !v )
     {
@@ -257,11 +252,6 @@  int mapcache_domain_init(struct domain *d)
     struct mapcache_domain *dcache = &d->arch.mapcache;
     unsigned int bitmap_pages;
 
-#ifdef NDEBUG
-    if ( !mem_hotplug && max_page <= PFN_DOWN(__pa(HYPERVISOR_VIRT_END - 1)) )
-        return 0;
-#endif
-
     BUILD_BUG_ON(MAPCACHE_VIRT_END + PAGE_SIZE * (3 +
                  2 * PFN_UP(BITS_TO_LONGS(MAPCACHE_ENTRIES) * sizeof(long))) >
                  MAPCACHE_VIRT_START + (PERDOMAIN_SLOT_MBYTES << 20));