From nobody Thu Apr 25 20:55:05 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1578480002; cv=none; d=zohomail.com; s=zohoarc; b=QjKw8moCd099DeFy04WkXFqA1UoDxXaf+eplc+VeoEYMR5H07D9xebk+CFx5nt2VDg5Yy9fsSNXx6LogzBJ0yWC7YUm+XtPEar8vaUggP7IXjdw4MzzlkkFq+cQ2FSwiS5yCZS9bJA8WGHgfkQmeh79UznJ+mRV0jLd71GnPtdk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578480002; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=YpKfLI7w+Fxs6Dz02ip69P6YOe0qkqprmL4Q74WL1Ek=; b=nBdcTVPIq8wm6sd5srn4A3gISEGO8DVNUbE8+By2hw+HHd87NOCNDxbhJJ9lg0Aje/1KfRmampmg2iHAKu/0oAvpV35wWR7G+1OOsJP5V5vB4F9esSawRyuQWlzb7jktxeUjTkfWc1gOtG4hJee4uuDxlRAkO1IGH2ulA2WuW0w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 157848000213273.52197778338143; Wed, 8 Jan 2020 02:40:02 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ip8kD-0007xG-UO; Wed, 08 Jan 2020 10:39:21 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ip8kC-0007x7-0v for xen-devel@lists.xenproject.org; Wed, 08 Jan 2020 10:39:20 +0000 Received: from esa3.hc3370-68.iphmx.com (unknown [216.71.145.155]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 193036a0-3203-11ea-bf56-bc764e2007e4; Wed, 08 Jan 2020 10:39:08 +0000 (UTC) X-Inumbo-ID: 193036a0-3203-11ea-bf56-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1578479948; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Ba4ra9nZdllESORCXLcGcHMgte79HZx546Vj9gUeQJk=; b=N0GfuyaWWR5994xiDC1fhU1axbZ7VrIbz8eay0N7CW+COJOBhmEaLPKM wzSs8z3m5/OPo1ccCRO98Dufn80uxu6C5jbnoEsusTPSYGz0+VhN5k1Tu /CX23Lk5hw/sROdEdHVAsk0bNgSV/Wz6ao7YB9q0P8f4fBQLw1xWUqnEm 8=; Authentication-Results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=roger.pau@citrix.com; spf=Pass smtp.mailfrom=roger.pau@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa3.hc3370-68.iphmx.com: no sender authenticity information available from domain of roger.pau@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa3.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="roger.pau@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa3.hc3370-68.iphmx.com: domain of roger.pau@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa3.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="roger.pau@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ip4:168.245.78.127 ~all" Received-SPF: None (esa3.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa3.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: 7jiqfmdepobmiVldalbVvA7XJ2NiDBNqSr9cq58kdW8Cdcj57QGOgPZSqS+OxEzuvFdbiOzHtu 7zdCjOkjsbIW78iZl2PqrBNHI+/lfwTp35o2gb/iNBfVK/KGOvGWOzvlo66a1k510/zcpMy2OT KEc4pWHSdqWQIpJkY8FPK99jQGc6ZjTaptTR5piMLG/oIDsp99M3OrafjzdemDygbnmLu+LxPg //Y7MJVfoe8idE39+dvdudlCzEoK8m/i2eeRFqfemNmLyJgBMbegT+JL6zyG4UUl5XOTVpA1Jk KxU= X-SBRS: 2.7 X-MesageID: 10603608 X-Ironport-Server: esa3.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.69,409,1571716800"; d="scan'208";a="10603608" From: Roger Pau Monne To: Date: Wed, 8 Jan 2020 11:38:56 +0100 Message-ID: <20200108103857.77236-2-roger.pau@citrix.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200108103857.77236-1-roger.pau@citrix.com> References: <20200108103857.77236-1-roger.pau@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 1/2] nvmx: fix handling of interrupts X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Kevin Tian , Jun Nakajima , Wei Liu , Andrew Cooper , Jan Beulich , Roger Pau Monne Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) When doing a virtual vmexit (ie: a vmexit handled by the L1 VMM) interrupts shouldn't be injected using the virtual interrupt delivery mechanism, and instead should be signaled in the vmcs using the exit reason and the interruption-information field if the "Acknowledge interrupt on exit" vmexit control is set. Remove the nvmx_update_apicv helper: it's bogus to attempt to inject interrupts on virtual vmexit using the virtual interrupt delivery assistance, and it's also bogus to ack interrupts without checking if the vmexit "Acknowledge interrupt on exit" vmexit control is set. nvmx_intr_intercept already handles interrupts correctly on virtual vmexit. Note that this fixes the usage of x2APIC by the L1 VMM, at least when the L1 VMM is Xen. Signed-off-by: Roger Pau Monn=C3=A9 --- xen/arch/x86/hvm/vmx/vvmx.c | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c index d8ab167d62..af48b0beef 100644 --- a/xen/arch/x86/hvm/vmx/vvmx.c +++ b/xen/arch/x86/hvm/vmx/vvmx.c @@ -1316,35 +1316,6 @@ static void sync_exception_state(struct vcpu *v) } } =20 -static void nvmx_update_apicv(struct vcpu *v) -{ - struct nestedvmx *nvmx =3D &vcpu_2_nvmx(v); - unsigned long reason =3D get_vvmcs(v, VM_EXIT_REASON); - uint32_t intr_info =3D get_vvmcs(v, VM_EXIT_INTR_INFO); - - if ( reason =3D=3D EXIT_REASON_EXTERNAL_INTERRUPT && - nvmx->intr.source =3D=3D hvm_intsrc_lapic && - (intr_info & INTR_INFO_VALID_MASK) ) - { - uint16_t status; - uint32_t rvi, ppr; - uint32_t vector =3D intr_info & 0xff; - struct vlapic *vlapic =3D vcpu_vlapic(v); - - vlapic_ack_pending_irq(v, vector, 1); - - ppr =3D vlapic_set_ppr(vlapic); - WARN_ON((ppr & 0xf0) !=3D (vector & 0xf0)); - - status =3D vector << VMX_GUEST_INTR_STATUS_SVI_OFFSET; - rvi =3D vlapic_has_pending_irq(v); - if ( rvi !=3D -1 ) - status |=3D rvi & VMX_GUEST_INTR_STATUS_SUBFIELD_BITMASK; - - __vmwrite(GUEST_INTR_STATUS, status); - } -} - static void virtual_vmexit(struct cpu_user_regs *regs) { struct vcpu *v =3D current; @@ -1393,9 +1364,6 @@ static void virtual_vmexit(struct cpu_user_regs *regs) /* updating host cr0 to sync TS bit */ __vmwrite(HOST_CR0, v->arch.hvm.vmx.host_cr0); =20 - if ( cpu_has_vmx_virtual_intr_delivery ) - nvmx_update_apicv(v); - nvcpu->nv_vmswitch_in_progress =3D 0; } =20 --=20 2.24.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Thu Apr 25 20:55:05 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1578480000; cv=none; d=zohomail.com; s=zohoarc; b=PeRPxITvMoEfZ4SdQ6aYJh9YADTSALRfxeziXy9bp2P5RRsQ+VEZzIJm23CIHBLDE7YfHnm/zuzkFvabiCDGV8/gl6vhjplMekHgJYZRcBY+FXw7uUdC9+0pVPsJ4IhGwOhX247suL+GUYYoOe2KxK1NHnQcfec5UqOfmStW5js= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578480000; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=g9+98jbzflaWCjXd1f0/G7xDzUxMdFmH6MZ2jjhLZQ4=; b=Iad4T6Ba3uyU/OkwrvhRbAQpg+A2LQzazSd8o/h1rfVDmYf3QzfAYymRCqNmLpyXs5s0CmKs3TdF1ZZ8c0Uf+F44dI3s60Pp7WsB9+o2ghWO1qHtDl+VEYTY6WTG/XiwBTD/nex794ePuWz27WMf60wAAoJZpaAP1hoMLDPMEGo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1578480000286353.02102495183624; Wed, 8 Jan 2020 02:40:00 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ip8kI-0007yF-C6; Wed, 08 Jan 2020 10:39:26 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ip8kH-0007xm-1A for xen-devel@lists.xenproject.org; Wed, 08 Jan 2020 10:39:25 +0000 Received: from esa6.hc3370-68.iphmx.com (unknown [216.71.155.175]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 19d012ce-3203-11ea-bf56-bc764e2007e4; Wed, 08 Jan 2020 10:39:09 +0000 (UTC) X-Inumbo-ID: 19d012ce-3203-11ea-bf56-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1578479949; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=UTOC1SLaRcRa8O25+Sabf5ebK+DXQWP5BRGRflW7lg0=; b=VD1xrchE7aebqlo0is2hE0sNzuTO28YT7llh28Ahut2LOozSbDNd2+gL +bPG7Do3b4fXhPwD0Lced/R0jtrdZ2ZRbCQS6d2c7oelJTGT+hf4oTVX2 cQt+zkm+CwABfGGC940JcCwZ6MBcNY3H8IjeMoKMeFX/fuLXgibF/OY0/ I=; Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=roger.pau@citrix.com; spf=Pass smtp.mailfrom=roger.pau@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa6.hc3370-68.iphmx.com: no sender authenticity information available from domain of roger.pau@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="roger.pau@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa6.hc3370-68.iphmx.com: domain of roger.pau@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="roger.pau@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ip4:168.245.78.127 ~all" Received-SPF: None (esa6.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: cQwm1PuzisoVEkLdpEdO+jzliCGBV4ULVdKS07BcOVb4OL0eiqrWfUM1zBjEV4pw690lX6IJGu E7Aht0/V1qfoXdznquRFZcRnkB4wVEEM7skQoZFoNQfQcJOWdbVOafX4s+LdIX0e3x7UyPGOtk IqTyZDDBjQ2wYzv37JUQJWquUmfJfh6dlEzpcTURqH8rLSVq9TSgBY/NA4hz/rbEsuXILpDAiF UaAko0hsXAPhxJnmAfWwN3+ZdZBQj6HpINDG2EB3DrM7VXeyLGMv1XMchh7KlHm8ZLDNLRltZe Aug= X-SBRS: 2.7 X-MesageID: 11047490 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.69,409,1571716800"; d="scan'208";a="11047490" From: Roger Pau Monne To: Date: Wed, 8 Jan 2020 11:38:57 +0100 Message-ID: <20200108103857.77236-3-roger.pau@citrix.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200108103857.77236-1-roger.pau@citrix.com> References: <20200108103857.77236-1-roger.pau@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 2/2] Revert "tools/libxc: disable x2APIC when using nested virtualization" X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson , Wei Liu , Roger Pau Monne Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) This reverts commit 7b3c5b70a32303b46d0d051e695f18d72cce5ed0 and re-enables the usage of x2APIC with nested virtualization. Signed-off-by: Roger Pau Monn=C3=A9 Acked-by: Wei Liu --- tools/libxc/xc_cpuid_x86.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/tools/libxc/xc_cpuid_x86.c b/tools/libxc/xc_cpuid_x86.c index ac38c1406e..2540aa1e1c 100644 --- a/tools/libxc/xc_cpuid_x86.c +++ b/tools/libxc/xc_cpuid_x86.c @@ -653,17 +653,6 @@ int xc_cpuid_apply_policy(xc_interface *xch, uint32_t = domid, p->extd.itsc =3D true; p->basic.vmx =3D true; p->extd.svm =3D true; - - /* - * BODGE: don't announce x2APIC mode when using nested virtualizat= ion, - * as it doesn't work properly. This should be removed once the - * underlying bug(s) are fixed. - */ - rc =3D xc_hvm_param_get(xch, domid, HVM_PARAM_NESTEDHVM, &val); - if ( rc ) - goto out; - if ( val ) - p->basic.x2apic =3D false; } =20 rc =3D x86_cpuid_copy_to_buffer(p, leaves, &nr_leaves); --=20 2.24.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel