lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130614200808.GO12023@redhat.com>
Date:	Fri, 14 Jun 2013 16:08:08 -0400
From:	Vivek Goyal <vgoyal@...hat.com>
To:	Michael Holzheu <holzheu@...ux.vnet.ibm.com>
Cc:	HATAYAMA Daisuke <d.hatayama@...fujitsu.com>,
	Jan Willeke <willeke@...ibm.com>,
	Martin Schwidefsky <schwidefsky@...ibm.com>,
	Heiko Carstens <heiko.carstens@...ibm.com>,
	linux-kernel@...r.kernel.org, kexec@...ts.infradead.org
Subject: Re: [PATCH v5 4/5] s390/vmcore: Implement remap_oldmem_pfn_range for
 s390

On Fri, Jun 07, 2013 at 06:56:00PM +0200, Michael Holzheu wrote:
> From: Jan Willeke <willeke@...ibm.com>
> 
> This patch introduces the s390 specific way to map pages from oldmem.
> The memory area below OLDMEM_SIZE is mapped with offset OLDMEM_BASE.
> The other old memory is mapped directly.
> 

If we get rid of swap logic in copy_oldmem_page(), quite some amount
of code can be cleaned up. One has to spcial case only zfcpdump to
read from HSA memory.

Anyway sounds like a s390 specific cleanup in a separate series.

Thanks
Vivek


> Signed-off-by: Jan Willeke <willeke@...ibm.com>
> Signed-off-by: Michael Holzheu <holzheu@...ux.vnet.ibm.com>
> ---
>  arch/s390/kernel/crash_dump.c | 26 ++++++++++++++++++++++++++
>  1 file changed, 26 insertions(+)
> 
> diff --git a/arch/s390/kernel/crash_dump.c b/arch/s390/kernel/crash_dump.c
> index a17f8d4..12ccc3c 100644
> --- a/arch/s390/kernel/crash_dump.c
> +++ b/arch/s390/kernel/crash_dump.c
> @@ -56,6 +56,32 @@ ssize_t copy_oldmem_page(unsigned long pfn, char *buf,
>  }
>  
>  /*
> + * Remap "oldmem"
> + *
> + * For the kdump reserved memory this functions performs a swap operation:
> + * [0 - OLDMEM_SIZE] is mapped to [OLDMEM_BASE - OLDMEM_BASE + OLDMEM_SIZE]
> + */
> +int remap_oldmem_pfn_range(struct vm_area_struct *vma, unsigned long from,
> +			   unsigned long pfn, unsigned long size, pgprot_t prot)
> +{
> +	unsigned long size_old;
> +	int rc;
> +
> +	if (pfn < OLDMEM_SIZE >> PAGE_SHIFT) {
> +		size_old = min(size, OLDMEM_SIZE - (pfn << PAGE_SHIFT));
> +		rc = remap_pfn_range(vma, from,
> +				     pfn + (OLDMEM_BASE >> PAGE_SHIFT),
> +				     size_old, prot);
> +		if (rc || size == size_old)
> +			return rc;
> +		size -= size_old;
> +		from += size_old;
> +		pfn += size_old >> PAGE_SHIFT;
> +	}
> +	return remap_pfn_range(vma, from, pfn, size, prot);
> +}
> +
> +/*
>   * Copy memory from old kernel
>   */
>  int copy_from_oldmem(void *dest, void *src, size_t count)
> -- 
> 1.8.1.6
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ