From: Sean Christopherson <seanjc@google.com>
To: Michael Roth <michael.roth@amd.com>
Cc: kvm@vger.kernel.org, Paolo Bonzini <pbonzini@redhat.com>,
Andy Lutomirski <luto@amacapital.net>,
Vitaly Kuznetsov <vkuznets@redhat.com>,
Wanpeng Li <wanpengli@tencent.com>,
Jim Mattson <jmattson@google.com>, Joerg Roedel <joro@8bytes.org>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
x86@kernel.org, "H . Peter Anvin" <hpa@zytor.com>,
linux-kernel@vger.kernel.org,
Tom Lendacky <thomas.lendacky@amd.com>
Subject: Re: [PATCH v4 1/3] KVM: SVM: use vmsave/vmload for saving/restoring additional host state
Date: Tue, 2 Feb 2021 16:38:02 -0800 [thread overview]
Message-ID: <YBnwaiy8L/O0PCrR@google.com> (raw)
In-Reply-To: <20210202190126.2185715-2-michael.roth@amd.com>
One quick comment while it's on my mind, I'll give this a proper gander tomorrow.
On Tue, Feb 02, 2021, Michael Roth wrote:
> diff --git a/arch/x86/kvm/svm/svm_ops.h b/arch/x86/kvm/svm/svm_ops.h
> index 0c8377aee52c..c2a05f56c8e4 100644
> --- a/arch/x86/kvm/svm/svm_ops.h
> +++ b/arch/x86/kvm/svm/svm_ops.h
> @@ -56,4 +56,9 @@ static inline void vmsave(hpa_t pa)
> svm_asm1(vmsave, "a" (pa), "memory");
> }
>
> +static inline void vmload(hpa_t pa)
This needs to be 'unsigned long', using 'hpa_t' in vmsave() is wrong as the
instructions consume rAX based on effective address. I wrote the function
comment for the vmsave() fix so that it applies to both VMSAVE and VMLOAD,
so this can be a simple fixup on application (assuming v5 isn't needed for
other reasons).
https://lkml.kernel.org/r/20210202223416.2702336-1-seanjc@google.com
> +{
> + svm_asm1(vmload, "a" (pa), "memory");
> +}
> +
> #endif /* __KVM_X86_SVM_OPS_H */
> --
> 2.25.1
>
next prev parent reply other threads:[~2021-02-03 0:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-02 19:01 [PATCH v4 0/3] KVM: SVM: Refactor vcpu_load/put to use vmload/vmsave for host state Michael Roth
2021-02-02 19:01 ` [PATCH v4 1/3] KVM: SVM: use vmsave/vmload for saving/restoring additional " Michael Roth
2021-02-03 0:38 ` Sean Christopherson [this message]
2021-02-03 8:04 ` Paolo Bonzini
2021-02-02 19:01 ` [PATCH v4 2/3] KVM: SVM: remove uneeded fields from host_save_users_msrs Michael Roth
2021-02-02 19:01 ` [PATCH v4 3/3] KVM: SVM: use .prepare_guest_switch() to handle CPU register save/setup Michael Roth
2021-02-03 8:10 ` [PATCH v4 0/3] KVM: SVM: Refactor vcpu_load/put to use vmload/vmsave for host state Paolo Bonzini
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=YBnwaiy8L/O0PCrR@google.com \
--to=seanjc@google.com \
--cc=bp@alien8.de \
--cc=hpa@zytor.com \
--cc=jmattson@google.com \
--cc=joro@8bytes.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=michael.roth@amd.com \
--cc=mingo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=tglx@linutronix.de \
--cc=thomas.lendacky@amd.com \
--cc=vkuznets@redhat.com \
--cc=wanpengli@tencent.com \
--cc=x86@kernel.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.