All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Isaku Yamahata <yamahata@valinux.co.jp>
Cc: skandasa@cisco.com, etmartin@cisco.com, qemu-devel@nongnu.org,
	wexu2@cisco.com
Subject: [Qemu-devel] Re: [PATCH] pci: make command SERR bit writable
Date: Thu, 2 Dec 2010 21:32:12 +0200	[thread overview]
Message-ID: <20101202193212.GA8950@redhat.com> (raw)
In-Reply-To: <63c89a2034c16abf58608f6db5a1229697813fea.1290772846.git.yamahata@valinux.co.jp>

On Fri, Nov 26, 2010 at 09:01:41PM +0900, Isaku Yamahata wrote:
> pcie aer wants SERR bit to be writable.
> So make it writable. For compatibility, introduce compat global property
> command_serr_enable and don't make it writable when pre 0.14 pc machine.
> 
> Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>

Applied on my branch, after fixing a typo
and some conflicts, but I dont see
b1d6dd8ce83e1430b7b0e98c898499a966464227 upstream.

> ---
> This patch depends on b1d6dd8ce83e1430b7b0e98c898499a966464227
> which is in upstream, but it isn't in pci branch.
> ---
>  hw/pc_piix.c |   20 ++++++++++++++++++++
>  hw/pci.c     |    5 +++++
>  hw/pci.h     |    4 ++++
>  3 files changed, 29 insertions(+), 0 deletions(-)
> 
> diff --git a/hw/pc_piix.c b/hw/pc_piix.c
> index e17e878..2994476 100644
> --- a/hw/pc_piix.c
> +++ b/hw/pc_piix.c
> @@ -225,6 +225,14 @@ static QEMUMachine pc_machine_v0_13 = {
>      .desc = "Standard PC",
>      .init = pc_init_pci,
>      .max_cpus = 255,
> +    .compat_props = (GlobalProperty[]) {
> +        {
> +            .driver   = "PCI",
> +            .property = "command_serr_enable",
> +            .value    = "off",
> +        },
> +        { /* end of list */ }
> +    }
>  };
>  
>  static QEMUMachine pc_machine_v0_12 = {
> @@ -241,6 +249,10 @@ static QEMUMachine pc_machine_v0_12 = {
>              .driver   = "virtio-serial-pci",
>              .property = "vectors",
>              .value    = stringify(0),
> +        },{
> +            .driver   = "PCI",
> +            .property = "command_serr_enable",
> +            .value    = "off",
>          },
>          { /* end of list */ }
>      }
> @@ -276,6 +288,10 @@ static QEMUMachine pc_machine_v0_11 = {
>              .driver   = "PCI",
>              .property = "rombar",
>              .value    = stringify(0),
> +        },{
> +            .driver   = "PCI",
> +            .property = "command_serr_enable",
> +            .value    = "off",
>          },
>          { /* end of list */ }
>      }
> @@ -323,6 +339,10 @@ static QEMUMachine pc_machine_v0_10 = {
>              .driver   = "PCI",
>              .property = "rombar",
>              .value    = stringify(0),
> +        },{
> +            .driver   = "PCI",
> +            .property = "command_serr_enable",
> +            .value    = "off",
>          },
>          { /* end of list */ }
>      },
> diff --git a/hw/pci.c b/hw/pci.c
> index d02f980..6b7e63c 100644
> --- a/hw/pci.c
> +++ b/hw/pci.c
> @@ -57,6 +57,8 @@ struct BusInfo pci_bus_info = {
>          DEFINE_PROP_UINT32("rombar",  PCIDevice, rom_bar, 1),
>          DEFINE_PROP_BIT("multifunction", PCIDevice, cap_present,
>                          QEMU_PCI_CAP_MULTIFUNCTION_BITNR, false),
> +        DEFINE_PROP_BIT("command_serr_enable", PCIDevice, cap_present,
> +                        QEMU_PCI_CAP_SERR_BITNR, true),
>          DEFINE_PROP_END_OF_LIST()
>      }
>  };
> @@ -568,6 +570,9 @@ static void pci_init_wmask(PCIDevice *dev)
>      pci_set_word(dev->wmask + PCI_COMMAND,
>                   PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER |
>                   PCI_COMMAND_INTX_DISABLE);
> +    if (dev->cap_present & QEMU_PCI_CAP_SERR) {
> +        pci_word_test_and_set_mask(dev->wmask + PCI_COMMAND, PCI_COMMAND_SERR);
> +    }
>  
>      memset(dev->wmask + PCI_CONFIG_HEADER_SIZE, 0xff,
>             config_size - PCI_CONFIG_HEADER_SIZE);
> diff --git a/hw/pci.h b/hw/pci.h
> index 89f7b76..e20ac36 100644
> --- a/hw/pci.h
> +++ b/hw/pci.h
> @@ -118,6 +118,10 @@ enum {
>      /* multifunction capable device */
>  #define QEMU_PCI_CAP_MULTIFUNCTION_BITNR        3
>      QEMU_PCI_CAP_MULTIFUNCTION = (1 << QEMU_PCI_CAP_MULTIFUNCTION_BITNR),
> +
> +    /* enable comman register SERR bit */
> +#define QEMU_PCI_CAP_SERR_BITNR 4
> +    QEMU_PCI_CAP_SERR = (1 << QEMU_PCI_CAP_SERR_BITNR),
>  };
>  
>  struct PCIDevice {
> -- 
> 1.7.1.1

  reply	other threads:[~2010-12-02 19:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-26 12:01 [Qemu-devel] [PATCH] pci: make command SERR bit writable Isaku Yamahata
2010-12-02 19:32 ` Michael S. Tsirkin [this message]
2010-12-07  5:00   ` [Qemu-devel] " Isaku Yamahata

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=20101202193212.GA8950@redhat.com \
    --to=mst@redhat.com \
    --cc=etmartin@cisco.com \
    --cc=qemu-devel@nongnu.org \
    --cc=skandasa@cisco.com \
    --cc=wexu2@cisco.com \
    --cc=yamahata@valinux.co.jp \
    /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.