*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * This file contain code under public domain from the hvdos project:
+ * https://github.com/mist64/hvdos
+ *
+ * Parts Copyright (c) 2011 NetApp, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY NETAPP, INC ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL NETAPP, INC OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
*/
#include "qemu/osdep.h"
#include "qemu-common.h"
#include <Hypervisor/hv_vmx.h>
#include "exec/address-spaces.h"
-#include "exec/exec-all.h"
-#include "exec/ioport.h"
#include "hw/i386/apic_internal.h"
#include "hw/boards.h"
#include "qemu/main-loop.h"
-#include "strings.h"
#include "sysemu/accel.h"
#include "sysemu/sysemu.h"
#include "target/i386/cpu.h"
switch (ret) {
case HV_ERROR:
- error_report("Error: HV_ERROR\n");
+ error_report("Error: HV_ERROR");
break;
case HV_BUSY:
- error_report("Error: HV_BUSY\n");
+ error_report("Error: HV_BUSY");
break;
case HV_BAD_ARGUMENT:
- error_report("Error: HV_BAD_ARGUMENT\n");
+ error_report("Error: HV_BAD_ARGUMENT");
break;
case HV_NO_RESOURCES:
- error_report("Error: HV_NO_RESOURCES\n");
+ error_report("Error: HV_NO_RESOURCES");
break;
case HV_NO_DEVICE:
- error_report("Error: HV_NO_DEVICE\n");
+ error_report("Error: HV_NO_DEVICE");
break;
case HV_UNSUPPORTED:
- error_report("Error: HV_UNSUPPORTED\n");
+ error_report("Error: HV_UNSUPPORTED");
break;
default:
- error_report("Unknown Error\n");
+ error_report("Unknown Error");
}
abort();
if (mem) {
mem->size = 0;
if (do_hvf_set_memory(mem)) {
- error_report("Failed to reset overlapping slot\n");
+ error_report("Failed to reset overlapping slot");
abort();
}
}
}
if (x == hvf_state->num_slots) {
- error_report("No free slots\n");
+ error_report("No free slots");
abort();
}
mem->region = area;
if (do_hvf_set_memory(mem)) {
- error_report("Error registering new memory slot\n");
+ error_report("Error registering new memory slot");
abort();
}
}
hvf_reset_vcpu(cpu);
x86cpu = X86_CPU(cpu);
- x86cpu->env.kvm_xsave_buf = qemu_memalign(4096, 4096);
+ x86cpu->env.xsave_buf = qemu_memalign(4096, 4096);
hv_vcpu_enable_native_msr(cpu->hvf_fd, MSR_STAR, 1);
hv_vcpu_enable_native_msr(cpu->hvf_fd, MSR_LSTAR, 1);
break;
}
default:
- error_report("Unrecognized CR %d\n", cr);
+ error_report("Unrecognized CR %d", cr);
abort();
}
RIP(env) += ins_len;
env->error_code = 0;
break;
default:
- error_report("%llx: unhandled exit %llx\n", rip, exit_reason);
+ error_report("%llx: unhandled exit %llx", rip, exit_reason);
}
} while (ret == 0);