qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 2/3] pci: add dev_reserved_mask property to PCIB


From: Mark Cave-Ayland
Subject: Re: [Qemu-devel] [PATCH 2/3] pci: add dev_reserved_mask property to PCIBus
Date: Mon, 10 Jul 2017 13:49:21 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

On 10/07/17 08:27, Marcel Apfelbaum wrote:

> On 07/07/2017 10:44, Mark Cave-Ayland wrote:
>> This is just a simple bitmask indicating whether or not each PCI slot
>> on the
>> bus is reserved. Ensure that it is initialised to zero so that all bus
>> slots
>> are available by default.
>>
> 
> Hi Mark,
> 
>> Signed-off-by: Mark Cave-Ayland <address@hidden>
>> ---
>>   hw/pci/pci.c             |    1 +
>>   include/hw/pci/pci_bus.h |    1 +
>>   2 files changed, 2 insertions(+)
>>
>> diff --git a/hw/pci/pci.c b/hw/pci/pci.c
>> index 04e6edb..239161e 100644
>> --- a/hw/pci/pci.c
>> +++ b/hw/pci/pci.c
>> @@ -371,6 +371,7 @@ static void pci_bus_init(PCIBus *bus, DeviceState
>> *parent,
>>   {
>>       assert(PCI_FUNC(devfn_min) == 0);
>>       bus->devfn_min = devfn_min;
>> +    bus->dev_reserved_mask = 0x0;
> 
> Not really necessary, the object are zeroed when created
> (as far as I remember).

Yes I believe that's true. The main reason I added it was that it makes
it easy to find the default value with grep rather than having to work
your way through the initialisation sequence to verify that in fact it
belongs to a struct that is zeroed before use. So again, not 100%
necessary but I felt it made life a bit easier.

>>       bus->address_space_mem = address_space_mem;
>>       bus->address_space_io = address_space_io;
>>   diff --git a/include/hw/pci/pci_bus.h b/include/hw/pci/pci_bus.h
>> index 5484a9b..a0cf655 100644
>> --- a/include/hw/pci/pci_bus.h
>> +++ b/include/hw/pci/pci_bus.h
>> @@ -23,6 +23,7 @@ struct PCIBus {
>>       PCIIOMMUFunc iommu_fn;
>>       void *iommu_opaque;
>>       uint8_t devfn_min;
>> +    uint32_t dev_reserved_mask;
> 
> I would merge this patch with the next one to
> see the new field "in action".

If everyone wants me to drop the above setting of dev_reserved_mask than
I can squash it into the following patch.


ATB,

Mark.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]