From nobody Tue Apr 30 03:28:19 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1563912016; cv=none; d=zoho.com; s=zohoarc; b=gaPHGxqsmAS69nvYP3e/fegaMy9kjVJarzg7+asWbpYpYbhUIpUxIqQZEs+Ys/dRvE9u+73JrXt+2e2F2iX6zGMFdJepjIsMf/UFcZDpVcv4iFejH9Z5YJnmqfS0T6UqSOwgKTmE7Q0JU0mGRR3gZamCw+I8c0q/goMOYP7+CkY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563912016; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=PpjOg3pC+0l5jLZPGpuio0r36xOZmdiSymV/oxcnvuI=; b=Wp3Svx2OYNxWL8iJqSY/MRWn8RghX/acSnZn+/aqty3J6pnWZLtsmKxqp6xzUjzJqi3rYMJXrGBMW5WkEQ2VYLXi8iqiODMeuQufpZR1qoE+PH3Ex6YjNCV6Ay9CLXbztUjbA3UqY82ivg6VD0gOCduExgAKfEXDFR8SNazcXiI= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1563912016732242.0489216693935; Tue, 23 Jul 2019 13:00:16 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hq0vn-0003HZ-Nv; Tue, 23 Jul 2019 19:58:39 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hq0vm-0003HS-BC for xen-devel@lists.xenproject.org; Tue, 23 Jul 2019 19:58:38 +0000 Received: from esa6.hc3370-68.iphmx.com (unknown [216.71.155.175]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 404bea12-ad84-11e9-8f0b-af4ed6feee0f; Tue, 23 Jul 2019 19:58:34 +0000 (UTC) X-Inumbo-ID: 404bea12-ad84-11e9-8f0b-af4ed6feee0f Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=andrew.cooper3@citrix.com; spf=Pass smtp.mailfrom=Andrew.Cooper3@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.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 andrew.cooper3@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa6.hc3370-68.iphmx.com: domain of Andrew.Cooper3@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="Andrew.Cooper3@citrix.com"; x-sender="Andrew.Cooper3@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 ~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="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: 4QMu0oNow4tY0RjosWLsM1zUdyZSt7GXPUuxEyLx2RgDm9vYDeuLuu3qTBhPwIJE+vWUoamXoh uWjJnrotFVilEIo4VlpOixIa3a+oM9TewEFo9n0eOkfCcSg1khWB8lUC0ZC7quPmivo2AQ5dP7 pQ8/xKSbs8NVieqIkv3QbJmrNbxXoV1JupbDfOO7J6xcH1vJf6+NAQo0BqxjOOtAfqF1NlzGIb CJIKwOBz6b/X0RT9aux2pgEB1Mk/5QNKPAB8eE5heQm2rVA7bcq+hoCnuQuLs6M3i3r3dmCrcb n+w= X-SBRS: 2.7 X-MesageID: 3440184 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.64,300,1559534400"; d="scan'208";a="3440184" From: Andrew Cooper To: Xen-devel Date: Tue, 23 Jul 2019 20:58:30 +0100 Message-ID: <20190723195830.4524-1-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH] x86/pv: Move async_exception_cleanup() into pv/iret.c 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: Juergen Gross , Andrew Cooper , Wei Liu , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" All callers are in pv/iret.c. Move the function and make it static. Even before the pinning cleanup, there was nothing which is specific to operating on curr, so rename the variable back to v. No functional change. Signed-off-by: Andrew Cooper Reviewed-by: Juergen Gross --- CC: Jan Beulich CC: Wei Liu CC: Roger Pau Monn=C3=A9 CC: Juergen Gross Discovered while reviewing/prodding Juergen's pinning removal patches. --- xen/arch/x86/pv/iret.c | 25 ++++++++++++++++++++++++- xen/arch/x86/traps.c | 24 ------------------------ xen/include/asm-x86/traps.h | 2 -- 3 files changed, 24 insertions(+), 27 deletions(-) diff --git a/xen/arch/x86/pv/iret.c b/xen/arch/x86/pv/iret.c index c359a1dbfd..ae1c33612b 100644 --- a/xen/arch/x86/pv/iret.c +++ b/xen/arch/x86/pv/iret.c @@ -22,7 +22,30 @@ #include =20 #include -#include + +static void async_exception_cleanup(struct vcpu *v) +{ + unsigned int trap; + + if ( !v->async_exception_mask ) + return; + + if ( !(v->async_exception_mask & (v->async_exception_mask - 1)) ) + trap =3D __scanbit(v->async_exception_mask, VCPU_TRAP_NONE); + else + for ( trap =3D VCPU_TRAP_NONE + 1; trap <=3D VCPU_TRAP_LAST; ++tra= p ) + if ( (v->async_exception_mask ^ + v->async_exception_state(trap).old_mask) =3D=3D (1u << t= rap) ) + break; + if ( unlikely(trap > VCPU_TRAP_LAST) ) + { + ASSERT_UNREACHABLE(); + return; + } + + /* Restore previous asynchronous exception mask. */ + v->async_exception_mask =3D v->async_exception_state(trap).old_mask; +} =20 unsigned long do_iret(void) { diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index 08d7edc568..38d12013db 100644 --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -1593,30 +1593,6 @@ static void pci_serr_softirq(void) outb(inb(0x61) & 0x0b, 0x61); /* re-enable the PCI SERR error line. */ } =20 -void async_exception_cleanup(struct vcpu *curr) -{ - int trap; - - if ( !curr->async_exception_mask ) - return; - - if ( !(curr->async_exception_mask & (curr->async_exception_mask - 1)) ) - trap =3D __scanbit(curr->async_exception_mask, VCPU_TRAP_NONE); - else - for ( trap =3D VCPU_TRAP_NONE + 1; trap <=3D VCPU_TRAP_LAST; ++tra= p ) - if ( (curr->async_exception_mask ^ - curr->async_exception_state(trap).old_mask) =3D=3D (1 <<= trap) ) - break; - if ( unlikely(trap > VCPU_TRAP_LAST) ) - { - ASSERT_UNREACHABLE(); - return; - } - - /* Restore previous asynchronous exception mask. */ - curr->async_exception_mask =3D curr->async_exception_state(trap).old_m= ask; -} - static void nmi_hwdom_report(unsigned int reason_idx) { struct domain *d =3D hardware_domain; diff --git a/xen/include/asm-x86/traps.h b/xen/include/asm-x86/traps.h index b88f2a4f2f..ec23d3a70b 100644 --- a/xen/include/asm-x86/traps.h +++ b/xen/include/asm-x86/traps.h @@ -19,8 +19,6 @@ #ifndef ASM_TRAP_H #define ASM_TRAP_H =20 -void async_exception_cleanup(struct vcpu *); - const char *trapstr(unsigned int trapnr); =20 #endif /* ASM_TRAP_H */ --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel