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: <201111271238.53544.rjw@sisk.pl>
Date:	Sun, 27 Nov 2011 12:38:53 +0100
From:	"Rafael J. Wysocki" <rjw@...k.pl>
To:	Cong Wang <amwang@...hat.com>
Cc:	linux-kernel@...r.kernel.org, akpm@...ux-foundation.org,
	Pavel Machek <pavel@....cz>, Len Brown <len.brown@...el.com>,
	linux-pm@...r.kernel.org
Subject: Re: [PATCH 50/62] power: remove the second argument of k[un]map_atomic()

On Sunday, November 27, 2011, Cong Wang wrote:
> 
> Signed-off-by: Cong Wang <amwang@...hat.com>

Acked-by: Rafael J. Wysocki <rjw@...k.pl>

> ---
>  kernel/power/snapshot.c |   28 ++++++++++++++--------------
>  1 files changed, 14 insertions(+), 14 deletions(-)
> 
> diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c
> index cbe2c14..8018450 100644
> --- a/kernel/power/snapshot.c
> +++ b/kernel/power/snapshot.c
> @@ -993,20 +993,20 @@ static void copy_data_page(unsigned long dst_pfn, unsigned long src_pfn)
>  	s_page = pfn_to_page(src_pfn);
>  	d_page = pfn_to_page(dst_pfn);
>  	if (PageHighMem(s_page)) {
> -		src = kmap_atomic(s_page, KM_USER0);
> -		dst = kmap_atomic(d_page, KM_USER1);
> +		src = kmap_atomic(s_page);
> +		dst = kmap_atomic(d_page);
>  		do_copy_page(dst, src);
> -		kunmap_atomic(dst, KM_USER1);
> -		kunmap_atomic(src, KM_USER0);
> +		kunmap_atomic(dst);
> +		kunmap_atomic(src);
>  	} else {
>  		if (PageHighMem(d_page)) {
>  			/* Page pointed to by src may contain some kernel
>  			 * data modified by kmap_atomic()
>  			 */
>  			safe_copy_page(buffer, s_page);
> -			dst = kmap_atomic(d_page, KM_USER0);
> +			dst = kmap_atomic(d_page);
>  			copy_page(dst, buffer);
> -			kunmap_atomic(dst, KM_USER0);
> +			kunmap_atomic(dst);
>  		} else {
>  			safe_copy_page(page_address(d_page), s_page);
>  		}
> @@ -1721,9 +1721,9 @@ int snapshot_read_next(struct snapshot_handle *handle)
>  			 */
>  			void *kaddr;
>  
> -			kaddr = kmap_atomic(page, KM_USER0);
> +			kaddr = kmap_atomic(page);
>  			copy_page(buffer, kaddr);
> -			kunmap_atomic(kaddr, KM_USER0);
> +			kunmap_atomic(kaddr);
>  			handle->buffer = buffer;
>  		} else {
>  			handle->buffer = page_address(page);
> @@ -2007,9 +2007,9 @@ static void copy_last_highmem_page(void)
>  	if (last_highmem_page) {
>  		void *dst;
>  
> -		dst = kmap_atomic(last_highmem_page, KM_USER0);
> +		dst = kmap_atomic(last_highmem_page);
>  		copy_page(dst, buffer);
> -		kunmap_atomic(dst, KM_USER0);
> +		kunmap_atomic(dst);
>  		last_highmem_page = NULL;
>  	}
>  }
> @@ -2302,13 +2302,13 @@ swap_two_pages_data(struct page *p1, struct page *p2, void *buf)
>  {
>  	void *kaddr1, *kaddr2;
>  
> -	kaddr1 = kmap_atomic(p1, KM_USER0);
> -	kaddr2 = kmap_atomic(p2, KM_USER1);
> +	kaddr1 = kmap_atomic(p1);
> +	kaddr2 = kmap_atomic(p2);
>  	copy_page(buf, kaddr1);
>  	copy_page(kaddr1, kaddr2);
>  	copy_page(kaddr2, buf);
> -	kunmap_atomic(kaddr2, KM_USER1);
> -	kunmap_atomic(kaddr1, KM_USER0);
> +	kunmap_atomic(kaddr2);
> +	kunmap_atomic(kaddr1);
>  }
>  
>  /**
> 

--
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