Re: [Xen-devel] [PATCH v3 2/5] x86/hyperv: provide Hyper-V hypercall functions

2020-01-16 Thread Andrew Cooper
On 07/01/2020 16:17, Wei Liu wrote: > On Sun, Jan 05, 2020 at 10:06:08PM +, Andrew Cooper wrote: >> On 05/01/2020 21:22, Wei Liu wrote: >>> On Sun, Jan 05, 2020 at 07:08:28PM +, Andrew Cooper wrote: > +static inline uint64_t hv_do_hypercall(uint64_t control, paddr_t input, >

Re: [Xen-devel] [PATCH v3 2/5] x86/hyperv: provide Hyper-V hypercall functions

2020-01-16 Thread Wei Liu
On Sun, Jan 05, 2020 at 07:08:28PM +, Andrew Cooper wrote: > > > +static inline uint64_t hv_do_hypercall(uint64_t control, paddr_t input, > > paddr_t output) > > +{ > > +uint64_t status; > > + > > +asm volatile ("mov %[output], %%r8\n" > > + "call hv_hypercall_page"

Re: [Xen-devel] [PATCH v3 2/5] x86/hyperv: provide Hyper-V hypercall functions

2020-01-07 Thread Wei Liu
On Mon, Jan 06, 2020 at 10:38:23AM +0100, Jan Beulich wrote: [...] > > + > > +static inline uint64_t hv_do_rep_hypercall(uint16_t code, uint16_t > > rep_count, > > + uint16_t varhead_size, > > + paddr_t input,

Re: [Xen-devel] [PATCH v3 2/5] x86/hyperv: provide Hyper-V hypercall functions

2020-01-07 Thread Wei Liu
On Sun, Jan 05, 2020 at 10:06:08PM +, Andrew Cooper wrote: > On 05/01/2020 21:22, Wei Liu wrote: > > On Sun, Jan 05, 2020 at 07:08:28PM +, Andrew Cooper wrote: > >>> +static inline uint64_t hv_do_hypercall(uint64_t control, paddr_t input, > >>> paddr_t output) > >>> +{ > >>> +uint64_t

Re: [Xen-devel] [PATCH v3 2/5] x86/hyperv: provide Hyper-V hypercall functions

2020-01-06 Thread Jan Beulich
On 05.01.2020 17:47, Wei Liu wrote: > +static inline uint64_t hv_do_fast_hypercall(uint16_t code, > +uint64_t input1, uint64_t input2) > +{ > +uint64_t status; > +uint64_t control = (uint64_t)code | HV_HYPERCALL_FAST_BIT; Unnecessary (afaict)

Re: [Xen-devel] [PATCH v3 2/5] x86/hyperv: provide Hyper-V hypercall functions

2020-01-05 Thread Andrew Cooper
On 05/01/2020 21:22, Wei Liu wrote: > On Sun, Jan 05, 2020 at 07:08:28PM +, Andrew Cooper wrote: >>> +static inline uint64_t hv_do_hypercall(uint64_t control, paddr_t input, >>> paddr_t output) >>> +{ >>> +uint64_t status; >>> + >>> +asm volatile ("mov %[output], %%r8\n" >>> +

Re: [Xen-devel] [PATCH v3 2/5] x86/hyperv: provide Hyper-V hypercall functions

2020-01-05 Thread Wei Liu
On Sun, Jan 05, 2020 at 07:08:28PM +, Andrew Cooper wrote: > > > +static inline uint64_t hv_do_hypercall(uint64_t control, paddr_t input, > > paddr_t output) > > +{ > > +uint64_t status; > > + > > +asm volatile ("mov %[output], %%r8\n" > > + "call hv_hypercall_page"

Re: [Xen-devel] [PATCH v3 2/5] x86/hyperv: provide Hyper-V hypercall functions

2020-01-05 Thread Andrew Cooper
> +static inline uint64_t hv_do_hypercall(uint64_t control, paddr_t input, > paddr_t output) > +{ > +uint64_t status; > + > +asm volatile ("mov %[output], %%r8\n" > + "call hv_hypercall_page" > + : "=a" (status), "+c" (control), > +

[Xen-devel] [PATCH v3 2/5] x86/hyperv: provide Hyper-V hypercall functions

2020-01-05 Thread Wei Liu
These functions will be used later to make hypercalls to Hyper-V. I couldn't find reference in TLFS that Hyper-V clobbers flags and r9-r11, but Linux's commit message says it does. Err on the safe side. Signed-off-by: Wei Liu --- v3: 1. Name the file hyperv-hcall.h v2: 1. Use direct call ---