blob: ce911b83e2bc7f724181662aad263a7a8380f6e9 [file] [log] [blame]
Pierre-Clément Tosi5bbfca52022-10-21 12:14:35 +01001// Copyright 2022, The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15//! Low-level entry and exit points of pvmfw.
16
Pierre-Clément Tosi20b60962022-10-17 13:35:27 +010017use crate::config;
Alice Wang93ee98a2023-06-08 08:20:39 +000018use crate::memory;
Pierre-Clément Tosi645e90e2022-10-21 13:27:19 +010019use core::arch::asm;
Jakob Vukalovic4c1edbe2023-04-17 19:10:57 +010020use core::mem::{drop, size_of};
Pierre-Clément Tosi97f52492023-04-04 15:52:17 +010021use core::ops::Range;
Pierre-Clément Tosi5bbfca52022-10-21 12:14:35 +010022use core::slice;
Per Larsen7ec45d32024-11-02 00:56:46 +000023use hypervisor_backends::get_mmio_guard;
Pierre-Clément Tosie8726e42022-10-17 13:35:27 +010024use log::error;
Pierre-Clément Tosia0934c12022-11-25 20:54:11 +000025use log::info;
Pierre-Clément Tosi20b60962022-10-17 13:35:27 +010026use log::warn;
Pierre-Clément Tosie8726e42022-10-17 13:35:27 +010027use log::LevelFilter;
Alice Wang4be4dd02023-06-07 07:50:40 +000028use vmbase::util::RangeExt as _;
Alice Wangeacb7382023-06-05 12:53:54 +000029use vmbase::{
Pierre-Clément Tosi8ab7c372024-10-30 20:46:04 +000030 arch::aarch64::min_dcache_line_size,
Pierre-Clément Tosib5a3ab12023-09-15 11:18:38 +010031 configure_heap, console_writeln,
Pierre-Clément Tosi38a36212024-06-06 11:30:39 +010032 layout::{self, crosvm, UART_PAGE_ADDR},
Pierre-Clément Tosid3305482023-06-29 15:03:48 +000033 main,
Pierre-Clément Tosi8ab7c372024-10-30 20:46:04 +000034 memory::{MemoryTracker, MEMORY, SIZE_128KB, SIZE_4KB},
Alice Wangeacb7382023-06-05 12:53:54 +000035 power::reboot,
36};
Jakob Vukalovic44b1ce32023-04-17 19:10:10 +010037use zeroize::Zeroize;
Pierre-Clément Tosi5bbfca52022-10-21 12:14:35 +010038
39#[derive(Debug, Clone)]
Andrew Walbran19690632022-12-07 16:41:30 +000040pub enum RebootReason {
Pierre-Clément Tosie8726e42022-10-17 13:35:27 +010041 /// A malformed BCC was received.
42 InvalidBcc,
Pierre-Clément Tosi20b60962022-10-17 13:35:27 +010043 /// An invalid configuration was appended to pvmfw.
44 InvalidConfig,
Pierre-Clément Tosi5bbfca52022-10-21 12:14:35 +010045 /// An unexpected internal error happened.
46 InternalError,
Pierre-Clément Tosia0934c12022-11-25 20:54:11 +000047 /// The provided FDT was invalid.
48 InvalidFdt,
49 /// The provided payload was invalid.
50 InvalidPayload,
51 /// The provided ramdisk was invalid.
52 InvalidRamdisk,
Alice Wang28cbcf12022-12-01 07:58:28 +000053 /// Failed to verify the payload.
54 PayloadVerificationError,
Pierre-Clément Tosi4f4f5eb2022-12-08 14:31:42 +000055 /// DICE layering process failed.
56 SecretDerivationError,
Pierre-Clément Tosi5bbfca52022-10-21 12:14:35 +010057}
58
Pierre-Clément Tosib5a3ab12023-09-15 11:18:38 +010059impl RebootReason {
60 pub fn as_avf_reboot_string(&self) -> &'static str {
61 match self {
62 Self::InvalidBcc => "PVM_FIRMWARE_INVALID_BCC",
63 Self::InvalidConfig => "PVM_FIRMWARE_INVALID_CONFIG_DATA",
64 Self::InternalError => "PVM_FIRMWARE_INTERNAL_ERROR",
65 Self::InvalidFdt => "PVM_FIRMWARE_INVALID_FDT",
66 Self::InvalidPayload => "PVM_FIRMWARE_INVALID_PAYLOAD",
67 Self::InvalidRamdisk => "PVM_FIRMWARE_INVALID_RAMDISK",
68 Self::PayloadVerificationError => "PVM_FIRMWARE_PAYLOAD_VERIFICATION_FAILED",
69 Self::SecretDerivationError => "PVM_FIRMWARE_SECRET_DERIVATION_FAILED",
70 }
71 }
72}
73
Pierre-Clément Tosi5bbfca52022-10-21 12:14:35 +010074main!(start);
Pierre-Clément Tosi6a4808c2023-06-29 09:19:38 +000075configure_heap!(SIZE_128KB);
Pierre-Clément Tosi5bbfca52022-10-21 12:14:35 +010076
77/// Entry point for pVM firmware.
78pub fn start(fdt_address: u64, payload_start: u64, payload_size: u64, _arg3: u64) {
79 // Limitations in this function:
80 // - can't access non-pvmfw memory (only statically-mapped memory)
Pierre-Clément Tosi8e92d1a2024-06-18 16:15:14 +010081 // - can't access MMIO (except the console, already configured by vmbase)
Pierre-Clément Tosi5bbfca52022-10-21 12:14:35 +010082
83 match main_wrapper(fdt_address as usize, payload_start as usize, payload_size as usize) {
Pierre-Clément Tosi97f52492023-04-04 15:52:17 +010084 Ok((entry, bcc)) => jump_to_payload(fdt_address, entry.try_into().unwrap(), bcc),
Pierre-Clément Tosib5a3ab12023-09-15 11:18:38 +010085 Err(e) => {
86 const REBOOT_REASON_CONSOLE: usize = 1;
87 console_writeln!(REBOOT_REASON_CONSOLE, "{}", e.as_avf_reboot_string());
88 reboot()
89 }
Pierre-Clément Tosi5bbfca52022-10-21 12:14:35 +010090 }
91
92 // if we reach this point and return, vmbase::entry::rust_entry() will call power::shutdown().
93}
94
95/// Sets up the environment for main() and wraps its result for start().
96///
97/// Provide the abstractions necessary for start() to abort the pVM boot and for main() to run with
98/// the assumption that its environment has been properly configured.
Pierre-Clément Tosi97f52492023-04-04 15:52:17 +010099fn main_wrapper(
100 fdt: usize,
101 payload: usize,
102 payload_size: usize,
103) -> Result<(usize, Range<usize>), RebootReason> {
Pierre-Clément Tosi5bbfca52022-10-21 12:14:35 +0100104 // Limitations in this function:
105 // - only access MMIO once (and while) it has been mapped and configured
106 // - only perform logging once the logger has been initialized
107 // - only access non-pvmfw memory once (and while) it has been mapped
Pierre-Clément Tosifc531152022-10-20 12:22:23 +0100108
Pierre-Clément Tosid3305482023-06-29 15:03:48 +0000109 log::set_max_level(LevelFilter::Info);
Pierre-Clément Tosi41748ed2023-03-31 18:20:40 +0100110
Alice Wang807fa592023-06-02 09:54:43 +0000111 let page_table = memory::init_page_table().map_err(|e| {
Pierre-Clément Tosia8a4a202022-11-03 14:16:46 +0000112 error!("Failed to set up the dynamic page tables: {e}");
113 RebootReason::InternalError
114 })?;
Alan Stokesc3829f12023-06-02 15:02:23 +0100115
Andrew Walbran20bb4e42023-07-07 13:55:55 +0100116 // SAFETY: We only get the appended payload from here, once. The region was statically mapped,
Alan Stokesc3829f12023-06-02 15:02:23 +0100117 // then remapped by `init_page_table()`.
118 let appended_data = unsafe { get_appended_data_slice() };
119
Alan Stokes65618332023-12-15 14:09:25 +0000120 let appended = AppendedPayload::new(appended_data).ok_or_else(|| {
Pierre-Clément Tosi20b60962022-10-17 13:35:27 +0100121 error!("No valid configuration found");
122 RebootReason::InvalidConfig
Pierre-Clément Tosia8a4a202022-11-03 14:16:46 +0000123 })?;
124
Alan Stokesd0cf3cd2023-12-12 14:36:37 +0000125 let config_entries = appended.get_entries();
Pierre-Clément Tosie8726e42022-10-17 13:35:27 +0100126
Jakob Vukalovic4c1edbe2023-04-17 19:10:57 +0100127 // Up to this point, we were using the built-in static (from .rodata) page tables.
Alice Wang4c70d142023-06-06 11:52:33 +0000128 MEMORY.lock().replace(MemoryTracker::new(
129 page_table,
Alice Wang63f4c9e2023-06-12 09:36:43 +0000130 crosvm::MEM_START..layout::MAX_VIRT_ADDR,
Alice Wang89d29592023-06-12 09:41:29 +0000131 crosvm::MMIO_RANGE,
Alice Wang5bb79502023-06-12 09:25:07 +0000132 Some(memory::appended_payload_range()),
Alice Wang4c70d142023-06-06 11:52:33 +0000133 ));
Jakob Vukalovic4c1edbe2023-04-17 19:10:57 +0100134
Pierre-Clément Tosi462bdf42024-10-30 17:46:23 +0000135 let slices = memory::MemorySlices::new(
Seungjae Yoo013f4c42024-01-02 13:04:19 +0900136 fdt,
137 payload,
138 payload_size,
139 config_entries.vm_dtbo,
Seungjae Yoof0af81d2024-01-17 13:48:36 +0900140 config_entries.vm_ref_dt,
Seungjae Yoo013f4c42024-01-02 13:04:19 +0900141 )?;
Pierre-Clément Tosia0934c12022-11-25 20:54:11 +0000142
Pierre-Clément Tosi072969b2022-10-19 17:32:24 +0100143 // This wrapper allows main() to be blissfully ignorant of platform details.
Pierre-Clément Tosi64aff642024-07-31 16:20:21 +0100144 let (next_bcc, debuggable_payload) = crate::main(
Alan Stokesd0cf3cd2023-12-12 14:36:37 +0000145 slices.fdt,
146 slices.kernel,
147 slices.ramdisk,
148 config_entries.bcc,
149 config_entries.debug_policy,
150 )?;
Pierre-Clément Tosie8726e42022-10-17 13:35:27 +0100151
Jakob Vukalovic44b1ce32023-04-17 19:10:10 +0100152 // Writable-dirty regions will be flushed when MemoryTracker is dropped.
Alan Stokesd0cf3cd2023-12-12 14:36:37 +0000153 config_entries.bcc.zeroize();
Pierre-Clément Tosi072969b2022-10-19 17:32:24 +0100154
Andrew Walbran19690632022-12-07 16:41:30 +0000155 info!("Expecting a bug making MMIO_GUARD_UNMAP return NOT_SUPPORTED on success");
Pierre-Clément Tosi6b867532024-04-29 02:29:42 +0100156 MEMORY.lock().as_mut().unwrap().unshare_all_mmio().map_err(|e| {
Andrew Walbran19690632022-12-07 16:41:30 +0000157 error!("Failed to unshare MMIO ranges: {e}");
158 RebootReason::InternalError
159 })?;
Pierre-Clément Tosif19c0e62023-05-02 13:56:58 +0000160 // Call unshare_all_memory here (instead of relying on the dtor) while UART is still mapped.
161 MEMORY.lock().as_mut().unwrap().unshare_all_memory();
Pierre-Clément Tosi64aff642024-07-31 16:20:21 +0100162
Pierre-Clément Tosid643cfe2023-06-29 09:30:51 +0000163 if let Some(mmio_guard) = get_mmio_guard() {
Nikita Ioffeb4268b32024-09-03 10:23:14 +0000164 if cfg!(debuggable_vms_improvements) && debuggable_payload {
165 // Keep UART MMIO_GUARD-ed for debuggable payloads, to enable earlycon.
166 } else {
Pierre-Clément Tosi64aff642024-07-31 16:20:21 +0100167 mmio_guard.unmap(UART_PAGE_ADDR).map_err(|e| {
168 error!("Failed to unshare the UART: {e}");
169 RebootReason::InternalError
170 })?;
171 }
Pierre-Clément Tosi5ad1e8c2023-06-29 10:36:48 +0000172 }
Jakob Vukalovic4c1edbe2023-04-17 19:10:57 +0100173
174 // Drop MemoryTracker and deactivate page table.
175 drop(MEMORY.lock().take());
Pierre-Clément Tosia99bfa62022-10-06 13:30:52 +0100176
Pierre-Clément Tosi97f52492023-04-04 15:52:17 +0100177 Ok((slices.kernel.as_ptr() as usize, next_bcc))
Pierre-Clément Tosi5bbfca52022-10-21 12:14:35 +0100178}
Pierre-Clément Tosi645e90e2022-10-21 13:27:19 +0100179
Pierre-Clément Tosi97f52492023-04-04 15:52:17 +0100180fn jump_to_payload(fdt_address: u64, payload_start: u64, bcc: Range<usize>) -> ! {
181 const ASM_STP_ALIGN: usize = size_of::<u64>() * 2;
Pierre-Clément Tosi6c0d48b2022-11-07 11:00:32 +0000182 const SCTLR_EL1_RES1: u64 = (0b11 << 28) | (0b101 << 20) | (0b1 << 11);
Pierre-Clément Tosi645e90e2022-10-21 13:27:19 +0100183 // Stage 1 instruction access cacheability is unaffected.
Pierre-Clément Tosi6c0d48b2022-11-07 11:00:32 +0000184 const SCTLR_EL1_I: u64 = 0b1 << 12;
Pierre-Clément Tosi645e90e2022-10-21 13:27:19 +0100185 // SETEND instruction disabled at EL0 in aarch32 mode.
Pierre-Clément Tosi6c0d48b2022-11-07 11:00:32 +0000186 const SCTLR_EL1_SED: u64 = 0b1 << 8;
Pierre-Clément Tosi645e90e2022-10-21 13:27:19 +0100187 // Various IT instructions are disabled at EL0 in aarch32 mode.
Pierre-Clément Tosi6c0d48b2022-11-07 11:00:32 +0000188 const SCTLR_EL1_ITD: u64 = 0b1 << 7;
Pierre-Clément Tosi645e90e2022-10-21 13:27:19 +0100189
Pierre-Clément Tosi6c0d48b2022-11-07 11:00:32 +0000190 const SCTLR_EL1_VAL: u64 = SCTLR_EL1_RES1 | SCTLR_EL1_ITD | SCTLR_EL1_SED | SCTLR_EL1_I;
Pierre-Clément Tosi645e90e2022-10-21 13:27:19 +0100191
Pierre-Clément Tosi97f52492023-04-04 15:52:17 +0100192 let scratch = layout::scratch_range();
193
Alice Wanga3931aa2023-07-05 12:52:09 +0000194 assert_ne!(scratch.end - scratch.start, 0, "scratch memory is empty.");
195 assert_eq!(scratch.start.0 % ASM_STP_ALIGN, 0, "scratch memory is misaligned.");
196 assert_eq!(scratch.end.0 % ASM_STP_ALIGN, 0, "scratch memory is misaligned.");
Pierre-Clément Tosi97f52492023-04-04 15:52:17 +0100197
Alice Wanga3931aa2023-07-05 12:52:09 +0000198 assert!(bcc.is_within(&(scratch.start.0..scratch.end.0)));
Pierre-Clément Tosi97f52492023-04-04 15:52:17 +0100199 assert_eq!(bcc.start % ASM_STP_ALIGN, 0, "Misaligned guest BCC.");
200 assert_eq!(bcc.end % ASM_STP_ALIGN, 0, "Misaligned guest BCC.");
201
Pierre-Clément Tosiad1fc752023-05-31 16:56:56 +0000202 let stack = memory::stack_range();
Pierre-Clément Tosi97f52492023-04-04 15:52:17 +0100203
Alice Wanga3931aa2023-07-05 12:52:09 +0000204 assert_ne!(stack.end - stack.start, 0, "stack region is empty.");
205 assert_eq!(stack.start.0 % ASM_STP_ALIGN, 0, "Misaligned stack region.");
206 assert_eq!(stack.end.0 % ASM_STP_ALIGN, 0, "Misaligned stack region.");
Pierre-Clément Tosi97f52492023-04-04 15:52:17 +0100207
208 // Zero all memory that could hold secrets and that can't be safely written to from Rust.
Pierre-Clément Tosi6c0d48b2022-11-07 11:00:32 +0000209 // Disable the exception vector, caches and page table and then jump to the payload at the
210 // given address, passing it the given FDT pointer.
211 //
Andrew Walbran20bb4e42023-07-07 13:55:55 +0100212 // SAFETY: We're exiting pvmfw by passing the register values we need to a noreturn asm!().
Pierre-Clément Tosi645e90e2022-10-21 13:27:19 +0100213 unsafe {
214 asm!(
Pierre-Clément Tosi97f52492023-04-04 15:52:17 +0100215 "cmp {scratch}, {bcc}",
216 "b.hs 1f",
217
218 // Zero .data & .bss until BCC.
219 "0: stp xzr, xzr, [{scratch}], 16",
220 "cmp {scratch}, {bcc}",
221 "b.lo 0b",
222
223 "1:",
224 // Skip BCC.
225 "mov {scratch}, {bcc_end}",
226 "cmp {scratch}, {scratch_end}",
227 "b.hs 1f",
228
229 // Keep zeroing .data & .bss.
230 "0: stp xzr, xzr, [{scratch}], 16",
231 "cmp {scratch}, {scratch_end}",
232 "b.lo 0b",
233
234 "1:",
235 // Flush d-cache over .data & .bss (including BCC).
236 "0: dc cvau, {cache_line}",
237 "add {cache_line}, {cache_line}, {dcache_line_size}",
238 "cmp {cache_line}, {scratch_end}",
239 "b.lo 0b",
240
241 "mov {cache_line}, {stack}",
242 // Zero stack region.
243 "0: stp xzr, xzr, [{stack}], 16",
244 "cmp {stack}, {stack_end}",
245 "b.lo 0b",
246
247 // Flush d-cache over stack region.
248 "0: dc cvau, {cache_line}",
249 "add {cache_line}, {cache_line}, {dcache_line_size}",
250 "cmp {cache_line}, {stack_end}",
251 "b.lo 0b",
252
Pierre-Clément Tosi645e90e2022-10-21 13:27:19 +0100253 "msr sctlr_el1, {sctlr_el1_val}",
254 "isb",
255 "mov x1, xzr",
256 "mov x2, xzr",
257 "mov x3, xzr",
258 "mov x4, xzr",
259 "mov x5, xzr",
260 "mov x6, xzr",
261 "mov x7, xzr",
262 "mov x8, xzr",
263 "mov x9, xzr",
264 "mov x10, xzr",
265 "mov x11, xzr",
266 "mov x12, xzr",
267 "mov x13, xzr",
268 "mov x14, xzr",
269 "mov x15, xzr",
270 "mov x16, xzr",
271 "mov x17, xzr",
272 "mov x18, xzr",
273 "mov x19, xzr",
274 "mov x20, xzr",
275 "mov x21, xzr",
276 "mov x22, xzr",
277 "mov x23, xzr",
278 "mov x24, xzr",
279 "mov x25, xzr",
280 "mov x26, xzr",
281 "mov x27, xzr",
282 "mov x28, xzr",
283 "mov x29, xzr",
284 "msr ttbr0_el1, xzr",
Pierre-Clément Tosi97f52492023-04-04 15:52:17 +0100285 // Ensure that CMOs have completed before entering payload.
Pierre-Clément Tosi645e90e2022-10-21 13:27:19 +0100286 "dsb nsh",
287 "br x30",
288 sctlr_el1_val = in(reg) SCTLR_EL1_VAL,
Pierre-Clément Tosi97f52492023-04-04 15:52:17 +0100289 bcc = in(reg) u64::try_from(bcc.start).unwrap(),
290 bcc_end = in(reg) u64::try_from(bcc.end).unwrap(),
Alice Wanga3931aa2023-07-05 12:52:09 +0000291 cache_line = in(reg) u64::try_from(scratch.start.0).unwrap(),
292 scratch = in(reg) u64::try_from(scratch.start.0).unwrap(),
293 scratch_end = in(reg) u64::try_from(scratch.end.0).unwrap(),
294 stack = in(reg) u64::try_from(stack.start.0).unwrap(),
295 stack_end = in(reg) u64::try_from(stack.end.0).unwrap(),
Alice Wang3fa9b802023-06-06 07:52:31 +0000296 dcache_line_size = in(reg) u64::try_from(min_dcache_line_size()).unwrap(),
Pierre-Clément Tosi645e90e2022-10-21 13:27:19 +0100297 in("x0") fdt_address,
298 in("x30") payload_start,
Pierre-Clément Tosi97f52492023-04-04 15:52:17 +0100299 options(noreturn),
Pierre-Clément Tosi645e90e2022-10-21 13:27:19 +0100300 );
301 };
302}
Pierre-Clément Tosie8726e42022-10-17 13:35:27 +0100303
Alan Stokesc3829f12023-06-02 15:02:23 +0100304/// # Safety
305///
306/// This must only be called once, since we are returning a mutable reference.
307/// The appended data region must be mapped.
Pierre-Clément Tosie8726e42022-10-17 13:35:27 +0100308unsafe fn get_appended_data_slice() -> &'static mut [u8] {
Pierre-Clément Tosiad1fc752023-05-31 16:56:56 +0000309 let range = memory::appended_payload_range();
Alan Stokesa0e42962023-04-14 17:59:50 +0100310 // SAFETY: This region is mapped and the linker script prevents it from overlapping with other
311 // objects.
Alice Wanga3931aa2023-07-05 12:52:09 +0000312 unsafe { slice::from_raw_parts_mut(range.start.0 as *mut u8, range.end - range.start) }
Pierre-Clément Tosie8726e42022-10-17 13:35:27 +0100313}
314
Pierre-Clément Tosi20b60962022-10-17 13:35:27 +0100315enum AppendedPayload<'a> {
316 /// Configuration data.
317 Config(config::Config<'a>),
318 /// Deprecated raw BCC, as used in Android T.
319 LegacyBcc(&'a mut [u8]),
320}
Pierre-Clément Tosie8726e42022-10-17 13:35:27 +0100321
Pierre-Clément Tosi20b60962022-10-17 13:35:27 +0100322impl<'a> AppendedPayload<'a> {
Alan Stokesc3829f12023-06-02 15:02:23 +0100323 fn new(data: &'a mut [u8]) -> Option<Self> {
Pierre-Clément Tosi147addf2024-04-15 15:07:58 +0100324 // The borrow checker gets confused about the ownership of data (see inline comments) so we
325 // intentionally obfuscate it using a raw pointer; see a similar issue (still not addressed
326 // in v1.77) in https://users.rust-lang.org/t/78467.
327 let data_ptr = data as *mut [u8];
328
329 // Config::new() borrows data as mutable ...
330 match config::Config::new(data) {
331 // ... so this branch has a mutable reference to data, from the Ok(Config<'a>). But ...
332 Ok(valid) => Some(Self::Config(valid)),
333 // ... if Config::new(data).is_err(), the Err holds no ref to data. However ...
334 Err(config::Error::InvalidMagic) if cfg!(feature = "legacy") => {
335 // ... the borrow checker still complains about a second mutable ref without this.
336 // SAFETY: Pointer to a valid mut (not accessed elsewhere), 'a lifetime re-used.
337 let data: &'a mut _ = unsafe { &mut *data_ptr };
338
Alice Wangeacb7382023-06-05 12:53:54 +0000339 const BCC_SIZE: usize = SIZE_4KB;
Pierre-Clément Tosi7aca7ff2022-12-12 14:04:30 +0000340 warn!("Assuming the appended data at {:?} to be a raw BCC", data.as_ptr());
341 Some(Self::LegacyBcc(&mut data[..BCC_SIZE]))
342 }
Pierre-Clément Tosi7aca7ff2022-12-12 14:04:30 +0000343 Err(e) => {
Pierre-Clément Tosi147addf2024-04-15 15:07:58 +0100344 error!("Invalid configuration data at {data_ptr:?}: {e}");
345 None
Pierre-Clément Tosi7aca7ff2022-12-12 14:04:30 +0000346 }
Pierre-Clément Tosi7aca7ff2022-12-12 14:04:30 +0000347 }
Pierre-Clément Tosi20b60962022-10-17 13:35:27 +0100348 }
349
Alan Stokes65618332023-12-15 14:09:25 +0000350 fn get_entries(self) -> config::Entries<'a> {
Pierre-Clément Tosi20b60962022-10-17 13:35:27 +0100351 match self {
Alan Stokesd0cf3cd2023-12-12 14:36:37 +0000352 Self::Config(cfg) => cfg.get_entries(),
353 Self::LegacyBcc(bcc) => config::Entries { bcc, ..Default::default() },
Pierre-Clément Tosi8edf72e2022-12-06 16:02:57 +0000354 }
Pierre-Clément Tosie8726e42022-10-17 13:35:27 +0100355 }
356}