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

[QEMU backport] riscv: fix wfi exception behavior #1995

Merged

Commits on Sep 3, 2024

  1. target/riscv: fix wfi exception behavior

    The wfi exception trigger behavior should take into account user mode,
    hstatus.vtw, and the fact the an wfi might raise different types of
    exceptions depending on various factors:
    
    If supervisor mode is not present:
    
    - an illegal instruction exception should be generated if user mode
    executes and wfi instruction and mstatus.tw = 1.
    
    If supervisor mode is present:
    
    - when a wfi instruction is executed, an illegal exception should be triggered
    if either the current mode is user or the mode is supervisor and mstatus.tw is
    set.
    
    Plus, if the hypervisor extensions are enabled:
    
    - a virtual instruction exception should be raised when a wfi is executed from
    virtual-user or virtual-supervisor and hstatus.vtw is set.
    
    Signed-off-by: Jose Martins <[email protected]>
    Reviewed-by: Alistair Francis <[email protected]>
    Message-id: [email protected]
    Signed-off-by: Alistair Francis <[email protected]>
    josecm authored and apparentlymart committed Sep 3, 2024
    Configuration menu
    Copy the full SHA
    58f1a61 View commit details
    Browse the repository at this point in the history