// SPDX-License-Identifier: GPL-2.0 /* * Entropy functions used on early boot for KASLR base and memory * randomization. The base randomization is done in the compressed * kernel and memory randomization is done early when the regular * kernel starts. This file is included in the compressed kernel and * normally linked in the regular. */ #include <asm/asm.h> #include <asm/kaslr.h> #include <asm/msr.h> #include <asm/archrandom.h> #include <asm/e820/api.h> #include <asm/io.h> /* * When built for the regular kernel, several functions need to be stubbed out * or changed to their regular kernel equivalent. */ #ifndef KASLR_COMPRESSED_BOOT #include <asm/cpufeature.h> #include <asm/setup.h> #define debug_putstr(v) early_printk("%s", v) #define has_cpuflag(f) boot_cpu_has(f) #define get_boot_seed() kaslr_offset() #endif #define I8254_PORT_CONTROL 0x43 #define I8254_PORT_COUNTER0 0x40 #define I8254_CMD_READBACK 0xC0 #define I8254_SELECT_COUNTER0 0x02 #define I8254_STATUS_NOTREADY 0x40
static inline u16 i8254(void) { u16 status, timer; do { outb(I8254_PORT_CONTROL, I8254_CMD_READBACK | I8254_SELECT_COUNTER0); status = inb(I8254_PORT_COUNTER0); timer = inb(I8254_PORT_COUNTER0); timer |= inb(I8254_PORT_COUNTER0) << 8; } while (status & I8254_STATUS_NOTREADY); return timer; }Contributors
Person | Tokens | Prop | Commits | CommitProp |
Thomas Garnier | 59 | 100.00% | 1 | 100.00% |
Total | 59 | 100.00% | 1 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
Thomas Garnier | 144 | 99.31% | 1 | 50.00% |
Matthias Kaehlcke | 1 | 0.69% | 1 | 50.00% |
Total | 145 | 100.00% | 2 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
Thomas Garnier | 268 | 97.45% | 1 | 20.00% |
Matthias Kaehlcke | 4 | 1.45% | 1 | 20.00% |
Greg Kroah-Hartman | 1 | 0.36% | 1 | 20.00% |
Ingo Molnar | 1 | 0.36% | 1 | 20.00% |
Nicolas Iooss | 1 | 0.36% | 1 | 20.00% |
Total | 275 | 100.00% | 5 | 100.00% |