Re: [PATCH RFC 1/3] vmx: allow ioeventfd for EPT violations

2015-09-01 Thread Michael S. Tsirkin
On Tue, Sep 01, 2015 at 12:49:19PM +0800, Jason Wang wrote: > > > On 09/01/2015 12:36 PM, Michael S. Tsirkin wrote: > > On Tue, Sep 01, 2015 at 11:37:13AM +0800, Jason Wang wrote: > >> > > >> > > >> > On 08/30/2015 05:12 PM, Michael S. Tsirkin wrote: > >>> > > Even when we skip data decoding,

Re: [PATCH RFC 1/3] vmx: allow ioeventfd for EPT violations

2015-09-01 Thread Michael S. Tsirkin
On Tue, Sep 01, 2015 at 12:49:19PM +0800, Jason Wang wrote: > > > On 09/01/2015 12:36 PM, Michael S. Tsirkin wrote: > > On Tue, Sep 01, 2015 at 11:37:13AM +0800, Jason Wang wrote: > >> > > >> > > >> > On 08/30/2015 05:12 PM, Michael S. Tsirkin wrote: > >>> > > Even when we skip data decoding,

Re: [PATCH RFC 1/3] vmx: allow ioeventfd for EPT violations

2015-08-31 Thread Jason Wang
On 09/01/2015 12:36 PM, Michael S. Tsirkin wrote: > On Tue, Sep 01, 2015 at 11:37:13AM +0800, Jason Wang wrote: >> > >> > >> > On 08/30/2015 05:12 PM, Michael S. Tsirkin wrote: >>> > > Even when we skip data decoding, MMIO is slightly slower >>> > > than port IO because it uses the

Re: [PATCH RFC 1/3] vmx: allow ioeventfd for EPT violations

2015-08-31 Thread Michael S. Tsirkin
On Tue, Sep 01, 2015 at 11:37:13AM +0800, Jason Wang wrote: > > > On 08/30/2015 05:12 PM, Michael S. Tsirkin wrote: > > Even when we skip data decoding, MMIO is slightly slower > > than port IO because it uses the page-tables, so the CPU > > must do a pagewalk on each access. > > > > This

Re: [PATCH RFC 1/3] vmx: allow ioeventfd for EPT violations

2015-08-31 Thread Jason Wang
On 08/30/2015 05:12 PM, Michael S. Tsirkin wrote: > Even when we skip data decoding, MMIO is slightly slower > than port IO because it uses the page-tables, so the CPU > must do a pagewalk on each access. > > This overhead is normally masked by using the TLB cache: > but not so for KVM MMIO,

Re: [PATCH RFC 1/3] vmx: allow ioeventfd for EPT violations

2015-08-31 Thread Michael S. Tsirkin
On Mon, Aug 31, 2015 at 09:23:13PM +0800, Xiao Guangrong wrote: > I have another question, the eventfd memory is never read by guest and it's > always > a write MMIO VM-exit, why you build it on RO memslot? Why not just use normal > MMIO page > instead? We do that at the moment, that's slower

Re: [PATCH RFC 1/3] vmx: allow ioeventfd for EPT violations

2015-08-31 Thread Xiao Guangrong
On 08/31/2015 07:27 PM, Michael S. Tsirkin wrote: On Mon, Aug 31, 2015 at 04:32:52PM +0800, Xiao Guangrong wrote: On 08/31/2015 03:46 PM, Michael S. Tsirkin wrote: On Mon, Aug 31, 2015 at 10:53:58AM +0800, Xiao Guangrong wrote: On 08/30/2015 05:12 PM, Michael S. Tsirkin wrote: Even

Re: [PATCH RFC 1/3] vmx: allow ioeventfd for EPT violations

2015-08-31 Thread Michael S. Tsirkin
On Mon, Aug 31, 2015 at 04:32:52PM +0800, Xiao Guangrong wrote: > > > On 08/31/2015 03:46 PM, Michael S. Tsirkin wrote: > >On Mon, Aug 31, 2015 at 10:53:58AM +0800, Xiao Guangrong wrote: > >> > >> > >>On 08/30/2015 05:12 PM, Michael S. Tsirkin wrote: > >>>Even when we skip data decoding, MMIO is

Re: [PATCH RFC 1/3] vmx: allow ioeventfd for EPT violations

2015-08-31 Thread Xiao Guangrong
On 08/31/2015 03:46 PM, Michael S. Tsirkin wrote: On Mon, Aug 31, 2015 at 10:53:58AM +0800, Xiao Guangrong wrote: On 08/30/2015 05:12 PM, Michael S. Tsirkin wrote: Even when we skip data decoding, MMIO is slightly slower than port IO because it uses the page-tables, so the CPU must do a

Re: [PATCH RFC 1/3] vmx: allow ioeventfd for EPT violations

2015-08-31 Thread Michael S. Tsirkin
On Mon, Aug 31, 2015 at 10:53:58AM +0800, Xiao Guangrong wrote: > > > On 08/30/2015 05:12 PM, Michael S. Tsirkin wrote: > >Even when we skip data decoding, MMIO is slightly slower > >than port IO because it uses the page-tables, so the CPU > >must do a pagewalk on each access. > > > >This

Re: [PATCH RFC 1/3] vmx: allow ioeventfd for EPT violations

2015-08-31 Thread Michael S. Tsirkin
On Mon, Aug 31, 2015 at 09:23:13PM +0800, Xiao Guangrong wrote: > I have another question, the eventfd memory is never read by guest and it's > always > a write MMIO VM-exit, why you build it on RO memslot? Why not just use normal > MMIO page > instead? We do that at the moment, that's slower

Re: [PATCH RFC 1/3] vmx: allow ioeventfd for EPT violations

2015-08-31 Thread Michael S. Tsirkin
On Mon, Aug 31, 2015 at 10:53:58AM +0800, Xiao Guangrong wrote: > > > On 08/30/2015 05:12 PM, Michael S. Tsirkin wrote: > >Even when we skip data decoding, MMIO is slightly slower > >than port IO because it uses the page-tables, so the CPU > >must do a pagewalk on each access. > > > >This

Re: [PATCH RFC 1/3] vmx: allow ioeventfd for EPT violations

2015-08-31 Thread Michael S. Tsirkin
On Mon, Aug 31, 2015 at 04:32:52PM +0800, Xiao Guangrong wrote: > > > On 08/31/2015 03:46 PM, Michael S. Tsirkin wrote: > >On Mon, Aug 31, 2015 at 10:53:58AM +0800, Xiao Guangrong wrote: > >> > >> > >>On 08/30/2015 05:12 PM, Michael S. Tsirkin wrote: > >>>Even when we skip data decoding, MMIO is

Re: [PATCH RFC 1/3] vmx: allow ioeventfd for EPT violations

2015-08-31 Thread Xiao Guangrong
On 08/31/2015 03:46 PM, Michael S. Tsirkin wrote: On Mon, Aug 31, 2015 at 10:53:58AM +0800, Xiao Guangrong wrote: On 08/30/2015 05:12 PM, Michael S. Tsirkin wrote: Even when we skip data decoding, MMIO is slightly slower than port IO because it uses the page-tables, so the CPU must do a

Re: [PATCH RFC 1/3] vmx: allow ioeventfd for EPT violations

2015-08-31 Thread Jason Wang
On 08/30/2015 05:12 PM, Michael S. Tsirkin wrote: > Even when we skip data decoding, MMIO is slightly slower > than port IO because it uses the page-tables, so the CPU > must do a pagewalk on each access. > > This overhead is normally masked by using the TLB cache: > but not so for KVM MMIO,

Re: [PATCH RFC 1/3] vmx: allow ioeventfd for EPT violations

2015-08-31 Thread Michael S. Tsirkin
On Tue, Sep 01, 2015 at 11:37:13AM +0800, Jason Wang wrote: > > > On 08/30/2015 05:12 PM, Michael S. Tsirkin wrote: > > Even when we skip data decoding, MMIO is slightly slower > > than port IO because it uses the page-tables, so the CPU > > must do a pagewalk on each access. > > > > This

Re: [PATCH RFC 1/3] vmx: allow ioeventfd for EPT violations

2015-08-31 Thread Jason Wang
On 09/01/2015 12:36 PM, Michael S. Tsirkin wrote: > On Tue, Sep 01, 2015 at 11:37:13AM +0800, Jason Wang wrote: >> > >> > >> > On 08/30/2015 05:12 PM, Michael S. Tsirkin wrote: >>> > > Even when we skip data decoding, MMIO is slightly slower >>> > > than port IO because it uses the

Re: [PATCH RFC 1/3] vmx: allow ioeventfd for EPT violations

2015-08-31 Thread Xiao Guangrong
On 08/31/2015 07:27 PM, Michael S. Tsirkin wrote: On Mon, Aug 31, 2015 at 04:32:52PM +0800, Xiao Guangrong wrote: On 08/31/2015 03:46 PM, Michael S. Tsirkin wrote: On Mon, Aug 31, 2015 at 10:53:58AM +0800, Xiao Guangrong wrote: On 08/30/2015 05:12 PM, Michael S. Tsirkin wrote: Even

Re: [PATCH RFC 1/3] vmx: allow ioeventfd for EPT violations

2015-08-30 Thread Xiao Guangrong
On 08/30/2015 05:12 PM, Michael S. Tsirkin wrote: Even when we skip data decoding, MMIO is slightly slower than port IO because it uses the page-tables, so the CPU must do a pagewalk on each access. This overhead is normally masked by using the TLB cache: but not so for KVM MMIO, where PTEs

[PATCH RFC 1/3] vmx: allow ioeventfd for EPT violations

2015-08-30 Thread Michael S. Tsirkin
Even when we skip data decoding, MMIO is slightly slower than port IO because it uses the page-tables, so the CPU must do a pagewalk on each access. This overhead is normally masked by using the TLB cache: but not so for KVM MMIO, where PTEs are marked as reserved and so are never cached. As

[PATCH RFC 1/3] vmx: allow ioeventfd for EPT violations

2015-08-30 Thread Michael S. Tsirkin
Even when we skip data decoding, MMIO is slightly slower than port IO because it uses the page-tables, so the CPU must do a pagewalk on each access. This overhead is normally masked by using the TLB cache: but not so for KVM MMIO, where PTEs are marked as reserved and so are never cached. As

Re: [PATCH RFC 1/3] vmx: allow ioeventfd for EPT violations

2015-08-30 Thread Xiao Guangrong
On 08/30/2015 05:12 PM, Michael S. Tsirkin wrote: Even when we skip data decoding, MMIO is slightly slower than port IO because it uses the page-tables, so the CPU must do a pagewalk on each access. This overhead is normally masked by using the TLB cache: but not so for KVM MMIO, where PTEs