From: Paolo Bonzini <pbonzini@redhat.com>
To: Chen Fan <chen.fan.fnst@cn.fujitsu.com>, qemu-devel@nongnu.org
Cc: Alex Williamson <alex.williamson@redhat.com>
Subject: Re: [Qemu-devel] [RFC PATCH 3/4] vfio-pci: add aer capability support
Date: Mon, 12 Jan 2015 14:14:48 +0100 [thread overview]
Message-ID: <54B3C8C8.20502@redhat.com> (raw)
In-Reply-To: <1e75bc42628775555cabe140c8438af0093d4ead.1421028274.git.chen.fan.fnst@cn.fujitsu.com>
On 12/01/2015 04:04, Chen Fan wrote:
> +static int vfio_add_ext_capabilities(VFIOPCIDevice *vdev)
> +{
> + PCIDevice *pdev = &vdev->pdev;
> + PCIExpressDevice *exp;
> + uint32_t header;
> + uint16_t next = PCI_CONFIG_SPACE_SIZE;
> +
> + if (pci_config_size(pdev) <= PCI_CONFIG_SPACE_SIZE) {
> + return 0;
> + }
> +
> + header = pci_get_long(pdev->config + next);
> + while (header) {
> + switch (PCI_EXT_CAP_ID(header)) {
> + case PCI_EXT_CAP_ID_ERR:
> + exp = &pdev->exp;
> + exp->aer_cap = next;
> +
> + /* enable the error report */
> + vfio_add_emulated_long(vdev, exp->exp_cap + PCI_EXP_DEVCTL,
> + PCI_EXP_DEVCTL_CERE | PCI_EXP_DEVCTL_NFERE |
> + PCI_EXP_DEVCTL_FERE | PCI_EXP_DEVCTL_URRE, ~0);
> + break;
> + };
> +
> + next = PCI_EXT_CAP_NEXT(header);
> + if (!next) {
> + return 0;
> + }
> + header = pci_get_long(pdev->config + next);
> + }
> +
> + return 0;
> +}
> +
Please add a property to the VFIO device, defaulting to true, and
disable it for older machine types.
Paolo
next prev parent reply other threads:[~2015-01-12 13:14 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-12 3:04 [Qemu-devel] [RFC PATCH 0/4] pass aer error to guest Chen Fan
2015-01-12 3:04 ` [Qemu-devel] [RFC PATCH 1/4] pcie_aer: fix typos in pcie_aer_inject_error comment Chen Fan
2015-01-12 3:04 ` [Qemu-devel] [RFC PATCH 2/4] pcie-aer: Fix command pcie_aer_inject_error is invalid Chen Fan
2015-01-12 13:56 ` Marcel Apfelbaum
2015-01-15 6:54 ` Chen Fan
2015-01-16 7:56 ` Chen Fan
2015-01-21 9:56 ` Chen Fan
2015-01-21 16:32 ` Marcel Apfelbaum
2015-01-12 3:04 ` [Qemu-devel] [RFC PATCH 3/4] vfio-pci: add aer capability support Chen Fan
2015-01-12 13:14 ` Paolo Bonzini [this message]
2015-01-15 8:45 ` Chen Fan
2015-01-12 15:26 ` Alex Williamson
2015-01-15 8:40 ` Chen Fan
2015-01-12 3:04 ` [Qemu-devel] [RFC PATCH 4/4] vfio-pci: pass the aer error to guest Chen Fan
2015-01-12 15:24 ` Alex Williamson
2015-01-28 8:51 ` Chen Fan
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=54B3C8C8.20502@redhat.com \
--to=pbonzini@redhat.com \
--cc=alex.williamson@redhat.com \
--cc=chen.fan.fnst@cn.fujitsu.com \
--cc=qemu-devel@nongnu.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).