@@ -27,7 +27,6 @@ use linux_loader::configurator::linux::LinuxBootConfigurator;
2727use linux_loader:: configurator:: pvh:: PvhBootConfigurator ;
2828use linux_loader:: configurator:: { BootConfigurator , BootParams } ;
2929use linux_loader:: loader:: bootparam:: boot_params;
30-
3130use linux_loader:: loader:: elf:: start_info:: {
3231 hvm_memmap_table_entry, hvm_modlist_entry, hvm_start_info,
3332} ;
@@ -136,7 +135,8 @@ pub fn configure_system(
136135 boot_prot : BootProtocol ,
137136) -> Result < ( ) , ConfigurationError > {
138137 // Note that this puts the mptable at the last 1k of Linux's 640k base RAM
139- mptable:: setup_mptable ( guest_mem, resource_allocator, num_cpus) . map_err ( ConfigurationError :: MpTableSetup ) ?;
138+ mptable:: setup_mptable ( guest_mem, resource_allocator, num_cpus)
139+ . map_err ( ConfigurationError :: MpTableSetup ) ?;
140140
141141 match boot_prot {
142142 BootProtocol :: PvhBoot => {
@@ -214,6 +214,7 @@ fn configure_pvh(
214214 // boot_params. This will be stored at PVH_INFO_START address, and %rbx
215215 // will be initialized to contain PVH_INFO_START prior to starting the
216216 // guest, as required by the PVH ABI.
217+ #[ allow( clippy:: cast_possible_truncation) ] // the vec lenghts are single digit integers
217218 let mut start_info = hvm_start_info {
218219 magic : XEN_HVM_START_MAGIC_VALUE ,
219220 version : 1 ,
@@ -275,10 +276,11 @@ fn configure_64bit_boot(
275276
276277 let himem_start = GuestAddress ( layout:: HIMEM_START ) ;
277278
278- let mut params = boot_params:: default ( ) ;
279-
280279 // Set the location of RSDP in Boot Parameters to help the guest kernel find it faster.
281- params. acpi_rsdp_addr = layout:: RSDP_ADDR ;
280+ let mut params = boot_params {
281+ acpi_rsdp_addr : layout:: RSDP_ADDR ,
282+ ..boot_params:: default ( )
283+ } ;
282284 params. hdr . type_of_loader = KERNEL_LOADER_OTHER ;
283285 params. hdr . boot_flag = KERNEL_BOOT_FLAG_MAGIC ;
284286 params. hdr . header = KERNEL_HDR_MAGIC ;
@@ -388,8 +390,15 @@ mod tests {
388390 let no_vcpus = 4 ;
389391 let gm = single_region_mem ( 0x10000 ) ;
390392 let mut resource_allocator = ResourceAllocator :: new ( ) . unwrap ( ) ;
391- let config_err =
392- configure_system ( & gm, & mut resource_allocator, GuestAddress ( 0 ) , 0 , & None , 1 , BootProtocol :: LinuxBoot ) ;
393+ let config_err = configure_system (
394+ & gm,
395+ & mut resource_allocator,
396+ GuestAddress ( 0 ) ,
397+ 0 ,
398+ & None ,
399+ 1 ,
400+ BootProtocol :: LinuxBoot ,
401+ ) ;
393402 assert_eq ! (
394403 config_err. unwrap_err( ) ,
395404 super :: ConfigurationError :: MpTableSetup ( mptable:: MptableError :: NotEnoughMemory )
0 commit comments