pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
qemu-nvmm: sync with the latest NVMM
Module Name: pkgsrc-wip
Committed By: Maxime Villard <max%m00nbsd.net@localhost>
Pushed By: maxv
Date: Mon Oct 28 09:31:42 2019 +0100
Changeset: 69f460fb7fbfd97ecc75b595dc52e560e478846d
Modified Files:
qemu-nvmm/files/target_i386_nvmm-all.c
Log Message:
qemu-nvmm: sync with the latest NVMM
Also style.
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=69f460fb7fbfd97ecc75b595dc52e560e478846d
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
qemu-nvmm/files/target_i386_nvmm-all.c | 32 ++++++++++++++------------------
1 file changed, 14 insertions(+), 18 deletions(-)
diffs:
diff --git a/qemu-nvmm/files/target_i386_nvmm-all.c b/qemu-nvmm/files/target_i386_nvmm-all.c
index 61e01183ec..983f6ee127 100644
--- a/qemu-nvmm/files/target_i386_nvmm-all.c
+++ b/qemu-nvmm/files/target_i386_nvmm-all.c
@@ -84,7 +84,7 @@ nvmm_set_segment(struct nvmm_x64_state_seg *nseg, const SegmentCache *qseg)
static void
nvmm_set_registers(CPUState *cpu)
{
- struct CPUX86State *env = (CPUArchState *)(cpu->env_ptr);
+ struct CPUX86State *env = (CPUArchState *)cpu->env_ptr;
struct nvmm_machine *mach = get_nvmm_mach();
struct qemu_vcpu *qcpu = get_qemu_vcpu(cpu);
struct nvmm_vcpu *vcpu = &qcpu->vcpu;
@@ -219,7 +219,7 @@ nvmm_get_segment(SegmentCache *qseg, const struct nvmm_x64_state_seg *nseg)
static void
nvmm_get_registers(CPUState *cpu)
{
- struct CPUX86State *env = (CPUArchState *)(cpu->env_ptr);
+ struct CPUX86State *env = (CPUArchState *)cpu->env_ptr;
struct nvmm_machine *mach = get_nvmm_mach();
struct qemu_vcpu *qcpu = get_qemu_vcpu(cpu);
struct nvmm_vcpu *vcpu = &qcpu->vcpu;
@@ -342,7 +342,7 @@ nvmm_get_registers(CPUState *cpu)
static bool
nvmm_can_take_int(CPUState *cpu)
{
- struct CPUX86State *env = (CPUArchState *)(cpu->env_ptr);
+ struct CPUX86State *env = (CPUArchState *)cpu->env_ptr;
struct qemu_vcpu *qcpu = get_qemu_vcpu(cpu);
struct nvmm_vcpu *vcpu = &qcpu->vcpu;
struct nvmm_machine *mach = get_nvmm_mach();
@@ -351,7 +351,7 @@ nvmm_can_take_int(CPUState *cpu)
return false;
}
- if (qcpu->int_shadow || (!(env->eflags & IF_MASK))) {
+ if (qcpu->int_shadow || !(env->eflags & IF_MASK)) {
struct nvmm_x64_state *state = vcpu->state;
/* Exit on interrupt window. */
@@ -389,7 +389,7 @@ nvmm_can_take_nmi(CPUState *cpu)
static void
nvmm_vcpu_pre_run(CPUState *cpu)
{
- struct CPUX86State *env = (CPUArchState *)(cpu->env_ptr);
+ struct CPUX86State *env = (CPUArchState *)cpu->env_ptr;
struct nvmm_machine *mach = get_nvmm_mach();
struct qemu_vcpu *qcpu = get_qemu_vcpu(cpu);
struct nvmm_vcpu *vcpu = &qcpu->vcpu;
@@ -475,20 +475,16 @@ static void
nvmm_vcpu_post_run(CPUState *cpu, struct nvmm_vcpu_exit *exit)
{
struct qemu_vcpu *qcpu = get_qemu_vcpu(cpu);
- struct CPUX86State *env = (CPUArchState *)(cpu->env_ptr);
+ struct CPUX86State *env = (CPUArchState *)cpu->env_ptr;
X86CPU *x86_cpu = X86_CPU(cpu);
uint64_t tpr;
- env->eflags = exit->exitstate[NVMM_X64_EXITSTATE_RFLAGS];
+ env->eflags = exit->exitstate.rflags;
+ qcpu->int_shadow = exit->exitstate.int_shadow;
+ qcpu->int_window_exit = exit->exitstate.int_window_exiting;
+ qcpu->nmi_window_exit = exit->exitstate.nmi_window_exiting;
- qcpu->int_shadow =
- exit->exitstate[NVMM_X64_EXITSTATE_INT_SHADOW];
- qcpu->int_window_exit =
- exit->exitstate[NVMM_X64_EXITSTATE_INT_WINDOW_EXIT];
- qcpu->nmi_window_exit =
- exit->exitstate[NVMM_X64_EXITSTATE_NMI_WINDOW_EXIT];
-
- tpr = exit->exitstate[NVMM_X64_EXITSTATE_CR8];
+ tpr = exit->exitstate.cr8;
if (qcpu->tpr != tpr) {
qcpu->tpr = tpr;
qemu_mutex_lock_iothread();
@@ -509,7 +505,7 @@ nvmm_io_callback(struct nvmm_io *io)
io->size, !io->in);
if (ret != MEMTX_OK) {
error_report("NVMM: I/O Transaction Failed "
- "[%s, port=%lu, size=%zu]", (io->in ? "in" : "out"),
+ "[%s, port=%u, size=%zu]", (io->in ? "in" : "out"),
io->port, io->size);
}
@@ -643,7 +639,7 @@ static int
nvmm_handle_halted(struct nvmm_machine *mach, CPUState *cpu,
struct nvmm_vcpu_exit *exit)
{
- struct CPUX86State *env = (CPUArchState *)(cpu->env_ptr);
+ struct CPUX86State *env = (CPUArchState *)cpu->env_ptr;
int ret = 0;
qemu_mutex_lock_iothread();
@@ -676,7 +672,7 @@ nvmm_inject_ud(struct nvmm_machine *mach, struct nvmm_vcpu *vcpu)
static int
nvmm_vcpu_loop(CPUState *cpu)
{
- struct CPUX86State *env = (CPUArchState *)(cpu->env_ptr);
+ struct CPUX86State *env = (CPUArchState *)cpu->env_ptr;
struct nvmm_machine *mach = get_nvmm_mach();
struct qemu_vcpu *qcpu = get_qemu_vcpu(cpu);
struct nvmm_vcpu *vcpu = &qcpu->vcpu;
Home |
Main Index |
Thread Index |
Old Index