lkml.org 
[lkml]   [2020]   [Dec]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH RFC 02/39] KVM: x86/xen: intercept xen hypercalls if enabled
From
Date
On 2020-12-02 12:03 a.m., David Woodhouse wrote:
> On Tue, 2020-12-01 at 21:19 -0800, Ankur Arora wrote:
>>> + for (i = 0; i < PAGE_SIZE / sizeof(instructions); i++) {
>>> + *(u32 *)&instructions[1] = i;
>>> + if (kvm_vcpu_write_guest(vcpu,
>>> + page_addr + (i * sizeof(instructions)),
>>> + instructions, sizeof(instructions)))
>>> + return 1;
>>> + }
>>
>> HYPERVISOR_iret isn't supported on 64bit so should be ud2 instead.
>
> Yeah, I got part way through typing that part but concluded it probably
> wasn't a fast path that absolutely needed to be emulated in the kernel.
>
> The VMM can inject the UD# when it receives the hypercall.

That would work as well but if it's a straight ud2 on the hypercall
page, wouldn't the guest just execute it when/if it does a
HYPERVISOR_iret?

Ankur


>
> I appreciate it *is* a guest-visible difference, if we're being really
> pedantic, but I don't think we were even going to be able to 100% hide
> the fact that it's not actually Xen.
>

\
 
 \ /
  Last update: 2020-12-02 19:23    [W:0.135 / U:0.212 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site