Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
|
|
isa_parser should already require any Zvef or Zved extensions
imply F/D
|
|
Accidentally removed in c9468f6e02.
See #1660.
|
|
|
|
Smstateen: Ignore writes to read-only hstateen*[n] bits when mstateen*[n]=0
|
|
|
|
The specification states that writes to read-only bits in a RW CSR are
ignored. The hstateen*[n] bits are read-only when mstateen*[n]=0. This
PR proposes ignoring writes to read-only hstateen*[n] bits when
mstateen*[n]=0 instead of writing the bits to 0.
|
|
1. Add EXT_ZICFISS for enable Zicfiss with zicfiss extension name.
2. Add new software exception with tval 3 for shadow stack.
3. Implement sspush_x1/sspush_x5/sspopchk_x1/sspopchk_x5/ssrdp/ssamoswap_w/ssamoswap_d.
4. Implement c_sspush_x1/c_sspopchk_x5 in c_lui.h which has same encoding.
5. Add new special access type ss_access in xlate_flags_t for checking special read/write permission in SS(Shadow Stack) page.
6. Add new ss_load/ss_store/ssamoswap to enable ss_access flag.
7. Check special pte(xwr=010) of SS page.
|
|
The henvcfg fields, i.e., PBMTE, STCE, and ADUE, are read-only 0 when
the corresponding bits in menvcfg are 0. Besides the reading behavior,
the spec also specified the writing behavior, i.e., ignoring writes.
This commit ignores writes to the henvcfg fields when read-only 0.
Reference: https://github.com/riscv/riscv-isa-manual/issues/1312
|
|
Zicfilp being enabled
|
|
|
|
|
|
|
|
Teach Sstc to respect xenvcfg.STCE
|
|
interrupts or CSR hgeip bits
The H extension defines that bits VSEIP, VSTIP, and VSSIP of hvip are
writable. (The other bits of hvip are read-only 0.) Only hip.VSSIP
(mip.VSSIP) is an alias of hvip.VSSIP. The hip.VSEIP is the logical-OR
of hvip.VSEIP, selected bit of hgeip by hstatus.VGEIN, and
platform-specific external interrupt signals to VS-level, e.g., from
AIA. The hip.VSTIP is the logical-OR of hvip.VSTIP and platform-specific
timer interrupt signals to VS-level, e.g., from Sstc. Thus, the read
values of hvip.VSEIP and hvip.VSTIP differ from the ones of hip.VSEIP
and hip.VSTIP (mip.VSEIP and mip.VSTIP). In other words, the hvip isn't
an alias (proxy) of mip.
The current aliasing (proxy) implementation does not provide the desired
behavior for hvip.VSEIP and hvip.VSTIP. An ISA-level behavior difference
is that any platform-specific external and timer interrupt signals
directed to VS-level should not be observable through the hvip. For
instance, the hvip should not observe the virtual timer interrupt signal
from the vstimecmp CSR (Sstc extension), which isn't true in the current
implementation. Additionally, the hvip should not observe the virtual
external interrupt signal from the IMSIC device (AIA extension).
Another ISA-level behavior difference is that the hgeip and
hstatus.VGEIN also should not affect hvip.VSEIP, which isn't true in the
current implementation.
This commit fixes the issue by giving the hvip a specialized class,
hvip_csr_t. The hvip_csr_t aliases the hvip.VSSIP to the mip.VSSIP but
decouples the hvip.VSEIP and hvip.VSTIP from mip.VSEIP and mip.VSTIP.
Additionally, the commit updates the read value of mip to be the
logical-OR of hvip.VSEIP, hvip.VSTIP, and other sources.
|
|
When menvcfg.STCE=0, mip.STIP reverts to its defined behavior as if
unsupporting Sstc extension. When henvcfg.STCE=0, mip.VSTIP reverts
to its defined behavior as if unsupporting Sstc extension. [https://github.com/riscv/riscv-time-compare/issues/5]
The previous Sstc implementation does not respect the xenvcfg.STCE.
In other words, the Sstc may assert mip.STIP (mip.VSTIP) when
menvcfg.STCE=0 (henvcfg.STCE=0), which is a misbehaving.
|
|
|
|
|
|
Signed-off-by: Ved Shanbhogue <91900059+ved-rivos@users.noreply.github.com>
|
|
|
|
|
|
|
|
|
|
modes
|
|
HS-mode
The spec requires menvcfg.STCE=1 on accessing stimecmp or vstimecmp in a
mode other than M-mode. The previous implementation does not check the
permission on accessing vstimecmp in HS-mode. This commit fixes the
issue by moveing the permission check from virtualized_stimecmp_csr_t to
stimecmp_csr_t, which implements the vstimecmp.
|
|
If Smcntrpmf is enabled, mcycle / minstret increment only if counting
for the privilege level isn't inhibited in mcyclecfg / minstretcfg.
|
|
Add Smcsrind / Sscsrind support
|
|
The value 2 of henvcfg.CBIE is reserved. This commit legalizes it to 0.
Reference: https://github.com/riscv/riscv-CMOs/issues/65
|
|
The value 2 of senvcfg.CBIE is reserved. This commit legalizes it to 0.
Reference: https://github.com/riscv/riscv-CMOs/issues/65
|
|
The value 2 of menvcfg.CBIE is reserved. This commit legalizes it to 0
by adding a specialized class envcfg_csr_t.
Reference: https://github.com/riscv/riscv-CMOs/issues/65
|
|
This adds the following CSRs:
miselect (0x350), mireg (0x351), mireg2/3 (0x352, 0x353),
mireg4-6 (0x355 - 0x357), siselect (0x150), sireg (0x151),
sireg2/3 (0x152, 0x153), sireg4-6 (0x155 - 0x157), vsiselect (0x250),
vsireg (0x251), mireg2/3 (0x252, 0x253), vsireg4-6 (0x255 - 0x257).
Presently, attempts to read / write from ireg? registers will fail, and
future extensions will provide proxy CSR mappings for the respective
?ireg CSRs.
|
|
This change was made ages ago in the spec.
I did not actually test that the new privilege checks in ebreak and
c.ebreak are correct, but all the existing debug tests still pass.
|
|
Resolves #1365
|
|
|
|
This commit lets the mstatus.MPP be a valid value if unsupporting
U-mode. Without this commit, the mret may result in a corrupted state
without properly setting the MPP to M-mode (if unsupporting U-mode).
|
|
We don't model any sources of RNMI, so this is mostly vestigial.
|
|
|
|
|
|
|
|
Now, when misa.C is writable, clearing misa.C also disables any
Zc* extension.
|
|
No functional change yet.
|
|
This resolves the issue discussed in #1201.
Prior to 0adf9307, clearing misa.C would disable compressed instructions
and increase IALIGN to 32. Afterwards, clearing misa.C had essentially
no effect because Zca and friends would stay enabled. While AFAICS this
isn't technically incorrect, it certainly doesn't follow the principle
of least surprise.
Instead, remove the feature to toggle misa.C. The effect is that misa.C
is 1 iff C is included in the ISA string, and IALIGN is independent of
misa.C: specifically, IALIGN is 16 iff Zca is present.
(And of course C implies Zca.)
Removing the alignment check on misa writes is not a separate commit
because these two changes should be made atomically. Not checking
the alignment on misa writes goes hand-in-hand with misa.C being
read-only.
|
|
This incurs a negligible performance impact
|
|
chaining
This step is to ensure that removing config.h out of headers will not cause regressions.
|
|
* decode.h contains constants/typedefs/classes. This should not depend on config.h
* decode_macros.h contains internally used macros, and depends on config.h
|
|
|
|
|
|
|
|
|