From: Paolo Bonzini <pbonzini@redhat.com>
To: Peter Xu <peterx@redhat.com>, qemu-devel@nongnu.org
Cc: "Michael S . Tsirkin" <mst@redhat.com>,
Marcel Apfelbaum <marcel@redhat.com>,
Markus Armbruster <armbru@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2 0/2] Edu leak fix series
Date: Wed, 31 May 2017 14:55:59 +0200 [thread overview]
Message-ID: <0d2dd83c-6a57-9617-087a-c57e64a667cd@redhat.com> (raw)
In-Reply-To: <20170531095023.GL14845@pxdev.xzpeter.org>
On 31/05/2017 11:50, Peter Xu wrote:
> On Wed, May 31, 2017 at 05:42:34PM +0800, Peter Xu wrote:
>> A whitelist for it does not really makes sense. Let's remove it and
>> then we can introduce a blacklist when really needed, with msi_broken.
>> That's patch 1.
> Ok this paragraph does not make sense if not mentioning what's "it"...
>
> Please just read the commit messages of patch 1. It should be much
> better.
I think fixing the leak in case we have to reintroduce msi_(non)broken should
be as simple as
diff --git a/hw/misc/edu.c b/hw/misc/edu.c
index 401039c100..01acacf142 100644
--- a/hw/misc/edu.c
+++ b/hw/misc/edu.c
@@ -343,6 +343,12 @@ static void pci_edu_realize(PCIDevice *pdev, Error **errp)
EduState *edu = DO_UPCAST(EduState, pdev, pdev);
uint8_t *pci_conf = pdev->config;
+ pci_config_set_interrupt_pin(pci_conf, 1);
+
+ if (msi_init(pdev, 0, 1, true, false, errp)) {
+ return;
+ }
+
timer_init_ms(&edu->dma_timer, QEMU_CLOCK_VIRTUAL, edu_dma_timer, edu);
qemu_mutex_init(&edu->thr_mutex);
@@ -350,12 +356,6 @@ static void pci_edu_realize(PCIDevice *pdev, Error **errp)
qemu_thread_create(&edu->thread, "edu", edu_fact_thread,
edu, QEMU_THREAD_JOINABLE);
- pci_config_set_interrupt_pin(pci_conf, 1);
-
- if (msi_init(pdev, 0, 1, true, false, errp)) {
- return;
- }
-
memory_region_init_io(&edu->mmio, OBJECT(edu), &edu_mmio_ops, edu,
"edu-mmio", 1 << 20);
pci_register_bar(pdev, 0, PCI_BASE_ADDRESS_SPACE_MEMORY, &edu->mmio);
Then the two patches can be even squashed together.
Paolo
next prev parent reply other threads:[~2017-05-31 12:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-31 9:42 [Qemu-devel] [PATCH v2 0/2] Edu leak fix series Peter Xu
2017-05-31 9:42 ` [Qemu-devel] [PATCH v2 1/2] msi: remove msi_nonbroken Peter Xu
2017-05-31 9:42 ` [Qemu-devel] [PATCH v2 2/2] msi: remove return code for msi_init() Peter Xu
2017-05-31 9:50 ` [Qemu-devel] [PATCH v2 0/2] Edu leak fix series Peter Xu
2017-05-31 12:55 ` Paolo Bonzini [this message]
2017-06-01 3:10 ` Peter Xu
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=0d2dd83c-6a57-9617-087a-c57e64a667cd@redhat.com \
--to=pbonzini@redhat.com \
--cc=armbru@redhat.com \
--cc=marcel@redhat.com \
--cc=mst@redhat.com \
--cc=peterx@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).