All of lore.kernel.org
 help / color / mirror / Atom feed
From: George Dunlap <george.dunlap@eu.citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Keir Fraser <keir@xen.org>,
	Ian Campbell <ian.campbell@citrix.com>,
	Hanweidong <hanweidong@huawei.com>,
	xen-devel@lists.xen.org,
	StefanoStabellini <stefano.stabellini@citrix.com>,
	Ian Jackson <ian.jackson@citrix.com>
Subject: Re: [PATCH v3 3/8] hvmloader: Set up highmem resouce appropriately if there is no RAM above 4G
Date: Fri, 21 Jun 2013 10:06:25 +0100	[thread overview]
Message-ID: <51C41791.3030104@eu.citrix.com> (raw)
In-Reply-To: <51C4166402000078000DF811@nat28.tlf.novell.com>

On 21/06/13 08:01, Jan Beulich wrote:
>>>> On 20.06.13 at 18:33, George Dunlap <george.dunlap@eu.citrix.com> wrote:
>> @@ -244,7 +244,14 @@ void pci_setup(void)
>>           hvm_info->high_mem_pgend += nr_pages;
>>       }
>>   
>> -    high_mem_resource.base = ((uint64_t)hvm_info->high_mem_pgend) << PAGE_SHIFT;
>>
>> +    if ( hvm_info->high_mem_pgend )
> To be on the safe side I'd make this
>
>      if ( hvm_info->high_mem_pgend >= (1ull << 32) )

high_mem_pgend is in frames, not physical address; but I do take your point.

On the other hand, there is other code (for instance, in the memory 
relocation loop) that assumes that high_mem_pgend is either 0, or 
pointing into the high mem region.  Normally the correct way to deal 
with internal invariants like this is to add an assert() to that effect, 
but adding a new assert() at this point is not really on either.

I'd just as soon leave it the way it is, but if people felt strongly 
about it I could change it to something like this:

   high_mem_resource.base = ((uint64_t)hvm_info->high_mem_pgend) << PAGE_SHIFT;
   if ( high_mem_resource.base < 1ull << 32 )
     high_mem_resource.base = 1ull << 32;


>> +        high_mem_resource.base = ((uint64_t)hvm_info->high_mem_pgend) << PAGE_SHIFT;
>> +    else
>> +        high_mem_resource.base = 1ull << 32;
>> +    printf("%sRAM in high memory; setting high_mem resource base to %x%08x\n",
>> +           hvm_info->high_mem_pgend?"":"No ",
>> +           (uint32_t)(high_mem_resource.base>>32),
>> +           (uint32_t)high_mem_resource.base);
> Seeing the n-th incarnation of this - mind creating a macro to do the
> splitting?

I'll give it a try and see how it looks.

  -George

  reply	other threads:[~2013-06-21  9:06 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-20 16:33 [PATCH 0/8] Relocate devices rather than memory for qemu-xen George Dunlap
2013-06-20 16:33 ` [PATCH v3 1/8] hvmloader: Remove all 64-bit print arguments George Dunlap
2013-06-20 17:06   ` Stefano Stabellini
2013-06-20 17:09     ` Ian Jackson
2013-06-21  8:37       ` George Dunlap
2013-06-21  8:34     ` George Dunlap
2013-06-21  9:22       ` George Dunlap
2013-06-21 10:23   ` Ian Jackson
2013-06-20 16:33 ` [PATCH v3 2/8] hvmloader: Make the printfs more informative George Dunlap
2013-06-20 17:12   ` Stefano Stabellini
2013-06-21  9:35     ` George Dunlap
2013-06-21  9:50       ` George Dunlap
2013-06-21 10:53         ` Stefano Stabellini
2013-06-21 10:53       ` Stefano Stabellini
2013-06-21 10:35   ` Ian Jackson
2013-06-20 16:33 ` [PATCH v3 3/8] hvmloader: Set up highmem resouce appropriately if there is no RAM above 4G George Dunlap
2013-06-20 17:16   ` Stefano Stabellini
2013-06-21  7:01   ` Jan Beulich
2013-06-21  9:06     ` George Dunlap [this message]
2013-06-21 10:38   ` Ian Jackson
2013-06-20 16:33 ` [PATCH v3 4/8] hvmloader: Fix check for needing a 64-bit bar George Dunlap
2013-06-20 16:33 ` [PATCH v3 5/8] hvmloader: Correct bug in low mmio region accounting George Dunlap
2013-06-20 17:20   ` Stefano Stabellini
2013-06-21  7:09   ` Jan Beulich
2013-06-20 16:33 ` [PATCH v3 6/8] hvmloader: Load large devices into high MMIO space as needed George Dunlap
2013-06-20 17:23   ` Stefano Stabellini
2013-06-21  7:12   ` Jan Beulich
2013-06-20 16:33 ` [PATCH v3 7/8] hvmloader: Remove minimum size for BARs to relocate to 64-bit space George Dunlap
2013-06-20 16:33 ` [PATCH v3 8/8] libxl, hvmloader: Don't relocate memory for MMIO hole George Dunlap
2013-06-20 17:38   ` Stefano Stabellini
2013-06-21  8:31     ` George Dunlap
2013-06-21 10:22       ` [PATCH v3 1/8] hvmloader: Remove all 64-bit print arguments [and 1 more messages] Ian Jackson
2013-06-21 11:21       ` [PATCH v3 8/8] libxl, hvmloader: Don't relocate memory for MMIO hole Stefano Stabellini
2013-06-21 11:31         ` Ian Jackson
2013-06-21  7:17   ` Jan Beulich
2013-06-21  8:32     ` George Dunlap

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=51C41791.3030104@eu.citrix.com \
    --to=george.dunlap@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=hanweidong@huawei.com \
    --cc=ian.campbell@citrix.com \
    --cc=ian.jackson@citrix.com \
    --cc=keir@xen.org \
    --cc=stefano.stabellini@citrix.com \
    --cc=xen-devel@lists.xen.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.