From: Igor Mammedov <imammedo@redhat.com>
To: David Woodhouse <dwmw2@infradead.org>
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
berrange@redhat.com, qemu-devel@nongnu.org,
Peter Xu <peterx@redhat.com>, Jason Wang <jasowang@redhat.com>,
Marcel Apfelbaum <marcel.apfelbaum@gmail.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Richard Henderson <richard.henderson@linaro.org>,
Marcelo Tosatti <mtosatti@redhat.com>,
kvm@vger.kernel.org, Claudio Fontana <cfontana@suse.de>,
vkuznets@redhat.com
Subject: Re: [PATCH 1/4] target/i386: Fix sanity check on max APIC ID / X2APIC enablement
Date: Thu, 17 Mar 2022 10:05:36 +0100 [thread overview]
Message-ID: <20220317100536.6ccabfe0@redhat.com> (raw)
In-Reply-To: <20220317094209.2888b431@redhat.com>
re-sending reply as something went wrong with headers (I suspect Daniel's name formatting)
and email got bounced back.
On Wed, 16 Mar 2022 14:31:33 +0000
David Woodhouse <dwmw2@infradead.org> wrote:
> On Wed, 2022-03-16 at 12:28 +0100, Igor Mammedov wrote:
> > Generally Daniel is right, as long as it's something that what real hardware
> > supports. (usually it's job if upper layers which know what guest OS is used,
> > and can tweak config based on that knowledge).
> >
> > But it's virt only extension and none (tested with
> > Windows (hangs on boot),
> > Linux (brings up only first 255 cpus)
> > ) of mainline OSes ended up up working as expected (i.e. user asked for this
> > many CPUs but can't really use them as expected).
>
> As I said, that kind of failure mode will happen even with the split
> irq chip and EXT_DEST_ID, with Windows and older (pre-5.10) Linux
> kernels.
>
> For older guests it would also happen on real hardware, and in VMs
> where you expose an IOMMU with interrupt remapping. Some guests don't
> support interrupt remapping, or don't support X2APIC at all.
>
> > Which would just lead to users reporting (obscure) bugs.
>
> It's not virt only. This could happen with real hardware.
I was talking about EXT_DEST_ID kvm extension.
With current upstream guest kernel, user gets only "bad cpu" messages
and then go figure what's wrong with configuration or
simply hangs in case of Windows.
> > Testing shows, Windows (2019 and 2004 build) doesn't work (at least with
> > just kernel-irqchip=on in current state). (CCing Vitaly, he might know
> > if Windows might work and under what conditions)
> >
> > Linux(recentish) was able to bring up all CPUs with APICID above 255
> > with 'split' irqchip and without iommu present (at least it boots to
> > command prompt).
>
> That'll be using the EXT_DEST_ID support.
>
> > What worked for both OSes (full boot), was split irqchip + iommu
> > (even without irq remapping, but I haven't tested with older guests
> > so irq remapping might be required anyways).
>
> Hm, that's surprising for Windows unless it's learned to use the
> EXT_DEST_ID support. Or maybe it *can* cope with only targeting
> external interrupts at CPUs < 255 but has a gratuitous check that
> prevents it bringing them up unless there's an IOMMU... *even* if that
> IOMMU doesn't have irq remapping anyway?
or maybe we are enabling irq remapping by default now.
I'll try to check, if guest is actually brings all CPUs up.
> Anyway, as fas as I'm concerned it doesn't matter very much whether we
> insist on the split irq chip or not. Feel free to repost your patch
> rebased on top of my fixes, which are also in my tree at
> https://git.infradead.org/users/dwmw2/qemu.git
>
> The check you're modifying has moved to x86_cpus_init().
if we are to keep iommu dependency then moving to x86_cpus_init()
isn't an option, it should be done at pc_machine_done() time.
in practice partial revert of your c1bb5418e to restore
iommu check including irq remapping.
In which case, do we still need kvm_enable_x2apic() check
you are adding here?
next prev parent reply other threads:[~2022-03-17 9:05 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-14 14:25 [PATCH 1/4] target/i386: Fix sanity check on max APIC ID / X2APIC enablement David Woodhouse
2022-03-14 14:25 ` [PATCH 2/4] intel_iommu: Support IR-only mode without DMA translation David Woodhouse
2022-03-14 15:24 ` Michael S. Tsirkin
2022-03-14 15:45 ` David Woodhouse
2022-03-14 22:27 ` Michael S. Tsirkin
2022-03-16 9:34 ` David Woodhouse
2022-03-14 16:01 ` David Woodhouse
2022-03-14 14:25 ` [PATCH 3/4] intel_iommu: Only allow interrupt remapping to be enabled if it's supported David Woodhouse
2022-03-14 14:25 ` [PATCH 4/4] intel_iommu: Fix irqchip / X2APIC configuration checks David Woodhouse
2022-03-16 9:04 ` [PATCH 1/4] target/i386: Fix sanity check on max APIC ID / X2APIC enablement Igor Mammedov
2022-03-16 9:37 ` David Woodhouse
2022-03-16 9:56 ` Michael S. Tsirkin
2022-03-16 10:37 ` David Woodhouse
2022-03-16 10:47 ` Michael S. Tsirkin
2022-03-16 11:28 ` Igor Mammedov
2022-03-16 14:31 ` David Woodhouse
[not found] ` <20220317094209.2888b431@redhat.com>
2022-03-17 9:05 ` Igor Mammedov [this message]
2022-03-17 11:13 ` David Woodhouse
2022-03-18 14:17 ` Igor Mammedov
2022-03-18 14:56 ` David Woodhouse
2022-05-13 13:37 ` Michael S. Tsirkin
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=20220317100536.6ccabfe0@redhat.com \
--to=imammedo@redhat.com \
--cc=berrange@redhat.com \
--cc=cfontana@suse.de \
--cc=dwmw2@infradead.org \
--cc=jasowang@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=marcel.apfelbaum@gmail.com \
--cc=mst@redhat.com \
--cc=mtosatti@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=vkuznets@redhat.com \
/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.