mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
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>
Subject: Re: [PATCH v1 2/3] kvm: svm: Add kvm_fast_pio_in support
Date: Tue, 22 Nov 2016 08:25:52 -0600	[thread overview]
Message-ID: <eae743da-6c8a-174a-39e6-18524647f82a@amd.com> (raw)
In-Reply-To: <63d4112c-71c4-9d6f-60dc-c5a71c03df7a@redhat.com>

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).

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;
>> +	}

  reply	other threads:[~2016-11-22 14:26 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-14 22:15 [PATCH v1 0/3] x86: SVM: add additional SVM NPF error and use HW GPA Brijesh Singh
2016-11-14 22:15 ` [PATCH v1 1/3] kvm: svm: Add support for additional SVM NPF error codes Brijesh Singh
2016-11-21 15:12   ` Paolo Bonzini
2016-11-22 22:15     ` Tom Lendacky
2016-11-22 22:29       ` Paolo Bonzini
2016-11-14 22:15 ` [PATCH v1 2/3] kvm: svm: Add kvm_fast_pio_in support Brijesh Singh
2016-11-21 14:50   ` Paolo Bonzini
2016-11-22 14:25     ` Tom Lendacky [this message]
2016-11-22 15:12       ` Paolo Bonzini
2016-11-14 22:16 ` [PATCH v1 3/3] kvm: svm: Use the hardware provided GPA instead of page walk Brijesh Singh
2016-11-21 15:07   ` Paolo Bonzini
2016-11-22 14:13     ` Tom Lendacky
  -- strict thread matches above, loose matches on Subject: below --
2016-11-14 22:04 [PATCH v1 0/3] x86: SVM: add additional SVM NPF error and use HW GPA Brijesh Singh
2016-11-14 22:04 ` [PATCH v1 2/3] kvm: svm: Add kvm_fast_pio_in support Brijesh Singh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=eae743da-6c8a-174a-39e6-18524647f82a@amd.com \
    --to=thomas.lendacky@amd.com \
    --cc=bp@suse.de \
    --cc=brijesh.singh@amd.com \
    --cc=hpa@zytor.com \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome