All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Chao Gao <chao.gao@intel.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 12:03:44 +0200	[thread overview]
Message-ID: <131d5f04-7ef9-9a2b-3009-2a93587186ef@suse.com> (raw)
In-Reply-To: <1567069347-22841-1-git-send-email-chao.gao@intel.com>

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?

> +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.

Jan


WARNING: multiple messages have this Message-ID (diff)
From: Jan Beulich <jbeulich@suse.com>
To: Chao Gao <chao.gao@intel.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 12:03:44 +0200	[thread overview]
Message-ID: <131d5f04-7ef9-9a2b-3009-2a93587186ef@suse.com> (raw)
In-Reply-To: <1567069347-22841-1-git-send-email-chao.gao@intel.com>

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?

> +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.

Jan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2019-08-29 10:04 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-29  9:02 [Qemu-devel] [RFC Patch] xen/pt: Emulate FLR capability Chao Gao
2019-08-29  9:02 ` [Xen-devel] " Chao Gao
2019-08-29 10:03 ` Jan Beulich [this message]
2019-08-29 10:03   ` Jan Beulich
2019-08-29 15:22   ` [Qemu-devel] " Chao Gao
2019-08-29 15:22     ` [Xen-devel] " Chao Gao
2019-08-29 10:21 ` [Qemu-devel] " Roger Pau Monné
2019-08-29 10:21   ` [Xen-devel] " Roger Pau Monné
2019-09-06  9:01   ` [Qemu-devel] " Chao Gao
2019-09-06  9:01     ` [Xen-devel] " Chao Gao
2019-09-06  9:20     ` [Qemu-devel] " Paul Durrant
2019-09-06  9:20       ` [Xen-devel] " Paul Durrant
2019-09-06 10:28     ` [Qemu-devel] " Roger Pau Monné
2019-09-06 10:28       ` [Xen-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=131d5f04-7ef9-9a2b-3009-2a93587186ef@suse.com \
    --to=jbeulich@suse.com \
    --cc=anthony.perard@citrix.com \
    --cc=chao.gao@intel.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.