Skip to content

Commit

Permalink
lib/ukvmem/arch/arm: Fix error_code build error with correct esr
Browse files Browse the repository at this point in the history
Commit 4d97341 ("lib/ukvmem/arch: Do not print error message if demand paging disabled")
introduced a build error and a warning by copy-pasting the change from
x86 to Arm. This is incorrect as the trap context from Arm does not have
the `error_code` but the `esr` field instead. Fix this by using using the
corect field and correct string format.

Signed-off-by: Sergiu Moga <sergiu@unikraft.io>
Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
GitHub-Closes: #1388
  • Loading branch information
mogasergiu authored and razvand committed Apr 20, 2024
1 parent 3facdb2 commit 6e1011b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/ukvmem/arch/arm/pagefault64.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ static int vmem_arch_pagefault(void *data)
vas = uk_vas_get_active();
if (unlikely(vas && !(vas->flags & UK_VAS_FLAG_NO_PAGING)))
uk_pr_crit("Cannot handle %s page fault at 0x%"
__PRIvaddr" (ec: 0x%x): %s (%d).\n",
__PRIvaddr" (ec: 0x%lx): %s (%d).\n",
faultstr[faulttype &
UK_VMA_FAULT_ACCESSTYPE],
vaddr, ctx->error_code, strerror(-rc), -rc);
vaddr, ctx->esr, strerror(-rc), -rc);

return UK_EVENT_NOT_HANDLED;
}
Expand Down

0 comments on commit 6e1011b

Please sign in to comment.