All of lore.kernel.org
 help / color / mirror / Atom feed
From: Don Slutz <dslutz@verizon.com>
To: Jan Beulich <JBeulich@suse.com>, Don Slutz <dslutz@verizon.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	xen-devel@lists.xen.org, Ian Jackson <ian.jackson@eu.citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [PATCH v3 1/1] Add pci_hole_min_size
Date: Tue, 01 Jul 2014 07:56:53 -0400	[thread overview]
Message-ID: <53B2A205.3080807@terremark.com> (raw)
In-Reply-To: <53AD48B8020000780001DDC2@mail.emea.novell.com>

On 06/27/14 04:34, Jan Beulich wrote:
>>>> On 26.06.14 at 19:47, <dslutz@verizon.com> wrote:
>> --- a/tools/firmware/hvmloader/config.h
>> +++ b/tools/firmware/hvmloader/config.h
>> @@ -53,7 +53,6 @@ extern struct bios_config ovmf_config;
>>   #define PCI_ISA_IRQ_MASK    0x0c20U /* ISA IRQs 5,10,11 are PCI connected */
>>   
>>   /* MMIO hole: Hardcoded defaults, which can be dynamically expanded. */
>> -#define PCI_MEM_START       0xf0000000
>>   #define PCI_MEM_END         0xfc000000
> This pair already shows that ... [skip next comment for continuation]
>
>> --- a/tools/firmware/hvmloader/pci.c
>> +++ b/tools/firmware/hvmloader/pci.c
>> @@ -28,9 +28,10 @@
>>   #include <xen/memory.h>
>>   #include <xen/hvm/ioreq.h>
>>   #include <xen/hvm/hvm_xs_strings.h>
>> +#include <xen/hvm/e820.h>
>>   #include <stdbool.h>
>>   
>> -unsigned long pci_mem_start = PCI_MEM_START;
>> +unsigned long pci_mem_start = HVM_BELOW_4G_RAM_END;
> Perhaps (also related to the comment below) better to use
> HVM_BELOW_4G_MMIO_START here, even if right now both evaluate
> to the same number.

Will do.

>
>> @@ -237,6 +243,26 @@ void pci_setup(void)
>>           pci_writew(devfn, PCI_COMMAND, cmd);
>>       }
>>   
>> +    if ( pci_hole_min_size )
>> +    {
>> +        uint64_t max_ram_below_4g = (1ULL << 32) - pci_hole_min_size;
> ... this isn't really correct: The space immediately below 4G is used for
> MMIO unrelated to PCI. Hence, to not confuse people, I'd really like
> the variable to be properly named (whether the xl config option should
> also get renamed I'm not sure - the xl maintainers will know), i.e.
> mmio_hole_min_size.

I think it is better to have at most 2 names.  So either
s/pci_hole_min_size/mmio_hole_min_size/ or switch to
max_ram_below_4g.

>> +
>> +        if ( max_ram_below_4g >= HVM_BELOW_4G_RAM_END )
>> +        {
>> +            printf("max_ram_below_4g=0x"PRIllx
>> +                   " too big for pci_hole_min_size=0x"PRIllx"\n",
>> +                   PRIllx_arg(max_ram_below_4g),
>> +                   PRIllx_arg(pci_hole_min_size));
> Probably worth making clear in the logged message that the option
> therefore is being ignored?

Sure.

>> +        }
>> +        else
>> +        {
>> +            pci_mem_start = max_ram_below_4g;
>> +            printf("pci_mem_start=0x%lx (was 0x%x) for pci_hole_min_size=%lu\n",
>> +                   pci_mem_start, HVM_BELOW_4G_RAM_END,
>> +                   (long)pci_hole_min_size);
>> +        }
>> +    }
> Furthermore the whole concept collides with the auto-growing of
> the hole immediately following this code. Both logically (both having
> a similar purpose) and, what's worse, functionally in that the
> shifting done there requires that ((1ULL << 32) - pci_mem_start)
> be a power of 2. An option might be to skip this auto-sizing if the
> option was given.

I am fine with disabling the auto-growing (since as far as I know
this is bug #28 (


  #28 - support PCI hole resize in qemu-xen

)

Which this change is a kind of work around.

I would also drop the _min part of the name (i.e. use mmio_hole_size
or max_ram_below_4g).

     -Don Slutz


> Jan
>

  reply	other threads:[~2014-07-01 11:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-26 17:47 [PATCH v3 0/1] Add pci_hole_min_size Don Slutz
2014-06-26 17:47 ` [PATCH v3 1/1] " Don Slutz
2014-06-27  8:34   ` Jan Beulich
2014-07-01 11:56     ` Don Slutz [this message]
2014-07-01 12:48       ` Jan Beulich
2014-07-01 13:54         ` Don Slutz

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=53B2A205.3080807@terremark.com \
    --to=dslutz@verizon.com \
    --cc=JBeulich@suse.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=stefano.stabellini@eu.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.