50
51 static int _zva_length;
52 static int _dcache_line_size;
53 static int _icache_line_size;
54 static int _initial_sve_vector_length;
55 static int _max_supported_sve_vector_length;
56 static bool _rop_protection;
57 static uintptr_t _pac_mask;
58
59 static SpinWait _spin_wait;
60
61 // Read additional info using OS-specific interfaces
62 static void get_os_cpu_info();
63
64 // Sets the SVE length and returns a new actual value or negative on error.
65 // If the len is larger than the system largest supported SVE vector length,
66 // the function sets the largest supported value.
67 static int set_and_get_current_sve_vector_length(int len);
68 static int get_current_sve_vector_length();
69
70 public:
71 // Initialization
72 static void initialize();
73 static void check_virtualizations();
74
75 static void insert_features_names(uint64_t features, stringStream& ss);
76
77 static void print_platform_virtualization_info(outputStream*);
78
79 // Asserts
80 static void assert_is_initialized() {
81 }
82
83 static bool expensive_load(int ld_size, int scale) {
84 if (cpu_family() == CPU_ARM) {
85 // Half-word load with index shift by 1 (aka scale is 2) has
86 // extra cycle latency, e.g. ldrsh w0, [x1,w2,sxtw #1].
87 if (ld_size == 2 && scale == 2) {
88 return true;
89 }
90 }
91 return false;
92 }
93
94 // The CPU implementer codes can be found in
95 // ARM Architecture Reference Manual ARMv8, for ARMv8-A architecture profile
96 // https://developer.arm.com/docs/ddi0487/latest
|
50
51 static int _zva_length;
52 static int _dcache_line_size;
53 static int _icache_line_size;
54 static int _initial_sve_vector_length;
55 static int _max_supported_sve_vector_length;
56 static bool _rop_protection;
57 static uintptr_t _pac_mask;
58
59 static SpinWait _spin_wait;
60
61 // Read additional info using OS-specific interfaces
62 static void get_os_cpu_info();
63
64 // Sets the SVE length and returns a new actual value or negative on error.
65 // If the len is larger than the system largest supported SVE vector length,
66 // the function sets the largest supported value.
67 static int set_and_get_current_sve_vector_length(int len);
68 static int get_current_sve_vector_length();
69
70 static void insert_features_names(uint64_t features, stringStream& ss);
71
72 public:
73 // Initialization
74 static void initialize();
75 static void check_virtualizations();
76
77 static void print_platform_virtualization_info(outputStream*);
78
79 // Asserts
80 static void assert_is_initialized() {
81 }
82
83 static bool expensive_load(int ld_size, int scale) {
84 if (cpu_family() == CPU_ARM) {
85 // Half-word load with index shift by 1 (aka scale is 2) has
86 // extra cycle latency, e.g. ldrsh w0, [x1,w2,sxtw #1].
87 if (ld_size == 2 && scale == 2) {
88 return true;
89 }
90 }
91 return false;
92 }
93
94 // The CPU implementer codes can be found in
95 // ARM Architecture Reference Manual ARMv8, for ARMv8-A architecture profile
96 // https://developer.arm.com/docs/ddi0487/latest
|