All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Joerg Roedel <joerg.roedel@amd.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Joerg Roedel <joro@8bytes.org>
Subject: Re: [PATCH 4/7] KVM: SVM: Use seperate VMCB for L2 guests
Date: Thu, 14 Jul 2011 14:38:39 +0300	[thread overview]
Message-ID: <4E1ED53F.7030903@redhat.com> (raw)
In-Reply-To: <1310571145-28930-5-git-send-email-joerg.roedel@amd.com>

On 07/13/2011 06:32 PM, Joerg Roedel wrote:
> From: Joerg Roedel<joro@8bytes.org>
>
> Move torwards emulation of VMCB-clean-bits by using a
> seperate VMCB when running L2 guests.
>
>
> diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
> index f81e35e..6dacf59 100644
> --- a/arch/x86/kvm/svm.c
> +++ b/arch/x86/kvm/svm.c
> @@ -105,6 +105,8 @@ struct nested_state {
>
>   	/* Nested Paging related state */
>   	u64 nested_cr3;
> +
> +	struct vmcb *n_vmcb;
>   };
>
>   #define MSRPM_OFFSETS	16
> @@ -974,6 +976,26 @@ static u64 svm_compute_tsc_offset(struct kvm_vcpu *vcpu, u64 target_tsc)
>   	return target_tsc - tsc;
>   }
>
> +static bool init_nested_vmcb(struct vcpu_svm *svm)
> +{
> +	struct vmcb_control_area *hc, *nc;
> +
> +	svm->nested.n_vmcb = (void *)get_zeroed_page(GFP_KERNEL);
> +	if (svm->nested.n_vmcb == NULL)
> +		return false;
> +
> +	nc =&svm->nested.n_vmcb->control;
> +	hc =&svm->host_vmcb->control;
> +
> +	nc->iopm_base_pa		= hc->iopm_base_pa;
> +	nc->msrpm_base_pa		= hc->msrpm_base_pa;
> +	nc->nested_ctl			= hc->nested_ctl;
> +	nc->pause_filter_count		= hc->pause_filter_count;
> +	svm->nested.n_vmcb->save.g_pat	= svm->host_vmcb->save.g_pat;
> +
> +	return true;
> +}
> +

Instead of initializing the non-nested vmcb and then copying it, 
separate out the bits you're copying here into a separate function (i.e. 
init_vmcb_host_state()) and call it for both vmcbs.

I had practically the same comment for nvmx (see 
vmx_set_constant_host_state()).

-- 
error compiling committee.c: too many arguments to function


  reply	other threads:[~2011-07-14 11:38 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-13 15:32 [PATCH 0/7] Implement Shadow VMCB for Nested SVM Joerg Roedel
2011-07-13 15:32 ` [PATCH 1/7] KVM: SVM: Keep seperate pointer to host-vmcb Joerg Roedel
2011-07-14 10:13   ` Avi Kivity
2011-07-13 15:32 ` [PATCH 2/7] KVM: SVM: Use host_vmcb_pa for vmload and vmsave Joerg Roedel
2011-07-14 11:29   ` Avi Kivity
2011-07-14 13:10     ` Joerg Roedel
2011-07-14 13:20       ` Avi Kivity
2011-07-14 13:52         ` Joerg Roedel
2011-07-14 14:01           ` Avi Kivity
2011-07-13 15:32 ` [PATCH 3/7] KVM: SVM: Reorder nested_svm_vmrun Joerg Roedel
2011-07-13 15:32 ` [PATCH 4/7] KVM: SVM: Use seperate VMCB for L2 guests Joerg Roedel
2011-07-14 11:38   ` Avi Kivity [this message]
2011-07-14 13:12     ` Joerg Roedel
2011-07-14 13:26       ` Avi Kivity
2011-07-14 13:40         ` Joerg Roedel
2011-07-14 13:43           ` Avi Kivity
2011-07-13 15:32 ` [PATCH 5/7] KVM: SVM: Remove nested.hsave state Joerg Roedel
2011-07-13 15:32 ` [PATCH 6/7] KVM: SVM: Rework hflags handling Joerg Roedel
2011-07-13 15:32 ` [PATCH 7/7] KVM: SVM: Don't change host intercepts in vmrun emulation Joerg Roedel

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=4E1ED53F.7030903@redhat.com \
    --to=avi@redhat.com \
    --cc=joerg.roedel@amd.com \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mtosatti@redhat.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.