[Crash-utility] [PATCH] x86_64: Remove the unused x86_64_task_uses_5level()

Dave Anderson anderson at redhat.com
Mon Jul 16 13:36:18 UTC 2018


----- Original Message -----
> There's no way to enable paging mode on per-task basis. So, Check
> for per-task is redundant. Remove the x86_64_task_uses_5level()

Beautiful -- queued for crash-7.2.4:

   https://github.com/crash-utility/crash/commit/61fcad549faa479e6831d5283387f8f2e4ec9202

Thanks again for all of your work in this task,
  Dave

> 
> Signed-off-by: Dou Liyang <douly.fnst at cn.fujitsu.com>
> ---
>  x86_64.c | 11 ++---------
>  1 file changed, 2 insertions(+), 9 deletions(-)
> 
> diff --git a/x86_64.c b/x86_64.c
> index b07d6f2..96f685b 100644
> --- a/x86_64.c
> +++ b/x86_64.c
> @@ -24,7 +24,6 @@ static int x86_64_uvtop(struct task_context *, ulong, physaddr_t *, int);
>  static int x86_64_uvtop_level4(struct task_context *, ulong, physaddr_t *, int);
>  static int x86_64_uvtop_level4_xen_wpt(struct task_context *, ulong, physaddr_t *, int);
>  static int x86_64_uvtop_level4_rhel4_xen_wpt(struct task_context *, ulong, physaddr_t *, int);
> -static int x86_64_task_uses_5level(struct task_context *);
>  static ulong x86_64_vmalloc_start(void);
>  static int x86_64_is_task_addr(ulong);
>  static int x86_64_verify_symbol(const char *, ulong, char);
> @@ -341,6 +340,7 @@ x86_64_init(int when)
>  			if (l5_enabled)
>  				machdep->flags |= VM_5LEVEL;
>  		}
> +
>  		if (machdep->flags & VM_5LEVEL) {
>  			machdep->machspec->userspace_top = USERSPACE_TOP_5LEVEL;
>  			machdep->machspec->page_offset = PAGE_OFFSET_5LEVEL;
> @@ -361,7 +361,6 @@ x86_64_init(int when)
>  			machdep->uvtop = x86_64_uvtop_level4;  /* 5-level is optional per-task */
>  			machdep->kvbase = (ulong)PAGE_OFFSET;
>  			machdep->identity_map_base = (ulong)PAGE_OFFSET;
> -
>  		}
>  
>  		/*
> @@ -1915,7 +1914,7 @@ x86_64_uvtop_level4(struct task_context *tc, ulong
> uvaddr, physaddr_t *paddr, in
>  		goto no_upage;
>  
>  	/* If the VM is in 5-level page table */
> -	if (machdep->flags & VM_5LEVEL && x86_64_task_uses_5level(tc)) {
> +	if (machdep->flags & VM_5LEVEL) {
>  		ulong p4d_pte;
>  		/*
>  		 *  p4d = p4d_offset(pgd, address);
> @@ -1986,12 +1985,6 @@ no_upage:
>  	return FALSE;
>  }
>  
> -static int
> -x86_64_task_uses_5level(struct task_context *tc)
> -{
> -	return FALSE;
> -}
> -
>  static int
>  x86_64_uvtop_level4_xen_wpt(struct task_context *tc, ulong uvaddr,
>  physaddr_t *paddr, int verbose)
>  {
> --
> 2.14.3




More information about the Crash-utility mailing list