From: Peter Xu <peterx@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Michael S . Tsirkin" <mst@redhat.com>,
Eduardo Habkost <ehabkost@redhat.com>,
Igor Mammedov <imammedo@redhat.com>,
peterx@redhat.com, Paolo Bonzini <pbonzini@redhat.com>
Subject: [Qemu-devel] [PATCH 4/4] x86-iommu: turn on IR by default if proper
Date: Wed, 19 Dec 2018 16:50:38 +0800 [thread overview]
Message-ID: <20181219085038.7729-5-peterx@redhat.com> (raw)
In-Reply-To: <20181219085038.7729-1-peterx@redhat.com>
When the user didn't specify "intremap" for the IOMMU device, we turn
it on by default if it is supported. This will turn IR on for the
default Q35 platform as long as the IOMMU device is specified on new
kernels.
Signed-off-by: Peter Xu <peterx@redhat.com>
---
hw/i386/x86-iommu.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/hw/i386/x86-iommu.c b/hw/i386/x86-iommu.c
index 61ee0f1eaa..d1534c1ae0 100644
--- a/hw/i386/x86-iommu.c
+++ b/hw/i386/x86-iommu.c
@@ -112,6 +112,7 @@ static void x86_iommu_realize(DeviceState *dev, Error **errp)
PCMachineState *pcms =
PC_MACHINE(object_dynamic_cast(OBJECT(ms), TYPE_PC_MACHINE));
QLIST_INIT(&x86_iommu->iec_notifiers);
+ bool irq_all_kernel = kvm_irqchip_in_kernel() && !kvm_irqchip_is_split();
if (!pcms || !pcms->bus) {
error_setg(errp, "Machine-type '%s' not supported by IOMMU",
@@ -121,12 +122,12 @@ static void x86_iommu_realize(DeviceState *dev, Error **errp)
/* If the user didn't specify IR, choose a default value for it */
if (x86_iommu->intr_supported == ON_OFF_AUTO_AUTO) {
- x86_iommu->intr_supported = ON_OFF_AUTO_OFF;
+ x86_iommu->intr_supported = irq_all_kernel ?
+ ON_OFF_AUTO_OFF : ON_OFF_AUTO_ON;
}
/* Both Intel and AMD IOMMU IR only support "kernel-irqchip={off|split}" */
- if (x86_iommu_ir_supported(x86_iommu) && kvm_irqchip_in_kernel() &&
- !kvm_irqchip_is_split()) {
+ if (x86_iommu_ir_supported(x86_iommu) && irq_all_kernel) {
error_setg(errp, "Interrupt Remapping cannot work with "
"kernel-irqchip=on, please use 'split|off'.");
return;
--
2.17.1
prev parent reply other threads:[~2018-12-19 8:51 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-19 8:50 [Qemu-devel] [PATCH 0/4] q35: change defaults for kernel irqchip and IR Peter Xu
2018-12-19 8:50 ` [Qemu-devel] [PATCH 1/4] kvm: let split be optional for kvm_arch_irqchip_create Peter Xu
2018-12-19 15:53 ` Michael S. Tsirkin
2018-12-19 20:15 ` Paolo Bonzini
2018-12-19 8:50 ` [Qemu-devel] [PATCH 2/4] q35: set split kernel irqchip as default Peter Xu
2018-12-19 15:52 ` Michael S. Tsirkin
2018-12-19 20:16 ` Paolo Bonzini
2018-12-19 20:12 ` Paolo Bonzini
2018-12-19 21:24 ` Eduardo Habkost
2018-12-19 21:45 ` Paolo Bonzini
2018-12-20 5:31 ` Peter Xu
2018-12-19 8:50 ` [Qemu-devel] [PATCH 3/4] x86-iommu: switch intr_supported to OnOffAuto type Peter Xu
2018-12-19 8:50 ` Peter Xu [this message]
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=20181219085038.7729-5-peterx@redhat.com \
--to=peterx@redhat.com \
--cc=ehabkost@redhat.com \
--cc=imammedo@redhat.com \
--cc=mst@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).