kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [V3 PATCH 0/2] Execute hypercalls from guests according to cpu
@ 2022-12-22 23:04 Vishal Annapurve
  2022-12-22 23:04 ` [V3 PATCH 1/2] KVM: selftests: x86: Cache the cpu vendor type Vishal Annapurve
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Vishal Annapurve @ 2022-12-22 23:04 UTC (permalink / raw)
  To: x86, kvm, linux-kernel, linux-kselftest
  Cc: pbonzini, shuah, bgardon, seanjc, oupton, peterx, vkuznets,
	dmatlack, pgonda, andrew.jones, Vishal Annapurve

Confidential VMs(CVMs) need to execute hypercall instruction as per the CPU
type. Normally KVM emulates the vmcall/vmmcall instruction by patching
the guest code at runtime. Such a guest memory manipulation by KVM is
not allowed with CVMs.

This series adds support of executing hypercall as per the native cpu
type queried using cpuid instruction. CPU vendor type is stored after
one time execution of cpuid instruction to be reused later.

Changes in v3:
1) Guest logic is modified to not rely on host cpu type and instead query
cpu vendor using cpuid instruction.
2) Existing callers of vmmcall/vmcall are not updated to avoid enforcing
native hypercall instruction across all users which are mostly
non-confidential usecases.

v2:
https://lore.kernel.org/all/20220915000448.1674802-1-vannapurve@google.com/

More discussion around this change:
https://lore.kernel.org/lkml/Y1Hhw40H58EmZ6lK@google.com/

Vishal Annapurve (2):
  KVM: selftests: x86: Cache the cpu vendor type
  KVM: selftests: x86: Add native hypercall support

 .../selftests/kvm/include/x86_64/processor.h  |  3 ++
 .../selftests/kvm/lib/x86_64/processor.c      | 51 +++++++++++++++++--
 2 files changed, 49 insertions(+), 5 deletions(-)

-- 
2.39.0.314.g84b9a713c41-goog


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-12-23 22:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-22 23:04 [V3 PATCH 0/2] Execute hypercalls from guests according to cpu Vishal Annapurve
2022-12-22 23:04 ` [V3 PATCH 1/2] KVM: selftests: x86: Cache the cpu vendor type Vishal Annapurve
2022-12-23  0:24   ` Sean Christopherson
2022-12-23  2:45     ` Vishal Annapurve
2022-12-22 23:04 ` [V3 PATCH 2/2] KVM: selftests: x86: Add native hypercall support Vishal Annapurve
2022-12-23  0:37   ` Sean Christopherson
2022-12-23 17:37 ` [V3 PATCH 0/2] Execute hypercalls from guests according to cpu Paolo Bonzini
2022-12-23 22:36   ` Vishal Annapurve

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).