Skip to content

Commit d0b629a

Browse files
a4lgtaiki-e
andcommitted
RISC-V: Remove privileged extensions for now
Until in-kernel feature detection is implemented, runtime detection of privileged extensions is temporally removed since none of privileged features are stable. Co-Authored-By: Taiki Endo <[email protected]>
1 parent 38aae36 commit d0b629a

File tree

3 files changed

+0
-31
lines changed

3 files changed

+0
-31
lines changed

crates/std_detect/src/detect/arch/riscv.rs

-24
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,6 @@ features! {
116116
/// * P: `"p"`
117117
/// * Zam: `"zam"`
118118
///
119-
/// Defined by Privileged Specification:
120-
///
121-
/// * *Supervisor-Level ISA* (not "S" extension): `"s"`
122-
/// * H (hypervisor): `"h"`
123-
/// * Svnapot: `"svnapot"`
124-
/// * Svpbmt: `"svpbmt"`
125-
/// * Svinval: `"svinval"`
126-
///
127119
/// # Performance Hints
128120
///
129121
/// Following two features define performance implications for unaligned
@@ -336,22 +328,6 @@ features! {
336328
without cfg check: true;
337329
/// "Supm" Extension for Pointer-Masking Support in User Mode with Platform-Defined Facility to Control
338330
339-
@FEATURE: #[unstable(feature = "stdarch_riscv_feature_detection", issue = "111192")] svnapot: "svnapot";
340-
without cfg check: true;
341-
/// "Svnapot" Extension for NAPOT Translation Contiguity
342-
@FEATURE: #[unstable(feature = "stdarch_riscv_feature_detection", issue = "111192")] svpbmt: "svpbmt";
343-
without cfg check: true;
344-
/// "Svpbmt" Extension for Page-Based Memory Types
345-
@FEATURE: #[unstable(feature = "stdarch_riscv_feature_detection", issue = "111192")] svinval: "svinval";
346-
without cfg check: true;
347-
/// "Svinval" Extension for Fine-Grained Address-Translation Cache Invalidation
348-
@FEATURE: #[unstable(feature = "stdarch_riscv_feature_detection", issue = "111192")] h: "h";
349-
without cfg check: true;
350-
/// "H" Extension for Hypervisor Support
351-
352-
@FEATURE: #[unstable(feature = "stdarch_riscv_feature_detection", issue = "111192")] s: "s";
353-
without cfg check: true;
354-
/// Supervisor-Level ISA
355331
@FEATURE: #[unstable(feature = "stdarch_riscv_feature_detection", issue = "111192")] j: "j";
356332
without cfg check: true;
357333
/// "J" Extension for Dynamically Translated Languages

crates/std_detect/src/detect/os/linux/riscv.rs

-2
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ pub(crate) fn imply_features(mut value: cache::Initializer) -> cache::Initialize
9696
imply!(d | zfhmin | zfa => f);
9797

9898
imply!(zicntr | zihpm | zkr | f | zfinx | zve32x => zicsr);
99-
imply!(s | h => zicsr);
10099

101100
value
102101
}
@@ -231,7 +230,6 @@ pub(crate) fn detect_features() -> cache::Initializer {
231230
enable_feature(Feature::c, bit::test(auxv.hwcap, (b'c' - b'a').into()));
232231
enable_feature(Feature::d, bit::test(auxv.hwcap, (b'd' - b'a').into()));
233232
enable_feature(Feature::f, bit::test(auxv.hwcap, (b'f' - b'a').into()));
234-
enable_feature(Feature::h, bit::test(auxv.hwcap, (b'h' - b'a').into()));
235233
enable_feature(Feature::m, bit::test(auxv.hwcap, (b'm' - b'a').into()));
236234
let has_v = bit::test(auxv.hwcap, (b'v' - b'a').into());
237235
let mut is_v_set = false;

crates/std_detect/tests/cpu-detection.rs

-5
Original file line numberDiff line numberDiff line change
@@ -320,11 +320,6 @@ fn riscv_linux() {
320320
println!("zvksg: {}", is_riscv_feature_detected!("zvksg"));
321321
println!("zvkt: {}", is_riscv_feature_detected!("zvkt"));
322322
println!("supm: {}", is_riscv_feature_detected!("supm"));
323-
println!("svnapot: {}", is_riscv_feature_detected!("svnapot"));
324-
println!("svpbmt: {}", is_riscv_feature_detected!("svpbmt"));
325-
println!("svinval: {}", is_riscv_feature_detected!("svinval"));
326-
println!("h: {}", is_riscv_feature_detected!("h"));
327-
println!("s: {}", is_riscv_feature_detected!("s"));
328323
println!("j: {}", is_riscv_feature_detected!("j"));
329324
println!("p: {}", is_riscv_feature_detected!("p"));
330325
}

0 commit comments

Comments
 (0)