Trait rustsbi::Fence[][src]

pub trait Fence: Send {
    fn remote_fence_i(&mut self, hart_mask: HartMask) -> SbiRet;
fn remote_sfence_vma(
        &mut self,
        hart_mask: HartMask,
        start_addr: usize,
        size: usize
    ) -> SbiRet;
fn remote_sfence_vma_asid(
        &mut self,
        hart_mask: HartMask,
        start_addr: usize,
        size: usize,
        asid: usize
    ) -> SbiRet; fn remote_hfence_gvma_vmid(
        &mut self,
        hart_mask: HartMask,
        start_addr: usize,
        size: usize,
        vmid: usize
    ) -> SbiRet { ... }
fn remote_hfence_gvma(
        &mut self,
        hart_mask: HartMask,
        start_addr: usize,
        size: usize
    ) -> SbiRet { ... }
fn remote_hfence_vvma_asid(
        &mut self,
        hart_mask: HartMask,
        start_addr: usize,
        size: usize,
        asid: usize
    ) -> SbiRet { ... }
fn remote_hfence_vvma(
        &mut self,
        hart_mask: HartMask,
        start_addr: usize,
        size: usize
    ) -> SbiRet { ... } }
Expand description

Remote fence support

In RustSBI, RFENCE support requires an IPI support is implemented. If your platform does not provide IPI support, RustSBI will disable RFENCE interface access from supervisor level.

The remote fence function acts as a full TLB flush if

  • start_addr and size are both 0, and
  • size is equal to usize::MAX.

Required methods

fn remote_fence_i(&mut self, hart_mask: HartMask) -> SbiRet[src]

Instructs remote harts to execute FENCE.I instruction.

Return value

Returns SBI_SUCCESS when remote fence was sent to all the targeted harts successfully.

fn remote_sfence_vma(
    &mut self,
    hart_mask: HartMask,
    start_addr: usize,
    size: usize
) -> SbiRet
[src]

Instructs the remote harts to execute one or more SFENCE.VMA instructions, covering the range of virtual addresses between start and size.

Return value

The possible return error codes returned in SbiRet.error are shown in the table below:

Return codeDescription
SBI_SUCCESSRemote fence was sent to all the targeted harts successfully.
SBI_ERR_INVALID_ADDRESSstart_addr or size is not valid.

fn remote_sfence_vma_asid(
    &mut self,
    hart_mask: HartMask,
    start_addr: usize,
    size: usize,
    asid: usize
) -> SbiRet
[src]

Instruct the remote harts to execute one or more SFENCE.VMA instructions, covering the range of virtual addresses between start and size. This covers only the given ASID.

Return value

The possible return error codes returned in SbiRet.error are shown in the table below:

Return codeDescription
SBI_SUCCESSRemote fence was sent to all the targeted harts successfully.
SBI_ERR_INVALID_ADDRESSstart_addr or size is not valid.

Provided methods

fn remote_hfence_gvma_vmid(
    &mut self,
    hart_mask: HartMask,
    start_addr: usize,
    size: usize,
    vmid: usize
) -> SbiRet
[src]

Instruct the remote harts to execute one or more HFENCE.GVMA instructions, covering the range of guest physical addresses between start and size only for the given VMID.

This function call is only valid for harts implementing hypervisor extension.

Return value

The possible return error codes returned in SbiRet.error are shown in the table below:

Return codeDescription
SBI_SUCCESSRemote fence was sent to all the targeted harts successfully.
SBI_ERR_NOT_SUPPORTEDThis function is not supported as it is not implemented or one of the target hart doesn’t support hypervisor extension.
SBI_ERR_INVALID_ADDRESSstart_addr or size is not valid.

fn remote_hfence_gvma(
    &mut self,
    hart_mask: HartMask,
    start_addr: usize,
    size: usize
) -> SbiRet
[src]

Instruct the remote harts to execute one or more HFENCE.GVMA instructions, covering the range of guest physical addresses between start and size for all the guests.

This function call is only valid for harts implementing hypervisor extension.

Return value

The possible return error codes returned in SbiRet.error are shown in the table below:

Return codeDescription
SBI_SUCCESSRemote fence was sent to all the targeted harts successfully.
SBI_ERR_NOT_SUPPORTEDThis function is not supported as it is not implemented or one of the target hart doesn’t support hypervisor extension.
SBI_ERR_INVALID_ADDRESSstart_addr or size is not valid.

fn remote_hfence_vvma_asid(
    &mut self,
    hart_mask: HartMask,
    start_addr: usize,
    size: usize,
    asid: usize
) -> SbiRet
[src]

Instruct the remote harts to execute one or more HFENCE.VVMA instructions, covering the range of guest virtual addresses between start and size for the given ASID and current VMID (in hgatp CSR) of calling hart.

This function call is only valid for harts implementing hypervisor extension.

Return value

The possible return error codes returned in SbiRet.error are shown in the table below:

Return codeDescription
SBI_SUCCESSRemote fence was sent to all the targeted harts successfully.
SBI_ERR_NOT_SUPPORTEDThis function is not supported as it is not implemented or one of the target hart doesn’t support hypervisor extension.
SBI_ERR_INVALID_ADDRESSstart_addr or size is not valid.

fn remote_hfence_vvma(
    &mut self,
    hart_mask: HartMask,
    start_addr: usize,
    size: usize
) -> SbiRet
[src]

Instruct the remote harts to execute one or more HFENCE.VVMA instructions, covering the range of guest virtual addresses between start and size for current VMID (in hgatp CSR) of calling hart.

This function call is only valid for harts implementing hypervisor extension.

Return value

The possible return error codes returned in SbiRet.error are shown in the table below:

Return codeDescription
SBI_SUCCESSRemote fence was sent to all the targeted harts successfully.
SBI_ERR_NOT_SUPPORTEDThis function is not supported as it is not implemented or one of the target hart doesn’t support hypervisor extension.
SBI_ERR_INVALID_ADDRESSstart_addr or size is not valid.

Implementors