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]
Date:	Wed, 18 Jul 2007 09:19:45 -0700
From:	Zachary Amsden <zach@...are.com>
To:	Rusty Russell <rusty@...tcorp.com.au>
CC:	lkml - Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Andi Kleen <ak@....de>,
	kvm-devel <kvm-devel@...ts.sourceforge.net>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH 2/3] i386: use x86_64's desc_def.h

Rusty Russell wrote:
> The main effect is to change the definition of "struct desc_struct" to
> a union of more complex types.
>   

Yay!  Someone finally killed it.  Every time I tried to kill it, I ended 
up off in the weeds chasing some bug.

>  
> diff -r 656f3ff2c9ce arch/i386/kernel/process.c
> @@ -880,21 +880,8 @@ asmlinkage int sys_set_thread_area(struc
>   * Get the current Thread-Local Storage area:
>   */
>  
> -#define GET_BASE(desc) ( \
> -	(((desc)->a >> 16) & 0x0000ffff) | \
> -	(((desc)->b << 16) & 0x00ff0000) | \
> -	( (desc)->b        & 0xff000000)   )
> -
> -#define GET_LIMIT(desc) ( \
> -	((desc)->a & 0x0ffff) | \
> -	 ((desc)->b & 0xf0000) )
> -	
> -#define GET_32BIT(desc)		(((desc)->b >> 22) & 1)
> -#define GET_CONTENTS(desc)	(((desc)->b >> 10) & 3)
> -#define GET_WRITABLE(desc)	(((desc)->b >>  9) & 1)
> -#define GET_LIMIT_PAGES(desc)	(((desc)->b >> 23) & 1)
> -#define GET_PRESENT(desc)	(((desc)->b >> 15) & 1)
> -#define GET_USEABLE(desc)	(((desc)->b >> 20) & 1)
> +#define GET_CONTENTS(desc)	(((desc)->raw32.b >> 10) & 3)
> +#define GET_WRITABLE(desc)	(((desc)->raw32.b >>  9) & 1)
>  
> diff -r 656f3ff2c9ce arch/i386/kernel/ptrace.c
> --- a/arch/i386/kernel/ptrace.c	Wed Jul 18 16:21:04 2007 +1000
> +++ b/arch/i386/kernel/ptrace.c	Wed Jul 18 16:21:06 2007 +1000
> @@ -283,22 +283,8 @@ ptrace_get_thread_area(struct task_struc
>  /*
>   * Get the current Thread-Local Storage area:
>   */
> -
> -#define GET_BASE(desc) ( \
> -	(((desc)->a >> 16) & 0x0000ffff) | \
> -	(((desc)->b << 16) & 0x00ff0000) | \
> -	( (desc)->b        & 0xff000000)   )
> -
> -#define GET_LIMIT(desc) ( \
> -	((desc)->a & 0x0ffff) | \
> -	 ((desc)->b & 0xf0000) )
> -
> -#define GET_32BIT(desc)		(((desc)->b >> 22) & 1)
> -#define GET_CONTENTS(desc)	(((desc)->b >> 10) & 3)
> -#define GET_WRITABLE(desc)	(((desc)->b >>  9) & 1)
> -#define GET_LIMIT_PAGES(desc)	(((desc)->b >> 23) & 1)
> -#define GET_PRESENT(desc)	(((desc)->b >> 15) & 1)
> -#define GET_USEABLE(desc)	(((desc)->b >> 20) & 1)
> +#define GET_CONTENTS(desc)	(((desc)->raw32.b >> 10) & 3)
> +#define GET_WRITABLE(desc)	(((desc)->raw32.b >>  9) & 1)
>   

You got rid of the duplicate definitions here, but then added new 
duplicates (GET_CONTENTS / WRITABLE).  Can you stick them in desc.h?

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