Skip to content

Commit a731a24

Browse files
committed
8315934: RISC-V: Disable conservative fences per vendor
Reviewed-by: rehn, mli, fyang
1 parent b3dad24 commit a731a24

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

src/hotspot/cpu/riscv/vm_version_riscv.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,17 @@ void VM_Version::initialize() {
9999
}
100100
}
101101

102+
// Enable vendor specific features
103+
104+
if (mvendorid.enabled()) {
105+
// Rivos
106+
if (mvendorid.value() == RIVOS) {
107+
if (FLAG_IS_DEFAULT(UseConservativeFence)) {
108+
FLAG_SET_DEFAULT(UseConservativeFence, false);
109+
}
110+
}
111+
}
112+
102113
if (UseZic64b) {
103114
if (CacheLineSize != 64) {
104115
assert(!FLAG_IS_DEFAULT(CacheLineSize), "default cache line size should be 64 bytes");

src/hotspot/cpu/riscv/vm_version_riscv.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ class RiscvHwprobe;
4040
class VM_Version : public Abstract_VM_Version {
4141
friend RiscvHwprobe;
4242
private:
43+
44+
// JEDEC encoded as ((bank - 1) << 7) | (0x7f & JEDEC)
45+
enum VendorId {
46+
RIVOS = 0x6cf, // JEDEC: 0x4f, Bank: 14
47+
};
48+
4349
class RVFeatureValue {
4450
const char* const _pretty;
4551
const bool _feature_string;

src/hotspot/os_cpu/linux_riscv/vm_version_linux_riscv.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,14 +208,11 @@ char* VM_Version::os_uarch_additional_features() {
208208
}
209209

210210
void VM_Version::vendor_features() {
211-
// JEDEC encoded as ((bank - 1) << 7) | (0x7f & JEDEC)
212-
static constexpr int RIVOS_MVENDORID = 0x6cf; // JEDEC: 0x4f, Bank: 14
213-
214211
if (!mvendorid.enabled()) {
215212
return;
216213
}
217214
switch (mvendorid.value()) {
218-
case RIVOS_MVENDORID:
215+
case RIVOS:
219216
rivos_features();
220217
break;
221218
default:

0 commit comments

Comments
 (0)