From owner-svn-src-all@FreeBSD.ORG Sat Apr 5 22:43:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4E1DBAD0; Sat, 5 Apr 2014 22:43:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2DC0B7C5; Sat, 5 Apr 2014 22:43:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s35MhOFm027985; Sat, 5 Apr 2014 22:43:24 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s35MhNiL027981; Sat, 5 Apr 2014 22:43:23 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404052243.s35MhNiL027981@svn.freebsd.org> From: Warner Losh Date: Sat, 5 Apr 2014 22:43:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264179 - in head/sys/amd64/vmm: . intel io X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Apr 2014 22:43:24 -0000 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; }