All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vitaly Kuznetsov <vkuznets@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	qemu-devel <qemu-devel@nongnu.org>,
	Liran Alon <liran.alon@oracle.com>,
	Roman Kagan <rkagan@virtuozzo.com>,
	Richard Henderson <rth@twiddle.net>
Subject: Re: [PATCH RFC] i386/kvm: fix enlightened VMCS with fine-grained VMX feature enablement
Date: Wed, 08 Jan 2020 11:32:02 +0100	[thread overview]
Message-ID: <87a76ys0gt.fsf@vitty.brq.redhat.com> (raw)
In-Reply-To: <CABgObfYviBXJNOTrSQk6hZC5HpBW4fZL_eJGSC+vs=Fv9h40bg@mail.gmail.com>

Paolo Bonzini <pbonzini@redhat.com> writes:

> SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES
>>
>> the problem with it is that we don't have 'apic_access_addr' field in
>> eVMCS ('virtual_apic_page_addr' is there). By running the same setup
>> with eVMCS disabled I figured out which address can be hardcoded to make
>> it boot.
>>
>
> Maybe it's really hard coded (what is the value? Is it consistent across
> Hyper-V version?) Can you try changing KVM to enable it and see if the
> hardcoded APIC access address works?

Unfortunately, it's not the same even between BIOS and UEFI booted
WS2016 (Gen1/Gen2). It is, however, the same across reboot for the same
image so for example for WS2016Gen1 it is '0x294000' so if I do:

diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c
index fab7451a5793..8366b2a02b3b 100644
--- a/arch/x86/kvm/vmx/nested.c
+++ b/arch/x86/kvm/vmx/nested.c
@@ -1433,6 +1433,8 @@ static int copy_enlightened_to_vmcs12(struct vcpu_vmx *vmx)
        vmcs12->tpr_threshold = evmcs->tpr_threshold;
        vmcs12->guest_rip = evmcs->guest_rip;
 
+       vmcs12->apic_access_addr = 0x294000;

it all works. I'm really puzzled.

-- 
Vitaly



  reply	other threads:[~2020-01-08 10:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-02 20:39 [PATCH RFC] i386/kvm: fix enlightened VMCS with fine-grained VMX feature enablement Vitaly Kuznetsov
2020-01-07  8:31 ` Paolo Bonzini
2020-01-07 12:08   ` Vitaly Kuznetsov
2020-01-07 12:25     ` Paolo Bonzini
2020-01-07 18:15       ` Vitaly Kuznetsov
2020-01-07 21:23         ` Paolo Bonzini
2020-01-08 10:32           ` Vitaly Kuznetsov [this message]
2020-01-10 15:02       ` Vitaly Kuznetsov

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=87a76ys0gt.fsf@vitty.brq.redhat.com \
    --to=vkuznets@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=liran.alon@oracle.com \
    --cc=mtosatti@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rkagan@virtuozzo.com \
    --cc=rth@twiddle.net \
    /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.