Re: [Xen-devel] [PATCH 4/9] x86/pv: Implement pv_hypercall() in C

2016-08-11 Thread Jan Beulich
>>> On 11.08.16 at 13:57, wrote: > On 02/08/16 14:12, Jan Beulich wrote: > On 18.07.16 at 11:51, wrote: >>> +mov %rsp, %rdi >>> +call pv_hypercall >>> movl %eax,UREGS_rax(%rsp) # save the return value >> To follow the HVM model, this should also move into C.

Re: [Xen-devel] [PATCH 4/9] x86/pv: Implement pv_hypercall() in C

2016-08-11 Thread Andrew Cooper
On 02/08/16 14:12, Jan Beulich wrote: On 18.07.16 at 11:51, wrote: >> +long pv_hypercall(struct cpu_user_regs *regs) >> +{ >> +struct vcpu *curr = current; >> +#ifndef NDEBUG >> +unsigned long old_rip = regs->rip; >> +#endif >> +long ret; >> +uint32_t eax = regs->eax; >> + >>

Re: [Xen-devel] [PATCH 4/9] x86/pv: Implement pv_hypercall() in C

2016-08-02 Thread Jan Beulich
>>> On 02.08.16 at 16:06, wrote: > On 02/08/16 14:12, Jan Beulich wrote: > On 18.07.16 at 11:51, wrote: >>> +long pv_hypercall(struct cpu_user_regs *regs) >>> +{ >>> +struct vcpu *curr = current; >>> +#ifndef NDEBUG >>> +unsigned long old_rip = regs->rip; >>> +#endif >>> +long ret

Re: [Xen-devel] [PATCH 4/9] x86/pv: Implement pv_hypercall() in C

2016-08-02 Thread Andrew Cooper
On 02/08/16 14:12, Jan Beulich wrote: On 18.07.16 at 11:51, wrote: >> +long pv_hypercall(struct cpu_user_regs *regs) >> +{ >> +struct vcpu *curr = current; >> +#ifndef NDEBUG >> +unsigned long old_rip = regs->rip; >> +#endif >> +long ret; >> +uint32_t eax = regs->eax; >> + >>

Re: [Xen-devel] [PATCH 4/9] x86/pv: Implement pv_hypercall() in C

2016-08-02 Thread Jan Beulich
>>> On 18.07.16 at 11:51, wrote: > +long pv_hypercall(struct cpu_user_regs *regs) > +{ > +struct vcpu *curr = current; > +#ifndef NDEBUG > +unsigned long old_rip = regs->rip; > +#endif > +long ret; > +uint32_t eax = regs->eax; > + > +ASSERT(curr->arch.flags & TF_kernel_mode);

[Xen-devel] [PATCH 4/9] x86/pv: Implement pv_hypercall() in C

2016-07-18 Thread Andrew Cooper
In a similar style to hvm_do_hypercall(). The C version is far easier to understand and edit than the assembly versions. There are a few small differences however. The register clobbering values have changed (to match the HVM side), and in particular clobber the upper 32bits of 64bit arguments.