Skip to content

Commit 40f4691

Browse files
executor: arm64: fix compiler warnings on inline assembly
Make sure operands passed to 64-bit MOV, MSR and MRS instructions are actually 64-bit. This fixes compiler warnings in certain build configurations.
1 parent 7cc1700 commit 40f4691

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

executor/common_kvm_arm64_syzos.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ GUEST_CODE static noinline void guest_handle_smc(struct api_call_smccc* cmd)
235235
// they are ignored as per the calling convention.
236236
"smc #0\n"
237237
: // Ignore the outputs for now
238-
: [func_id] "r"((uint32)cmd->func_id),
238+
: [func_id] "r"((uint64)cmd->func_id),
239239
[arg1] "r"(cmd->params[0]), [arg2] "r"(cmd->params[1]),
240240
[arg3] "r"(cmd->params[2]), [arg4] "r"(cmd->params[3]),
241241
[arg5] "r"(cmd->params[4])
@@ -257,7 +257,7 @@ GUEST_CODE static noinline void guest_handle_hvc(struct api_call_smccc* cmd)
257257
// TODO(glider): nonzero immediate values are designated for use by hypervisor vendors.
258258
"hvc #0\n"
259259
: // Ignore the outputs for now
260-
: [func_id] "r"((uint32)cmd->func_id),
260+
: [func_id] "r"((uint64)cmd->func_id),
261261
[arg1] "r"(cmd->params[0]), [arg2] "r"(cmd->params[1]),
262262
[arg3] "r"(cmd->params[2]), [arg4] "r"(cmd->params[3]),
263263
[arg5] "r"(cmd->params[4])
@@ -488,7 +488,7 @@ GUEST_CODE static void gicv3_cpu_init(uint32 cpu)
488488
gicr_wait_for_rwp(cpu);
489489

490490
// Enable the GIC system register (ICC_*) access.
491-
uint32 icc_sre_el1 = 0;
491+
uint64 icc_sre_el1 = 0;
492492
asm volatile("mrs %0, " ICC_SRE_EL1
493493
:
494494
: "r"(icc_sre_el1));
@@ -498,7 +498,7 @@ GUEST_CODE static void gicv3_cpu_init(uint32 cpu)
498498
: "r"(icc_sre_el1));
499499

500500
// Set a default priority threshold.
501-
uint32 value = ICC_PMR_DEF_PRIO;
501+
uint64 value = ICC_PMR_DEF_PRIO;
502502
asm volatile("msr " ICC_PMR_EL1 ", %0"
503503
:
504504
: "r"(value));
@@ -677,7 +677,7 @@ __attribute__((used))
677677
GUEST_CODE static void
678678
guest_irq_handler(struct ex_regs* regs)
679679
{
680-
uint32 iar0, iar1, irq_num = 0;
680+
uint64 iar0, iar1, irq_num = 0;
681681
bool is_group0 = false;
682682
// Acknowledge the interrupt by reading the IAR.
683683
// Depending on the particular interrupt's Group (0 or 1), its number will appear in either ICC_IAR0_EL1, or ICC_IAR1_EL1.

0 commit comments

Comments
 (0)