[PATCH 4/6] add syscall emulation

2009-06-17 Thread Andre Przywara
Handle #UD intercept of the syscall instruction in 32bit compat mode on an Intel host. Setup the segment descriptors for CS and SS and the EIP/ESP registers according to the manual. Save the RIP and EFLAGS to the correct registers. Signed-off-by: Christoph Egger Signed-off-by: Andre Przywara ---

Re: [PATCH 4/6] add syscall emulation

2009-06-18 Thread Avi Kivity
On 06/17/2009 04:50 PM, Andre Przywara wrote: +static inline void +setup_syscalls_segments(struct x86_emulate_ctxt *ctxt, + struct kvm_segment *cs, struct kvm_segment *ss) +{ + memset(cs, 0, sizeof(struct kvm_segment)); + kvm_x86_ops->get_segment(ctxt->vcpu, cs, VCPU_SREG_CS);

Re: [PATCH 4/6] add syscall emulation

2009-06-18 Thread Andre Przywara
Avi Kivity wrote: On 06/17/2009 04:50 PM, Andre Przywara wrote: +static inline void +setup_syscalls_segments(struct x86_emulate_ctxt *ctxt, +struct kvm_segment *cs, struct kvm_segment *ss) +{ +memset(cs, 0, sizeof(struct kvm_segment)); +kvm_x86_ops->get_segment(ctxt->vcpu, cs, VCPU_

Re: [PATCH 4/6] add syscall emulation

2009-06-22 Thread Avi Kivity
On 06/18/2009 01:27 PM, Andre Przywara wrote: limit in kvm_segment is expanded, so 4GB is 0x. You are right. This was probably a leftover from this cross vendor migration g-bit issue. Beside the fix here this removes some code in the separate paths, so I remade patch 4-6/6 and will re