Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load/store as user #54

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ SAIL_RV64_VM_SRCS = $(SAIL_RISCV_MODEL_DIR)/riscv_vmem_sv39.sail \

SAIL_VM_SRCS = $(SAIL_CHERI_MODEL_DIR)/cheri_pte.sail $(SAIL_CHERI_MODEL_DIR)/cheri_ptw.sail \
$(SAIL_RISCV_MODEL_DIR)/riscv_vmem_common.sail $(SAIL_RISCV_MODEL_DIR)/riscv_vmem_tlb.sail
SAIL_VM_SRCS += $(SAIL_$(ARCH)_VM_SRCS)
SAIL_VM_SRCS += $(SAIL_$(ARCH)_VM_SRCS) \
$(SAIL_CHERI_MODEL_DIR)/cheri_ptw_late.sail

# Non-instruction sources
PRELUDE = $(SAIL_RISCV_MODEL_DIR)/prelude.sail \
Expand Down Expand Up @@ -98,6 +99,7 @@ SAIL_ARCH_SRCS = $(PRELUDE) \
$(SAIL_RISCV_MODEL_DIR)/riscv_types_common.sail \
$(SAIL_CHERI_MODEL_DIR)/cheri_riscv_types.sail \
$(SAIL_RISCV_MODEL_DIR)/riscv_types.sail \
$(SAIL_CHERI_MODEL_DIR)/cheri_riscv_types_late.sail \
$(SAIL_REGS_SRCS) \
$(SAIL_SYS_SRCS) \
$(SAIL_RISCV_MODEL_DIR)/riscv_platform.sail \
Expand All @@ -111,6 +113,7 @@ SAIL_ARCH_RVFI_SRCS = \
$(SAIL_RISCV_MODEL_DIR)/riscv_types_common.sail \
$(SAIL_CHERI_MODEL_DIR)/cheri_riscv_types.sail \
$(SAIL_RISCV_MODEL_DIR)/riscv_types.sail \
$(SAIL_CHERI_MODEL_DIR)/cheri_riscv_types_late.sail \
$(SAIL_REGS_SRCS) \
$(SAIL_SYS_SRCS) \
$(SAIL_RISCV_MODEL_DIR)/riscv_platform.sail \
Expand Down
2 changes: 1 addition & 1 deletion sail-riscv
6 changes: 6 additions & 0 deletions src/cheri_addr_checks.sail
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,12 @@ function ext_handle_data_check_error(err : ext_data_addr_error) -> unit = {
handle_cheri_cap_exception(capEx, regnum)
}

/* Default implementations of these hooks permit all accesses. */
function ext_check_phys_mem_read (access_type, paddr, size, aquire, release, reserved, read_meta) =
Ext_PhysAddr_OK ()

function ext_check_phys_mem_write(write_kind, paddr, size, data, metadata) =
Ext_PhysAddr_OK ()

/* Is XRET from given mode permitted by extension? */
function ext_check_xret_priv (p : Privilege) : Privilege -> bool =
Expand Down
4 changes: 4 additions & 0 deletions src/cheri_cap_common.sail
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,10 @@ function isCapSealed(cap) = signed(cap.otype) != otype_unsealed
val hasReservedOType : Capability -> bool
function hasReservedOType(cap) = unsigned(cap.otype) > cap_max_otype

function isCapSentryOrIsentry(cap) : Capability -> bool =
let sotype = signed(cap.otype) in
(sotype == otype_sentry) | (sotype == otype_isentry_pcc)

function sealCap(cap, otyp) : (Capability, bits(cap_otype_width)) -> Capability =
{cap with otype=otyp}

Expand Down
Loading