Author: imp
Date: Sat Apr  5 22:43:23 2014
New Revision: 264179
URL: http://svnweb.freebsd.org/changeset/base/264179

Log:
  Make the vmm code compile with gcc too. Not entirely sure things are
  correct for the pirbase test (since I'd have thought we'd need to do
  something even when the offset is 0 and that test looks like a
  misguided attempt to not use an uninitialized variable), but it is at
  least the same as today.

Modified:
  head/sys/amd64/vmm/intel/vmx.c
  head/sys/amd64/vmm/io/vatpic.c
  head/sys/amd64/vmm/io/vatpit.c
  head/sys/amd64/vmm/vmm_dev.c

Modified: head/sys/amd64/vmm/intel/vmx.c
==============================================================================
--- head/sys/amd64/vmm/intel/vmx.c      Sat Apr  5 22:43:18 2014        
(r264178)
+++ head/sys/amd64/vmm/intel/vmx.c      Sat Apr  5 22:43:23 2014        
(r264179)
@@ -1048,6 +1048,7 @@ vmx_set_pcpu_defaults(struct vmx *vmx, i
                        invvpid_desc._res1 = 0;
                        invvpid_desc._res2 = 0;
                        invvpid_desc.vpid = vmxstate->vpid;
+                       invvpid_desc.linear_addr = 0;
                        invvpid(INVVPID_TYPE_SINGLE_CONTEXT, invvpid_desc);
                } else {
                        /*
@@ -2742,7 +2743,7 @@ vmx_inject_pir(struct vlapic *vlapic)
        struct pir_desc *pir_desc;
        struct LAPIC *lapic;
        uint64_t val, pirval;
-       int rvi, pirbase;
+       int rvi, pirbase = -1;
        uint16_t intr_status_old, intr_status_new;
 
        vlapic_vtx = (struct vlapic_vtx *)vlapic;
@@ -2787,6 +2788,11 @@ vmx_inject_pir(struct vlapic *vlapic)
                pirbase = 192;
                pirval = val;
        }
+       if (pirbase == -1) {
+               VCPU_CTR0(vlapic->vm, vlapic->vcpuid, "vmx_inject_pir: "
+                   "no posted interrupt found");
+               return;
+       }
        VLAPIC_CTR_IRR(vlapic, "vmx_inject_pir");
 
        /*

Modified: head/sys/amd64/vmm/io/vatpic.c
==============================================================================
--- head/sys/amd64/vmm/io/vatpic.c      Sat Apr  5 22:43:18 2014        
(r264178)
+++ head/sys/amd64/vmm/io/vatpic.c      Sat Apr  5 22:43:23 2014        
(r264179)
@@ -473,7 +473,7 @@ vatpic_master_handler(void *vm, int vcpu
 {
        struct vatpic *vatpic;
        struct atpic *atpic;
-       int error;
+       int error = 0;;
        uint8_t val;
 
        vatpic = vm_atpic(vm);

Modified: head/sys/amd64/vmm/io/vatpit.c
==============================================================================
--- head/sys/amd64/vmm/io/vatpit.c      Sat Apr  5 22:43:18 2014        
(r264178)
+++ head/sys/amd64/vmm/io/vatpit.c      Sat Apr  5 22:43:23 2014        
(r264179)
@@ -234,28 +234,6 @@ vatpit_update_mode(struct vatpit *vatpit
        return (0);
 }
 
-static int
-vatpit_get_out(struct vatpit *vatpit, int channel)
-{
-       struct channel *c;
-       sbintime_t delta_ticks;
-       int out;
-
-       c = &vatpit->channel[channel];
-
-       switch (c->mode) {
-       case TIMER_INTTC:
-               delta_ticks = (sbinuptime() - c->now_sbt) / vatpit->freq_sbt;
-               out = ((c->initial - delta_ticks) <= 0);
-               break;
-       default:
-               out = 0;
-               break;
-       }
-
-       return (out);
-}
-
 int
 vatpit_handler(void *vm, int vcpuid, struct vm_exit *vmexit)
 {

Modified: head/sys/amd64/vmm/vmm_dev.c
==============================================================================
--- head/sys/amd64/vmm/vmm_dev.c        Sat Apr  5 22:43:18 2014        
(r264178)
+++ head/sys/amd64/vmm/vmm_dev.c        Sat Apr  5 22:43:23 2014        
(r264179)
@@ -231,6 +231,7 @@ vmmdev_ioctl(struct cdev *cdev, u_long c
                break;
 
        default:
+               error = EINVAL;
                break;
        }
 
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to