From: Precific <precification@posteo.de>
To: Alex Williamson <alex.williamson@redhat.com>
Cc: Peter Xu <peterx@redhat.com>,
Athul Krishna <athul.krishna.kr@protonmail.com>,
Bjorn Helgaas <helgaas@kernel.org>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
Linux PCI <linux-pci@vger.kernel.org>,
"regressions@lists.linux.dev" <regressions@lists.linux.dev>
Subject: Re: [bugzilla-daemon@kernel.org: [Bug 219619] New: vfio-pci: screen graphics artifacts after 6.12 kernel upgrade]
Date: Wed, 1 Jan 2025 03:10:00 +0000 [thread overview]
Message-ID: <d8355707-7b81-49ef-930e-1bf7e5159f35@posteo.de> (raw)
In-Reply-To: <20241231090733.5cc5504a.alex.williamson@redhat.com>
On 31.12.24 17:07, Alex Williamson wrote:
>
> Thank you so much for your testing, this is immensely helpful! This
> all suggests to me we're dealing with an alignment issue for 1GB pages.
> We're getting 2MB alignment on the mmap by default, so that's working
> everywhere. QEMU 9.2 provides us with proper 1GB alignment, but it
> seems we need to filter alignment more strictly when that's not present.
> Please give this a try with QEMU 9.1.x and an otherwise stock v6.12.x:
>
> diff --git a/drivers/vfio/pci/vfio_pci_core.c b/drivers/vfio/pci/vfio_pci_core.c
> index 1ab58da9f38a..bdfdc8ee4c2b 100644
> --- a/drivers/vfio/pci/vfio_pci_core.c
> +++ b/drivers/vfio/pci/vfio_pci_core.c
> @@ -1661,7 +1661,8 @@ static vm_fault_t vfio_pci_mmap_huge_fault(struct vm_fault *vmf,
> unsigned long pfn, pgoff = vmf->pgoff - vma->vm_pgoff;
> vm_fault_t ret = VM_FAULT_SIGBUS;
>
> - if (order && (vmf->address & ((PAGE_SIZE << order) - 1) ||
> + if (order && (pgoff & ((1 << order) - 1) ||
> + vmf->address & ((PAGE_SIZE << order) - 1) ||
> vmf->address + (PAGE_SIZE << order) > vma->vm_end)) {
> ret = VM_FAULT_FALLBACK;
> goto out;
>
>
> Thanks,
> Alex
>
Thank you, that does the trick. In my tests with your patch, the
order=18 huge_faults from QEMU 9.1.2 all fall back to order=9 (in one
case, even with pgoff=0, likely from the vmf->address check), while
those from QEMU 9.2.0 succeed as before.
My Windows VM also is happy with the patched kernel 6.12.4 and QEMU
9.1.2 so far.
For completeness' sake, here are the host logs with the patch applied,
booting a Linux guest: https://bugzilla.kernel.org/show_bug.cgi?id=219619#c4
Thanks and Best wishes for the new year,
Precific
next prev parent reply other threads:[~2025-01-01 3:19 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-22 22:36 [bugzilla-daemon@kernel.org: [Bug 219619] New: vfio-pci: screen graphics artifacts after 6.12 kernel upgrade] Bjorn Helgaas
2024-12-23 7:37 ` Athul Krishna
2024-12-23 16:59 ` Peter Xu
2024-12-23 18:15 ` Alex Williamson
2024-12-24 18:06 ` Athul Krishna
2024-12-30 21:03 ` Precific
2024-12-31 1:27 ` Alex Williamson
2024-12-31 15:44 ` Precific
2024-12-31 16:07 ` Alex Williamson
2025-01-01 3:10 ` Precific [this message]
2025-01-02 16:39 ` Peter Xu
2025-01-02 17:04 ` Alex Williamson
2025-01-02 18:38 ` Alex Williamson
2025-02-25 17:59 ` Bjorn Helgaas
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=d8355707-7b81-49ef-930e-1bf7e5159f35@posteo.de \
--to=precification@posteo.de \
--cc=alex.williamson@redhat.com \
--cc=athul.krishna.kr@protonmail.com \
--cc=helgaas@kernel.org \
--cc=kvm@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=peterx@redhat.com \
--cc=regressions@lists.linux.dev \
/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