mirror of
https://github.com/genodelabs/genode.git
synced 2025-03-28 22:59:34 +00:00
parent
149f199735
commit
f0c7eccdc7
@ -21,12 +21,18 @@
|
|||||||
/* libc includes */
|
/* libc includes */
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
/* libc memory allocator */
|
||||||
|
#include <libc_mem_alloc.h>
|
||||||
|
|
||||||
/* Virtualbox includes of VBoxBFE */
|
/* Virtualbox includes of VBoxBFE */
|
||||||
#include <iprt/initterm.h>
|
#include <iprt/initterm.h>
|
||||||
#include <iprt/err.h>
|
#include <iprt/err.h>
|
||||||
|
|
||||||
void *operator new (Genode::size_t size) {
|
void *operator new (Genode::size_t size)
|
||||||
return Genode::env()->heap()->alloc(size); }
|
{
|
||||||
|
static Libc::Mem_alloc_impl heap(Genode::env()->rm_session());
|
||||||
|
return heap.alloc(size, 0x10);
|
||||||
|
}
|
||||||
|
|
||||||
void *operator new [] (Genode::size_t size) {
|
void *operator new [] (Genode::size_t size) {
|
||||||
return Genode::env()->heap()->alloc(size); }
|
return Genode::env()->heap()->alloc(size); }
|
||||||
|
@ -73,6 +73,8 @@ class Vcpu_handler : public Vmm::Vcpu_dispatcher<pthread>
|
|||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
X86FXSTATE _fpu_state __attribute__((aligned(0x10)));
|
||||||
|
|
||||||
Genode::Cap_connection _cap_connection;
|
Genode::Cap_connection _cap_connection;
|
||||||
Vmm::Vcpu_other_pd _vcpu;
|
Vmm::Vcpu_other_pd _vcpu;
|
||||||
|
|
||||||
@ -670,9 +672,11 @@ class Vcpu_handler : public Vmm::Vcpu_dispatcher<pthread>
|
|||||||
*/
|
*/
|
||||||
VMCPU_SET_STATE(pVCpu, VMCPUSTATE_STARTED_EXEC);
|
VMCPU_SET_STATE(pVCpu, VMCPUSTATE_STARTED_EXEC);
|
||||||
|
|
||||||
/* write FPU state from pCtx to vCPU */
|
/* save current FPU state */
|
||||||
|
fpu_save(reinterpret_cast<char *>(&_fpu_state));
|
||||||
|
/* write FPU state from pCtx to FPU registers */
|
||||||
fpu_load(reinterpret_cast<char *>(&pCtx->fpu));
|
fpu_load(reinterpret_cast<char *>(&pCtx->fpu));
|
||||||
|
/* tell kernel to transfer current fpu registers to vCPU */
|
||||||
utcb->mtd |= Mtd::FPU;
|
utcb->mtd |= Mtd::FPU;
|
||||||
|
|
||||||
_current_vm = pVM;
|
_current_vm = pVM;
|
||||||
@ -686,8 +690,10 @@ class Vcpu_handler : public Vmm::Vcpu_dispatcher<pthread>
|
|||||||
_current_vm = 0;
|
_current_vm = 0;
|
||||||
_current_vcpu = 0;
|
_current_vcpu = 0;
|
||||||
|
|
||||||
/* write FPU state of vCPU to pCtx */
|
/* write FPU state of vCPU (in current FPU registers) to pCtx */
|
||||||
fpu_save(reinterpret_cast<char *>(&pCtx->fpu));
|
fpu_save(reinterpret_cast<char *>(&pCtx->fpu));
|
||||||
|
/* load saved FPU state of EMT thread */
|
||||||
|
fpu_load(reinterpret_cast<char *>(&_fpu_state));
|
||||||
|
|
||||||
// CPUMSetChangedFlags(pVCpu, CPUM_CHANGED_GLOBAL_TLB_FLUSH);
|
// CPUMSetChangedFlags(pVCpu, CPUM_CHANGED_GLOBAL_TLB_FLUSH);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user