From: Chao Gao <chao.gao@intel.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "Stefano Stabellini" <sstabellini@kernel.org>,
qemu-devel@nongnu.org, "Paul Durrant" <paul.durrant@citrix.com>,
"Anthony Perard" <anthony.perard@citrix.com>,
xen-devel@lists.xenproject.org,
"Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [Xen-devel] [RFC Patch] xen/pt: Emulate FLR capability
Date: Thu, 29 Aug 2019 23:22:08 +0800 [thread overview]
Message-ID: <20190829152206.GA3174@gao-cwp> (raw)
In-Reply-To: <131d5f04-7ef9-9a2b-3009-2a93587186ef@suse.com>
On Thu, Aug 29, 2019 at 12:03:44PM +0200, Jan Beulich wrote:
>On 29.08.2019 11:02, Chao Gao wrote:
>> Currently, for a HVM on Xen, no reset method is virtualized. So in a VM's
>> perspective, assigned devices cannot be reset. But some devices rely on PCI
>> reset to recover from hardware hangs. When being assigned to a VM, those
>> devices cannot be reset and won't work any longer if a hardware hang occurs.
>> We have to reboot VM to trigger PCI reset on host to recover the device.
>
>Did you consider a hot-unplug, reset (by host), hot-plug cycle instead?
Yes. I considered this means. But it needs host to initiate this action.
However, when a device needs reset is determined by the device driver
in VM. So in practice, VM still needs a way to notify host to do
unplug/reset/plug. As the standard FLR capability can meet the
requirement, I don't try to invent one.
>
>> +static int xen_pt_devctl_reg_write(XenPCIPassthroughState *s,
>> + XenPTReg *cfg_entry, uint16_t *val,
>> + uint16_t dev_value, uint16_t valid_mask)
>> +{
>> + if (s->real_device.is_resetable && (*val & PCI_EXP_DEVCTL_BCR_FLR)) {
>> + xen_pt_reset(s);
>> + }
>> + return xen_pt_word_reg_write(s, cfg_entry, val, dev_value, valid_mask);
>
>I think you also need to clear the bit before handing on the request,
>such that reads will always observe it clear.
Will do.
Thanks
Chao
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
WARNING: multiple messages have this Message-ID (diff)
From: Chao Gao <chao.gao@intel.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "Stefano Stabellini" <sstabellini@kernel.org>,
qemu-devel@nongnu.org, "Paul Durrant" <paul.durrant@citrix.com>,
"Anthony Perard" <anthony.perard@citrix.com>,
xen-devel@lists.xenproject.org,
"Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [Qemu-devel] [RFC Patch] xen/pt: Emulate FLR capability
Date: Thu, 29 Aug 2019 23:22:08 +0800 [thread overview]
Message-ID: <20190829152206.GA3174@gao-cwp> (raw)
In-Reply-To: <131d5f04-7ef9-9a2b-3009-2a93587186ef@suse.com>
On Thu, Aug 29, 2019 at 12:03:44PM +0200, Jan Beulich wrote:
>On 29.08.2019 11:02, Chao Gao wrote:
>> Currently, for a HVM on Xen, no reset method is virtualized. So in a VM's
>> perspective, assigned devices cannot be reset. But some devices rely on PCI
>> reset to recover from hardware hangs. When being assigned to a VM, those
>> devices cannot be reset and won't work any longer if a hardware hang occurs.
>> We have to reboot VM to trigger PCI reset on host to recover the device.
>
>Did you consider a hot-unplug, reset (by host), hot-plug cycle instead?
Yes. I considered this means. But it needs host to initiate this action.
However, when a device needs reset is determined by the device driver
in VM. So in practice, VM still needs a way to notify host to do
unplug/reset/plug. As the standard FLR capability can meet the
requirement, I don't try to invent one.
>
>> +static int xen_pt_devctl_reg_write(XenPCIPassthroughState *s,
>> + XenPTReg *cfg_entry, uint16_t *val,
>> + uint16_t dev_value, uint16_t valid_mask)
>> +{
>> + if (s->real_device.is_resetable && (*val & PCI_EXP_DEVCTL_BCR_FLR)) {
>> + xen_pt_reset(s);
>> + }
>> + return xen_pt_word_reg_write(s, cfg_entry, val, dev_value, valid_mask);
>
>I think you also need to clear the bit before handing on the request,
>such that reads will always observe it clear.
Will do.
Thanks
Chao
next prev parent reply other threads:[~2019-08-29 15:18 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-29 9:02 [Xen-devel] [RFC Patch] xen/pt: Emulate FLR capability Chao Gao
2019-08-29 9:02 ` [Qemu-devel] " Chao Gao
2019-08-29 10:03 ` [Xen-devel] " Jan Beulich
2019-08-29 10:03 ` [Qemu-devel] " Jan Beulich
2019-08-29 15:22 ` Chao Gao [this message]
2019-08-29 15:22 ` Chao Gao
2019-08-29 10:21 ` [Xen-devel] " Roger Pau Monné
2019-08-29 10:21 ` [Qemu-devel] " Roger Pau Monné
2019-09-06 9:01 ` [Xen-devel] " Chao Gao
2019-09-06 9:01 ` [Qemu-devel] " Chao Gao
2019-09-06 9:20 ` [Xen-devel] " Paul Durrant
2019-09-06 9:20 ` [Qemu-devel] " Paul Durrant
2019-09-06 10:28 ` [Xen-devel] " Roger Pau Monné
2019-09-06 10:28 ` [Qemu-devel] " Roger Pau Monné
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=20190829152206.GA3174@gao-cwp \
--to=chao.gao@intel.com \
--cc=anthony.perard@citrix.com \
--cc=jbeulich@suse.com \
--cc=paul.durrant@citrix.com \
--cc=qemu-devel@nongnu.org \
--cc=roger.pau@citrix.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.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.