Re: [PATCH RFC 02/39] KVM: x86/xen: intercept xen hypercalls if enabled

2020-12-02 Thread Ankur Arora
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 *)[1] = i; + if (kvm_vcpu_write_guest(vcpu, +

Re: [PATCH RFC 02/39] KVM: x86/xen: intercept xen hypercalls if enabled

2020-12-02 Thread David Woodhouse
On Wed, 2020-12-02 at 11:17 +, Joao Martins wrote: > Xen viridian mode is indeed one thing that needed fixing. And definitely a > separate patch as you do here. Both this one and the previous is looking good. > > I suppose that because you switch to kvm_vcpu_write_guest() you no longer need >

Re: [PATCH RFC 02/39] KVM: x86/xen: intercept xen hypercalls if enabled

2020-12-02 Thread Joao Martins
On 12/1/20 11:19 AM, David Woodhouse wrote: > On Tue, 2020-12-01 at 09:48 +, David Woodhouse wrote: >> So I switched it to generate the hypercall page directly from the >> kernel, just like we do for the Hyper-V hypercall page. > > Speaking of Hyper-V... I'll post this one now so you can

Re: [PATCH RFC 02/39] KVM: x86/xen: intercept xen hypercalls if enabled

2020-12-02 Thread David Woodhouse
On Tue, 2020-12-01 at 21:19 -0800, Ankur Arora wrote: > > + for (i = 0; i < PAGE_SIZE / sizeof(instructions); i++) { > > + *(u32 *)[1] = i; > > + if (kvm_vcpu_write_guest(vcpu, > > + page_addr + (i *

Re: [PATCH RFC 02/39] KVM: x86/xen: intercept xen hypercalls if enabled

2020-12-01 Thread Ankur Arora
On 2020-12-01 1:48 a.m., David Woodhouse wrote: On Wed, 2019-02-20 at 20:15 +, Joao Martins wrote: Add a new exit reason for emulator to handle Xen hypercalls. Albeit these are injected only if guest has initialized the Xen hypercall page I've reworked this a little. I didn't like the

Re: [PATCH RFC 02/39] KVM: x86/xen: intercept xen hypercalls if enabled

2020-12-01 Thread David Woodhouse
On Tue, 2020-12-01 at 09:48 +, David Woodhouse wrote: > So I switched it to generate the hypercall page directly from the > kernel, just like we do for the Hyper-V hypercall page. Speaking of Hyper-V... I'll post this one now so you can start heckling it. I won't post the rest as I go; not

Re: [PATCH RFC 02/39] KVM: x86/xen: intercept xen hypercalls if enabled

2020-12-01 Thread David Woodhouse
On Wed, 2019-02-20 at 20:15 +, Joao Martins wrote: > Add a new exit reason for emulator to handle Xen hypercalls. > Albeit these are injected only if guest has initialized the Xen > hypercall page I've reworked this a little. I didn't like the inconsistency of allowing userspace to provide

Re: [PATCH RFC 02/39] KVM: x86/xen: intercept xen hypercalls if enabled

2019-02-22 Thread Paolo Bonzini
On 22/02/19 01:30, Sean Christopherson wrote: > On Thu, Feb 21, 2019 at 08:56:06PM +, Joao Martins wrote: >> The Xen addition follows the same structure as Hyper-V in kvm (what you >> suggest >> here is probably applicable for both). i.e. there's some Xen specific >> routines >> for vm/vcpu

Re: [PATCH RFC 02/39] KVM: x86/xen: intercept xen hypercalls if enabled

2019-02-21 Thread Sean Christopherson
On Thu, Feb 21, 2019 at 08:56:06PM +, Joao Martins wrote: > On 2/21/19 6:29 PM, Sean Christopherson wrote: > > On Wed, Feb 20, 2019 at 08:15:32PM +, Joao Martins wrote: > >> Add a new exit reason for emulator to handle Xen hypercalls. > >> Albeit these are injected only if guest has

Re: [PATCH RFC 02/39] KVM: x86/xen: intercept xen hypercalls if enabled

2019-02-21 Thread Joao Martins
On 2/21/19 6:29 PM, Sean Christopherson wrote: > On Wed, Feb 20, 2019 at 08:15:32PM +, Joao Martins wrote: >> Add a new exit reason for emulator to handle Xen hypercalls. >> Albeit these are injected only if guest has initialized the Xen >> hypercall page - the hypercall is just a convenience

Re: [PATCH RFC 02/39] KVM: x86/xen: intercept xen hypercalls if enabled

2019-02-21 Thread Sean Christopherson
On Wed, Feb 20, 2019 at 08:15:32PM +, Joao Martins wrote: > Add a new exit reason for emulator to handle Xen hypercalls. > Albeit these are injected only if guest has initialized the Xen > hypercall page - the hypercall is just a convenience but one > that is done by pretty much all guests.

[PATCH RFC 02/39] KVM: x86/xen: intercept xen hypercalls if enabled

2019-02-20 Thread Joao Martins
Add a new exit reason for emulator to handle Xen hypercalls. Albeit these are injected only if guest has initialized the Xen hypercall page - the hypercall is just a convenience but one that is done by pretty much all guests. Hence if the guest sets the hypercall page, we assume a Xen guest is