1 /*
  2  * Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved.
  3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  4  *
  5  * This code is free software; you can redistribute it and/or modify it
  6  * under the terms of the GNU General Public License version 2 only, as
  7  * published by the Free Software Foundation.
  8  *
  9  * This code is distributed in the hope that it will be useful, but WITHOUT
 10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 12  * version 2 for more details (a copy is included in the LICENSE file that
 13  * accompanied this code).
 14  *
 15  * You should have received a copy of the GNU General Public License version
 16  * 2 along with this work; if not, write to the Free Software Foundation,
 17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 18  *
 19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 20  * or visit www.oracle.com if you need additional information or have any
 21  * questions.
 22  *
 23  */
 24 
 25 #include "cds/aotArtifactFinder.hpp"
 26 #include "cds/aotClassLinker.hpp"
 27 #include "cds/aotClassLocation.hpp"
 28 #include "cds/archiveBuilder.hpp"
 29 #include "cds/archiveHeapWriter.hpp"
 30 #include "cds/archiveUtils.inline.hpp"
 31 #include "cds/cds_globals.hpp"
 32 #include "cds/cdsConfig.hpp"
 33 #include "cds/dynamicArchive.hpp"
 34 #include "cds/regeneratedClasses.hpp"
 35 #include "classfile/classLoader.hpp"
 36 #include "classfile/classLoaderData.inline.hpp"
 37 #include "classfile/symbolTable.hpp"
 38 #include "classfile/systemDictionaryShared.hpp"
 39 #include "classfile/vmSymbols.hpp"
 40 #include "gc/shared/collectedHeap.hpp"
 41 #include "gc/shared/gcVMOperations.hpp"
 42 #include "gc/shared/gc_globals.hpp"
 43 #include "jvm.h"
 44 #include "logging/log.hpp"
 45 #include "memory/metaspaceClosure.hpp"
 46 #include "memory/resourceArea.hpp"
 47 #include "oops/klass.inline.hpp"
 48 #include "runtime/arguments.hpp"
 49 #include "runtime/os.hpp"
 50 #include "runtime/sharedRuntime.hpp"
 51 #include "runtime/vmOperations.hpp"
 52 #include "runtime/vmThread.hpp"
 53 #include "utilities/align.hpp"
 54 #include "utilities/bitMap.inline.hpp"
 55 
 56 
 57 class DynamicArchiveBuilder : public ArchiveBuilder {
 58   const char* _archive_name;
 59 public:
 60   DynamicArchiveBuilder(const char* archive_name) : _archive_name(archive_name) {}
 61   void mark_pointer(address* ptr_loc) {
 62     ArchivePtrMarker::mark_pointer(ptr_loc);
 63   }
 64 
 65   static int dynamic_dump_method_comparator(Method* a, Method* b) {
 66     Symbol* a_name = a->name();
 67     Symbol* b_name = b->name();
 68 
 69     if (a_name == b_name) {
 70       return 0;
 71     }
 72 
 73     u4 a_offset = ArchiveBuilder::current()->any_to_offset_u4(a_name);
 74     u4 b_offset = ArchiveBuilder::current()->any_to_offset_u4(b_name);
 75 
 76     if (a_offset < b_offset) {
 77       return -1;
 78     } else {
 79       assert(a_offset > b_offset, "must be");
 80       return 1;
 81     }
 82   }
 83 
 84 public:
 85   DynamicArchiveHeader *_header;
 86 
 87   void init_header();
 88   void release_header();
 89   void post_dump();
 90   void sort_methods();
 91   void sort_methods(InstanceKlass* ik) const;
 92   void remark_pointers_for_instance_klass(InstanceKlass* k, bool should_mark) const;
 93   void write_archive(char* serialized_data, AOTClassLocationConfig* cl_config);
 94   void gather_array_klasses();
 95 
 96 public:
 97   DynamicArchiveBuilder() : ArchiveBuilder() { }
 98 
 99   // Do this before and after the archive dump to see if any corruption
100   // is caused by dynamic dumping.
101   void verify_universe(const char* info) {
102     if (VerifyBeforeExit) {
103       log_info(cds)("Verify %s", info);
104       // Among other things, this ensures that Eden top is correct.
105       Universe::heap()->prepare_for_verify();
106       Universe::verify(info);
107     }
108   }
109 
110   void doit() {
111     verify_universe("Before CDS dynamic dump");
112     DEBUG_ONLY(SystemDictionaryShared::NoClassLoadingMark nclm);
113 
114     // Block concurrent class unloading from changing the _dumptime_table
115     MutexLocker ml(DumpTimeTable_lock, Mutex::_no_safepoint_check_flag);
116 
117     if (SystemDictionaryShared::is_dumptime_table_empty()) {
118       log_warning(cds, dynamic)("There is no class to be included in the dynamic archive.");
119       return;
120     }
121 
122     log_info(cds,dynamic)("CDS dynamic dump: clinit = " JLONG_FORMAT "ms)",
123                           ClassLoader::class_init_time_ms());
124 
125     init_header();
126     gather_source_objs();
127     gather_array_klasses();
128     reserve_buffer();
129 
130     log_info(cds, dynamic)("Copying %d klasses and %d symbols",
131                            klasses()->length(), symbols()->length());
132     dump_rw_metadata();
133     dump_ro_metadata();
134     relocate_metaspaceobj_embedded_pointers();
135 
136     sort_methods();
137 
138     log_info(cds)("Make classes shareable");
139     make_klasses_shareable();
140 
141     char* serialized_data;
142     AOTClassLocationConfig* cl_config;
143     {
144       // Write the symbol table and system dictionaries to the RO space.
145       // Note that these tables still point to the *original* objects, so
146       // they would need to call DynamicArchive::original_to_target() to
147       // get the correct addresses.
148       assert(current_dump_region() == ro_region(), "Must be RO space");
149       SymbolTable::write_to_archive(symbols());
150 
151       ArchiveBuilder::OtherROAllocMark mark;
152       SystemDictionaryShared::write_to_archive(false);
153       cl_config = AOTClassLocationConfig::dumptime()->write_to_archive();
154       DynamicArchive::dump_array_klasses();
155       AOTClassLinker::write_to_archive();
156 
157       serialized_data = ro_region()->top();
158       WriteClosure wc(ro_region());
159       ArchiveBuilder::serialize_dynamic_archivable_items(&wc);
160     }
161 
162     log_info(cds)("Adjust lambda proxy class dictionary");
163     SystemDictionaryShared::adjust_lambda_proxy_class_dictionary();
164 
165     relocate_to_requested();
166 
167     write_archive(serialized_data, cl_config);
168     release_header();
169     DynamicArchive::post_dump();
170 
171     post_dump();
172 
173     assert(_num_dump_regions_used == _total_dump_regions, "must be");
174     verify_universe("After CDS dynamic dump");
175   }
176 
177   virtual void iterate_roots(MetaspaceClosure* it) {
178     AOTArtifactFinder::all_cached_classes_do(it);
179     SystemDictionaryShared::dumptime_classes_do(it);
180     iterate_primitive_array_klasses(it);
181   }
182 
183   void iterate_primitive_array_klasses(MetaspaceClosure* it) {
184     for (int i = T_BOOLEAN; i <= T_LONG; i++) {
185       assert(is_java_primitive((BasicType)i), "sanity");
186       Klass* k = Universe::typeArrayKlass((BasicType)i);  // this give you "[I", etc
187       assert(MetaspaceShared::is_shared_static((void*)k),
188         "one-dimensional primitive array should be in static archive");
189       ArrayKlass* ak = ArrayKlass::cast(k);
190       while (ak != nullptr && ak->is_shared()) {
191         Klass* next_k = ak->array_klass_or_null();
192         if (next_k != nullptr) {
193           ak = ArrayKlass::cast(next_k);
194         } else {
195           ak = nullptr;
196         }
197       }
198       if (ak != nullptr) {
199         assert(ak->dimension() > 1, "sanity");
200         // this is the lowest dimension that's not in the static archive
201         it->push(&ak);
202       }
203     }
204   }
205 };
206 
207 void DynamicArchiveBuilder::init_header() {
208   FileMapInfo* mapinfo = new FileMapInfo(_archive_name, false);
209   assert(FileMapInfo::dynamic_info() == mapinfo, "must be");
210   FileMapInfo* base_info = FileMapInfo::current_info();
211   // header only be available after populate_header
212   mapinfo->populate_header(base_info->core_region_alignment());
213   _header = mapinfo->dynamic_header();
214 
215   _header->set_base_header_crc(base_info->crc());
216   for (int i = 0; i < MetaspaceShared::n_regions; i++) {
217     _header->set_base_region_crc(i, base_info->region_crc(i));
218   }
219 }
220 
221 void DynamicArchiveBuilder::release_header() {
222   // We temporarily allocated a dynamic FileMapInfo for dumping, which makes it appear we
223   // have mapped a dynamic archive, but we actually have not. We are in a safepoint now.
224   // Let's free it so that if class loading happens after we leave the safepoint, nothing
225   // bad will happen.
226   assert(SafepointSynchronize::is_at_safepoint(), "must be");
227   FileMapInfo *mapinfo = FileMapInfo::dynamic_info();
228   assert(mapinfo != nullptr && _header == mapinfo->dynamic_header(), "must be");
229   delete mapinfo;
230   assert(!DynamicArchive::is_mapped(), "must be");
231   _header = nullptr;
232 }
233 
234 void DynamicArchiveBuilder::post_dump() {
235   ArchivePtrMarker::reset_map_and_vs();
236   AOTClassLinker::dispose();
237 }
238 
239 void DynamicArchiveBuilder::sort_methods() {
240   InstanceKlass::disable_method_binary_search();
241   for (int i = 0; i < klasses()->length(); i++) {
242     Klass* k = get_buffered_addr(klasses()->at(i));
243     if (k->is_instance_klass()) {
244       sort_methods(InstanceKlass::cast(k));
245     }
246   }
247 }
248 
249 // The address order of the copied Symbols may be different than when the original
250 // klasses were created. Re-sort all the tables. See Method::sort_methods().
251 void DynamicArchiveBuilder::sort_methods(InstanceKlass* ik) const {
252   assert(ik != nullptr, "DynamicArchiveBuilder currently doesn't support dumping the base archive");
253   if (MetaspaceShared::is_in_shared_metaspace(ik)) {
254     // We have reached a supertype that's already in the base archive
255     return;
256   }
257   assert(is_in_buffer_space(ik), "method sorting must be done on buffered class, not original class");
258   if (ik->java_mirror() == nullptr) {
259     // null mirror means this class has already been visited and methods are already sorted
260     return;
261   }
262   ik->remove_java_mirror();
263 
264   if (log_is_enabled(Debug, cds, dynamic)) {
265     ResourceMark rm;
266     log_debug(cds, dynamic)("sorting methods for " PTR_FORMAT " (" PTR_FORMAT ") %s",
267                             p2i(ik), p2i(to_requested(ik)), ik->external_name());
268   }
269 
270   // Method sorting may re-layout the [iv]tables, which would change the offset(s)
271   // of the locations in an InstanceKlass that would contain pointers. Let's clear
272   // all the existing pointer marking bits, and re-mark the pointers after sorting.
273   remark_pointers_for_instance_klass(ik, false);
274 
275   // Make sure all supertypes have been sorted
276   sort_methods(ik->java_super());
277   Array<InstanceKlass*>* interfaces = ik->local_interfaces();
278   int len = interfaces->length();
279   for (int i = 0; i < len; i++) {
280     sort_methods(interfaces->at(i));
281   }
282 
283 #ifdef ASSERT
284   if (ik->methods() != nullptr) {
285     for (int m = 0; m < ik->methods()->length(); m++) {
286       Symbol* name = ik->methods()->at(m)->name();
287       assert(MetaspaceShared::is_in_shared_metaspace(name) || is_in_buffer_space(name), "must be");
288     }
289   }
290   if (ik->default_methods() != nullptr) {
291     for (int m = 0; m < ik->default_methods()->length(); m++) {
292       Symbol* name = ik->default_methods()->at(m)->name();
293       assert(MetaspaceShared::is_in_shared_metaspace(name) || is_in_buffer_space(name), "must be");
294     }
295   }
296 #endif
297 
298   Method::sort_methods(ik->methods(), /*set_idnums=*/true, dynamic_dump_method_comparator);
299   if (ik->default_methods() != nullptr) {
300     Method::sort_methods(ik->default_methods(), /*set_idnums=*/false, dynamic_dump_method_comparator);
301   }
302   if (ik->is_linked()) {
303     // If the class has already been linked, we must relayout the i/v tables, whose order depends
304     // on the method sorting order.
305     // If the class is unlinked, we cannot layout the i/v tables yet. This is OK, as the
306     // i/v tables will be initialized at runtime after bytecode verification.
307     ik->vtable().initialize_vtable();
308     ik->itable().initialize_itable();
309   }
310 
311   // Set all the pointer marking bits after sorting.
312   remark_pointers_for_instance_klass(ik, true);
313 }
314 
315 template<bool should_mark>
316 class PointerRemarker: public MetaspaceClosure {
317 public:
318   virtual bool do_ref(Ref* ref, bool read_only) {
319     if (should_mark) {
320       ArchivePtrMarker::mark_pointer(ref->addr());
321     } else {
322       ArchivePtrMarker::clear_pointer(ref->addr());
323     }
324     return false; // don't recurse
325   }
326 };
327 
328 void DynamicArchiveBuilder::remark_pointers_for_instance_klass(InstanceKlass* k, bool should_mark) const {
329   if (should_mark) {
330     PointerRemarker<true> marker;
331     k->metaspace_pointers_do(&marker);
332     marker.finish();
333   } else {
334     PointerRemarker<false> marker;
335     k->metaspace_pointers_do(&marker);
336     marker.finish();
337   }
338 }
339 
340 void DynamicArchiveBuilder::write_archive(char* serialized_data, AOTClassLocationConfig* cl_config) {
341   _header->set_class_location_config(cl_config);
342   _header->set_serialized_data(serialized_data);
343 
344   FileMapInfo* dynamic_info = FileMapInfo::dynamic_info();
345   assert(dynamic_info != nullptr, "Sanity");
346 
347   dynamic_info->open_for_write();
348   ArchiveHeapInfo no_heap_for_dynamic_dump;
349   ArchiveBuilder::write_archive(dynamic_info, &no_heap_for_dynamic_dump);
350 
351   address base = _requested_dynamic_archive_bottom;
352   address top  = _requested_dynamic_archive_top;
353   size_t file_size = pointer_delta(top, base, sizeof(char));
354 
355   log_info(cds, dynamic)("Written dynamic archive " PTR_FORMAT " - " PTR_FORMAT
356                          " [" UINT32_FORMAT " bytes header, %zu bytes total]",
357                          p2i(base), p2i(top), _header->header_size(), file_size);
358 
359   log_info(cds, dynamic)("%d klasses; %d symbols", klasses()->length(), symbols()->length());
360 }
361 
362 void DynamicArchiveBuilder::gather_array_klasses() {
363   for (int i = 0; i < klasses()->length(); i++) {
364     if (klasses()->at(i)->is_objArray_klass()) {
365       ObjArrayKlass* oak = ObjArrayKlass::cast(klasses()->at(i));
366       Klass* elem = oak->element_klass();
367       if (MetaspaceShared::is_shared_static(elem)) {
368         // Only capture the array klass whose element_klass is in the static archive.
369         // During run time, setup (see DynamicArchive::setup_array_klasses()) is needed
370         // so that the element_klass can find its array klasses from the dynamic archive.
371         DynamicArchive::append_array_klass(oak);
372       } else {
373         // The element_klass and its array klasses are in the same archive.
374         assert(!MetaspaceShared::is_shared_static(oak),
375           "we should not gather klasses that are already in the static archive");
376       }
377     }
378   }
379   log_debug(cds)("Total array klasses gathered for dynamic archive: %d", DynamicArchive::num_array_klasses());
380 }
381 
382 class VM_PopulateDynamicDumpSharedSpace: public VM_GC_Sync_Operation {
383   DynamicArchiveBuilder _builder;
384 public:
385   VM_PopulateDynamicDumpSharedSpace(const char* archive_name)
386   : VM_GC_Sync_Operation(), _builder(archive_name) {}
387   VMOp_Type type() const { return VMOp_PopulateDumpSharedSpace; }
388   void doit() {
389     ResourceMark rm;
390     if (AllowArchivingWithJavaAgent) {
391       log_warning(cds)("This %s was created with AllowArchivingWithJavaAgent. It should be used "
392                        "for testing purposes only and should not be used in a production environment",
393                        CDSConfig::type_of_archive_being_loaded());
394     }
395     AOTClassLocationConfig::dumptime_check_nonempty_dirs();
396     _builder.doit();
397   }
398   ~VM_PopulateDynamicDumpSharedSpace() {
399     RegeneratedClasses::cleanup();
400   }
401 };
402 
403 // _array_klasses and _dynamic_archive_array_klasses only hold the array klasses
404 // which have element klass in the static archive.
405 GrowableArray<ObjArrayKlass*>* DynamicArchive::_array_klasses = nullptr;
406 Array<ObjArrayKlass*>* DynamicArchive::_dynamic_archive_array_klasses = nullptr;
407 
408 void DynamicArchive::append_array_klass(ObjArrayKlass* ak) {
409   if (_array_klasses == nullptr) {
410     _array_klasses = new (mtClassShared) GrowableArray<ObjArrayKlass*>(50, mtClassShared);
411   }
412   _array_klasses->append(ak);
413 }
414 
415 void DynamicArchive::dump_array_klasses() {
416   assert(CDSConfig::is_dumping_dynamic_archive(), "sanity");
417   if (_array_klasses != nullptr) {
418     ArchiveBuilder* builder = ArchiveBuilder::current();
419     int num_array_klasses = _array_klasses->length();
420     _dynamic_archive_array_klasses =
421         ArchiveBuilder::new_ro_array<ObjArrayKlass*>(num_array_klasses);
422     for (int i = 0; i < num_array_klasses; i++) {
423       builder->write_pointer_in_buffer(_dynamic_archive_array_klasses->adr_at(i), _array_klasses->at(i));
424     }
425   }
426 }
427 
428 void DynamicArchive::setup_array_klasses() {
429   if (_dynamic_archive_array_klasses != nullptr) {
430     for (int i = 0; i < _dynamic_archive_array_klasses->length(); i++) {
431       ObjArrayKlass* oak = _dynamic_archive_array_klasses->at(i);
432       assert(!oak->is_typeArray_klass(), "all type array classes must be in static archive");
433 
434       Klass* elm = oak->element_klass();
435       assert(MetaspaceShared::is_shared_static((void*)elm), "must be");
436 
437       if (elm->is_instance_klass()) {
438         assert(InstanceKlass::cast(elm)->array_klasses() == nullptr, "must be");
439         InstanceKlass::cast(elm)->set_array_klasses(oak);
440       } else {
441         assert(elm->is_array_klass(), "sanity");
442         assert(ArrayKlass::cast(elm)->higher_dimension() == nullptr, "must be");
443         ArrayKlass::cast(elm)->set_higher_dimension(oak);
444       }
445     }
446     log_debug(cds)("Total array klasses read from dynamic archive: %d", _dynamic_archive_array_klasses->length());
447   }
448 }
449 
450 void DynamicArchive::serialize_array_klasses(SerializeClosure* soc) {
451   soc->do_ptr(&_dynamic_archive_array_klasses);
452 }
453 
454 void DynamicArchive::make_array_klasses_shareable() {
455   if (_array_klasses != nullptr) {
456     int num_array_klasses = _array_klasses->length();
457     for (int i = 0; i < num_array_klasses; i++) {
458       ObjArrayKlass* k = ArchiveBuilder::current()->get_buffered_addr(_array_klasses->at(i));
459       k->remove_unshareable_info();
460     }
461   }
462 }
463 
464 void DynamicArchive::post_dump() {
465   if (_array_klasses != nullptr) {
466     delete _array_klasses;
467     _array_klasses = nullptr;
468   }
469 }
470 
471 int DynamicArchive::num_array_klasses() {
472   return _array_klasses != nullptr ? _array_klasses->length() : 0;
473 }
474 
475 void DynamicArchive::check_for_dynamic_dump() {
476   if (CDSConfig::is_dumping_dynamic_archive() && !CDSConfig::is_using_archive()) {
477     // This could happen if SharedArchiveFile has failed to load:
478     // - -Xshare:off was specified
479     // - SharedArchiveFile points to an non-existent file.
480     // - SharedArchiveFile points to an archive that has failed CRC check
481     // - SharedArchiveFile is not specified and the VM doesn't have a compatible default archive
482 
483 #define __THEMSG " is unsupported when base CDS archive is not loaded. Run with -Xlog:cds for more info."
484     if (RecordDynamicDumpInfo) {
485       log_error(cds)("-XX:+RecordDynamicDumpInfo%s", __THEMSG);
486       MetaspaceShared::unrecoverable_loading_error();
487     } else {
488       assert(ArchiveClassesAtExit != nullptr, "sanity");
489       log_warning(cds)("-XX:ArchiveClassesAtExit" __THEMSG);
490     }
491 #undef __THEMSG
492     CDSConfig::disable_dumping_dynamic_archive();
493   }
494 }
495 
496 void DynamicArchive::dump_at_exit(JavaThread* current, const char* archive_name) {
497   ExceptionMark em(current);
498   ResourceMark rm(current);
499   CDSConfig::DumperThreadMark dumper_thread_mark(current);
500 
501   if (!CDSConfig::is_dumping_dynamic_archive() || archive_name == nullptr) {
502     return;
503   }
504 
505   log_info(cds, dynamic)("Preparing for dynamic dump at exit in thread %s", current->name());
506 
507   JavaThread* THREAD = current; // For TRAPS processing related to link_shared_classes
508   MetaspaceShared::link_shared_classes(false/*not from jcmd*/, THREAD);
509   if (!HAS_PENDING_EXCEPTION) {
510     VM_PopulateDynamicDumpSharedSpace op(archive_name);
511     VMThread::execute(&op);
512     return;
513   }
514 
515   // One of the prepatory steps failed
516   oop ex = current->pending_exception();
517   log_error(cds)("Dynamic dump has failed");
518   log_error(cds)("%s: %s", ex->klass()->external_name(),
519                  java_lang_String::as_utf8_string(java_lang_Throwable::message(ex)));
520   CLEAR_PENDING_EXCEPTION;
521   CDSConfig::disable_dumping_dynamic_archive();  // Just for good measure
522 }
523 
524 // This is called by "jcmd VM.cds dynamic_dump"
525 void DynamicArchive::dump_for_jcmd(const char* archive_name, TRAPS) {
526   CDSConfig::DumperThreadMark dumper_thread_mark(THREAD);
527   assert(CDSConfig::is_using_archive() && RecordDynamicDumpInfo, "already checked in arguments.cpp");
528   assert(ArchiveClassesAtExit == nullptr, "already checked in arguments.cpp");
529   assert(CDSConfig::is_dumping_dynamic_archive(), "already checked by check_for_dynamic_dump() during VM startup");
530   MetaspaceShared::link_shared_classes(true/*from jcmd*/, CHECK);
531   // copy shared path table to saved.
532   VM_PopulateDynamicDumpSharedSpace op(archive_name);
533   VMThread::execute(&op);
534 }
535 
536 bool DynamicArchive::validate(FileMapInfo* dynamic_info) {
537   assert(!dynamic_info->is_static(), "must be");
538   // Check if the recorded base archive matches with the current one
539   FileMapInfo* base_info = FileMapInfo::current_info();
540   DynamicArchiveHeader* dynamic_header = dynamic_info->dynamic_header();
541 
542   // Check the header crc
543   if (dynamic_header->base_header_crc() != base_info->crc()) {
544     log_warning(cds)("Dynamic archive cannot be used: static archive header checksum verification failed.");
545     return false;
546   }
547 
548   // Check each space's crc
549   for (int i = 0; i < MetaspaceShared::n_regions; i++) {
550     if (dynamic_header->base_region_crc(i) != base_info->region_crc(i)) {
551       log_warning(cds)("Dynamic archive cannot be used: static archive region #%d checksum verification failed.", i);
552       return false;
553     }
554   }
555 
556   return true;
557 }
558 
559 void DynamicArchiveHeader::print(outputStream* st) {
560   ResourceMark rm;
561 
562   st->print_cr("- base_header_crc:                0x%08x", base_header_crc());
563   for (int i = 0; i < NUM_CDS_REGIONS; i++) {
564     st->print_cr("- base_region_crc[%d]:             0x%08x", i, base_region_crc(i));
565   }
566 }