Re: [PATCH 2/2] Provide fast path for "rep ins" emulation if possible.

2012-06-06 Thread Roedel, Joerg
On Tue, Jun 05, 2012 at 08:57:17PM +0300, Gleb Natapov wrote: > On Tue, Jun 05, 2012 at 07:41:17PM +0200, Alexander Graf wrote: > > IIRC it was the size field, but I could be wrong. Please take an old > > (phenom / barcelona is old enough) machine and create some traces to make > > 100% sure that

Re: [PATCH 2/2] Provide fast path for "rep ins" emulation if possible.

2012-06-06 Thread Avi Kivity
On 06/05/2012 08:19 PM, Gleb Natapov wrote: > On Tue, Jun 05, 2012 at 07:07:39PM +0300, Avi Kivity wrote: >> > + >> > + count = (PAGE_SIZE - offset_in_page(linear_addr))/size; >> > + >> > + if (count == 0) /* 'in' crosses page boundry */ >> > + return EMULATE_FAIL; >> > + >> > + count =

Re: [PATCH 2/2] Provide fast path for "rep ins" emulation if possible.

2012-06-05 Thread Gleb Natapov
On Tue, Jun 05, 2012 at 08:50:16PM +0300, Gleb Natapov wrote: > > No, what I'm saying is that the hardware omitted some fields even though > > they were provided in the spec. IIRC it was the size field, but I could be > > wrong. Please take an old (phenom / barcelona is old enough) machine and >

Re: [PATCH 2/2] Provide fast path for "rep ins" emulation if possible.

2012-06-05 Thread Gleb Natapov
On Tue, Jun 05, 2012 at 07:41:17PM +0200, Alexander Graf wrote: > IIRC it was the size field, but I could be wrong. Please take an old (phenom > / barcelona is old enough) machine and create some traces to make 100% sure > that all fields you're trying to read out are actually provided. > Joerg

Re: [PATCH 2/2] Provide fast path for "rep ins" emulation if possible.

2012-06-05 Thread Gleb Natapov
On Tue, Jun 05, 2012 at 07:41:17PM +0200, Alexander Graf wrote: > > On 05.06.2012, at 19:36, Gleb Natapov wrote: > > > On Tue, Jun 05, 2012 at 07:27:40PM +0200, Alexander Graf wrote: > >> > >> On 24.05.2012, at 12:54, Roedel, Joerg wrote: > >> > >>> On Thu, May 24, 2012 at 01:36:51PM +0300, Avi

Re: [PATCH 2/2] Provide fast path for "rep ins" emulation if possible.

2012-06-05 Thread Alexander Graf
On 05.06.2012, at 19:36, Gleb Natapov wrote: > On Tue, Jun 05, 2012 at 07:27:40PM +0200, Alexander Graf wrote: >> >> On 24.05.2012, at 12:54, Roedel, Joerg wrote: >> >>> On Thu, May 24, 2012 at 01:36:51PM +0300, Avi Kivity wrote: On 05/24/2012 01:34 PM, Roedel, Joerg wrote: > On Wed, M

Re: [PATCH 2/2] Provide fast path for "rep ins" emulation if possible.

2012-06-05 Thread Gleb Natapov
On Tue, Jun 05, 2012 at 07:27:40PM +0200, Alexander Graf wrote: > > On 24.05.2012, at 12:54, Roedel, Joerg wrote: > > > On Thu, May 24, 2012 at 01:36:51PM +0300, Avi Kivity wrote: > >> On 05/24/2012 01:34 PM, Roedel, Joerg wrote: > >>> On Wed, May 23, 2012 at 05:49:31PM +0300, Avi Kivity wrote: >

Re: [PATCH 2/2] Provide fast path for "rep ins" emulation if possible.

2012-06-05 Thread Alexander Graf
On 24.05.2012, at 12:54, Roedel, Joerg wrote: > On Thu, May 24, 2012 at 01:36:51PM +0300, Avi Kivity wrote: >> On 05/24/2012 01:34 PM, Roedel, Joerg wrote: >>> On Wed, May 23, 2012 at 05:49:31PM +0300, Avi Kivity wrote: On 05/23/2012 05:40 PM, Avi Kivity wrote: > On 05/23/2012 05:08 PM,

Re: [PATCH 2/2] Provide fast path for "rep ins" emulation if possible.

2012-06-05 Thread Gleb Natapov
On Tue, Jun 05, 2012 at 07:07:39PM +0300, Avi Kivity wrote: > > + > > + count = (PAGE_SIZE - offset_in_page(linear_addr))/size; > > + > > + if (count == 0) /* 'in' crosses page boundry */ > > + return EMULATE_FAIL; > > + > > + count = min(count, rcx); > > + > > + r = __kvm_fast_st

Re: [PATCH 2/2] Provide fast path for "rep ins" emulation if possible.

2012-06-05 Thread Avi Kivity
On 05/23/2012 05:08 PM, Gleb Natapov wrote: > "rep ins" emulation is going through emulator now. This is slow because > emulator knows how to write back only one datum at a time. This patch > provides fast path for the instruction in certain conditions. The > conditions are: DF flag is not set, des

Re: [PATCH 2/2] Provide fast path for "rep ins" emulation if possible.

2012-05-24 Thread Roedel, Joerg
On Thu, May 24, 2012 at 01:36:51PM +0300, Avi Kivity wrote: > On 05/24/2012 01:34 PM, Roedel, Joerg wrote: > > On Wed, May 23, 2012 at 05:49:31PM +0300, Avi Kivity wrote: > >> On 05/23/2012 05:40 PM, Avi Kivity wrote: > >> > On 05/23/2012 05:08 PM, Gleb Natapov wrote: > >> > If decode assists are n

Re: [PATCH 2/2] Provide fast path for "rep ins" emulation if possible.

2012-05-24 Thread Avi Kivity
On 05/24/2012 01:34 PM, Roedel, Joerg wrote: > On Wed, May 23, 2012 at 05:49:31PM +0300, Avi Kivity wrote: >> On 05/23/2012 05:40 PM, Avi Kivity wrote: >> > On 05/23/2012 05:08 PM, Gleb Natapov wrote: >> > If decode assists are not available, we still need to emulate, see 15.33.5. >> > >> >> Joer

Re: [PATCH 2/2] Provide fast path for "rep ins" emulation if possible.

2012-05-24 Thread Roedel, Joerg
On Wed, May 23, 2012 at 05:49:31PM +0300, Avi Kivity wrote: > On 05/23/2012 05:40 PM, Avi Kivity wrote: > > On 05/23/2012 05:08 PM, Gleb Natapov wrote: > > If decode assists are not available, we still need to emulate, see 15.33.5. > > > > Joerg, the 2010 version of the manual says that the effec

Re: [PATCH 2/2] Provide fast path for "rep ins" emulation if possible.

2012-05-23 Thread Avi Kivity
On 05/23/2012 05:40 PM, Avi Kivity wrote: > On 05/23/2012 05:08 PM, Gleb Natapov wrote: >> "rep ins" emulation is going through emulator now. This is slow because >> emulator knows how to write back only one datum at a time. This patch >> provides fast path for the instruction in certain conditions

Re: [PATCH 2/2] Provide fast path for "rep ins" emulation if possible.

2012-05-23 Thread Avi Kivity
On 05/23/2012 05:08 PM, Gleb Natapov wrote: > "rep ins" emulation is going through emulator now. This is slow because > emulator knows how to write back only one datum at a time. This patch > provides fast path for the instruction in certain conditions. The > conditions are: DF flag is not set, des

[PATCH 2/2] Provide fast path for "rep ins" emulation if possible.

2012-05-23 Thread Gleb Natapov
"rep ins" emulation is going through emulator now. This is slow because emulator knows how to write back only one datum at a time. This patch provides fast path for the instruction in certain conditions. The conditions are: DF flag is not set, destination memory is RAM and single datum does not cro