search for: write_ghcb_msr

Displaying 8 results from an estimated 8 matches for "write_ghcb_msr".

2020 Feb 11
0
[PATCH 14/62] x86/boot/compressed/64: Add stage1 #VC handler
...> + +#include "misc.h" + +static inline u64 read_ghcb_msr(void) +{ + unsigned long low, high; + + asm volatile("rdmsr\n" : "=a" (low), "=d" (high) : + "c" (MSR_AMD64_SEV_ES_GHCB)); + + return ((high << 32) | low); +} + +static inline void write_ghcb_msr(u64 val) +{ + u32 low, high; + + low = val & 0xffffffffUL; + high = val >> 32; + + asm volatile("wrmsr\n" : : "c" (MSR_AMD64_SEV_ES_GHCB), + "a"(low), "d" (high) : "memory"); +} + +#undef __init +#define __init + +/* Include code for ea...
2020 Feb 11
0
[PATCH 18/62] x86/boot/compressed/64: Setup GHCB Based VC Exception handler
...<asm/msr-index.h> #include <asm/ptrace.h> #include <asm/svm.h> #include "misc.h" +struct ghcb boot_ghcb_page __aligned(PAGE_SIZE); +struct ghcb *boot_ghcb; + static inline u64 read_ghcb_msr(void) { unsigned long low, high; @@ -35,8 +39,95 @@ static inline void write_ghcb_msr(u64 val) "a"(low), "d" (high) : "memory"); } +static enum es_result es_fetch_insn_byte(struct es_em_ctxt *ctxt, + unsigned int offset, + char *buffer) +{ + char *rip = (char *)ctxt->regs->ip; + + buffer[offset] = rip[offset]; + + return ES_OK; +}...
2020 Feb 11
1
[PATCH 18/62] x86/boot/compressed/64: Setup GHCB Based VC Exception handler
...t; #include <asm/svm.h> > > #include "misc.h" > > +struct ghcb boot_ghcb_page __aligned(PAGE_SIZE); > +struct ghcb *boot_ghcb; > + > static inline u64 read_ghcb_msr(void) > { > unsigned long low, high; > @@ -35,8 +39,95 @@ static inline void write_ghcb_msr(u64 val) > "a"(low), "d" (high) : "memory"); > } > > +static enum es_result es_fetch_insn_byte(struct es_em_ctxt *ctxt, > + unsigned int offset, > +...
2020 Feb 11
0
[PATCH 62/62] x86/sev-es: Add NMI state tracking
...this_cpu_write(sev_es_in_nmi, true); +} + +void sev_es_nmi_complete(void) +{ + struct ghcb *ghcb; + + ghcb = this_cpu_ptr(&ghcb_page); + + ghcb_invalidate(ghcb); + ghcb_set_sw_exit_code(ghcb, SVM_VMGEXIT_NMI_COMPLETE); + ghcb_set_sw_exit_info_1(ghcb, 0); + ghcb_set_sw_exit_info_2(ghcb, 0); + + write_ghcb_msr(__pa(ghcb)); + VMGEXIT(); + + this_cpu_write(sev_es_in_nmi, false); +} + static u64 sev_es_get_jump_table_addr(void) { unsigned long flags; @@ -485,7 +508,10 @@ static enum es_result handle_vmmcall(struct ghcb *ghcb, static enum es_result handle_db_exception(struct ghcb *ghcb, struct e...
2020 Feb 11
83
[RFC PATCH 00/62] Linux as SEV-ES Guest Support
Hi, here is the first public post of the patch-set to enable Linux to run under SEV-ES enabled hypervisors. The code is mostly feature-complete, but there are still a couple of bugs to fix. Nevertheless, given the size of the patch-set, I think it is about time to ask for initial feedback of the changes that come with it. To better understand the code here is a quick explanation of SEV-ES first.
2020 Feb 11
83
[RFC PATCH 00/62] Linux as SEV-ES Guest Support
Hi, here is the first public post of the patch-set to enable Linux to run under SEV-ES enabled hypervisors. The code is mostly feature-complete, but there are still a couple of bugs to fix. Nevertheless, given the size of the patch-set, I think it is about time to ask for initial feedback of the changes that come with it. To better understand the code here is a quick explanation of SEV-ES first.
2020 Feb 11
2
[PATCH 14/62] x86/boot/compressed/64: Add stage1 #VC handler
...; + unsigned long low, high; > + > + asm volatile("rdmsr\n" : "=a" (low), "=d" (high) : > + "c" (MSR_AMD64_SEV_ES_GHCB)); > + > + return ((high << 32) | low); > +} > + > +static inline void write_ghcb_msr(u64 val) > +{ > + u32 low, high; > + > + low = val & 0xffffffffUL; > + high = val >> 32; > + > + asm volatile("wrmsr\n" : : "c" (MSR_AMD64_SEV_ES_GHCB), > + "a"(low), "d" (high)...
2020 Feb 11
2
[PATCH 14/62] x86/boot/compressed/64: Add stage1 #VC handler
...; + unsigned long low, high; > + > + asm volatile("rdmsr\n" : "=a" (low), "=d" (high) : > + "c" (MSR_AMD64_SEV_ES_GHCB)); > + > + return ((high << 32) | low); > +} > + > +static inline void write_ghcb_msr(u64 val) > +{ > + u32 low, high; > + > + low = val & 0xffffffffUL; > + high = val >> 32; > + > + asm volatile("wrmsr\n" : : "c" (MSR_AMD64_SEV_ES_GHCB), > + "a"(low), "d" (high)...