File tree Expand file tree Collapse file tree 2 files changed +5
-10
lines changed Expand file tree Collapse file tree 2 files changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,11 @@ int vmcall_vmexit_handler(struct vcpu *vcpu)
52
52
/* hypercall param4 from guest, reserved*/
53
53
/* uint64_t param4 = cur_context->guest_cpu_regs.regs.rcx; */
54
54
55
+ if (!is_hypercall_from_ring0 ()) {
56
+ pr_err ("hypercall is only allowed from RING-0!\n" );
57
+ return -1 ;
58
+ }
59
+
55
60
/* Dispatch the hypercall handler */
56
61
switch (hypcall_id ) {
57
62
case HC_GET_API_VERSION :
Original file line number Diff line number Diff line change @@ -40,11 +40,6 @@ int64_t hcall_world_switch(struct vcpu *vcpu)
40
40
{
41
41
int next_world_id = !(vcpu -> arch_vcpu .cur_context );
42
42
43
- if (!is_hypercall_from_ring0 ()) {
44
- pr_err ("%s() is only allowed from RING-0!\n" , __func__ );
45
- return -1 ;
46
- }
47
-
48
43
if (!vcpu -> vm -> sworld_control .sworld_enabled ) {
49
44
pr_err ("Secure World is not enabled!\n" );
50
45
return -1 ;
@@ -64,11 +59,6 @@ int64_t hcall_world_switch(struct vcpu *vcpu)
64
59
65
60
int64_t hcall_initialize_trusty (struct vcpu * vcpu , uint64_t param )
66
61
{
67
- if (!is_hypercall_from_ring0 ()) {
68
- pr_err ("%s() is only allowed from RING-0!\n" , __func__ );
69
- return -1 ;
70
- }
71
-
72
62
if (!vcpu -> vm -> sworld_control .sworld_enabled ) {
73
63
pr_err ("Secure World is not enabled!\n" );
74
64
return -1 ;
You can’t perform that action at this time.
0 commit comments