qemu-devel.nongnu.org archive mirror
 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


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

Thread overview: 7+ 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 10:03 ` Jan Beulich [this message]
2019-08-29 15:22   ` Chao Gao
2019-08-29 10:21 ` Roger Pau Monné
2019-09-06  9:01   ` Chao Gao
2019-09-06  9:20     ` Paul Durrant
2019-09-06 10:28     ` 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 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).