From: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
To: Paolo Bonzini <pbonzini@redhat.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: Thu, 15 Jan 2015 16:45:08 +0800 [thread overview]
Message-ID: <54B77E14.7060104@cn.fujitsu.com> (raw)
In-Reply-To: <54B3C8C8.20502@redhat.com>
On 01/12/2015 09:14 PM, Paolo Bonzini wrote:
>
> 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.
Thanks for your suggestion.
Chen
>
> Paolo
>
next prev parent reply other threads:[~2015-01-15 8:51 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
2015-01-15 8:45 ` Chen Fan [this message]
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=54B77E14.7060104@cn.fujitsu.com \
--to=chen.fan.fnst@cn.fujitsu.com \
--cc=alex.williamson@redhat.com \
--cc=pbonzini@redhat.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).