Lines Matching +full:num +full:- +full:ss +full:- +full:bits
1 // SPDX-License-Identifier: GPL-2.0
41 /* Simplified build-specific string for starting entropy. */
52 /* Rotate by odd number of bits and XOR. */ in rotate_xor()
53 hash = (hash << ((sizeof(hash) * 8) - 7)) | (hash >> 7); in rotate_xor()
82 * Store memory limit: MAXMEM on 64-bit and KERNEL_IMAGE_SIZE on 32-bit.
96 MEM_AVOID_MEMMAP_END = MEM_AVOID_MEMMAP_BEGIN + MAX_MEMMAP_REGIONS - 1,
105 if (one->start + one->size <= two->start) in mem_overlaps()
108 if (one->start >= two->start + two->size) in mem_overlaps()
133 return -EINVAL; in parse_memmap()
137 return -EINVAL; in parse_memmap()
142 return -EINVAL; in parse_memmap()
153 * memmap=nn@ss specifies usable region, should in parse_memmap()
161 * efi_fake_mem=nn@ss:attr the attr specifies in parse_memmap()
162 * flags that might imply a soft-reservation. in parse_memmap()
185 return -EINVAL; in parse_memmap()
265 len = strnlen(args, COMMAND_LINE_SIZE-1); in handle_mem_options()
279 /* Stop at -- */ in handle_mem_options()
280 if (!val && strcmp(param, "--") == 0) in handle_mem_options()
309 * on 64-bit, and [16M, KERNEL_IMAGE_SIZE) on 32-bit.
336 * - input + input_size >= output + output_size
337 * - kernel_total_size <= init_size
338 * - kernel_total_size <= output_size (see Note below)
339 * - output + init_size >= output + output_size
352 * |-----|--------|--------|--------------|-----------|--|-------------|
355 * output+init_size-ZO_INIT_SIZE output+output_size output+kernel_total_size
367 * [output+init_size-ZO_INIT_SIZE, output+init_size) is the worst-case
386 unsigned long init_size = boot_params->hdr.init_size; in mem_avoid_init()
395 mem_avoid[MEM_AVOID_ZO_RANGE].size = (output + init_size) - input; in mem_avoid_init()
398 initrd_start = (u64)boot_params->ext_ramdisk_image << 32; in mem_avoid_init()
399 initrd_start |= boot_params->hdr.ramdisk_image; in mem_avoid_init()
400 initrd_size = (u64)boot_params->ext_ramdisk_size << 32; in mem_avoid_init()
401 initrd_size |= boot_params->hdr.ramdisk_size; in mem_avoid_init()
410 cmd_line_size = strnlen((char *)cmd_line, COMMAND_LINE_SIZE-1) + 1; in mem_avoid_init()
437 u64 earliest = img->start + img->size; in mem_avoid_overlap()
444 earliest = overlap->start; in mem_avoid_overlap()
450 ptr = (struct setup_data *)(unsigned long)boot_params->hdr.setup_data; in mem_avoid_overlap()
455 avoid.size = sizeof(*ptr) + ptr->len; in mem_avoid_overlap()
459 earliest = overlap->start; in mem_avoid_overlap()
463 if (ptr->type == SETUP_INDIRECT && in mem_avoid_overlap()
464 ((struct setup_indirect *)ptr->data)->type != SETUP_INDIRECT) { in mem_avoid_overlap()
465 avoid.start = ((struct setup_indirect *)ptr->data)->addr; in mem_avoid_overlap()
466 avoid.size = ((struct setup_indirect *)ptr->data)->len; in mem_avoid_overlap()
470 earliest = overlap->start; in mem_avoid_overlap()
475 ptr = (struct setup_data *)(unsigned long)ptr->next; in mem_avoid_overlap()
483 unsigned long num; member
499 slot_area.addr = region->start; in store_slot_info()
500 slot_area.num = 1 + (region->size - image_size) / CONFIG_PHYSICAL_ALIGN; in store_slot_info()
503 slot_max += slot_area.num; in store_slot_info()
523 pud_start = ALIGN(region->start, PUD_SIZE); in process_gb_huge_pages()
524 pud_end = ALIGN_DOWN(region->start + region->size, PUD_SIZE); in process_gb_huge_pages()
533 if (pud_start >= region->start + image_size) { in process_gb_huge_pages()
534 tmp.start = region->start; in process_gb_huge_pages()
535 tmp.size = pud_start - region->start; in process_gb_huge_pages()
540 gb_huge_pages = (pud_end - pud_start) >> PUD_SHIFT; in process_gb_huge_pages()
545 max_gb_huge_pages -= gb_huge_pages; in process_gb_huge_pages()
549 if (region->start + region->size >= pud_end + image_size) { in process_gb_huge_pages()
551 tmp.size = region->start + region->size - pud_end; in process_gb_huge_pages()
568 if (slot >= slot_areas[i].num) { in slots_fetch_random()
569 slot -= slot_areas[i].num; in slots_fetch_random()
588 region.start = max_t(u64, entry->start, minimum); in __process_mem_region()
589 region_end = min(entry->start + entry->size, mem_limit); in __process_mem_region()
601 region.size = region_end - region.start; in __process_mem_region()
615 region.size = overlap.start - region.start; in __process_mem_region()
657 region_end = region->start + region->size; in process_mem_region()
659 entry.start = clamp(region->start, start, end); in process_mem_region()
661 entry.size = entry_end - entry.start; in process_mem_region()
682 struct efi_info *e = &boot_params->efi_info; in process_efi_entries()
691 signature = (char *)&e->efi_loader_signature; in process_efi_entries()
698 if (e->efi_memmap_hi) { in process_efi_entries()
702 pmap = e->efi_memmap; in process_efi_entries()
704 pmap = (e->efi_memmap | ((__u64)e->efi_memmap_hi << 32)); in process_efi_entries()
707 nr_desc = e->efi_memmap_size / e->efi_memdesc_size; in process_efi_entries()
709 md = efi_early_memdesc_ptr(pmap, e->efi_memdesc_size, i); in process_efi_entries()
710 if (md->attribute & EFI_MEMORY_MORE_RELIABLE) { in process_efi_entries()
717 md = efi_early_memdesc_ptr(pmap, e->efi_memdesc_size, i); in process_efi_entries()
730 if (md->type != EFI_CONVENTIONAL_MEMORY) in process_efi_entries()
734 (md->attribute & EFI_MEMORY_SP)) in process_efi_entries()
738 !(md->attribute & EFI_MEMORY_MORE_RELIABLE)) in process_efi_entries()
741 region.start = md->phys_addr; in process_efi_entries()
742 region.size = md->num_pages << EFI_PAGE_SHIFT; in process_efi_entries()
764 for (i = 0; i < boot_params->e820_entries; i++) { in process_e820_entries()
765 entry = &boot_params->e820_table[i]; in process_e820_entries()
766 /* Skip non-RAM entries. */ in process_e820_entries()
767 if (entry->type != E820_TYPE_RAM) in process_e820_entries()
769 region.start = entry->addr; in process_e820_entries()
770 region.size = entry->size; in process_e820_entries()
811 * There are how many CONFIG_PHYSICAL_ALIGN-sized slots in find_random_virt_addr()
815 slots = 1 + (KERNEL_IMAGE_SIZE - minimum - image_size) / CONFIG_PHYSICAL_ALIGN; in find_random_virt_addr()
839 boot_params->hdr.loadflags |= KASLR_FLAG; in choose_random_location()