/qemu/util/ |
H A D | guest-random.c | 2 * QEMU guest-visible random functions 15 #include "qemu/guest-random.h" 17 #include "exec/replay-core.h" 31 /* Thread not initialized for a cpu, or main w/o -seed. */ in glib_random_bytes() 41 __builtin_memcpy(buf + i, &x, len - i); in glib_random_bytes() 56 /* Non-deterministic implementation using crypto routines. */ in qemu_guest_getrandom() 80 void qemu_guest_random_seed_thread_part2(uint64_t seed) in qemu_guest_random_seed_thread_part2() argument 85 g_rand_new_with_seed_array((const guint32 *)&seed, in qemu_guest_random_seed_thread_part2() 86 sizeof(seed) / sizeof(guint32)); in qemu_guest_random_seed_thread_part2() 92 uint64_t seed; in qemu_guest_random_seed_main() local [all …]
|
/qemu/tests/image-fuzzer/ |
H A D | runner.py | 40 "'--config' and '--command' options are not supported.", file=sys.stderr) 96 return -term_signal 117 The test log will include application (e.g. 'qemu-img') logs besides info 121 def __init__(self, test_id, seed, work_dir, run_log, argument 125 Path to qemu-img and qemu-io will be retrieved from 'QEMU_IMG' and 128 if seed is not None: 129 self.seed = seed 131 self.seed = str(random.randint(0, sys.maxsize)) 132 random.seed(self.seed) 136 self.current_dir = os.path.join(work_dir, 'test-' + test_id) [all …]
|
/qemu/include/qemu/ |
H A D | guest-random.h | 2 * QEMU guest-visible random functions 17 * @seedstr: a non-NULL pointer to a C string 20 * The @seedstr value is that which accompanies the -seed argument. 31 * independent seed for the new thread. Otherwise returns 0. 36 * qemu_guest_random_seed_thread_part2(uint64_t seed) 37 * @seed: a value for the new thread. 40 * independent seed for the new thread. Otherwise a no-op. 42 void qemu_guest_random_seed_thread_part2(uint64_t seed); 51 * for data presented to the guest. Host-side crypto services should
|
H A D | xxhash.h | 2 * xxHash - Fast Hash algorithm 3 * Copyright (C) 2012-2016, Yann Collet 5 * BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php) 31 * - xxHash source repository : https://github.com/Cyan4973/xxHash 57 uint32_t v4 = QEMU_XXHASH_SEED - PRIME32_1; in qemu_xxhash8() 141 * v1 = seed + XXH_PRIME64_1 + XXH_PRIME64_2; 142 * v2 = seed + XXH_PRIME64_2; 143 * v3 = seed + 0; 144 * v4 = seed - XXH_PRIME64_1; 153 * h64 = seed + XXH_PRIME64_5; [all …]
|
/qemu/docs/ |
H A D | image-fuzzer.txt | 23 ----------- 25 The goal of the image fuzzer is to catch crashes of qemu-io/qemu-img 32 ----------- 40 keyboard interruption. But if a test seed is specified via the '--seed' runner 41 parameter, then only one test with this seed will be executed, after its finish 54 Paths to binaries under test (SUTs) ``qemu-img`` and ``qemu-io`` are retrieved 57 ``qemu-img`` is required for creation of backing files, so it's mandatory to set 59 For details about environment variables see qemu-iotests/check. 62 '--config' argument, e.g. 71 the '--command' argument. Each command is a list containing a SUT and all its [all …]
|
/qemu/hw/misc/ |
H A D | xlnx-versal-trng.c | 2 * Non-crypto strength model of the True Random Number Generator 5 * Copyright (c) 2017-2020 Xilinx Inc. 29 #include "hw/misc/xlnx-versal-trng.h" 33 #include "qemu/error-report.h" 34 #include "qemu/guest-random.h" 38 #include "hw/qdev-properties.h" 140 return s->hw_version < 0x0200; in trng_older_than_v2() 145 if (ARRAY_FIELD_EX32(s->regs, RESET, VAL)) { in trng_in_reset() 148 if (ARRAY_FIELD_EX32(s->regs, CTRL, PRNGSRST)) { in trng_in_reset() 157 return ARRAY_FIELD_EX32(s->regs, CTRL, TSTMODE); in trng_test_enabled() [all …]
|
H A D | exynos4210_rng.c | 25 #include "qemu/guest-random.h" 76 /* bits from 0 to EXYNOS4210_RNG_PRNG_NUM if given seed register was set */ 88 /* Return true if all the seed-set bits are set. */ in exynos4210_rng_seed_ready() 89 return (s->seed_set & mask) == mask; in exynos4210_rng_seed_ready() 96 * We actually ignore the seed and always generate true random numbers. in exynos4210_rng_set_seed() 99 * generates random numbers regardless of the seed value. in exynos4210_rng_set_seed() 101 s->seed_set |= BIT(i); in exynos4210_rng_set_seed() 105 s->reg_status |= EXYNOS4210_RNG_STATUS_SEED_SETTING_DONE; in exynos4210_rng_set_seed() 107 s->reg_status &= ~EXYNOS4210_RNG_STATUS_SEED_SETTING_DONE; in exynos4210_rng_set_seed() 115 /* Seed set? */ in exynos4210_rng_run_engine() [all …]
|
H A D | imx_rngc.c | 7 * See the COPYING file in the top-level directory. 9 * This driver provides the minimum functionality to initialize and seed 15 #include "qemu/main-loop.h" 17 #include "qemu/guest-random.h" 45 /* the current status for self-test and seed operations */ 61 if (s->op_seed == OP_RUN) { in imx_rngc_read() 64 if (s->op_self_test == OP_RUN) { in imx_rngc_read() 74 val |= s->mask; in imx_rngc_read() 75 if (s->auto_seed) { in imx_rngc_read() 87 * We never report any statistics test or self-test errors or any in imx_rngc_read() [all …]
|
/qemu/tests/qtest/fuzz/ |
H A D | fuzz.h | 10 * See the COPYING file in the top-level directory. 26 * with a unique @name that can be specified on the command-line to 29 * A target must implement ->fuzz() to process a random input. If QEMU 30 * crashes in ->fuzz() then libfuzzer will record a failure. 35 * .name = "my-device-fifo", 36 * .description = "Fuzz the FIFO buffer registers of my-device", 47 const char *name; /* target identifier (passed to --fuzz-target=)*/ 59 * eg: set up shared-memory for communication with the child-process 65 * will run once, after QEMU has been initialized, prior to the fuzz-loop. 90 * seed: the seed that should be used to make mutations deterministic, when [all …]
|
H A D | fuzz.c | 10 * See the COPYING file in the top-level directory. 23 #include "qemu/main-loop.h" 50 while (g_main_context_pending(NULL) && i-- > 0) { in flush_events() 77 if (g_strcmp0(tmp->target->name, target->name) == 0) { in fuzz_add_target() 79 target->name); in fuzz_add_target() 84 target_state->target = g_new0(FuzzTarget, 1); in fuzz_add_target() 85 *(target_state->target) = *target; in fuzz_add_target() 93 printf("Usage: %s --fuzz-target=FUZZ_TARGET [LIBFUZZER ARGUMENTS]\n", path); in usage() 101 printf(" * %s : %s\n", tmp->target->name, in usage() 102 tmp->target->description); in usage() [all …]
|
/qemu/tests/tcg/multiarch/ |
H A D | vma-pthread.c | 4 * SPDX-License-Identifier: GPL-2.0-or-later 12 * Two mutator threads change the non-fixed protection bits randomly. 28 #define PAGE_IDX_MASK (PAGE_COUNT - 1) 34 #define PAGES_PER_REGION (1 << (PAGE_IDX_BITS - REGION_IDX_BITS)) 50 for (i = 0; ctx->mutator_count; i++) { in thread_read() 54 p = &ctx->ptr[j * ctx->pagesize]; in thread_read() 64 sret = write(ctx->dev_null_fd, p, 1); in thread_read() 85 for (i = 0; ctx->mutator_count; i++) { in thread_write() 89 memcpy(&ctx->ptr[j * ctx->pagesize], nop_func, sizeof(nop_func)); in thread_write() 92 ts = (struct timespec *)(&ctx->ptr[(j + 1) * ctx->pagesize] - in thread_write() [all …]
|
/qemu/tests/bench/ |
H A D | qht-bench.c | 5 * See the COPYING file in the top-level directory. 30 * Seed is in the range [1..UINT64_MAX], because the RNG requires 31 * a non-zero seed. To use, subtract 1 and compare against the 35 uint64_t seed; member 78 " -d = duration, in seconds\n" 79 " -n = number of threads\n" 81 " -o = offset at which keys start\n" 82 " -p = precompute hashes\n" 84 " -g = set -s,-k,-K,-l,-r to the same value\n" 85 " -s = initial size hint\n" [all …]
|
/qemu/target/arm/tcg/ |
H A D | mte_helper.c | 2 * ARM v8.5-MemTag Operations 24 #include "exec/page-protection.h" 27 #include "user/page-protection.h" 31 #include "accel/tcg/cpu-ldst.h" 33 #include "exec/helper-proto.h" 34 #include "exec/tlb-flags.h" 35 #include "accel/tcg/cpu-ops.h" 37 #include "qemu/guest-random.h" 54 } while (--offset > 0); in choose_nonexcluded_tag() 89 TARGET_PAGE_BITS - LOG2_TAG_GRANULE - 1); in allocation_tag_mem_probe() [all …]
|
/qemu/tests/qtest/ |
H A D | xlnx-versal-trng-test.c | 6 * SPDX-License-Identifier: GPL-2.0-or-later 10 #include "libqtest-single.h" 83 static const gchar trng_qname[] = "xlnx-versal-trng-test"; 97 qtest_start("-machine xlnx-versal-virt"); in trng_test_start() 107 const char *path = "/machine/xlnx-versal/trng"; in trng_test_set_uint_prop() 110 response = qmp("{ 'execute': 'qom-set'," in trng_test_set_uint_prop() 243 static void trng_reseed(const uint32_t *seed) in trng_reseed() argument 254 if (seed) { in trng_reseed() 255 trng_load(R_TRNG_EXT_SEED_0, seed); in trng_reseed() 318 TRNG_FAILED("PRNG_1 Auto-gen test failed: expected = %u, got = %u", in trng_test_autogen() [all …]
|
/qemu/docs/system/arm/ |
H A D | virt.rst | 1 .. _arm-virt: 10 idiosyncrasies and limitations of a particular bit of real-world 18 ``virt-5.0`` machine type will behave like the ``virt`` machine from 19 the QEMU 5.0 release, and migration should work between ``virt-5.0`` 20 of the 5.0 release and ``virt-5.0`` of the 5.1 release. Migration 22 the non-versioned ``virt`` machine type. 24 VM migration is not guaranteed when using ``-cpu max``, as features 33 - PCI/PCIe devices 34 - Flash memory 35 - Either one or two PL011 UARTs for the NonSecure World [all …]
|
/qemu/pc-bios/s390-ccw/ |
H A D | netmain.c | 2 * S390 virtio-ccw network boot loading program 6 * Based on the S390 virtio-ccw loading program (main.c) 35 #include "s390-ccw.h" 38 #include "s390-time.h" 65 return dest_timer - get_time_ms(); in get_timer() 76 * client MAC, client IP, TFTP-server MAC, TFTP-server IP, 80 * non-0 : error condition occurred. 85 int rc = -1; in dhcp() 93 printf("\b\b\b%03d", i - 1); in dhcp() 94 if (!--i) { in dhcp() [all …]
|
/qemu/include/hw/misc/ |
H A D | xlnx-zynqmp-crf.h | 2 * QEMU model of the CRF - Clock Reset FPD. 5 * SPDX-License-Identifier: GPL-2.0-or-later 45 FIELD(APLL_FRAC_CFG, SEED, 22, 3) 65 FIELD(DPLL_FRAC_CFG, SEED, 22, 3) 85 FIELD(VPLL_FRAC_CFG, SEED, 22, 3)
|
/qemu/include/standard-headers/asm-m68k/ |
H A D | bootinfo.h | 1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 3 * asm/bootinfo.h -- Definition of the Linux/m68k boot information structure 61 * A random seed used to initialize the RNG. Record format: 63 * - length [ 2 bytes, 16-bit big endian ] 64 * - seed data [ `length` bytes, padded to preserve 4-byte struct alignment ] 115 #define FPUB_SUNFPA 4 /* Sun-3 FPA */ 130 #define MMUB_SUN3 5 /* Custom Sun-3 */ 148 * together :-) 152 * appropriate machine. If a change is backward-compatible, the minor 153 * should be stepped. "Backwards-compatible" means that booting will work,
|
/qemu/tests/docker/ |
H A D | test-fuzz | 1 #!/bin/bash -e 3 # Compile and check with oss-fuzz. 10 # SPDX-License-Identifier: GPL-2.0-or-later 18 cp -a $QEMU_SRC . 20 mkdir build-oss-fuzz 21 export LSAN_OPTIONS=suppressions=scripts/oss-fuzz/lsan_suppressions.txt 22 env CC="clang" CXX="clang++" CFLAGS="-fsanitize=address" ./scripts/oss-fuzz/build.sh 24 for fuzzer in $(find ./build-oss-fuzz/DEST_DIR/ -executable -type f | grep -v slirp); do 27 "${fuzzer}" -runs=1 -seed=1 || exit 1 ;
|
/qemu/tests/functional/ |
H A D | test_arm_quanta_gsj.py | 5 # SPDX-License-Identifier: GPL-2.0-or-later 15 '20200711-gsj-qemu-0/obmc-phosphor-image-gsj.static.mtd.gz'), 20 '20200711-gsj-qemu-0/obmc-phosphor-initramfs-gsj.cpio.xz'), 25 '20200711-gsj-qemu-0/uImage-gsj.bin'), 30 '20200711-gsj-qemu-0/nuvoton-npcm730-gsj.dtb'), 35 self.set_machine('quanta-gsj') 40 self.vm.add_args('-drive', drive_args) 44 # to avoid running past the 90-second timeout. These may be removed 50 'systemd.mask=systemd-random-seed.service ' 57 self.wait_for_console_pattern('U-Boot ') [all …]
|
/qemu/hw/arm/ |
H A D | virt.c | 2 * ARM mach-virt emulation 23 * + we want to present a very stripped-down minimalist platform, 41 #include "hw/vfio/vfio-calxeda-xgmac.h" 42 #include "hw/vfio/vfio-amd-xgbe.h" 57 #include "qemu/error-report.h" 59 #include "hw/pci-host/gpex.h" 60 #include "hw/virtio/virtio-pci.h" 61 #include "hw/core/sysbus-fdt.h" 62 #include "hw/platform-bus.h" 63 #include "hw/qdev-properties.h" [all …]
|
/qemu/docs/about/ |
H A D | deprecated.rst | 21 for pre-existing VM deployments. They should be scheduled for updating to a 23 should exclusively use a non-deprecated machine type, with use of the most 24 recent version highly recommended. Non-versioned machine types follow the 31 -------------------------------------- 33 Short-form boolean options (since 6.0) 43 The replacement for the ``nodelay`` short-form boolean option is ``nodelay=on`` 50 command-line less readable, especially when the argument itself consist of a 51 name and a value, e.g. ``-plugin plugin_name,arg="arg_name=arg_value"``. 52 Therefore, the usage of ``arg`` is redundant. Single-word arguments are treated 53 as short-form boolean values, and passed to plugins as ``arg_name=on``. [all …]
|
/qemu/hw/microblaze/ |
H A D | boot.c | 31 #include "qemu/config-file.h" 32 #include "qemu/error-report.h" 33 #include "qemu/guest-random.h" 57 CPUMBState *env = &cpu->env; in main_cpu_reset() 60 env->regs[5] = boot_info.cmdline; in main_cpu_reset() 61 env->regs[6] = boot_info.initrd_start; in main_cpu_reset() 62 env->regs[7] = boot_info.fdt; in main_cpu_reset() 89 qemu_fdt_setprop(fdt, "/chosen", "rng-seed", rng_seed, sizeof(rng_seed)); in microblaze_load_dtb() 100 qemu_fdt_setprop_cell(fdt, "/chosen", "linux,initrd-start", in microblaze_load_dtb() 103 qemu_fdt_setprop_cell(fdt, "/chosen", "linux,initrd-end", in microblaze_load_dtb() [all …]
|
/qemu/hw/rx/ |
H A D | rx-gdbsim.c | 21 #include "qemu/error-report.h" 22 #include "qemu/guest-random.h" 53 #define TYPE_RX_GDBSIM_MACHINE MACHINE_TYPE_NAME("rx62n-common") 71 cpu->env.pc = start; in DECLARE_OBJ_CHECKERS() 74 /* linux kernel only works little-endian mode */ in DECLARE_OBJ_CHECKERS() 87 const char *kernel_filename = machine->kernel_filename; in rx_gdbsim_init() 88 const char *dtb_filename = machine->dtb; in rx_gdbsim_init() 91 if (machine->ram_size < mc->default_ram_size) { in rx_gdbsim_init() 92 char *sz = size_to_str(mc->default_ram_size); in rx_gdbsim_init() 99 memory_region_add_subregion(sysmem, SDRAM_BASE, machine->ram); in rx_gdbsim_init() [all …]
|
/qemu/hw/loongarch/ |
H A D | virt-fdt-build.c | 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 6 #include "qemu/error-report.h" 7 #include "qemu/guest-random.h" 10 #include "hw/core/sysbus-fdt.h" 14 #include "hw/pci-host/gpex.h" 15 #include "hw/pci-host/ls7a.h" 25 ms->fdt = create_device_tree(&lvms->fdt_size); in create_fdt() 26 if (!ms->fdt) { in create_fdt() 32 qemu_fdt_setprop_string(ms->fdt, "/", "compatible", in create_fdt() 33 "linux,dummy-loongson3"); in create_fdt() [all …]
|