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:	Mon, 02 Aug 2010 13:38:19 -0700
From:	"H. Peter Anvin" <hpa@...or.com>
To:	Yinghai Lu <yinghai@...nel.org>
CC:	Cyrill Gorcunov <gorcunov@...il.com>, Ingo Molnar <mingo@...e.hu>,
	Thomas Gleixner <tglx@...utronix.de>,
	Pekka Enberg <penberg@...helsinki.fi>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH -v3 2/2] x86: more early console output from	compressed/misc.c

On 08/02/2010 12:35 PM, Yinghai Lu wrote:
> 
> it seems I can not global variables in arch/x86/boot/compressed/misc.c
> 

Well, that should be fixed, then.  If we can't use the linker for what
it's supposed to be used for it's just crap.

> and misc.c already include some decompress .c like
> 
> #ifdef CONFIG_KERNEL_GZIP
> #include "../../../../lib/decompress_inflate.c"
> #endif
> 
> #ifdef CONFIG_KERNEL_BZIP2
> #include "../../../../lib/decompress_bunzip2.c"
> #endif
> 
> #ifdef CONFIG_KERNEL_LZMA
> #include "../../../../lib/decompress_unlzma.c"
> #endif
> 
> #ifdef CONFIG_KERNEL_LZO
> #include "../../../../lib/decompress_unlzo.c"
> #endif
> 

Yes, I know; that's crap in a lot of ways too... the whole decompression
stuff is its own issue which is slowly being addressed.  It's not an
excuse to make the code crappier than it already is.

> 
> this patch change to misc.c are following lines:
> 
> #define BOOT_BOOT_H
> #include "../isdigit.h"
> #include "../string.c"
> #include "../printf.c"
> 
> ...
> 
> static unsigned long fs;
> static inline void set_fs(unsigned long seg)
> {
>         fs = seg << 4;  /* shift it back */
> }
> typedef unsigned long addr_t;
> static inline char rdfs8(addr_t addr)
> {
>         return *((char *)(fs + addr));
> }
> #include "../cmdline.c"
> static inline int cmdline_find_option(const char *option, char *buffer, int bufsize)
> {
>         return __cmdline_find_option(real_mode->hdr.cmd_line_ptr, option, buffer, bufsize);
> }
> static inline int cmdline_find_option_bool(const char *option)
> {
>         return __cmdline_find_option_bool(real_mode->hdr.cmd_line_ptr, option);
> }
> static int early_serial_base;
> #include "../early_serial_console.c"
> 
> or put them in another file?
> 

Hmf... games with set_fs() aren't a whole lot of fun at all.  I think it
would be better to define some wrappers specific to cmdline.c which
allow it to be using a real pointer in 32-bit mode.

I'll see if I can muck with it, it shouldn't take long.

	-hpa


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