From: "Michael S. Tsirkin" <mst@redhat.com>
To: BALATON Zoltan <balaton@eik.bme.hu>
Cc: qemu-block@nongnu.org, John Snow <jsnow@redhat.com>,
Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>,
qemu-devel@nongnu.org,
Aleksandar Markovic <amarkovic@wavecomp.com>,
philmd@redhat.com, Artyom Tarasenko <atar4qemu@gmail.com>,
Richard Henderson <rth@twiddle.net>
Subject: Re: [PATCH v4 3/4] pci: Honour wmask when resetting PCI_INTERRUPT_LINE
Date: Tue, 10 Mar 2020 17:18:54 -0400 [thread overview]
Message-ID: <20200310171802-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <5e372f6a73d4f45c0c18a264e986c29fc075f2d4.1583867210.git.balaton@eik.bme.hu>
On Tue, Mar 10, 2020 at 08:06:50PM +0100, BALATON Zoltan wrote:
> The pci_do_device_reset() function (called from pci_device_reset)
> clears the PCI_INTERRUPT_LINE config reg of devices on the bus but did
> this without taking wmask into account. We'll have a device model now
> that needs to set a constant value for this reg and this patch allows
> to do that without additional workaround in device emulation to
> reverse the effect of this PCI bus reset function.
>
> Suggested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Looks ok to me
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Feel free to merge with the rest of the series.
> ---
> hw/pci/pci.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/hw/pci/pci.c b/hw/pci/pci.c
> index e1ed6677e1..b5bc842fac 100644
> --- a/hw/pci/pci.c
> +++ b/hw/pci/pci.c
> @@ -302,8 +302,11 @@ static void pci_do_device_reset(PCIDevice *dev)
> pci_word_test_and_clear_mask(dev->config + PCI_STATUS,
> pci_get_word(dev->wmask + PCI_STATUS) |
> pci_get_word(dev->w1cmask + PCI_STATUS));
> + /* Some devices make bits of PCI_INTERRUPT_LINE read only */
> + pci_byte_test_and_clear_mask(dev->config + PCI_INTERRUPT_LINE,
> + pci_get_word(dev->wmask + PCI_INTERRUPT_LINE) |
> + pci_get_word(dev->w1cmask + PCI_INTERRUPT_LINE));
> dev->config[PCI_CACHE_LINE_SIZE] = 0x0;
> - dev->config[PCI_INTERRUPT_LINE] = 0x0;
> for (r = 0; r < PCI_NUM_REGIONS; ++r) {
> PCIIORegion *region = &dev->io_regions[r];
> if (!region->size) {
> --
> 2.21.1
next prev parent reply other threads:[~2020-03-10 21:20 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-10 19:06 [PATCH v4 0/4] Implement "non 100% native mode" in via-ide BALATON Zoltan
2020-03-10 19:06 ` [PATCH v4 4/4] via-ide: Also emulate non 100% native mode BALATON Zoltan
2020-03-11 21:10 ` Mark Cave-Ayland
2020-03-11 21:50 ` BALATON Zoltan
2020-03-10 19:06 ` [PATCH v4 1/4] ide/via: Get rid of via_init_ide() BALATON Zoltan
2020-03-10 23:14 ` BALATON Zoltan
2020-03-11 20:59 ` Mark Cave-Ayland
2020-03-10 19:06 ` [PATCH v4 3/4] pci: Honour wmask when resetting PCI_INTERRUPT_LINE BALATON Zoltan
2020-03-10 21:18 ` Michael S. Tsirkin [this message]
2020-03-11 20:58 ` Mark Cave-Ayland
2020-03-10 19:06 ` [PATCH v4 2/4] ide: Make room for flags in PCIIDEState and add one for legacy IRQ routing BALATON Zoltan
2020-03-10 22:39 ` [PATCH v4 0/4] Implement "non 100% native mode" in via-ide no-reply
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=20200310171802-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=amarkovic@wavecomp.com \
--cc=atar4qemu@gmail.com \
--cc=balaton@eik.bme.hu \
--cc=jsnow@redhat.com \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=philmd@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
/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.