From: Sean Christopherson <seanjc@google.com>
To: Sean Christopherson <seanjc@google.com>,
Paolo Bonzini <pbonzini@redhat.com>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
Borislav Petkov <bp@alien8.de>
Subject: [PATCH 1/3] KVM: SVM: Force sev_es_host_save_area() to be inlined (for noinstr usage)
Date: Mon, 17 Jun 2024 14:04:30 -0700 [thread overview]
Message-ID: <20240617210432.1642542-2-seanjc@google.com> (raw)
In-Reply-To: <20240617210432.1642542-1-seanjc@google.com>
Force sev_es_host_save_area() to be always inlined, as it's used in the
low level VM-Enter/VM-Exit path, which is non-instrumentable.
vmlinux.o: warning: objtool: svm_vcpu_enter_exit+0xb0: call to
sev_es_host_save_area() leaves .noinstr.text section
vmlinux.o: warning: objtool: svm_vcpu_enter_exit+0xbf: call to
sev_es_host_save_area.isra.0() leaves .noinstr.text section
Fixes: c92be2fd8edf ("KVM: SVM: Save/restore non-volatile GPRs in SEV-ES VMRUN via host save area")
Reported-by: Borislav Petkov <bp@alien8.de>
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
arch/x86/kvm/svm/svm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
index 9ac6fca50cf3..0a36c82b316f 100644
--- a/arch/x86/kvm/svm/svm.c
+++ b/arch/x86/kvm/svm/svm.c
@@ -1504,7 +1504,7 @@ static void svm_vcpu_free(struct kvm_vcpu *vcpu)
__free_pages(virt_to_page(svm->msrpm), get_order(MSRPM_SIZE));
}
-static struct sev_es_save_area *sev_es_host_save_area(struct svm_cpu_data *sd)
+static __always_inline struct sev_es_save_area *sev_es_host_save_area(struct svm_cpu_data *sd)
{
return page_address(sd->save_area) + 0x400;
}
--
2.45.2.627.g7a2c4fd464-goog
next prev parent reply other threads:[~2024-06-17 21:04 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-17 21:04 [PATCH 0/3] KVM: SVM: SEV-ES save area fix+cleanups Sean Christopherson
2024-06-17 21:04 ` Sean Christopherson [this message]
2024-06-18 10:17 ` [PATCH 1/3] KVM: SVM: Force sev_es_host_save_area() to be inlined (for noinstr usage) Borislav Petkov
2024-06-17 21:04 ` [PATCH 2/3] KVM: SVM: Use sev_es_host_save_area() helper when initializing tsc_aux Sean Christopherson
2024-06-17 21:04 ` [PATCH 3/3] KVM: SVM: Use compound literal in lieu of __maybe_unused rdmsr() param Sean Christopherson
2024-06-18 10:24 ` Borislav Petkov
2024-06-18 13:44 ` Sean Christopherson
2024-06-18 13:49 ` Borislav Petkov
2024-06-28 22:55 ` [PATCH 0/3] KVM: SVM: SEV-ES save area fix+cleanups Sean Christopherson
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=20240617210432.1642542-2-seanjc@google.com \
--to=seanjc@google.com \
--cc=bp@alien8.de \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
/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
all inboxes | Powered by JetHome®