File tree Expand file tree Collapse file tree 4 files changed +9
-13
lines changed Expand file tree Collapse file tree 4 files changed +9
-13
lines changed Original file line number Diff line number Diff line change @@ -374,7 +374,10 @@ int32_t acrn_handle_pending_request(struct acrn_vcpu *vcpu)
374
374
} else {
375
375
376
376
if (bitmap_test_and_clear_lock (ACRN_REQUEST_EPT_FLUSH , pending_req_bits )) {
377
- invept (vcpu );
377
+ invept (vcpu -> vm -> arch_vm .nworld_eptp );
378
+ if (vcpu -> vm -> sworld_control .flag .active != 0UL ) {
379
+ invept (vcpu -> vm -> arch_vm .sworld_eptp );
380
+ }
378
381
}
379
382
380
383
if (bitmap_test_and_clear_lock (ACRN_REQUEST_VPID_FLUSH , pending_req_bits )) {
Original file line number Diff line number Diff line change 35
35
#include <mmu.h>
36
36
#include <vmx.h>
37
37
#include <reloc.h>
38
- #include <vcpu.h>
39
38
#include <vm.h>
40
39
#include <ld_sym.h>
41
40
#include <logmsg.h>
@@ -123,19 +122,13 @@ void flush_vpid_global(void)
123
122
local_invvpid (VMX_VPID_TYPE_ALL_CONTEXT , 0U , 0UL );
124
123
}
125
124
126
- void invept (const struct acrn_vcpu * vcpu )
125
+ void invept (const void * eptp )
127
126
{
128
127
struct invept_desc desc = {0 };
129
128
130
129
if (pcpu_has_vmx_ept_cap (VMX_EPT_INVEPT_SINGLE_CONTEXT )) {
131
- desc .eptp = hva2hpa (vcpu -> vm -> arch_vm .nworld_eptp ) |
132
- (3UL << 3U ) | 6UL ;
130
+ desc .eptp = hva2hpa (eptp ) | (3UL << 3U ) | 6UL ;
133
131
local_invept (INVEPT_TYPE_SINGLE_CONTEXT , desc );
134
- if (vcpu -> vm -> sworld_control .flag .active != 0UL ) {
135
- desc .eptp = hva2hpa (vcpu -> vm -> arch_vm .sworld_eptp )
136
- | (3UL << 3U ) | 6UL ;
137
- local_invept (INVEPT_TYPE_SINGLE_CONTEXT , desc );
138
- }
139
132
} else if (pcpu_has_vmx_ept_cap (VMX_EPT_INVEPT_GLOBAL_CONTEXT )) {
140
133
local_invept (INVEPT_TYPE_ALL_CONTEXTS , desc );
141
134
} else {
Original file line number Diff line number Diff line change @@ -165,11 +165,11 @@ void flush_address_space(void *addr, uint64_t size);
165
165
/**
166
166
* @brief Guest-physical mappings and combined mappings invalidation
167
167
*
168
- * @param[in] vcpu the pointer that points the vcpu data structure
168
+ * @param[in] eptp the pointer that points the eptp
169
169
*
170
170
* @return None
171
171
*/
172
- void invept (const struct acrn_vcpu * vcpu );
172
+ void invept (const void * eptp );
173
173
174
174
static inline void cache_flush_invalidate_all (void )
175
175
{
Original file line number Diff line number Diff line change @@ -186,7 +186,7 @@ static inline void *hpa2hva(uint64_t x)
186
186
*
187
187
* @return The translated host-physical address
188
188
*/
189
- static inline uint64_t hva2hpa (void * x )
189
+ static inline uint64_t hva2hpa (const void * x )
190
190
{
191
191
return (uint64_t )x ;
192
192
}
You can’t perform that action at this time.
0 commit comments