From: Don Slutz <dslutz@verizon.com>
To: Paul Durrant <Paul.Durrant@citrix.com>,
Wei Liu <wei.liu2@citrix.com>,
"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Cc: Andrew Cooper <Andrew.Cooper3@citrix.com>,
Jan Beulich <jbeulich@suse.com>
Subject: Re: [PATCH] ioreq-server: handle IOREQ_TYPE_PCI_CONFIG in assist function
Date: Wed, 28 Jan 2015 19:27:41 -0500 [thread overview]
Message-ID: <54C97E7D.8070103@terremark.com> (raw)
In-Reply-To: <9AAE0902D5BC7E449B7C8E4E778ABCD0257D8FA3@AMSPEX01CL01.citrite.net>
On 01/28/15 04:22, Paul Durrant wrote:
>> -----Original Message-----
>> From: Wei Liu [mailto:wei.liu2@citrix.com]
>> Sent: 27 January 2015 19:06
>> To: xen-devel@lists.xen.org
>> Cc: Wei Liu; Jan Beulich; Paul Durrant; Andrew Cooper
>> Subject: [PATCH] ioreq-server: handle IOREQ_TYPE_PCI_CONFIG in assist
>> function
>>
>> QEMU stubdom will read PCI config space when enumerating PCI devices.
>> Xen should return ~0 when there is no suitable ioreq server to dispatch
>> the request.
>>
>> Without this patch, QEMU stubdom will fail to start because hvmloader
>> fails following assertion:
>>
>> 118 ASSERT((devfn != PCI_ISA_DEVFN) ||
>> 119 ((vendor_id == 0x8086) && (device_id == 0x7000)));
>>
>> because vendor_id and device_id are 0.
>>
>> This fixes a regression for QEMU stubdom. It should be backported to 4.5
>> as well.
>>
>> Signed-off-by: Wei Liu <wei.liu2@citrix.com>
>> Cc: Jan Beulich <jbeulich@suse.com>
>> Cc: Paul Durrant <paul.durrant@citrix.com>
>> Cc: Andrew Cooper <andrew.cooper3@citrix.com>
>
> No, you should not need this. If you look at the code closely you'll see that
> hvm_complete_assist_req() is only called if hvm_select_ioreq_server()
returns NULL,
> and the switch from IOREQ_TYPE_PIO to IOREQ_TYPE_PCI_CONFIG is only
made if a
> non-default ioreq server matches the current cf8. Hence we could
> actually ASSERT(p->type !- IOREQ_TYPE_PCI_CONFIG) at the top
> of hvm_complete_assist_req().
>
I will agree that the ASSERT looks good to me with s/!-/!=/.
I have no idea how Wei Liu makes it to this code via QEMU stubdom
(last I knew QEMU stubdom needs QEMU traditional not QEMU upstream.
And the only way to get IOREQ_TYPE_PCI_CONFIG is with QEMU upstream).
I have found out how hvmloader ends up using hvm_complete_assist_req()
when not expected. Not sure how this is related to Wei Liu's issue.
-Don Slutz
> Paul
>
>> ---
>> xen/arch/x86/hvm/hvm.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
>> index c7984d1..c826ac5 100644
>> --- a/xen/arch/x86/hvm/hvm.c
>> +++ b/xen/arch/x86/hvm/hvm.c
>> @@ -2577,6 +2577,7 @@ static bool_t hvm_complete_assist_req(ioreq_t *p)
>> {
>> case IOREQ_TYPE_COPY:
>> case IOREQ_TYPE_PIO:
>> + case IOREQ_TYPE_PCI_CONFIG:
>> if ( p->dir == IOREQ_READ )
>> {
>> if ( !p->data_is_ptr )
>> --
>> 1.9.1
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
>
next prev parent reply other threads:[~2015-01-29 0:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-27 19:06 [PATCH] ioreq-server: handle IOREQ_TYPE_PCI_CONFIG in assist function Wei Liu
2015-01-27 19:34 ` Andrew Cooper
2015-01-28 9:26 ` Jan Beulich
2015-01-28 20:03 ` Don Slutz
2015-01-28 9:22 ` Paul Durrant
2015-01-29 0:27 ` Don Slutz [this message]
2015-01-29 10:52 ` Wei Liu
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=54C97E7D.8070103@terremark.com \
--to=dslutz@verizon.com \
--cc=Andrew.Cooper3@citrix.com \
--cc=Paul.Durrant@citrix.com \
--cc=jbeulich@suse.com \
--cc=wei.liu2@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.