On Wed, Jun 16, 2010, Gleb Natapov wrote about "Re: [PATCH 11/24] Implement VMPTRST": > On Mon, Jun 14, 2010 at 12:15:10PM +0300, Avi Kivity wrote: > > write_guest_virt_system() is used by writes which need to ignore the > > cpl, for example when a cpl 3 instruction loads a segment, the > > processor needs to update the accessed flag even though it is only > > accessible to cpl 0. That's not your case, you need the ordinary > > write_guest_virt(). > > > > Um, I see there is no kvm_write_guest_virt(), you'll have to introduce it. > > > the code uses this function after checking cpl to be zero, so may be it > is ok, not to pretty though. I was actually hoping to get rid of all > kvm_(read|write)_guest_virt* and replace existing uses with > emulator_(read|write)_emulated, but this patch series adds more users > that will be hard to replace :( If I remember the history correctly, this is exactly what happened in this code. We used to use kvm_write_guest_virt(), until a few months ago it disappeared. I thought it to be fine to call write_guest_virt_system() because, like you said, we only already check above that cpl=0, so it is fine to assume we have cpl 0 privileges. So while it might look a bit strange at first, I think it should be fine and there's no need to create more functions. -- Nadav Har'El | Wednesday, Jun 16 2010, 4 Tammuz 5770 nyh@xxxxxxxxxxxxxxxxxxx |----------------------------------------- Phone +972-523-790466, ICQ 13349191 |Amateurs built the ark - professionals http://nadav.harel.org.il |built the Titanic. -- 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