summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kvm.c64
-rw-r--r--kvm.h1
-rw-r--r--kvm_lapic.c4
-rw-r--r--kvm_x86.c6
4 files changed, 65 insertions, 10 deletions
diff --git a/kvm.c b/kvm.c
index a43daa7..b99b773 100644
--- a/kvm.c
+++ b/kvm.c
@@ -29,6 +29,10 @@
#include <vm/seg_kpm.h>
#include <sys/avl.h>
#include <sys/condvar_impl.h>
+#include <sys/file.h>
+#include <sys/vnode.h>
+#include <sys/strsubr.h>
+#include <sys/stream.h>
#include "vmx.h"
#include "msr-index.h"
@@ -59,6 +63,11 @@ typedef struct {
} kvm_devstate_t;
/*
+ * Tunables
+ */
+static int kvm_hiwat = 0x1000000;
+
+/*
* Internal driver-wide values
*/
static void *kvm_state; /* DDI state */
@@ -14197,6 +14206,61 @@ kvm_ioctl(dev_t dev, int cmd, intptr_t arg, int md, cred_t *cr, int *rv)
rval = kvm_vm_ioctl_get_dirty_log(kvmp, &log);
break;
}
+ case KVM_NET_QUEUE: {
+ struct vnode *vn;
+ file_t *fp;
+ struct stroptions *stropt;
+ mblk_t *mp;
+ queue_t *q;
+
+ fp = getf(arg);
+ if (fp == NULL) {
+ rval = EINVAL;
+ break;
+ }
+ ASSERT(fp->f_vnode);
+
+ if (fp->f_vnode->v_stream == NULL) {
+ releasef(arg);
+ rval = EINVAL;
+ break;
+ }
+
+ mp = allocb(sizeof (struct stroptions), BPRI_LO);
+ if (mp == NULL) {
+ releasef(arg);
+ rval = ENOMEM;
+ }
+
+ /*
+ * XXX This really just shouldn't need to exist, etc. and we
+ * should really get the hiwat value more intelligently at least
+ * a #define or a tunable god forbid. Oh well, as bmc said
+ * earlier:
+ * "I am in blood steeped in so far that I wade no more.
+ * Returning were as tedious as go o'er.
+ *
+ * We'd love to just putmsg on RD(fp->f_vnode->v_stream->sd_wq)
+ * however that would be the stream head. Instead, we need to
+ * get the write version and then go to the next one and then
+ * the opposite end. The doctor may hemorrhage before the
+ * patient.
+ *
+ * Banquo's ghost is waiting to pop up
+ */
+ mp->b_datap->db_type = M_SETOPTS;
+ stropt = (struct stroptions *)mp->b_rptr;
+ stropt->so_flags = SO_HIWAT;
+ stropt->so_hiwat = 0x100042;
+ q = WR(fp->f_vnode->v_stream->sd_wrq);
+ q = RD(q->q_next);
+ putnext(q, mp);
+
+ releasef(arg);
+
+ rval = 0;
+ *rv = 0;
+ }
default:
#ifndef XXX
XXX_KVM_PROBE;
diff --git a/kvm.h b/kvm.h
index 4343bb4..8c334c0 100644
--- a/kvm.h
+++ b/kvm.h
@@ -1559,6 +1559,7 @@ typedef struct kvm_set_boot_cpu_id_ioc {
#define KVM_CREATE_VM _IO(KVMIO, 0x01) /* returns a VM fd */
#define KVM_DESTROY_VM _IO(KVMIO, 0x0a)
#define KVM_CLONE _IO(KVMIO, 0x20)
+#define KVM_NET_QUEUE _IO(KVMIO, 0x21)
#define KVM_GET_MSR_INDEX_LIST _IOWR(KVMIO, 0x02, struct kvm_msr_list)
diff --git a/kvm_lapic.c b/kvm_lapic.c
index b017eed..1190532 100644
--- a/kvm_lapic.c
+++ b/kvm_lapic.c
@@ -353,10 +353,6 @@ kvm_apic_match_dest(struct kvm_vcpu *vcpu, struct kvm_lapic *source,
int result = 0;
struct kvm_lapic *target = vcpu->arch.apic;
- /* XXX - debug */
- cmn_err(CE_NOTE, "target %p, source %p, dest 0x%x, dest_mode 0x%x, "
- "short_hand 0x%x\n", target, source, dest, dest_mode, short_hand);
-
ASSERT(target != NULL);
switch (short_hand) {
case APIC_DEST_NOSHORT:
diff --git a/kvm_x86.c b/kvm_x86.c
index ea77a65..06994d6 100644
--- a/kvm_x86.c
+++ b/kvm_x86.c
@@ -690,12 +690,6 @@ ioapic_deliver(struct kvm_ioapic *ioapic, int irq)
union kvm_ioapic_redirect_entry *entry = &ioapic->redirtbl[irq];
struct kvm_lapic_irq irqe;
- /* XXX - debug */
- cmn_err(CE_NOTE, "dest_mode=%x delivery_mode=%x vector=%x "
- "trig_mode=%x\n", entry->fields.dest_mode,
- entry->fields.delivery_mode, entry->fields.vector,
- entry->fields.trig_mode);
-
irqe.dest_id = entry->fields.dest_id;
irqe.vector = entry->fields.vector;
irqe.dest_mode = entry->fields.dest_mode;