guest.c (834bf88726f0f11ddc7ff9679fc9458654c01a12) guest.c (eef8c85a3b81301f912e8802a1dd9f42dd884947)
1/*
2 * Copyright (C) 2012,2013 - ARM Ltd
3 * Author: Marc Zyngier <marc.zyngier@arm.com>
4 *
5 * Derived from arch/arm/kvm/guest.c:
6 * Copyright (C) 2012 - Virtual Open Systems and Columbia University
7 * Author: Christoffer Dall <c.dall@virtualopensystems.com>
8 *

--- 18 unchanged lines hidden (view full) ---

27#include <linux/fs.h>
28#include <asm/cputype.h>
29#include <asm/uaccess.h>
30#include <asm/kvm.h>
31#include <asm/kvm_asm.h>
32#include <asm/kvm_emulate.h>
33#include <asm/kvm_coproc.h>
34
1/*
2 * Copyright (C) 2012,2013 - ARM Ltd
3 * Author: Marc Zyngier <marc.zyngier@arm.com>
4 *
5 * Derived from arch/arm/kvm/guest.c:
6 * Copyright (C) 2012 - Virtual Open Systems and Columbia University
7 * Author: Christoffer Dall <c.dall@virtualopensystems.com>
8 *

--- 18 unchanged lines hidden (view full) ---

27#include <linux/fs.h>
28#include <asm/cputype.h>
29#include <asm/uaccess.h>
30#include <asm/kvm.h>
31#include <asm/kvm_asm.h>
32#include <asm/kvm_emulate.h>
33#include <asm/kvm_coproc.h>
34
35#include "trace.h"
36
35struct kvm_stats_debugfs_item debugfs_entries[] = {
36 { NULL }
37};
38
39int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu)
40{
41 return 0;
42}

--- 302 unchanged lines hidden (view full) ---

345 * This sets up and enables the VM for guest debugging. Userspace
346 * passes in a control flag to enable different debug types and
347 * potentially other architecture specific information in the rest of
348 * the structure.
349 */
350int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu,
351 struct kvm_guest_debug *dbg)
352{
37struct kvm_stats_debugfs_item debugfs_entries[] = {
38 { NULL }
39};
40
41int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu)
42{
43 return 0;
44}

--- 302 unchanged lines hidden (view full) ---

347 * This sets up and enables the VM for guest debugging. Userspace
348 * passes in a control flag to enable different debug types and
349 * potentially other architecture specific information in the rest of
350 * the structure.
351 */
352int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu,
353 struct kvm_guest_debug *dbg)
354{
355 trace_kvm_set_guest_debug(vcpu, dbg->control);
356
353 if (dbg->control & ~KVM_GUESTDBG_VALID_MASK)
354 return -EINVAL;
355
356 if (dbg->control & KVM_GUESTDBG_ENABLE) {
357 vcpu->guest_debug = dbg->control;
358
359 /* Hardware assisted Break and Watch points */
360 if (vcpu->guest_debug & KVM_GUESTDBG_USE_HW) {
361 vcpu->arch.external_debug_state = dbg->arch;
362 }
363
364 } else {
365 /* If not enabled clear all flags */
366 vcpu->guest_debug = 0;
367 }
368 return 0;
369}
357 if (dbg->control & ~KVM_GUESTDBG_VALID_MASK)
358 return -EINVAL;
359
360 if (dbg->control & KVM_GUESTDBG_ENABLE) {
361 vcpu->guest_debug = dbg->control;
362
363 /* Hardware assisted Break and Watch points */
364 if (vcpu->guest_debug & KVM_GUESTDBG_USE_HW) {
365 vcpu->arch.external_debug_state = dbg->arch;
366 }
367
368 } else {
369 /* If not enabled clear all flags */
370 vcpu->guest_debug = 0;
371 }
372 return 0;
373}