svm.h (59d67fc1f0dbb5ee8841d62140efe0fdc4fbabf5) svm.h (b89456aee78d22b20c6c83c4d75af7985ae5be8d)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Kernel-based Virtual Machine driver for Linux
4 *
5 * AMD SVM support
6 *
7 * Copyright (C) 2006 Qumranet, Inc.
8 * Copyright 2010 Red Hat, Inc. and/or its affiliates.

--- 8 unchanged lines hidden (view full) ---

17
18#include <linux/kvm_types.h>
19#include <linux/kvm_host.h>
20#include <linux/bits.h>
21
22#include <asm/svm.h>
23#include <asm/sev-common.h>
24
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Kernel-based Virtual Machine driver for Linux
4 *
5 * AMD SVM support
6 *
7 * Copyright (C) 2006 Qumranet, Inc.
8 * Copyright 2010 Red Hat, Inc. and/or its affiliates.

--- 8 unchanged lines hidden (view full) ---

17
18#include <linux/kvm_types.h>
19#include <linux/kvm_host.h>
20#include <linux/bits.h>
21
22#include <asm/svm.h>
23#include <asm/sev-common.h>
24
25#include "cpuid.h"
25#include "kvm_cache_regs.h"
26
27#define __sme_page_pa(x) __sme_set(page_to_pfn(x) << PAGE_SHIFT)
28
29#define IOPM_SIZE PAGE_SIZE * 3
30#define MSRPM_SIZE PAGE_SIZE * 2
31
32#define MAX_DIRECT_ACCESS_MSRS 46

--- 221 unchanged lines hidden (view full) ---

254 bool nmi_l1_to_l2;
255
256 unsigned long soft_int_csbase;
257 unsigned long soft_int_old_rip;
258 unsigned long soft_int_next_rip;
259 bool soft_int_injected;
260
261 /* optional nested SVM features that are enabled for this guest */
26#include "kvm_cache_regs.h"
27
28#define __sme_page_pa(x) __sme_set(page_to_pfn(x) << PAGE_SHIFT)
29
30#define IOPM_SIZE PAGE_SIZE * 3
31#define MSRPM_SIZE PAGE_SIZE * 2
32
33#define MAX_DIRECT_ACCESS_MSRS 46

--- 221 unchanged lines hidden (view full) ---

255 bool nmi_l1_to_l2;
256
257 unsigned long soft_int_csbase;
258 unsigned long soft_int_old_rip;
259 unsigned long soft_int_next_rip;
260 bool soft_int_injected;
261
262 /* optional nested SVM features that are enabled for this guest */
262 bool vgif_enabled : 1;
263 bool vnmi_enabled : 1;
264
265 u32 ldr_reg;
266 u32 dfr_reg;
267 struct page *avic_backing_page;
268 u64 *avic_physical_id_cache;
269
270 /*

--- 209 unchanged lines hidden (view full) ---

480
481static inline bool svm_is_intercept(struct vcpu_svm *svm, int bit)
482{
483 return vmcb_is_intercept(&svm->vmcb->control, bit);
484}
485
486static inline bool nested_vgif_enabled(struct vcpu_svm *svm)
487{
263 bool vnmi_enabled : 1;
264
265 u32 ldr_reg;
266 u32 dfr_reg;
267 struct page *avic_backing_page;
268 u64 *avic_physical_id_cache;
269
270 /*

--- 209 unchanged lines hidden (view full) ---

480
481static inline bool svm_is_intercept(struct vcpu_svm *svm, int bit)
482{
483 return vmcb_is_intercept(&svm->vmcb->control, bit);
484}
485
486static inline bool nested_vgif_enabled(struct vcpu_svm *svm)
487{
488 return svm->vgif_enabled && (svm->nested.ctl.int_ctl & V_GIF_ENABLE_MASK);
488 return guest_can_use(&svm->vcpu, X86_FEATURE_VGIF) &&
489 (svm->nested.ctl.int_ctl & V_GIF_ENABLE_MASK);
489}
490
491static inline struct vmcb *get_vgif_vmcb(struct vcpu_svm *svm)
492{
493 if (!vgif)
494 return NULL;
495
496 if (is_guest_mode(&svm->vcpu) && !nested_vgif_enabled(svm))

--- 245 unchanged lines hidden ---
490}
491
492static inline struct vmcb *get_vgif_vmcb(struct vcpu_svm *svm)
493{
494 if (!vgif)
495 return NULL;
496
497 if (is_guest_mode(&svm->vcpu) && !nested_vgif_enabled(svm))

--- 245 unchanged lines hidden ---