Re: Questions about the real mode in kvm/qemu

2019-09-29 Thread Li Qiang
Paolo Bonzini 于2019年9月26日周四 下午5:18写道: > On 26/09/19 10:59, Maxim Levitsky wrote: > > If you mean to ask if there is a way to let guest access use no > > paging at all, that is access host physical addresses directly, then > > indeed there is no way, since regular non 'unrestricted guest' mode > >

Re: Questions about the real mode in kvm/qemu

2019-09-28 Thread Avi Kivity
On 9/26/19 12:18 PM, Paolo Bonzini wrote: On 26/09/19 10:59, Maxim Levitsky wrote: If you mean to ask if there is a way to let guest access use no paging at all, that is access host physical addresses directly, then indeed there is no way, since regular non 'unrestricted guest' mode required bot

Re: Questions about the real mode in kvm/qemu

2019-09-26 Thread Li Qiang
Paolo Bonzini 于2019年9月26日周四 下午5:53写道: > On 26/09/19 11:35, Li Qiang wrote: > > So without unrestrict guest the mainline is this: KVM set guest's > > rflag bit X86_EFLAGS_VM, so when the guest enter guest mode, it is in > > vm86 mode. In this mode, the CPU will access the address like in > > real

Re: Questions about the real mode in kvm/qemu

2019-09-26 Thread Maxim Levitsky
On Thu, 2019-09-26 at 12:00 +0200, Paolo Bonzini wrote: > On 26/09/19 11:41, Maxim Levitsky wrote: > > > Thinking more about it, I suppose that saves memory (the same EPT page > > > tables can now be used independent of guest CR0.PG), at the cost of > > > making TLB misses a little slower. > > > >

Re: Questions about the real mode in kvm/qemu

2019-09-26 Thread Paolo Bonzini
On 26/09/19 11:41, Maxim Levitsky wrote: >> Thinking more about it, I suppose that saves memory (the same EPT page >> tables can now be used independent of guest CR0.PG), at the cost of >> making TLB misses a little slower. > Don't really understand what you mean. > Isn't this always the case that

Re: Questions about the real mode in kvm/qemu

2019-09-26 Thread Paolo Bonzini
On 26/09/19 11:35, Li Qiang wrote: > So without unrestrict guest the mainline is this: KVM set guest's > rflag bit X86_EFLAGS_VM, so when the guest enter guest mode, it is in > vm86 mode. In this mode, the CPU will access the address like in > real mode(seg*4+offset), this address is linear address

Re: Questions about the real mode in kvm/qemu

2019-09-26 Thread Maxim Levitsky
On Thu, 2019-09-26 at 11:33 +0200, Paolo Bonzini wrote: > On 26/09/19 11:24, Maxim Levitsky wrote: > > On Thu, 2019-09-26 at 11:18 +0200, Paolo Bonzini wrote: > > > On 26/09/19 10:59, Maxim Levitsky wrote: > > > > If you mean to ask if there is a way to let guest access use no > > > > paging at all

Re: Questions about the real mode in kvm/qemu

2019-09-26 Thread Li Qiang
Paolo Bonzini 于2019年9月26日周四 下午5:15写道: > On 26/09/19 09:52, Li Qiang wrote: > > Hi Paolo and all, > > > > There are some question about the emulation for real mode in kvm/qemu. > > For all the > > question I suppose the 'unstrict guest' is not enabled. > > > > 1. how the protected mode CPU emulate

Re: Questions about the real mode in kvm/qemu

2019-09-26 Thread Maxim Levitsky
On Thu, 2019-09-26 at 11:15 +0200, Paolo Bonzini wrote: > On 26/09/19 09:52, Li Qiang wrote: > > Hi Paolo and all, > > > > There are some question about the emulation for real mode in kvm/qemu. > > For all the > > question I suppose the 'unstrict guest' is not enabled. > > > > 1. how the protec

Re: Questions about the real mode in kvm/qemu

2019-09-26 Thread Paolo Bonzini
On 26/09/19 11:24, Maxim Levitsky wrote: > On Thu, 2019-09-26 at 11:18 +0200, Paolo Bonzini wrote: >> On 26/09/19 10:59, Maxim Levitsky wrote: >>> If you mean to ask if there is a way to let guest access use no >>> paging at all, that is access host physical addresses directly, then >>> indeed ther

Re: Questions about the real mode in kvm/qemu

2019-09-26 Thread Maxim Levitsky
On Thu, 2019-09-26 at 11:18 +0200, Paolo Bonzini wrote: > On 26/09/19 10:59, Maxim Levitsky wrote: > > If you mean to ask if there is a way to let guest access use no > > paging at all, that is access host physical addresses directly, then > > indeed there is no way, since regular non 'unrestricted

Re: Questions about the real mode in kvm/qemu

2019-09-26 Thread Paolo Bonzini
On 26/09/19 10:59, Maxim Levitsky wrote: > If you mean to ask if there is a way to let guest access use no > paging at all, that is access host physical addresses directly, then > indeed there is no way, since regular non 'unrestricted guest' mode > required both protected mode and paging, and 'unr

Re: Questions about the real mode in kvm/qemu

2019-09-26 Thread Paolo Bonzini
On 26/09/19 09:52, Li Qiang wrote: > Hi Paolo and all, > > There are some question about the emulation for real mode in kvm/qemu. > For all the  > question I suppose the 'unstrict guest' is not enabled.  > > 1. how the protected mode CPU emulate the real mode? It seems it uses > vm86, however, vm

Re: Questions about the real mode in kvm/qemu

2019-09-26 Thread Maxim Levitsky
On Thu, 2019-09-26 at 16:52 +0800, Li Qiang wrote: > > > Maxim Levitsky 于2019年9月26日周四 下午4:31写道: > > On Thu, 2019-09-26 at 15:52 +0800, Li Qiang wrote: > > > Hi Paolo and all, > > > > > > There are some question about the emulation for real mode in kvm/qemu. > > > For all the > > > question I

Re: Questions about the real mode in kvm/qemu

2019-09-26 Thread Li Qiang
Maxim Levitsky 于2019年9月26日周四 下午4:31写道: > On Thu, 2019-09-26 at 15:52 +0800, Li Qiang wrote: > > Hi Paolo and all, > > > > There are some question about the emulation for real mode in kvm/qemu. > For all the > > question I suppose the 'unstrict guest' is not enabled. > > > > 1. how the protected m

Re: Questions about the real mode in kvm/qemu

2019-09-26 Thread Maxim Levitsky
On Thu, 2019-09-26 at 15:52 +0800, Li Qiang wrote: > Hi Paolo and all, > > There are some question about the emulation for real mode in kvm/qemu. For > all the > question I suppose the 'unstrict guest' is not enabled. > > 1. how the protected mode CPU emulate the real mode? It seems it uses vm

Questions about the real mode in kvm/qemu

2019-09-26 Thread Li Qiang
Hi Paolo and all, There are some question about the emulation for real mode in kvm/qemu. For all the question I suppose the 'unstrict guest' is not enabled. 1. how the protected mode CPU emulate the real mode? It seems it uses vm86, however, vm86 is not available in x86_64 CPU? So what's the 'to_