Re: [PATCH 2/6] KVM: SVM: Add manipulation functions for CRxintercepts

From: Marcelo Tosatti
Date: Thu Dec 02 2010 - 11:46:30 EST


On Tue, Nov 30, 2010 at 06:03:57PM +0100, Joerg Roedel wrote:
> This patch wraps changes to the CRx intercepts of SVM into
> seperate functions to abstract nested-svm better and prepare
> the implementation of the vmcb-clean-bits feature.
>
> Signed-off-by: Joerg Roedel <joerg.roedel@xxxxxxx>
> ---
> arch/x86/include/asm/svm.h | 15 +++--
> arch/x86/kvm/svm.c | 119 +++++++++++++++++++++++---------------------
> 2 files changed, 72 insertions(+), 62 deletions(-)
>

> - control->intercept_cr_read = INTERCEPT_CR0_MASK |
> - INTERCEPT_CR3_MASK |
> - INTERCEPT_CR4_MASK;
> -
> - control->intercept_cr_write = INTERCEPT_CR0_MASK |
> - INTERCEPT_CR3_MASK |
> - INTERCEPT_CR4_MASK |
> - INTERCEPT_CR8_MASK;
> + set_cr_intercept(svm, INTERCEPT_CR0_READ);
> + set_cr_intercept(svm, INTERCEPT_CR3_READ);
> + set_cr_intercept(svm, INTERCEPT_CR4_READ);
> + set_cr_intercept(svm, INTERCEPT_CR0_WRITE);
> + set_cr_intercept(svm, INTERCEPT_CR3_WRITE);
> + set_cr_intercept(svm, INTERCEPT_CR4_WRITE);
> + set_cr_intercept(svm, INTERCEPT_CR8_WRITE);

Should clear hflags before using is_guest_mode().

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/