From: Gal Hammer <ghammer@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>, David Gibson <dgibson@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>,
qemu-devel@nongnu.org, afaerber@suse.de
Subject: Re: [Qemu-devel] [PATCH V14 2/3] pc: add a Virtual Machine Generation ID device
Date: Thu, 19 Mar 2015 13:31:29 +0200 [thread overview]
Message-ID: <550AB391.1020906@redhat.com> (raw)
In-Reply-To: <20150319091051-mutt-send-email-mst@redhat.com>
On 19/03/2015 11:50, Michael S. Tsirkin wrote:
> On Wed, Mar 11, 2015 at 04:35:41PM +1100, David Gibson wrote:
>>>>> So it boils down to the fact that windows thinks it's RAM,
>>>> It thinks it's PCI Standard RAM Controller not RAM itself.
>>>>
>>>>> so it binds a generic driver to it, but then we get
>>>> According to device manager no driver is bound to it and neither needed.
>>>>
>>>>> lucky and it does not try to use it as RAM.
>>>> Video cards also use a bunch of "PCI Standard RAM Controller"
>>>> devices I guess to expose additional VRAM,
>>>> That doesn't mean that BARs are to be used by OS as conventional RAM
>>>> it's rather for usage by vendor's driver.
>>>> Same goes for ivshmem which is also expose RAM bar and has the same CLASS ID,
>>>> BAR's RAM is used only by means of ivshmem driver.
>>>>
>>>> But yes we get lucky that Windows has stub device description.
>>>
>>> OK. So if you are going to rely on this,
>>> I think it's a good idea to get ack from David to confirm
>>> this is solvable for pseries.
>>
>> I've looked into this a bit more. We've confirmed it's definitely a
>> bug in SLOF - but fixing it is a bit more subtle than I thought.
>>
>> Basically, SLOF is setting the device_type property for all PCI devices
>> based on the PCI class code - it's device_type = "memory" that causes
>> the kernel to erroneously pick up the PCI device as regular RAM.
>>
>> In fact, device_type is supposed to indicate the capabilities of the OF
>> driver attached to the device, so it should only be set by an actual OF
>> driver binding to the device, not generically in the PCI code.
>>
>> The catch is whether we'll break any existing SLOF supported devices is
>> we remove setting of the device_type. This will need some testing.
>
> I guess we can look for some other IDs to use, as well.
> Host pci bridge class binds to NO_DRV too:
> class 0x0604. So that's one other option.
>
> There are also many devices for which windows won't require a driver.
> For example, Intel, taken at random:
> 2620 E8500/E8501 eXternal Memory Bridge
> 277c 82975X Memory Controller Hub
> 3600 7300 Chipset Memory Controller Hub
> Are we more, or less likely to see problems
> with one of these?
>
> It seems hard to decide, either way.
I think it is wrong to have a fake PCI device just to avoid the fact
that Windows will show the device in the devices tree. If the device
doesn't implement the required interface, then it should impersonate to
be one.
The PCI device implementation might be a simpler/cleaner solution but it
can cause more problems if an application or a driver will try to access
the device and get might get an access to the GUID memory region.
Gal.
>> --
>> David Gibson <dgibson@redhat.com>
>> Senior Software Engineer, Virtualization, Red Hat
>
>
next prev parent reply other threads:[~2015-03-19 11:30 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-03 16:18 [Qemu-devel] [PATCH V14 0/3] Virtual Machine Generation ID Igor Mammedov
2015-03-03 16:18 ` [Qemu-devel] [PATCH V14 1/3] docs: vm generation id device's description Igor Mammedov
2015-03-04 19:57 ` Eric Blake
2015-03-03 16:18 ` [Qemu-devel] [PATCH V14 2/3] pc: add a Virtual Machine Generation ID device Igor Mammedov
2015-03-03 17:35 ` Michael S. Tsirkin
2015-03-03 20:33 ` Igor Mammedov
2015-03-04 12:11 ` Michael S. Tsirkin
2015-03-04 13:12 ` Igor Mammedov
2015-03-04 13:49 ` Michael S. Tsirkin
2015-03-04 14:03 ` Andreas Färber
2015-03-04 15:14 ` Igor Mammedov
2015-03-04 15:31 ` Michael S. Tsirkin
2015-03-04 16:33 ` Igor Mammedov
2015-03-04 19:12 ` Michael S. Tsirkin
2015-03-05 14:22 ` Igor Mammedov
2015-03-11 5:35 ` David Gibson
2015-03-19 9:50 ` Michael S. Tsirkin
2015-03-19 11:31 ` Gal Hammer [this message]
2015-03-20 4:58 ` David Gibson
2015-03-03 16:18 ` [Qemu-devel] [PATCH V14 3/3] tests: add a unit test for the vmgenid device Igor Mammedov
2015-04-15 10:38 ` [Qemu-devel] [PATCH V14 0/3] Virtual Machine Generation ID Michael S. Tsirkin
2015-04-15 13:59 ` Igor Mammedov
2015-04-19 7:52 ` Michael S. Tsirkin
2015-04-19 13:38 ` Yan Vugenfirer
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=550AB391.1020906@redhat.com \
--to=ghammer@redhat.com \
--cc=afaerber@suse.de \
--cc=dgibson@redhat.com \
--cc=imammedo@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).