Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1527593
| From | Paolo Bonzini <pbonzini@redhat.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v1 2/3] kvm: svm: Add kvm_fast_pio_in support |
| Date | 2016-11-22 16:20 +0100 |
| Message-ID | <sGl1v-oK-21@gated-at.bofh.it> (permalink) |
| References | <sFYeC-2u5-9@gated-at.bofh.it> <sFYeC-2u5-11@gated-at.bofh.it> <sFYeC-2u5-7@gated-at.bofh.it> <sGl1v-oK-23@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
----- Original Message -----
> From: "Tom Lendacky" <thomas.lendacky@amd.com>
> To: "Paolo Bonzini" <pbonzini@redhat.com>, "Brijesh Singh" <brijesh.singh@amd.com>, kvm@vger.kernel.org
> Cc: rkrcmar@redhat.com, joro@8bytes.org, x86@kernel.org, linux-kernel@vger.kernel.org, mingo@redhat.com,
> hpa@zytor.com, tglx@linutronix.de, bp@suse.de
> Sent: Tuesday, November 22, 2016 3:25:52 PM
> Subject: Re: [PATCH v1 2/3] kvm: svm: Add kvm_fast_pio_in support
>
> On 11/21/2016 8:50 AM, Paolo Bonzini wrote:
> >
> >
> > On 14/11/2016 23:15, Brijesh Singh wrote:
> >> + /* For size less than 4 we merge, else we zero extend */
> >> + val = (size < 4) ? kvm_register_read(vcpu, VCPU_REGS_RAX) : 0;
> >
> > Are you sure it shouldn't always zero extend the high 32-bits? So "val"
> > should be declared as u32.
> >
> > Paolo
>
> It should only zero extend when dealing with a 32-bit operation. Any use
> of 8 or 16 bit registers leaves the upper 56 or 48 bits as is (see
> section 3.1.2.3 in http://support.amd.com/TechDocs/24592.pdf).
Duh, right, see also assign_register in arch/x86/kvm/emulate.c.
Paolo
> Thanks,
> Tom
>
> >
> >> + ret = emulator_pio_in_emulated(&vcpu->arch.emulate_ctxt, size, port,
> >> + &val, 1);
> >> + if (ret) {
> >> + kvm_register_write(vcpu, VCPU_REGS_RAX, val);
> >> + return ret;
> >> + }
>
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: [PATCH v1 2/3] kvm: svm: Add kvm_fast_pio_in support Paolo Bonzini <pbonzini@redhat.com> - 2016-11-21 16:00 +0100 Re: [PATCH v1 2/3] kvm: svm: Add kvm_fast_pio_in support Paolo Bonzini <pbonzini@redhat.com> - 2016-11-22 16:20 +0100
csiph-web