Now PCI bridges get a bus range number on a system init,
basing on currently plugged devices. That's why when one wants to hotplug another bridge,
it needs his child bus, which the parent is unable to provide (speaking about virtual device).
The suggested workaround is to have vendor-specific capability in Red Hat PCI bridges
that contains number of additional bus to reserve (as well as various space limit hints,
unused for now) on BIOS PCI init.
So this capability is intented only for pure …
[View More]QEMU->SeaBIOS usage.
Considering all aforesaid, this series is directly connected with
QEMU series (v3) "Generic PCIE-PCI Bridge".
Although the new PCI capability is supposed to contain various limits along with
bus number to reserve, now only its full layout is proposed. And
only bus_reserve field is used in QEMU and BIOS. Limits usage
is still a subject for implementation as now
the main goal of this series to provide necessary support from the
firmware side to PCIE-PCI bridge hotplug.
Changes v2->v3:
1. Merge commit 2 (Red Hat vendor ID) into commit 4 - addresses Marcel's comment,
and add Generic PCIE Root Port device ID - addresses Michael's comment.
2. Changes of the capability layout (QEMU side has the same changes):
- add 'type' field to distinguish multiple
RedHat-specific capabilities - addresses Michael's comment
- do not mimiс PCI Config space register layout, but use mutually exclusive differently
sized fields for IO and prefetchable memory limits - addresses Laszlo's comment
- use defines instead of structure and offsetof - addresses Michael's comment
3. Interpret 'bus_reserve' field as a minimum necessary
range to reserve - addresses Gerd's comment
4. pci_find_capability moved to pci.c - addresses Kevin's comment
5. Move capability layout header to src/fw/dev-pci.h - addresses Kevin's comment
6. Add the capability documentation - addresses Michael's comment
7. Add capability length and bus_reserve field sanity checks - addresses Michael's comment
Changes v1->v2:
1. New #define for Red Hat vendor added (addresses Konrad's comment).
2. Refactored pci_find_capability function (addresses Marcel's comment).
3. Capability reworked:
- data type added;
- reserve space in a structure for IO, memory and
prefetchable memory limits.
Aleksandr Bezzubikov (3):
pci: refactor pci_find_capapibilty to get bdf as the first argument
instead of the whole pci_device
pci: add QEMU-specific PCI capability structure
pci: enable RedHat PCI bridges to reserve additional buses on PCI init
src/fw/dev-pci.h | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++
src/fw/pciinit.c | 41 +++++++++++++++++++++++++++++++----
src/hw/pci.c | 25 +++++++++++++++++++++
src/hw/pci.h | 1 +
src/hw/pci_ids.h | 3 +++
src/hw/pcidevice.c | 24 ---------------------
src/hw/pcidevice.h | 1 -
src/hw/virtio-pci.c | 6 +++---
src/types.h | 2 ++
9 files changed, 133 insertions(+), 32 deletions(-)
create mode 100644 src/fw/dev-pci.h
--
2.7.4
[View Less]
> Hi
>
>
> We are looking for developers to develop an authentication module in the
> standard Chromebook OS/firmware.
>
>
> 1) The purpose of this authentication module is to ‘lock' the device
> at factory during manufacturing.
> A lock PIN consist of 10-12 numeric is written to the device memory.
>
>
> 2) During first boot up, the device will prompt for a login pin.
>
>
> 3) If there is a matched between the login pin and the lock pin stored
…
[View More]> in the device memory, the Chromebook will be ‘unlocked’ and normal
> operation can proceed. If the PIN numbers are not matched, the
> Chromebook will remain lock. (see attached flow-chart)
>
>
> 4) The development needs not be confined to only firmware. We are open
> to all options (example thru apps) so long the authentication process
> can be achieved.
>
>
> We are writing to request whether if any Chromebook expert/specialist
> can provide Non-recurring engineering (NRE) services for the
> development. Please do contact the undersign should you require more
> info.
>
>
>
>
>
> Hope to hear from you
>
>
>
> --
> Best Regards
> Victor Chng
>
> Send from my iphone
>
>
>
>
>
--
Best Regards
Victor Chng
Send from my iphone
[View Less]
On 25/07/2017 17:09, Alexander Bezzubikov wrote:
> 2017-07-25 16:53 GMT+03:00 Michael S. Tsirkin <mst(a)redhat.com>:
>> On Tue, Jul 25, 2017 at 04:50:49PM +0300, Alexander Bezzubikov wrote:
>>> 2017-07-25 16:43 GMT+03:00 Michael S. Tsirkin <mst(a)redhat.com>:
>>>> On Sun, Jul 23, 2017 at 05:13:11PM +0300, Marcel Apfelbaum wrote:
>>>>> On 23/07/2017 15:22, Michael S. Tsirkin wrote:
>>>>>> On Sun, Jul 23, 2017 at 01:15:…
[View More]42AM +0300, Aleksandr Bezzubikov wrote:
>>>>>>> To enable hotplugging of a newly created pcie-pci-bridge,
>>>>>>> we need to tell firmware (SeaBIOS in this case)
>>>>>>
>>>>>
>>>>> Hi Michael,
>>>>>
>>>>>> Presumably, EFI would need to support this too?
>>>>>>
>>>>>
>>>>> Sure, Eduardo added to CC, but he is in PTO now.
>>>>>
>>>>>>> to reserve
>>>>>>> additional buses for pcie-root-port, that allows us to
>>>>>>> hotplug pcie-pci-bridge into this root port.
>>>>>>> The number of buses to reserve is provided to the device via a corresponding
>>>>>>> property, and to the firmware via new PCI capability (next patch).
>>>>>>> The property's default value is 1 as we want to hotplug at least 1 bridge.
>>>>>>
>>>>>> If so you should just teach firmware to allocate one bus #
>>>>>> unconditionally.
>>>>>>
>>>>>
>>>>> That would be a problem for the PCIe machines, since each PCIe
>>>>> devices is plugged in a different bus and we are already
>>>>> limited to 256 PCIe devices. Allocating an extra-bus always
>>>>> would really limit the PCIe devices we can use.
>>>>
>>>> One of the declared advantages of PCIe is easy support for multiple roots.
>>>> We really should look at that IMHO so we do not need to pile up hacks.
>>>>
>>>>>> But why would that be so? What's wrong with a device
>>>>>> directly in the root port?
>>>>>>
>>>>
>>>> To clarify, my point is we might be wasting bus numbers by reservation
>>>> since someone might just want to put pcie devices there.
>>>
>>> I think, changing default value to 0 can help us avoid this,
>>> as no bus reservation by default. If one's surely wants
>>> to hotplug pcie-pci-bridge into this root port in future,
>>> the property gives him such an opportunity.
>>> So, sure need pcie-pci-bridge hotplug -> creating a root port with
>>> bus_reserve > 0. Otherwise (and default) - just as now, no changes
>>> in bus topology.
>>
>> I guess 0 should mean "do not reserve any buses". So I think we also
>> need a flag to just avoid the capability altogether. Maybe -1? *That*
>> should be the default.
>
> -1 might be useful if any limit value 0 is legal, but is it?
> If not, we can set every field to 0 and
> this is a sign of avoiding capability since none legal
> values are provided.
>
As Gerd suggested, this value is not a "delta" but the number
of buses to be reserved behind the bridge. If I got it right,
0 is not a valid value, since the bridge by definition
has a list one bus behind.
Michael, would you be OK with that?
Thanks,
Marcel
>>
>>>>
>>>>> First, plugging a legacy PCI device into a PCIe Root Port
>>>>> looks strange at least, and it can;t be done on real HW anyway.
>>>>> (incompatible slots)
>>>>>
>>>>> Second (and more important), if we want 2 or more PCI
>>>>> devices we would loose both IO ports space and bus numbers.
>>>>>
>>>>>>
>>>>>>>
>>>>>>> Signed-off-by: Aleksandr Bezzubikov <zuban32s(a)gmail.com>
>>>>>>> ---
>>>>>>> hw/pci-bridge/pcie_root_port.c | 1 +
>>>>>>> include/hw/pci/pcie_port.h | 3 +++
>>>>>>> 2 files changed, 4 insertions(+)
>>>>>>>
>>>>>>> diff --git a/hw/pci-bridge/pcie_root_port.c b/hw/pci-bridge/pcie_root_port.c
>>>>>>> index 4d588cb..b0e49e1 100644
>>>>>>> --- a/hw/pci-bridge/pcie_root_port.c
>>>>>>> +++ b/hw/pci-bridge/pcie_root_port.c
>>>>>>> @@ -137,6 +137,7 @@ static void rp_exit(PCIDevice *d)
>>>>>>> static Property rp_props[] = {
>>>>>>> DEFINE_PROP_BIT(COMPAT_PROP_PCP, PCIDevice, cap_present,
>>>>>>> QEMU_PCIE_SLTCAP_PCP_BITNR, true),
>>>>>>> + DEFINE_PROP_UINT8("bus_reserve", PCIEPort, bus_reserve, 1),
>>>>>>> DEFINE_PROP_END_OF_LIST()
>>>>>>> };
>>>>>>> diff --git a/include/hw/pci/pcie_port.h b/include/hw/pci/pcie_port.h
>>>>>>> index 1333266..1b2dd1f 100644
>>>>>>> --- a/include/hw/pci/pcie_port.h
>>>>>>> +++ b/include/hw/pci/pcie_port.h
>>>>>>> @@ -34,6 +34,9 @@ struct PCIEPort {
>>>>>>> /* pci express switch port */
>>>>>>> uint8_t port;
>>>>>>> +
>>>>>>> + /* additional buses to reserve on firmware init */
>>>>>>> + uint8_t bus_reserve;
>>>>>>> };
>>>>>>> void pcie_port_init_reg(PCIDevice *d);
>>>>>>
>>>>>> So here is a property and it does not do anything.
>>>>>> It makes it easier to work on series maybe, but review
>>>>>> is harder since we do not see what it does at all.
>>>>>> Please do not split up patches like this - you can maintain
>>>>>> it split up in your branch if you like and merge before sending.
>>>>>>
>>>>>
>>>>> Agreed, Alexandr please merge patches 4-5-6 for your next submission.
>>>>>
>>>>> Thanks,
>>>>> Marcel
>>>>>
>>>>>
>>>>>>> --
>>>>>>> 2.7.4
>>>
>>>
>>>
>>> --
>>> Alexander Bezzubikov
>
>
>
[View Less]
On Tue, Jul 25, 2017 at 12:41:12AM +0300, Alexander Bezzubikov wrote:
> 2017-07-24 23:46 GMT+03:00 Michael S. Tsirkin <mst(a)redhat.com>:
> > On Sun, Jul 23, 2017 at 05:13:11PM +0300, Marcel Apfelbaum wrote:
> >> On 23/07/2017 15:22, Michael S. Tsirkin wrote:
> >> > On Sun, Jul 23, 2017 at 01:15:42AM +0300, Aleksandr Bezzubikov wrote:
> >> > > To enable hotplugging of a newly created pcie-pci-bridge,
> >> > > we need to tell …
[View More]firmware (SeaBIOS in this case)
> >> >
> >>
> >> Hi Michael,
> >>
> >> > Presumably, EFI would need to support this too?
> >> >
> >>
> >> Sure, Eduardo added to CC, but he is in PTO now.
> >>
> >> > > to reserve
> >> > > additional buses for pcie-root-port, that allows us to
> >> > > hotplug pcie-pci-bridge into this root port.
> >> > > The number of buses to reserve is provided to the device via a corresponding
> >> > > property, and to the firmware via new PCI capability (next patch).
> >> > > The property's default value is 1 as we want to hotplug at least 1 bridge.
> >> >
> >> > If so you should just teach firmware to allocate one bus #
> >> > unconditionally.
> >> >
> >>
> >> That would be a problem for the PCIe machines, since each PCIe
> >> devices is plugged in a different bus and we are already
> >> limited to 256 PCIe devices. Allocating an extra-bus always
> >> would really limit the PCIe devices we can use.
> >
> > But this is exactly what this patch does as the property is added to all
> > buses and default to 1 (1 extra bus).
> >
> >> > But why would that be so? What's wrong with a device
> >> > directly in the root port?
> >> >
> >>
> >> First, plugging a legacy PCI device into a PCIe Root Port
> >> looks strange at least, and it can;t be done on real HW anyway.
> >> (incompatible slots)
> >
> > You can still plug in PCIe devices there.
> >
> >> Second (and more important), if we want 2 or more PCI
> >> devices we would loose both IO ports space and bus numbers.
> >
> > What I am saying is maybe default should not be 1.
>
> The only sensible variant left is 0.
> But as we want pcie-pci-bridge to be used for every legacy PCI device
> on q35 machine, every time one hotplugs the bridge into the root port,
> he must be sure rp's prop value >0 (for Linux). I'm not sure
> that it is a very convenient way to utilize the bridge - always remember
> to set property.
That's what I'm saying then - if in your opinion default is >0 anyway,
tweak firmware to do it by default.
> Another way - we can set this to 0 by default, and to 1 for pcie-root-port,
> and recommend to use it for hotplugging of the pcie-pci-bridge itself.
I wonder about something: imagine hotplugging a hierarchy of bridges
below a root port. It seems that nothing prevents guest from finding a
free range of buses to cover this hierarchy and setting that as
secondary/subordinate bus for this bridge.
This does need support on QEMU side to hotplug a hierarchy at once,
and might need some fixes in Linux, on the plus side you can defer
management decision on how many are needed until you are actually
adding something, and you don't need vendor specific patches.
> >
> >> >
> >> > >
> >> > > Signed-off-by: Aleksandr Bezzubikov <zuban32s(a)gmail.com>
> >> > > ---
> >> > > hw/pci-bridge/pcie_root_port.c | 1 +
> >> > > include/hw/pci/pcie_port.h | 3 +++
> >> > > 2 files changed, 4 insertions(+)
> >> > >
> >> > > diff --git a/hw/pci-bridge/pcie_root_port.c b/hw/pci-bridge/pcie_root_port.c
> >> > > index 4d588cb..b0e49e1 100644
> >> > > --- a/hw/pci-bridge/pcie_root_port.c
> >> > > +++ b/hw/pci-bridge/pcie_root_port.c
> >> > > @@ -137,6 +137,7 @@ static void rp_exit(PCIDevice *d)
> >> > > static Property rp_props[] = {
> >> > > DEFINE_PROP_BIT(COMPAT_PROP_PCP, PCIDevice, cap_present,
> >> > > QEMU_PCIE_SLTCAP_PCP_BITNR, true),
> >> > > + DEFINE_PROP_UINT8("bus_reserve", PCIEPort, bus_reserve, 1),
> >> > > DEFINE_PROP_END_OF_LIST()
> >> > > };
> >> > > diff --git a/include/hw/pci/pcie_port.h b/include/hw/pci/pcie_port.h
> >> > > index 1333266..1b2dd1f 100644
> >> > > --- a/include/hw/pci/pcie_port.h
> >> > > +++ b/include/hw/pci/pcie_port.h
> >> > > @@ -34,6 +34,9 @@ struct PCIEPort {
> >> > > /* pci express switch port */
> >> > > uint8_t port;
> >> > > +
> >> > > + /* additional buses to reserve on firmware init */
> >> > > + uint8_t bus_reserve;
> >> > > };
> >> > > void pcie_port_init_reg(PCIDevice *d);
> >> >
> >> > So here is a property and it does not do anything.
> >> > It makes it easier to work on series maybe, but review
> >> > is harder since we do not see what it does at all.
> >> > Please do not split up patches like this - you can maintain
> >> > it split up in your branch if you like and merge before sending.
> >> >
> >>
> >> Agreed, Alexandr please merge patches 4-5-6 for your next submission.
> >>
> >> Thanks,
> >> Marcel
> >>
> >>
> >> > > --
> >> > > 2.7.4
>
>
>
> --
> Alexander Bezzubikov
[View Less]
Now PCI bridges get a bus range number on a system init,
basing on currently plugged devices. That's why when one wants to hotplug another bridge,
it needs his child bus, which the parent is unable to provide (speaking about virtual device).
The suggested workaround is to have vendor-specific capability in Red Hat PCI bridges
that contains number of additional bus to reserve on BIOS PCI init.
So this capability is intented only for pure QEMU->SeaBIOS usage.
Considering all aforesaid, this …
[View More]series is directly connected with
QEMU RFC series (v2) "Generic PCIE-PCI Bridge".
Although the new PCI capability is supposed to contain various limits along with
bus number to reserve, now only its full layout is proposed, but
only bus_reserve field is used in QEMU and BIOS. Limits usage
is still a subject for implementation as now
the main goal of this series to provide necessary support from the
firmware side to PCIE-PCI bridge hotplug.
Changes v1->v2:
1. New #define for Red Hat vendor added (addresses Konrad's comment).
2. Refactored pci_find_capability function (addresses Marcel's comment).
3. Capability reworked:
- data type added;
- reserve space in a structure for IO, memory and
prefetchable memory limits.
Aleksandr Bezzubikov (4):
pci: refactor pci_find_capapibilty to get bdf as the first argument
instead of the whole pci_device
pci: add RedHat vendor ID
pci: add QEMU-specific PCI capability structure
pci: enable RedHat PCI bridges to reserve additional buses on PCI init
src/fw/pciinit.c | 18 ++++++++++++++----
src/hw/pci_cap.h | 23 +++++++++++++++++++++++
src/hw/pci_ids.h | 2 ++
src/hw/pcidevice.c | 12 ++++++------
src/hw/pcidevice.h | 2 +-
src/hw/virtio-pci.c | 4 ++--
6 files changed, 48 insertions(+), 13 deletions(-)
create mode 100644 src/hw/pci_cap.h
--
2.7.4
[View Less]
I just realized what we need in order to test QEMU better. We need a list of people who
are willing to support a certain operating system.
The list would probably be located here: http://wiki.qemu.org/Testing/Windows
It would look like this:
Operating system Tester
Windows 3.1 <email address of a tester>, <email address of another tester>, ...
Windows NT 3.1 <email address of a tester>, <email address of another tester>, ...
Windows NT 3.5 <email address of a …
[View More]tester>, <email address of another tester>, ...
Windows 95 <email address of a tester>, <email address of another tester>, ...
Windows NT 4.0 <email address of a tester>, <email address of another tester>, ...
Windows 98 <email address of a tester>, <email address of another tester>, ...
Windows ME <email address of a tester>, <email address of another tester>, ...
Windows 2000 <email address of a tester>, <email address of another tester>, ...
Windows XP <email address of a tester>, <email address of another tester>, ...
Windows Vista <email address of a tester>, <email address of another tester>, ...
Windows 7 <email address of a tester>, <email address of another tester>, ...
Windows 8 <email address of a tester>, <email address of another tester>, ...
Windows 10 <email address of a tester>, <email address of another tester>, ...
ReactOS <email address of a tester>, <email address of another tester>, ...
If someone has a patch that makes a change to the qemu-system-i386 emulator,
the patch maker can consult the list of people who might be willing to help test the patch.
There are many people who work on QEMU with certain versions of Windows at their
disposal. With this knowledge compatibility testing can become more thorough.
Thoughts? Ideas?
[View Less]
On 07/26/17 23:54, Alexander Bezzubikov wrote:
> 2017-07-26 22:43 GMT+03:00 Michael S. Tsirkin <mst(a)redhat.com>:
>> On Sun, Jul 23, 2017 at 01:15:41AM +0300, Aleksandr Bezzubikov wrote:
>>> + PCIBridgeQemuCap cap;
>>
>> This leaks info to guest. You want to init all fields here:
>>
>> cap = {
>> .len = ....
>> };
>
> I surely can do this for len field, but as Laszlo proposed
> we can use mutually exclusive fields,
> …
[View More]e.g. pref_32 and pref_64, the only way I have left
> is to use ternary operator (if we surely need this
> big initializer). Keeping some if's would look better,
> I think.
I think it's fine to use "if"s in order to set up the structure
partially / gradually, but then please clear the structure up-front:
PCIBridgeQemuCap cap = { 0 };
(In general "{ 0 }" is the best initializer ever, because it can
zero-init a variable of *any* type at all. Gcc might complain about the
inexact depth of {} nesting of course, but it's nonetheless valid C.)
Or else add a memset-to-zero.
Or else, do just
PCIBridgeQemuCap cap = { .len = ... };
which will zero-fill every other field. ("[...] all subobjects that are
not initialized explicitly shall be initialized implicitly the same as
objects that have static storage duration").
Thanks
Laszlo
[View Less]
This series introduces a new device - generic PCI Express to PCI bridge,
and also makes all necessary changes to enable hotplug of the bridge itself
and any device into the bridge.
Obvious reasons to remain RFC:
1. The new PCI capability: layout, creation interface.
2. Windows SHPC issue - devices hotplugging into the bridge
doens't work on Windows 7 (unlike Windows 10),
whereas an old pci-bridge usage is fine.
3. Hot-unplug not completely tested.
Changes v1->v2:
1. Enable SHPC for …
[View More]the bridge.
2. Enable SHPC support for the Q35 machine (ACPI stuff).
3. Introduce PCI capability to help firmware on the system init.
This allows the bridge to be hotpluggable. Now it's supported
only for pcie-root-port. Now it's supposed to used with
SeaBIOS only, look at the SeaBIOS corresponding series
"".
Aleksandr Bezzubikov (6):
hw/pci: introduce pcie-pci-bridge device
hw/i386: allow SHPC for Q35 machine
hw/pci: enable SHPC for PCIE-PCI bridge
hw/pci: introduce bridge-only vendor-specific capability to provide
some hints to firmware
hw/pci: add bus_reserve property to pcie-root-port
hw/pci: add hint capabilty for additional bus reservation to
pcie-root-port
hw/i386/acpi-build.c | 2 +-
hw/pci-bridge/Makefile.objs | 2 +-
hw/pci-bridge/pcie_pci_bridge.c | 212 ++++++++++++++++++++++++++++++++++++++++
hw/pci-bridge/pcie_root_port.c | 6 ++
hw/pci/pci_bridge.c | 27 +++++
include/hw/pci/pci.h | 1 +
include/hw/pci/pci_bridge.h | 18 ++++
include/hw/pci/pcie_port.h | 3 +
8 files changed, 269 insertions(+), 2 deletions(-)
create mode 100644 hw/pci-bridge/pcie_pci_bridge.c
--
2.7.4
[View Less]