Re: [PATCH v3] x86: svm: use kvm_fast_pio_in()

2015-04-07 Thread Paolo Bonzini
On 03/03/2015 21:42, Radim Krčmář wrote: > 2015-03-03 13:48-0600, Joel Schopp: + unsigned long new_rax = kvm_register_read(vcpu, VCPU_REGS_RAX); >>> Shouldn't we handle writes in EAX differently than in AX and AL, because >>> of implicit zero extension. >> I don't think the implicit zero

Re: [PATCH v3] x86: svm: use kvm_fast_pio_in()

2015-04-07 Thread Paolo Bonzini
On 03/03/2015 21:42, Radim Krčmář wrote: 2015-03-03 13:48-0600, Joel Schopp: + unsigned long new_rax = kvm_register_read(vcpu, VCPU_REGS_RAX); Shouldn't we handle writes in EAX differently than in AX and AL, because of implicit zero extension. I don't think the implicit zero extension

Re: [PATCH v3] x86: svm: use kvm_fast_pio_in()

2015-03-12 Thread Marcelo Tosatti
On Mon, Mar 02, 2015 at 03:02:02PM -0600, Joel Schopp wrote: > From: David Kaplan > > We can make the in instruction go faster the same way the out instruction is > already. > > Changes from v2[Joel]: > * changed rax from u32 to unsigned long > * changed a couple return 0 to

Re: [PATCH v3] x86: svm: use kvm_fast_pio_in()

2015-03-12 Thread Marcelo Tosatti
On Mon, Mar 02, 2015 at 03:02:02PM -0600, Joel Schopp wrote: From: David Kaplan david.kap...@amd.com We can make the in instruction go faster the same way the out instruction is already. Changes from v2[Joel]: * changed rax from u32 to unsigned long * changed a couple return

Re: [PATCH v3] x86: svm: use kvm_fast_pio_in()

2015-03-03 Thread Radim Krčmář
2015-03-03 14:03-0600, Joel Schopp: > On 03/03/2015 10:44 AM, Radim Krčmář wrote: > > 2015-03-02 15:02-0600, Joel Schopp: > >> + int ret = emulator_pio_in_emulated(>arch.emulate_ctxt, size, > >> + port, , 1); > > Btw. does this return 1 in some scenario? > If a

Re: [PATCH v3] x86: svm: use kvm_fast_pio_in()

2015-03-03 Thread Radim Krčmář
2015-03-03 13:48-0600, Joel Schopp: > >> + unsigned long new_rax = kvm_register_read(vcpu, VCPU_REGS_RAX); > > Shouldn't we handle writes in EAX differently than in AX and AL, because > > of implicit zero extension. > I don't think the implicit zero extension hurts us here, but maybe there > is

Re: [PATCH v3] x86: svm: use kvm_fast_pio_in()

2015-03-03 Thread Joel Schopp
On 03/03/2015 10:44 AM, Radim Krčmář wrote: > 2015-03-02 15:02-0600, Joel Schopp: >> +int kvm_fast_pio_in(struct kvm_vcpu *vcpu, int size, unsigned short port) >> +{ >> +unsigned long val; >> +int ret = emulator_pio_in_emulated(>arch.emulate_ctxt, size, >> +

Re: [PATCH v3] x86: svm: use kvm_fast_pio_in()

2015-03-03 Thread Joel Schopp
Thank you for your detailed review on several of my patches. >> >> +static int complete_fast_pio(struct kvm_vcpu *vcpu) > (complete_fast_pio_in()?) If I do a v4 I'll adopt that name. >> +{ >> +unsigned long new_rax = kvm_register_read(vcpu, VCPU_REGS_RAX); > Shouldn't we handle writes in

Re: [PATCH v3] x86: svm: use kvm_fast_pio_in()

2015-03-03 Thread Radim Krčmář
2015-03-02 15:02-0600, Joel Schopp: > +int kvm_fast_pio_in(struct kvm_vcpu *vcpu, int size, unsigned short port) > +{ > + unsigned long val; > + int ret = emulator_pio_in_emulated(>arch.emulate_ctxt, size, > +port, , 1); > + Btw. does this return 1

Re: [PATCH v3] x86: svm: use kvm_fast_pio_in()

2015-03-03 Thread Radim Krčmář
2015-03-02 15:02-0600, Joel Schopp: > From: David Kaplan > > We can make the in instruction go faster the same way the out instruction is > already. (How much faster do benchmarks run?) > Changes from v2[Joel]: > * changed rax from u32 to unsigned long > * changed a couple return 0

Re: [PATCH v3] x86: svm: use kvm_fast_pio_in()

2015-03-03 Thread Radim Krčmář
2015-03-02 15:02-0600, Joel Schopp: From: David Kaplan david.kap...@amd.com We can make the in instruction go faster the same way the out instruction is already. (How much faster do benchmarks run?) Changes from v2[Joel]: * changed rax from u32 to unsigned long * changed a

Re: [PATCH v3] x86: svm: use kvm_fast_pio_in()

2015-03-03 Thread Radim Krčmář
2015-03-02 15:02-0600, Joel Schopp: +int kvm_fast_pio_in(struct kvm_vcpu *vcpu, int size, unsigned short port) +{ + unsigned long val; + int ret = emulator_pio_in_emulated(vcpu-arch.emulate_ctxt, size, +port, val, 1); + Btw. does this return 1

Re: [PATCH v3] x86: svm: use kvm_fast_pio_in()

2015-03-03 Thread Joel Schopp
Thank you for your detailed review on several of my patches. +static int complete_fast_pio(struct kvm_vcpu *vcpu) (complete_fast_pio_in()?) If I do a v4 I'll adopt that name. +{ +unsigned long new_rax = kvm_register_read(vcpu, VCPU_REGS_RAX); Shouldn't we handle writes in EAX

Re: [PATCH v3] x86: svm: use kvm_fast_pio_in()

2015-03-03 Thread Joel Schopp
On 03/03/2015 10:44 AM, Radim Krčmář wrote: 2015-03-02 15:02-0600, Joel Schopp: +int kvm_fast_pio_in(struct kvm_vcpu *vcpu, int size, unsigned short port) +{ +unsigned long val; +int ret = emulator_pio_in_emulated(vcpu-arch.emulate_ctxt, size, +

Re: [PATCH v3] x86: svm: use kvm_fast_pio_in()

2015-03-03 Thread Radim Krčmář
2015-03-03 13:48-0600, Joel Schopp: + unsigned long new_rax = kvm_register_read(vcpu, VCPU_REGS_RAX); Shouldn't we handle writes in EAX differently than in AX and AL, because of implicit zero extension. I don't think the implicit zero extension hurts us here, but maybe there is something

Re: [PATCH v3] x86: svm: use kvm_fast_pio_in()

2015-03-03 Thread Radim Krčmář
2015-03-03 14:03-0600, Joel Schopp: On 03/03/2015 10:44 AM, Radim Krčmář wrote: 2015-03-02 15:02-0600, Joel Schopp: + int ret = emulator_pio_in_emulated(vcpu-arch.emulate_ctxt, size, + port, val, 1); Btw. does this return 1 in some scenario? If a

[PATCH v3] x86: svm: use kvm_fast_pio_in()

2015-03-02 Thread Joel Schopp
From: David Kaplan We can make the in instruction go faster the same way the out instruction is already. Changes from v2[Joel]: * changed rax from u32 to unsigned long * changed a couple return 0 to BUG_ON() * changed 8 to sizeof(new_rax) * added trace hook

[PATCH v3] x86: svm: use kvm_fast_pio_in()

2015-03-02 Thread Joel Schopp
From: David Kaplan david.kap...@amd.com We can make the in instruction go faster the same way the out instruction is already. Changes from v2[Joel]: * changed rax from u32 to unsigned long * changed a couple return 0 to BUG_ON() * changed 8 to sizeof(new_rax) *