mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-20 17:52:52 +00:00
Remove obsolete vmm_utils test
This commit is contained in:
parent
ea78d85d35
commit
894c7411e7
@ -1,40 +0,0 @@
|
||||
build { core init timer test/vmm_utils }
|
||||
|
||||
create_boot_directory
|
||||
|
||||
install_config {
|
||||
<config>
|
||||
<parent-provides>
|
||||
<service name="ROM"/>
|
||||
<service name="IRQ"/>
|
||||
<service name="IO_MEM"/>
|
||||
<service name="IO_PORT"/>
|
||||
<service name="PD"/>
|
||||
<service name="RM"/>
|
||||
<service name="CPU"/>
|
||||
<service name="LOG"/>
|
||||
</parent-provides>
|
||||
<default-route>
|
||||
<any-service><parent/><any-child/></any-service>
|
||||
</default-route>
|
||||
<start name="timer">
|
||||
<resource name="RAM" quantum="1M"/>
|
||||
<provides><service name="Timer"/></provides>
|
||||
</start>
|
||||
<start name="test-vmm_utils">
|
||||
<resource name="RAM" quantum="1G"/>
|
||||
</start>
|
||||
</config>
|
||||
}
|
||||
|
||||
build_boot_image { core ld.lib.so init timer test-vmm_utils }
|
||||
|
||||
append qemu_args " -cpu phenom "
|
||||
append qemu_args " -nographic "
|
||||
|
||||
run_genode_until {.*VMM: vcpu_s_1 _vcpu_startup called.*\n} 30
|
||||
run_genode_until {.*VMM: vcpu_s_2 _vcpu_startup called.*\n} 10 [output_spawn_id]
|
||||
run_genode_until {.*VMM: vcpu_o_1 _vcpu_startup called.*\n} 10 [output_spawn_id]
|
||||
run_genode_until {.*VMM: vcpu_o_2 _vcpu_startup called.*\n} 10 [output_spawn_id]
|
||||
|
||||
puts "Test succeeded"
|
@ -1,100 +0,0 @@
|
||||
/*
|
||||
* \brief Test for Genode's VMM utilities
|
||||
* \author Norman Feske
|
||||
* \date 2013-08-20
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2010-2017 Genode Labs GmbH
|
||||
*
|
||||
* This file is distributed under the terms of the GNU General Public License
|
||||
* version 2.
|
||||
*/
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/component.h>
|
||||
|
||||
/* VMM utility includes */
|
||||
#include <vmm/vcpu_thread.h>
|
||||
#include <vmm/vcpu_dispatcher.h>
|
||||
#include <vmm/log.h>
|
||||
|
||||
|
||||
template <typename T>
|
||||
class Vcpu_dispatcher : public Vmm::Vcpu_dispatcher<Genode::Thread>
|
||||
{
|
||||
private:
|
||||
|
||||
typedef Vcpu_dispatcher This;
|
||||
|
||||
T _vcpu_thread;
|
||||
|
||||
/**
|
||||
* Shortcut for calling 'Vmm::Vcpu_dispatcher::register_handler'
|
||||
* with 'Vcpu_dispatcher' as template argument
|
||||
*/
|
||||
template <unsigned EV, void (This::*FUNC)()>
|
||||
void _register_handler(Genode::addr_t exc_base, Nova::Mtd mtd)
|
||||
{
|
||||
register_handler<EV, This, FUNC>(exc_base, mtd);
|
||||
}
|
||||
|
||||
enum { STACK_SIZE = 1024*sizeof(long) };
|
||||
|
||||
|
||||
/***********************************
|
||||
** Virtualization event handlers **
|
||||
***********************************/
|
||||
|
||||
void _vcpu_startup()
|
||||
{
|
||||
Vmm::log(name(), " ", __func__, " called");
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
enum Type { SVM, VTX };
|
||||
|
||||
Vcpu_dispatcher(Genode::Env &env, Type type, char const * name,
|
||||
Genode::Capability<Genode::Pd_session> pd_cap)
|
||||
:
|
||||
Vmm::Vcpu_dispatcher<Genode::Thread>(env, STACK_SIZE, &env.cpu(),
|
||||
Genode::Affinity::Location(),
|
||||
name),
|
||||
_vcpu_thread(&env.cpu(), Genode::Affinity::Location(), pd_cap,
|
||||
STACK_SIZE)
|
||||
{
|
||||
using namespace Nova;
|
||||
|
||||
/* shortcuts for common message-transfer descriptors */
|
||||
Mtd const mtd_all(Mtd::ALL);
|
||||
Mtd const mtd_cpuid(Mtd::EIP | Mtd::ACDB | Mtd::IRQ);
|
||||
Mtd const mtd_irq(Mtd::IRQ);
|
||||
|
||||
Genode::addr_t exc_base = _vcpu_thread.exc_base();
|
||||
|
||||
/* register virtualization event handlers */
|
||||
if (type == SVM) {
|
||||
_register_handler<0xfe, &This::_vcpu_startup>
|
||||
(exc_base, mtd_all);
|
||||
}
|
||||
|
||||
/* start virtual CPU */
|
||||
_vcpu_thread.start(sel_sm_ec() + 1);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
void Component::construct(Genode::Env &env)
|
||||
{
|
||||
typedef Vcpu_dispatcher<Vmm::Vcpu_same_pd> Vcpu_s;
|
||||
|
||||
static Vcpu_s vcpu_s_1(env, Vcpu_s::SVM, "vcpu_s_1", env.pd_session_cap());
|
||||
static Vcpu_s vcpu_s_2(env, Vcpu_s::SVM, "vcpu_s_2", env.pd_session_cap());
|
||||
|
||||
typedef Vcpu_dispatcher<Vmm::Vcpu_other_pd> Vcpu_o;
|
||||
|
||||
static Genode::Pd_connection remote_pd(env, "VM");
|
||||
static Vcpu_o vcpu_o_1(env, Vcpu_o::SVM, "vcpu_o_1", remote_pd.rpc_cap());
|
||||
static Vcpu_o vcpu_o_2(env, Vcpu_o::SVM, "vcpu_o_2", remote_pd.rpc_cap());
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
TARGET = test-vmm_utils
|
||||
SRC_CC = main.cc
|
||||
LIBS += base-nova
|
||||
|
||||
REQUIRES = nova
|
||||
|
||||
vpath %.cc $(PRG_DIR)/..
|
||||
|
||||
CC_CXX_WARN_STRICT =
|
Loading…
x
Reference in New Issue
Block a user