All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <jbeulich@novell.com>
To: "Ingo Molnar" <mingo@elte.hu>, "Yinghai Lu" <yinghai@kernel.org>
Cc: <jeremy.fitzhardinge@citrix.com>, <tglx@linutronix.de>,
	<linux-kernel@vger.kernel.org>, <hpa@zytor.com>
Subject: Re: [PATCH] x86-64: improve e820_search_gap()
Date: Thu, 12 Mar 2009 11:31:54 +0000	[thread overview]
Message-ID: <49B900BA.76E4.0078.0@novell.com> (raw)
In-Reply-To: <20090312110244.GD30204@elte.hu>

>>> Ingo Molnar <mingo@elte.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


  reply	other threads:[~2009-03-12 11:31 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-12 10:45 [PATCH] x86-64: improve e820_search_gap() Jan Beulich
2009-03-12 11:02 ` Ingo Molnar
2009-03-12 11:31   ` Jan Beulich [this message]
2009-03-13 17:37 ` Jeremy Fitzhardinge
2009-05-06 12:07 Jan Beulich
2009-05-08  4:59 ` H. Peter Anvin
2009-05-08  6:40   ` Jan Beulich
2009-05-08 16:52     ` H. Peter Anvin
2009-05-08 19:22     ` Andi Kleen
2009-05-08 20:15       ` H. Peter Anvin
2009-05-08 20:53         ` Andi Kleen
2009-05-08 20:52           ` H. Peter Anvin
2009-05-09 10:00             ` Andi Kleen
2009-05-10  6:43               ` H. Peter Anvin
2009-05-10 15:18                 ` Andi Kleen
2009-05-10 17:56                   ` H. Peter Anvin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49B900BA.76E4.0078.0@novell.com \
    --to=jbeulich@novell.com \
    --cc=hpa@zytor.com \
    --cc=jeremy.fitzhardinge@citrix.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    --cc=yinghai@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.