cachepc-qemu

Fork of AMDESE/qemu with changes for cachepc side-channel attack
git clone https://git.sinitax.com/sinitax/cachepc-qemu
Log | Files | Refs | Submodules | LICENSE | sfeed.txt

qtest.c (1714B)


      1/*
      2 * QTest accelerator code
      3 *
      4 * Copyright IBM, Corp. 2011
      5 *
      6 * Authors:
      7 *  Anthony Liguori   <aliguori@us.ibm.com>
      8 *
      9 * This work is licensed under the terms of the GNU GPL, version 2 or later.
     10 * See the COPYING file in the top-level directory.
     11 *
     12 */
     13
     14#include "qemu/osdep.h"
     15#include "qemu/rcu.h"
     16#include "qapi/error.h"
     17#include "qemu/module.h"
     18#include "qemu/option.h"
     19#include "qemu/config-file.h"
     20#include "qemu/accel.h"
     21#include "sysemu/qtest.h"
     22#include "sysemu/cpus.h"
     23#include "sysemu/cpu-timers.h"
     24#include "qemu/guest-random.h"
     25#include "qemu/main-loop.h"
     26#include "hw/core/cpu.h"
     27
     28static int qtest_init_accel(MachineState *ms)
     29{
     30    return 0;
     31}
     32
     33static void qtest_accel_class_init(ObjectClass *oc, void *data)
     34{
     35    AccelClass *ac = ACCEL_CLASS(oc);
     36    ac->name = "QTest";
     37    ac->init_machine = qtest_init_accel;
     38    ac->allowed = &qtest_allowed;
     39}
     40
     41#define TYPE_QTEST_ACCEL ACCEL_CLASS_NAME("qtest")
     42
     43static const TypeInfo qtest_accel_type = {
     44    .name = TYPE_QTEST_ACCEL,
     45    .parent = TYPE_ACCEL,
     46    .class_init = qtest_accel_class_init,
     47};
     48module_obj(TYPE_QTEST_ACCEL);
     49
     50static void qtest_accel_ops_class_init(ObjectClass *oc, void *data)
     51{
     52    AccelOpsClass *ops = ACCEL_OPS_CLASS(oc);
     53
     54    ops->create_vcpu_thread = dummy_start_vcpu_thread;
     55    ops->get_virtual_clock = qtest_get_virtual_clock;
     56};
     57
     58static const TypeInfo qtest_accel_ops_type = {
     59    .name = ACCEL_OPS_NAME("qtest"),
     60
     61    .parent = TYPE_ACCEL_OPS,
     62    .class_init = qtest_accel_ops_class_init,
     63    .abstract = true,
     64};
     65module_obj(ACCEL_OPS_NAME("qtest"));
     66
     67static void qtest_type_init(void)
     68{
     69    type_register_static(&qtest_accel_type);
     70    type_register_static(&qtest_accel_ops_type);
     71}
     72
     73type_init(qtest_type_init);