From: Dmitry Osipenko <dmitry.osipenko@collabora.com>
To: ~myrslint <myrskylintu@proton.me>, qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>, Gerd Hoffmann <kraxel@redhat.com>
Subject: Re: [PATCH qemu v6 1/1] Honor guest PAT on x86, absent Bochs display
Date: Tue, 14 Oct 2025 03:59:16 +0300 [thread overview]
Message-ID: <9eaadef8-2fa7-4fb0-aeff-9842a75c3804@collabora.com> (raw)
In-Reply-To: <176006500714.5527.9159197863408802401-1@git.sr.ht>
Hi,
On 10/10/25 05:43, ~myrslint wrote:
> From: myrslint <qemu.haziness801@passinbox.com>
>
> On x86_64, where most CPUs support self-snoop, it is preferrable to
> always honor guest PAT. Not doing so is a quirk. There is a default
> enabled KVM quirk flag which enforces not doing so due to a former bug
> in Bochs display driver.
>
> The bug has been fixed but not enough has yet passed since so we only
> disable said quirk flag if a Bochs display is not configured for the
> virtual machine.
>
> This commit also moves around a bit of code that would be called when
> the initialization of a VM is done.
>
> Signed-off-by: myrslint <qemu.haziness801@passinbox.com>
> ---
> accel/kvm/kvm-all.c | 1 +
> accel/stubs/kvm-stub.c | 1 +
> hw/display/bochs-display.c | 5 +++++
> include/system/kvm.h | 9 ++++++++
> target/i386/kvm/kvm.c | 42 +++++++++++++++++++++++++++++++-------
> 5 files changed, 51 insertions(+), 7 deletions(-)
>
...
> +#include "system/kvm.h"
> +
> typedef struct BochsDisplayMode {
> pixman_format_code_t format;
> uint32_t bytepp;
> @@ -261,6 +263,7 @@ static const GraphicHwOps bochs_display_gfx_ops = {
> .gfx_update = bochs_display_update,
> };
>
> +
Nit: please remove the extra newline
> static void bochs_display_realize(PCIDevice *dev, Error **errp)
> {
> BochsDisplayState *s = BOCHS_DISPLAY(dev);
> @@ -309,6 +312,8 @@ static void bochs_display_realize(PCIDevice *dev, Error **errp)
> }
>
> memory_region_set_log(&s->vram, true, DIRTY_MEMORY_VGA);
> +
> + kvm_bochs_drm = true;
The patch looks good, only minor suggestions from me:
1. rename kvm_bochs_drm -> kvm_bochs_drm_quirk for more clarity
2. add clarifying comment to the code explaining what this quirk does
and why it's needed, basically repeating the commit msg
...
> +static void handle_machine_done(Notifier *n, void *unused)
> +{
> + if (kvm_x86_smm_enabled()) {
> + register_smram_listener();
> + }
> + if (!kvm_has_bochs_drm() && \
> + (kvm_x86_disable_quirsk2_mask() & KVM_X86_QUIRK_IGNORE_GUEST_PAT)) {
> + if (kvm_disable_ignore_guest_pat()) {
> + error_report("KVM_X86_QUIRK_IGNORE_GUEST_PAT available and "
> + "modifiable but we failed to disable it\n");
Nit: the extra "\n" shouldn't be needed for error_report()
--
Best regards,
Dmitry
prev parent reply other threads:[~2025-10-14 1:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-10 2:56 [PATCH qemu v6 0/1] Honor guest PAT on x86, absent Bochs display ~myrslint
2025-10-10 2:43 ` [PATCH qemu v6 1/1] " ~myrslint
2025-10-14 0:59 ` Dmitry Osipenko [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=9eaadef8-2fa7-4fb0-aeff-9842a75c3804@collabora.com \
--to=dmitry.osipenko@collabora.com \
--cc=kraxel@redhat.com \
--cc=myrskylintu@proton.me \
--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).