On Mon, Jan 25, 2010 at 02:53:09PM +0200, Avi Kivity wrote: > On 01/25/2010 02:24 PM, Gleb Natapov wrote: > >On Mon, Jan 25, 2010 at 01:12:36PM +0200, Avi Kivity wrote: > >>On 01/25/2010 01:11 PM, Gleb Natapov wrote: > >>>On Mon, Jan 25, 2010 at 01:08:13PM +0200, Avi Kivity wrote: > >>>>On 01/25/2010 12:01 PM, Gleb Natapov wrote: > >>>>>On HW task switch newly loaded segments should me marked as accessed. > >>>>> > >>>>>@@ -4775,6 +4766,11 @@ int kvm_load_segment_descriptor(struct kvm_vcpu *vcpu, u16 selector, > >>>>> kvm_seg.unusable = 1; > >>>>> > >>>>> kvm_set_segment(vcpu,&kvm_seg, seg); > >>>>>+ if (selector&& !kvm_seg.unusable&& kvm_seg.s) { > >>>>>+ /* mark segment as accessed */ > >>>>>+ seg_desc.type |= 1; > >>>>>+ save_guest_segment_descriptor(vcpu, selector,&seg_desc); > >>>>>+ } > >>>>> return 0; > >>>>> } > >>>>What about an error return from s_g_s_d? > >>>> > >>>What can or should we do about it? > >>> > >>If -EFAULT, propagate to userspace. > >> > >We don't handle it anywhere in task switch emulation. Separate patch? > > > > Things like 'return kvm_write_guest_virt()' do handle it. > That what save_guest_segment_descriptor() calls, but error is not propagated to userspace anywhere in the task switch code. Lets apply this patch and I'll send follow up with fixes for error handling in task switch code. -- Gleb. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html