81a71f51b8
x86/acrn: Set up timekeeping
...
ACRN Hypervisor reports timing information via CPUID leaf 0x40000010.
Get the TSC and CPU frequency via CPUID leaf 0x40000010 and set the
kernel values accordingly.
Signed-off-by: Fei Li <fei1.li@intel.com >
Signed-off-by: Ingo Molnar <mingo@kernel.org >
Reviewed-by: Conghui <conghui.chen@intel.com >
Link: https://lore.kernel.org/r/20220804055903.365211-1-fei1.li@intel.com
2022-08-04 11:11:59 +02:00
8a0a87198a
x86/acrn: Introduce hypercall interfaces
...
The Service VM communicates with the hypervisor via conventional
hypercalls. VMCALL instruction is used to make the hypercalls.
ACRN hypercall ABI:
* Hypercall number is in R8 register.
* Up to 2 parameters are in RDI and RSI registers.
* Return value is in RAX register.
Introduce the ACRN hypercall interfaces. Because GCC doesn't support R8
register as direct register constraints, use supported constraint as
input with a explicit MOV to R8 in beginning of asm.
Cc: Dave Hansen <dave.hansen@intel.com >
Cc: Sean Christopherson <sean.j.christopherson@intel.com >
Cc: Dan Williams <dan.j.williams@intel.com >
Cc: Fengwei Yin <fengwei.yin@intel.com >
Cc: Zhi Wang <zhi.a.wang@intel.com >
Cc: Zhenyu Wang <zhenyuw@linux.intel.com >
Cc: Yu Wang <yu1.wang@intel.com >
Cc: Reinette Chatre <reinette.chatre@intel.com >
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Cc: Borislav Petkov <bp@alien8.de >
Cc: Arvind Sankar <nivedita@alum.mit.edu >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Nick Desaulniers <ndesaulniers@google.com >
Cc: Segher Boessenkool <segher@kernel.crashing.org >
Originally-by: Yakui Zhao <yakui.zhao@intel.com >
Reviewed-by: Reinette Chatre <reinette.chatre@intel.com >
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com >
Acked-by: Borislav Petkov <bp@suse.de >
Signed-off-by: Shuo Liu <shuo.a.liu@intel.com >
Link: https://lore.kernel.org/r/20210207031040.49576-5-shuo.a.liu@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-02-09 10:58:18 +01:00
ebbfc978f3
x86/acrn: Introduce acrn_cpuid_base() and hypervisor feature bits
...
ACRN Hypervisor reports hypervisor features via CPUID leaf 0x40000001
which is similar to KVM. A VM can check if it's the privileged VM using
the feature bits. The Service VM is the only privileged VM by design.
Cc: Dave Hansen <dave.hansen@intel.com >
Cc: Sean Christopherson <sean.j.christopherson@intel.com >
Cc: Dan Williams <dan.j.williams@intel.com >
Cc: Fengwei Yin <fengwei.yin@intel.com >
Cc: Zhi Wang <zhi.a.wang@intel.com >
Cc: Zhenyu Wang <zhenyuw@linux.intel.com >
Cc: Yu Wang <yu1.wang@intel.com >
Cc: Reinette Chatre <reinette.chatre@intel.com >
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Reviewed-by: Reinette Chatre <reinette.chatre@intel.com >
Acked-by: Borislav Petkov <bp@suse.de >
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com >
Signed-off-by: Shuo Liu <shuo.a.liu@intel.com >
Link: https://lore.kernel.org/r/20210207031040.49576-4-shuo.a.liu@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-02-09 10:58:18 +01:00
7995700e65
x86/acrn: Introduce acrn_{setup, remove}_intr_handler()
...
The ACRN Hypervisor builds an I/O request when a trapped I/O access
happens in User VM. Then, ACRN Hypervisor issues an upcall by sending
a notification interrupt to the Service VM. HSM in the Service VM needs
to hook the notification interrupt to handle I/O requests.
Notification interrupts from ACRN Hypervisor are already supported and
a, currently uninitialized, callback called.
Export two APIs for HSM to setup/remove its callback.
Cc: Dave Hansen <dave.hansen@intel.com >
Cc: Sean Christopherson <sean.j.christopherson@intel.com >
Cc: Dan Williams <dan.j.williams@intel.com >
Cc: Fengwei Yin <fengwei.yin@intel.com >
Cc: Zhi Wang <zhi.a.wang@intel.com >
Cc: Zhenyu Wang <zhenyuw@linux.intel.com >
Cc: Yu Wang <yu1.wang@intel.com >
Cc: Reinette Chatre <reinette.chatre@intel.com >
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Originally-by: Yakui Zhao <yakui.zhao@intel.com >
Reviewed-by: Zhi Wang <zhi.a.wang@intel.com >
Reviewed-by: Reinette Chatre <reinette.chatre@intel.com >
Acked-by: Borislav Petkov <bp@suse.de >
Signed-off-by: Shuo Liu <shuo.a.liu@intel.com >
Link: https://lore.kernel.org/r/20210207031040.49576-3-shuo.a.liu@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-02-09 10:58:18 +01:00
a16be368dd
x86/entry: Convert various hypervisor vectors to IDTENTRY_SYSVEC
...
Convert various hypervisor vectors to IDTENTRY_SYSVEC:
- Implement the C entry point with DEFINE_IDTENTRY_SYSVEC
- Emit the ASM stub with DECLARE_IDTENTRY_SYSVEC
- Remove the ASM idtentries in 64-bit
- Remove the BUILD_INTERRUPT entries in 32-bit
- Remove the old prototypes
No functional change.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
Signed-off-by: Ingo Molnar <mingo@kernel.org >
Acked-by: Andy Lutomirski <luto@kernel.org >
Reviewed-by: Wei Liu <wei.liu@kernel.org >
Link: https://lore.kernel.org/r/20200521202119.647997594@linutronix.de
2020-06-11 15:15:15 +02:00
498ad39368
x86/acrn: Use HYPERVISOR_CALLBACK_VECTOR for ACRN guest upcall vector
...
Use the HYPERVISOR_CALLBACK_VECTOR to notify an ACRN guest.
Co-developed-by: Jason Chen CJ <jason.cj.chen@intel.com >
Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com >
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com >
Signed-off-by: Borislav Petkov <bp@suse.de >
Reviewed-by: Thomas Gleixner <tglx@linutronix.de >
Cc: Andy Lutomirski <luto@kernel.org >
Cc: "H. Peter Anvin" <hpa@zytor.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: x86-ml <x86@kernel.org >
Link: https://lkml.kernel.org/r/1559108037-18813-4-git-send-email-yakui.zhao@intel.com
2019-06-11 21:31:31 +02:00