memstress.c (730cfa45b5f4f170095707b526dc7af99c9f0959) memstress.c (cb6c6914788f65efc8efa72b8a582e2aa2ccc386)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (C) 2020, Google LLC.
4 */
5#include <inttypes.h>
6#include <linux/bitmap.h>
7
8#include "kvm_util.h"

--- 40 unchanged lines hidden (view full) ---

49 struct memstress_vcpu_args *vcpu_args = &args->vcpu_args[vcpu_idx];
50 struct guest_random_state rand_state;
51 uint64_t gva;
52 uint64_t pages;
53 uint64_t addr;
54 uint64_t page;
55 int i;
56
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (C) 2020, Google LLC.
4 */
5#include <inttypes.h>
6#include <linux/bitmap.h>
7
8#include "kvm_util.h"

--- 40 unchanged lines hidden (view full) ---

49 struct memstress_vcpu_args *vcpu_args = &args->vcpu_args[vcpu_idx];
50 struct guest_random_state rand_state;
51 uint64_t gva;
52 uint64_t pages;
53 uint64_t addr;
54 uint64_t page;
55 int i;
56
57 rand_state = new_guest_random_state(args->random_seed + vcpu_idx);
57 rand_state = new_guest_random_state(guest_random_seed + vcpu_idx);
58
59 gva = vcpu_args->gva;
60 pages = vcpu_args->pages;
61
62 /* Make sure vCPU args data structure is not corrupt. */
63 GUEST_ASSERT(vcpu_args->vcpu_idx == vcpu_idx);
64
65 while (true) {

--- 170 unchanged lines hidden (view full) ---

236}
237
238void memstress_set_write_percent(struct kvm_vm *vm, uint32_t write_percent)
239{
240 memstress_args.write_percent = write_percent;
241 sync_global_to_guest(vm, memstress_args.write_percent);
242}
243
58
59 gva = vcpu_args->gva;
60 pages = vcpu_args->pages;
61
62 /* Make sure vCPU args data structure is not corrupt. */
63 GUEST_ASSERT(vcpu_args->vcpu_idx == vcpu_idx);
64
65 while (true) {

--- 170 unchanged lines hidden (view full) ---

236}
237
238void memstress_set_write_percent(struct kvm_vm *vm, uint32_t write_percent)
239{
240 memstress_args.write_percent = write_percent;
241 sync_global_to_guest(vm, memstress_args.write_percent);
242}
243
244void memstress_set_random_seed(struct kvm_vm *vm, uint32_t random_seed)
245{
246 memstress_args.random_seed = random_seed;
247 sync_global_to_guest(vm, memstress_args.random_seed);
248}
249
250void memstress_set_random_access(struct kvm_vm *vm, bool random_access)
251{
252 memstress_args.random_access = random_access;
253 sync_global_to_guest(vm, memstress_args.random_access);
254}
255
256uint64_t __weak memstress_nested_pages(int nr_vcpus)
257{

--- 139 unchanged lines hidden ---
244void memstress_set_random_access(struct kvm_vm *vm, bool random_access)
245{
246 memstress_args.random_access = random_access;
247 sync_global_to_guest(vm, memstress_args.random_access);
248}
249
250uint64_t __weak memstress_nested_pages(int nr_vcpus)
251{

--- 139 unchanged lines hidden ---