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:	Thu, 12 Mar 2009 11:31:54 +0000
From:	"Jan Beulich" <jbeulich@...ell.com>
To:	"Ingo Molnar" <mingo@...e.hu>, "Yinghai Lu" <yinghai@...nel.org>
Cc:	<jeremy.fitzhardinge@...rix.com>, <tglx@...utronix.de>,
	<linux-kernel@...r.kernel.org>, <hpa@...or.com>
Subject: Re: [PATCH] x86-64: improve e820_search_gap()

>>> Ingo Molnar <mingo@...e.hu> 12.03.09 12:02 >>>
>  
> +#ifdef CONFIG_X86_64
> +	if (start_addr >= MAX_GAP_END)
> +		last = end_addr ?: (1UL << boot_cpu_data.x86_phys_bits);
> +	else
> +#endif
>  	last = (end_addr && end_addr < MAX_GAP_END) ? end_addr : MAX_GAP_END;

>hm, this #ifdef block looks quite ugly and should be cleaned up. 
>x86_phys_bits could be filled in on 32-bit too - and on 32-bit 

I'm about to submit a patch to that effect. But I'm trying to keep patches
independent as much as possible.

>start_addr cannot be larger than 4GB anyway.

Correct, but I think the code would be less self-documenting if it relied
on that fact rather than making clear from the first glance that the
conditional is only being evaluated (and hence can only be true) on 64-bits.

>> @@ -585,11 +591,12 @@ __init void e820_setup_gap(void)
>>  
>>  #ifdef CONFIG_X86_64
>>  	if (!found) {
>> -		gapstart = (max_pfn << PAGE_SHIFT) + 1024*1024;
>>  		printk(KERN_ERR "PCI: Warning: Cannot find a gap in the 32bit "
>>  		       "address range\n"
>>  		       KERN_ERR "PCI: Unassigned devices with 32bit resource "
>>  		       "registers may break!\n");
>> +		found = e820_search_gap(&gapstart, &gapsize, MAX_GAP_END, 0);
>> +		BUG_ON(!found);
>
>that BUG_ON() will be hard to debug - please use a WARN_ON 
>instead.

Will do, but please clarify the above point before I re-submit.

Jan

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