From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
"Jürgen Groß" <jgross@suse.com>,
xen-devel@lists.xenproject.org
Subject: Re: [PATCH v3 3/3] x86/dom0: be less restrictive with the Interrupt Address Range
Date: Thu, 20 Feb 2025 09:55:33 +0100 [thread overview]
Message-ID: <Z7buBc4yLtf-UpmB@macbook.local> (raw)
In-Reply-To: <1e8ef6d3-09db-4d53-b7c8-4b10a7f5d8f0@suse.com>
On Thu, Feb 20, 2025 at 09:33:46AM +0100, Jan Beulich wrote:
> On 19.02.2025 17:48, Roger Pau Monne wrote:
> > Xen currently prevents dom0 from creating CPU or IOMMU page-table mappings
> > into the interrupt address range [0xfee00000, 0xfeefffff]. This range has
> > two different purposes. For accesses from the CPU is contains the default
> > position of local APIC page at 0xfee00000. For accesses from devices
> > it's the MSI address range, so the address field in the MSI entries
> > (usually) point to an address on that range to trigger an interrupt.
> >
> > There are reports of Lenovo Thinkpad devices placing what seems to be the
> > UCSI shared mailbox at address 0xfeec2000 in the interrupt address range.
> > Attempting to use that device with a Linux PV dom0 leads to an error when
> > Linux kernel maps 0xfeec2000:
> >
> > RIP: e030:xen_mc_flush+0x1e8/0x2b0
> > xen_leave_lazy_mmu+0x15/0x60
> > vmap_range_noflush+0x408/0x6f0
> > __ioremap_caller+0x20d/0x350
> > acpi_os_map_iomem+0x1a3/0x1c0
> > acpi_ex_system_memory_space_handler+0x229/0x3f0
> > acpi_ev_address_space_dispatch+0x17e/0x4c0
> > acpi_ex_access_region+0x28a/0x510
> > acpi_ex_field_datum_io+0x95/0x5c0
> > acpi_ex_extract_from_field+0x36b/0x4e0
> > acpi_ex_read_data_from_field+0xcb/0x430
> > acpi_ex_resolve_node_to_value+0x2e0/0x530
> > acpi_ex_resolve_to_value+0x1e7/0x550
> > acpi_ds_evaluate_name_path+0x107/0x170
> > acpi_ds_exec_end_op+0x392/0x860
> > acpi_ps_parse_loop+0x268/0xa30
> > acpi_ps_parse_aml+0x221/0x5e0
> > acpi_ps_execute_method+0x171/0x3e0
> > acpi_ns_evaluate+0x174/0x5d0
> > acpi_evaluate_object+0x167/0x440
> > acpi_evaluate_dsm+0xb6/0x130
> > ucsi_acpi_dsm+0x53/0x80
> > ucsi_acpi_read+0x2e/0x60
> > ucsi_register+0x24/0xa0
> > ucsi_acpi_probe+0x162/0x1e3
> > platform_probe+0x48/0x90
> > really_probe+0xde/0x340
> > __driver_probe_device+0x78/0x110
> > driver_probe_device+0x1f/0x90
> > __driver_attach+0xd2/0x1c0
> > bus_for_each_dev+0x77/0xc0
> > bus_add_driver+0x112/0x1f0
> > driver_register+0x72/0xd0
> > do_one_initcall+0x48/0x300
> > do_init_module+0x60/0x220
> > __do_sys_init_module+0x17f/0x1b0
> > do_syscall_64+0x82/0x170
> >
> > Remove the restrictions to create mappings the interrupt address range for
>
> Nit: Missing "in"?
Indeed, thanks for spotting.
> > dom0. Note that the restriction to map the local APIC page is enforced
> > separately, and that continues to be present. Additionally make sure the
> > emulated local APIC page is also not mapped, in case dom0 is using it.
>
> But that's in GFN space, not in MFN one. Why would that matter for iomem_caps?
It's required to avoid arch_iommu_hwdom_init() creating an identity
mapping for APIC_DEFAULT_PHYS_BASE, which would prevent the local APIC
emulation from being used.
Note that mp_lapic_addr can be zeor if the host local APICs are
started in x2APIC mode, or it could (in theory) contain an address
different than APIC_DEFAULT_PHYS_BASE.
Thanks, Roger.
next prev parent reply other threads:[~2025-02-20 8:55 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-19 16:48 [PATCH v3 0/3] x86/dom0: be less restrictive with the Interrupt Address Range Roger Pau Monne
2025-02-19 16:48 ` [PATCH v3 1/3] x86/dom0: correctly set the maximum ->iomem_caps bound for PVH Roger Pau Monne
2025-02-20 8:22 ` Jan Beulich
2025-02-20 8:49 ` Roger Pau Monné
2025-02-20 13:02 ` Jan Beulich
2025-02-19 16:48 ` [PATCH v3 2/3] x86/iommu: account for IOMEM caps when populating dom0 IOMMU page-tables Roger Pau Monne
2025-02-20 8:29 ` Jan Beulich
2025-02-19 16:48 ` [PATCH v3 3/3] x86/dom0: be less restrictive with the Interrupt Address Range Roger Pau Monne
2025-02-20 8:33 ` Jan Beulich
2025-02-20 8:55 ` Roger Pau Monné [this message]
2025-02-20 13:30 ` Jan Beulich
2025-02-20 15:40 ` Roger Pau Monné
2025-02-20 16:05 ` Jan Beulich
2025-02-20 16:16 ` Roger Pau Monné
2025-03-05 14:27 ` [PATCH v3 0/3] " Jan Beulich
2025-03-05 14:35 ` Roger Pau Monné
2025-03-05 14:54 ` Jan Beulich
2025-03-05 17:42 ` Roger Pau Monné
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=Z7buBc4yLtf-UpmB@macbook.local \
--to=roger.pau@citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=jbeulich@suse.com \
--cc=jgross@suse.com \
--cc=xen-devel@lists.xenproject.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 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.