From: Avi Kivity <avi@redhat.com>
To: Anthony Liguori <anthony@codemonkey.ws>
Cc: "lmr@redhat.com" <lmr@redhat.com>,
Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>,
cleber@redhat.com, dlaor@redhat.com,
qemu-devel <qemu-devel@nongnu.org>,
Gerd Hoffmann <kraxel@redhat.com>, Cleber Rosa <crosa@redhat.com>
Subject: Re: [Qemu-devel] [ANNOUNCE] qemu-test: a set of tests scripts for QEMU
Date: Thu, 29 Dec 2011 19:03:55 +0200 [thread overview]
Message-ID: <4EFC9D7B.2010408@redhat.com> (raw)
In-Reply-To: <4EFC9A04.3030004@codemonkey.ws>
On 12/29/2011 06:49 PM, Anthony Liguori wrote:
> On 12/29/2011 10:36 AM, Avi Kivity wrote:
>> On 12/29/2011 06:12 PM, Anthony Liguori wrote:
>>>>> That's why I've also proposed qtest. But having written quite a few
>>>>> qtest unit tests by now, you hit the limits of this type of testing
>>>>> pretty quickly.
>>>>
>>>> Can you describe those limits?
>>>
>>>
>>> I started writing a finger print test. While it's easy to do PCI
>>> enumeration, it gets pretty nasty if you want to actually access BARs
>>> (to read virtio registers)
>>
>> Why is that? it should be pretty easy to poke values into the BAR
>> registers.
>
> You have to map them which means you need to figure out what the
> memory layout looks like. Since there's no BIOS, you need to poke
> fw_cfg to figure all of this out and then program the BARs appropriately.
>
> It's definitely non-trivial.
Or just map sequentially at 0xe0000000 ascending.
>
>> Something else we can do is access the BARs directly. We have APIs to
>> poke values into mmio, add an api to poke a value into a device's BAR.
>> Now that each BAR is represented by exactly one memory region, known to
>> the pci core even if it is not mapped, it should be easy.
>>
>>> and forget about trying to get SMBIOS information as that involves
>>> mucking around with ACPI.
>>
>> SMBIOS is built by seabios, yes?
>
> I think QEMU actually builds the blob of information and passes the
> full blob to SeaBIOS. You could read and parse the blob out of fw_cfg
> I guess but that's still pretty sucky. It's a lot nicer to just poke
> sysfs.
Seems like two lines of code, either way.
>
>> So fingerprinting it should be done
>> from seabios-test.git. Let's divide it into two problems:
>
> That seems awkward especially since fingerprinting Just Works with
> qemu-test already (and it was only 50 lines of shell code!).
>
>> - seabios pokes qemu to get information. We should fingerprint this
>> information to make sure different qemu version can interoperate with
>> different seabios versions (needed since we migrate the bios along with
>> the rest of the guest). I'm guessing most of this info is from fwcfg?
>> We can easily fingerprint it like any other device.
>> - we need to make sure seabios generates the same tables when using -M.
>> Here, we're not testing a device, rather we're testing guest code, so it
>> makes sense to use a guest for this.
>>
>> However, I don't think it's even necessary. From a quick read of the
>> manual, SMBIOS is just a set of static tables in memory which are picked
>> up using a signature. So all we need to do is boot an empty guest, read
>> its memory, and look for the tables.
>
> Doesn't it sound a whole nicer use linux.git to parse this information
> for us in a friendly, easy to consume fashion?
Run 'dmidecode -d /path/to/memory/dump', if you must.
I don't think the qemu-test approach is bad, per se, it's just that
qtest is better. It gives you full control over what to fingerprint and
is not reliant on Linux not changing.
>>
>> Yes; but using Linux limits you to what it exposes (of course Linux
>> exposes quite a lot, so that's mostly a non issue; but we'll have
>> counterexamples).
>
>
> Maybe. And for those counter examples, we can drill down to qtest.
> But just because we may need to do fancy things, it doesn't mean we
> shouldn't take the easy approach 95% of the time.
I guess we have to see how difficult it will be with qtest. My feeling
is that it will be very easy.
>> I don't see why. A python library to read pci config should be a couple
>> of dozens of lines long. Then you iterate over all functions and print
>> selected registers.
>
>
> PCI enumeration is easy. It's mapping the bars and then poking other
> sources of information that's more challenging.
>
> Everything is doable by writing a libOS but I'd rather just use Linux
> than invent a libOS just for testing.
We will have to write a libOS to test devices. To test, say, virtio-net
with indirect buffers, you have to map BARs (or poke unmapped BARs
directly).
>>
>> You mention in the changelog replacing the APIC. Why can't you do that?
>
>
> I currently replace the I/O APIC which seems to be limited to 16
> IRQs. I think MSI takes a side channel directly to the local APIC, no?
Yes, writes to the 1MB @ 0xfee00000 gets translated to MSIs. So you
just translate them to events.
>> It looks great. One thing I'd change is to use the qmp protocol
>> (perhaps not the monitor, just the schema/codegen). Does something
>> prohibit this?
>
>
> Yeah, I thought about using QMP. But events are posted in QMP which
> means that you never get an explicit ACK. That may not be a problem
> but it's something I had in mind.
>
> It also seemed to be reasonably complicated without a clear
> advantage. qtest isn't going to be a supported protocol so we can
> certainly change it down the road if we want to.
It's a pity not to reuse all the tooling? Seems like self-NIH.
--
error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2011-12-29 17:04 UTC|newest]
Thread overview: 74+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-19 17:13 [Qemu-devel] [ANNOUNCE] qemu-test: a set of tests scripts for QEMU Anthony Liguori
2011-12-19 17:39 ` Avi Kivity
2011-12-19 17:55 ` Anthony Liguori
2011-12-20 20:34 ` Lucas Meneghel Rodrigues
2011-12-25 15:19 ` Dor Laor
2011-12-26 15:12 ` Anthony Liguori
2011-12-26 23:00 ` Dor Laor
2011-12-27 15:22 ` Anthony Liguori
2011-12-27 15:58 ` Avi Kivity
2011-12-27 16:40 ` Anthony Liguori
2011-12-27 18:00 ` Lucas Meneghel Rodrigues
2011-12-27 22:35 ` Cleber Rosa
2011-12-28 2:37 ` Anthony Liguori
2011-12-28 4:15 ` Cleber Rosa
2011-12-28 5:01 ` Cleber Rosa
2011-12-28 14:27 ` Anthony Liguori
2011-12-28 15:01 ` Avi Kivity
2011-12-28 15:28 ` Avi Kivity
2011-12-28 16:44 ` Anthony Liguori
2011-12-28 17:26 ` Avi Kivity
2011-12-29 16:12 ` Anthony Liguori
2011-12-29 16:36 ` Avi Kivity
2011-12-29 16:49 ` Anthony Liguori
2011-12-29 17:03 ` Avi Kivity [this message]
2011-12-29 17:10 ` Anthony Liguori
2011-12-29 17:18 ` Avi Kivity
2011-12-29 17:22 ` Peter Maydell
2011-12-29 17:26 ` Avi Kivity
2011-12-29 17:36 ` Peter Maydell
2011-12-29 17:40 ` Avi Kivity
2011-12-29 17:49 ` Peter Maydell
2011-12-29 17:56 ` Avi Kivity
2011-12-29 21:10 ` Peter Maydell
2012-01-01 9:21 ` Avi Kivity
2011-12-29 18:35 ` Anthony Liguori
2011-12-29 19:04 ` Peter Maydell
2011-12-29 19:40 ` Blue Swirl
2011-12-29 21:46 ` Anthony Liguori
2011-12-29 22:10 ` Peter Maydell
2011-12-29 22:30 ` Anthony Liguori
2011-12-30 15:43 ` Andreas Färber
2012-01-03 13:42 ` Anthony Liguori
2012-01-03 14:51 ` Andreas Färber
2011-12-29 22:11 ` Lucas Meneghel Rodrigues
2011-12-29 18:33 ` Anthony Liguori
2011-12-30 13:44 ` Andreas Färber
2012-01-02 14:07 ` Paolo Bonzini
2012-01-03 8:19 ` Stefan Hajnoczi
2012-01-03 9:10 ` Paolo Bonzini
2011-12-28 16:42 ` Anthony Liguori
2011-12-28 17:21 ` Avi Kivity
2011-12-29 14:38 ` Dor Laor
2011-12-29 16:39 ` Anthony Liguori
2011-12-29 16:53 ` Avi Kivity
2011-12-29 17:02 ` Anthony Liguori
2011-12-29 17:06 ` Avi Kivity
2011-12-29 17:11 ` Anthony Liguori
2011-12-29 23:17 ` Lucas Meneghel Rodrigues
2011-12-30 0:33 ` Anthony Liguori
2011-12-30 1:20 ` Lucas Meneghel Rodrigues
2011-12-30 2:20 ` Cleber Rosa
2012-01-03 13:52 ` Anthony Liguori
2011-12-29 22:45 ` Lucas Meneghel Rodrigues
2011-12-29 16:26 ` Anthony Liguori
2011-12-29 16:46 ` Avi Kivity
2011-12-29 16:53 ` Anthony Liguori
2011-12-29 17:08 ` Avi Kivity
2011-12-29 17:14 ` Anthony Liguori
2011-12-29 17:22 ` Avi Kivity
2011-12-29 18:27 ` Anthony Liguori
2011-12-29 17:16 ` Anthony Liguori
2011-12-29 17:23 ` Avi Kivity
2011-12-28 14:49 ` Christoph Hellwig
2011-12-28 16:30 ` Anthony Liguori
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=4EFC9D7B.2010408@redhat.com \
--to=avi@redhat.com \
--cc=anthony@codemonkey.ws \
--cc=cleber@redhat.com \
--cc=crosa@redhat.com \
--cc=dlaor@redhat.com \
--cc=kraxel@redhat.com \
--cc=lmr@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@linux.vnet.ibm.com \
/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.