All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gleb Natapov <gleb@redhat.com>
To: Yang Zhang <yang.z.zhang@intel.com>
Cc: kvm@vger.kernel.org, haitao.shan@intel.com, mtosatti@redhat.com,
	Kevin Tian <kevin.tian@intel.com>
Subject: Re: [PATCH v9 2/3] x86, apicv: add virtual x2apic support
Date: Thu, 10 Jan 2013 10:25:27 +0200	[thread overview]
Message-ID: <20130110082527.GK700@redhat.com> (raw)
In-Reply-To: <1357802768-15816-3-git-send-email-yang.z.zhang@intel.com>

On Thu, Jan 10, 2013 at 03:26:07PM +0800, Yang Zhang wrote:
> +static void vmx_enable_virtual_x2apic_mode(struct kvm_vcpu *vcpu)
> +{
> +	u32 exec_control;
> +	int msr;
> +	struct vcpu_vmx *vmx = to_vmx(vcpu);
> +
> +	if (!cpu_has_vmx_virtualize_x2apic_mode())
> +		return;
> +
> +	exec_control = vmcs_read32(CPU_BASED_VM_EXEC_CONTROL);
> +	/* virtualize x2apic mode relies on tpr shadow */
> +	if (!(exec_control & CPU_BASED_TPR_SHADOW))
> +		return;
> +
> +	exec_control = vmcs_read32(SECONDARY_VM_EXEC_CONTROL);
> +	exec_control &= ~SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES;
> +	exec_control |= SECONDARY_EXEC_VIRTUALIZE_X2APIC_MODE;
> +	vmcs_write32(SECONDARY_VM_EXEC_CONTROL, exec_control);
> +	vmx->virtual_x2apic_enabled = true;
> +
> +	if (!cpu_has_vmx_virtual_intr_delivery())
> +		return;
> +
> +	for (msr = 0x800; msr <= 0x8ff; msr++)
> +		vmx_intercept_for_msr_read(msr, false, false);
> +
> +	/* APIC ID */
> +	vmx_intercept_for_msr_read(0x802, false, true);
Why are you enabling apic id read intercept?

> +	/* TMCCT */
> +	vmx_intercept_for_msr_read(0x839, false, true);
> +	/* TPR */
> +	vmx_intercept_for_msr_write(0x808, false, false);
> +	/* EOI */
> +	vmx_intercept_for_msr_write(0x80b, false, false);
> +	/* SELF-IPI */
> +	vmx_intercept_for_msr_write(0x83f, false, false);
> +
> +}
> +

--
			Gleb.

  parent reply	other threads:[~2013-01-10  8:25 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-10  7:26 [PATCH v9 0/3] x86, apicv: Add APIC virtualization support Yang Zhang
2013-01-10  7:26 ` [PATCH v9 1/3] x86, apicv: add APICv register " Yang Zhang
2013-01-10 20:25   ` Marcelo Tosatti
2013-01-10  7:26 ` [PATCH v9 2/3] x86, apicv: add virtual x2apic support Yang Zhang
2013-01-10  7:55   ` Gleb Natapov
2013-01-10  8:32     ` Zhang, Yang Z
2013-01-10  8:52       ` Gleb Natapov
2013-01-10 11:54         ` Zhang, Yang Z
2013-01-10 12:16           ` Gleb Natapov
2013-01-10 12:22             ` Zhang, Yang Z
2013-01-10 12:34               ` Gleb Natapov
2013-01-11  7:36                 ` Zhang, Yang Z
2013-01-11 16:54                   ` Gleb Natapov
2013-01-14  1:03                     ` Zhang, Yang Z
2013-01-14  1:14                     ` Zhang, Yang Z
2013-01-11  2:37         ` Zhang, Yang Z
2013-01-11 13:51           ` Gleb Natapov
2013-01-10  8:25   ` Gleb Natapov [this message]
2013-01-10  8:31     ` Zhang, Yang Z
2013-01-10  8:53       ` Gleb Natapov
2013-01-10  7:26 ` [PATCH v9 3/3] x86, apicv: add virtual interrupt delivery support Yang Zhang
2013-01-10  8:23   ` Gleb Natapov
2013-01-10 12:04     ` Zhang, Yang Z
2013-01-10 21:36   ` Marcelo Tosatti
2013-01-11 14:09     ` Gleb Natapov
2013-01-11 17:58       ` Marcelo Tosatti

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=20130110082527.GK700@redhat.com \
    --to=gleb@redhat.com \
    --cc=haitao.shan@intel.com \
    --cc=kevin.tian@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=yang.z.zhang@intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.