[BACK]Return to patch-target_i386_nvmm_nvmm-all.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / emulators / qemu / patches

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /pkgsrc/emulators/qemu/patches/patch-target_i386_nvmm_nvmm-all.c between version 1.1 and 1.2

version 1.1, 2021/05/24 14:22:08 version 1.2, 2021/06/01 16:28:05
Line 1 
Line 1 
 $NetBSD$  $NetBSD$
   
 --- target/i386/nvmm/nvmm-all.c.orig    2021-05-06 05:09:24.911125954 +0000  --- target/i386/nvmm/nvmm-all.c.orig    2021-06-01 15:07:31.572325819 +0000
 +++ target/i386/nvmm/nvmm-all.c  +++ target/i386/nvmm/nvmm-all.c
 @@ -0,0 +1,1226 @@  @@ -0,0 +1,1236 @@
 +/*  +/*
 + * Copyright (c) 2018-2019 Maxime Villard, All rights reserved.  + * Copyright (c) 2018-2019 Maxime Villard, All rights reserved.
 + *  + *
Line 755  $NetBSD$
Line 755  $NetBSD$
 +        nvmm_vcpu_pre_run(cpu);  +        nvmm_vcpu_pre_run(cpu);
 +  +
 +        if (qatomic_read(&cpu->exit_request)) {  +        if (qatomic_read(&cpu->exit_request)) {
   +#if NVMM_USER_VERSION >= 2
 +            nvmm_vcpu_stop(vcpu);  +            nvmm_vcpu_stop(vcpu);
   +#else
   +            qemu_cpu_kick_self();
   +#endif
 +        }  +        }
 +  +
 +        /* Read exit_request before the kernel reads the immediate exit flag */  +        /* Read exit_request before the kernel reads the immediate exit flag */
Line 772  $NetBSD$
Line 776  $NetBSD$
 +        switch (exit->reason) {  +        switch (exit->reason) {
 +        case NVMM_VCPU_EXIT_NONE:  +        case NVMM_VCPU_EXIT_NONE:
 +            break;  +            break;
   +#if NVMM_USER_VERSION >= 2
 +        case NVMM_VCPU_EXIT_STOPPED:  +        case NVMM_VCPU_EXIT_STOPPED:
 +            /*  +            /*
 +             * The kernel cleared the immediate exit flag; cpu->exit_request  +             * The kernel cleared the immediate exit flag; cpu->exit_request
Line 780  $NetBSD$
Line 785  $NetBSD$
 +            smp_wmb();  +            smp_wmb();
 +            qcpu->stop = true;  +            qcpu->stop = true;
 +            break;  +            break;
   +#endif
 +        case NVMM_VCPU_EXIT_MEMORY:  +        case NVMM_VCPU_EXIT_MEMORY:
 +            ret = nvmm_handle_mem(mach, vcpu);  +            ret = nvmm_handle_mem(mach, vcpu);
 +            break;  +            break;
Line 893  $NetBSD$
Line 899  $NetBSD$
 +{  +{
 +    if (current_cpu) {  +    if (current_cpu) {
 +        struct qemu_vcpu *qcpu = get_qemu_vcpu(current_cpu);  +        struct qemu_vcpu *qcpu = get_qemu_vcpu(current_cpu);
   +#if NVMM_USER_VERSION >= 2
 +        struct nvmm_vcpu *vcpu = &qcpu->vcpu;  +        struct nvmm_vcpu *vcpu = &qcpu->vcpu;
 +        nvmm_vcpu_stop(vcpu);  +        nvmm_vcpu_stop(vcpu);
   +#else
   +        qcpu->stop = true;
   +#endif
 +    }  +    }
 +}  +}
 +  +

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

CVSweb <webmaster@jp.NetBSD.org>