aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm/svm.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/kvm/svm.c')
-rw-r--r--drivers/kvm/svm.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c
index 72cac0488b31..f6e86528f031 100644
--- a/drivers/kvm/svm.c
+++ b/drivers/kvm/svm.c
@@ -1669,6 +1669,18 @@ static int is_disabled(void)
1669 return 0; 1669 return 0;
1670} 1670}
1671 1671
1672static void
1673svm_patch_hypercall(struct kvm_vcpu *vcpu, unsigned char *hypercall)
1674{
1675 /*
1676 * Patch in the VMMCALL instruction:
1677 */
1678 hypercall[0] = 0x0f;
1679 hypercall[1] = 0x01;
1680 hypercall[2] = 0xd9;
1681 hypercall[3] = 0xc3;
1682}
1683
1672static struct kvm_arch_ops svm_arch_ops = { 1684static struct kvm_arch_ops svm_arch_ops = {
1673 .cpu_has_kvm_support = has_svm, 1685 .cpu_has_kvm_support = has_svm,
1674 .disabled_by_bios = is_disabled, 1686 .disabled_by_bios = is_disabled,
@@ -1717,6 +1729,7 @@ static struct kvm_arch_ops svm_arch_ops = {
1717 .run = svm_vcpu_run, 1729 .run = svm_vcpu_run,
1718 .skip_emulated_instruction = skip_emulated_instruction, 1730 .skip_emulated_instruction = skip_emulated_instruction,
1719 .vcpu_setup = svm_vcpu_setup, 1731 .vcpu_setup = svm_vcpu_setup,
1732 .patch_hypercall = svm_patch_hypercall,
1720}; 1733};
1721 1734
1722static int __init svm_init(void) 1735static int __init svm_init(void)