From patchwork Tue Oct 15 15:47:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Roger Pau Monne X-Patchwork-Id: 11190827 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6C8DE15AB for ; Tue, 15 Oct 2019 15:49:41 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 489B42067B for ; Tue, 15 Oct 2019 15:49:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=citrix.com header.i=@citrix.com header.b="hQhuFvy6" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 489B42067B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iKP3i-0006uQ-BX; Tue, 15 Oct 2019 15:48:26 +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 1iKP3g-0006u8-Ua for xen-devel@lists.xenproject.org; Tue, 15 Oct 2019 15:48:24 +0000 X-Inumbo-ID: 338a037f-ef63-11e9-9396-12813bfff9fa Received: from esa6.hc3370-68.iphmx.com (unknown [216.71.155.175]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 338a037f-ef63-11e9-9396-12813bfff9fa; Tue, 15 Oct 2019 15:48:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1571154496; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=CwG9FoDNNaNrnAzwi1LDXmD0Mhp0qmEEwxaNTwdnO6I=; b=hQhuFvy68vtkUXgmq94YW10qcmIJH1Hf5CP2rrMxDFHSl3DVDa+evBK/ LmpSertAZEia9gM+/oDmSrD8NM7SVyKfEM1AT1unCGoYq6Wu1QA9BcTXE H2Y32XSzFJeUL3D+JK+fuxufU3n21K7Dcd+sXSXZ92Z7r+zv/EvUqxEAY E=; 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 (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: CypyybIhGXy+DnSwugSYaLxDky0P8mB01N9i6dxeoE7/3NGpId1CEPIVq4wqWZJokYaECbKK2s J/Xi6Wg/wNr/896CsJU7LtfXqN7twarZeHTR9t+hjr6wGu84i9/S2ambYKmRr7t9/6R83ILse+ hmFOVbIqLFCOJsASNO1wSYUs5WkrILYHfZ7iqOUkTNmzWgW+HoXBs1XhHsKXdJOqsceVsny6uV YZ80yqhhRws5WVXk7DRkYU53BtoPFmRncQ64RGlhkY5Lo+BaSKRqfY904gN2AubCRY1GvoE6SB rvM= X-SBRS: 2.7 X-MesageID: 7228589 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.67,300,1566878400"; d="scan'208";a="7228589" From: Roger Pau Monne To: Date: Tue, 15 Oct 2019 17:47:34 +0200 Message-ID: <20191015154736.19882-3-roger.pau@citrix.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191015154736.19882-1-roger.pau@citrix.com> References: <20191015154736.19882-1-roger.pau@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v3 2/4] x2APIC: simplify resume 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 , Wei Liu , Andrew Cooper , =?utf-8?q?Marek_Marczykowski-G?= =?utf-8?q?=C3=B3recki?= , Jan Beulich , Roger Pau Monne Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" There's no need to save and restore the IO-APIC entries, the entries prior to suspension have already been saved by ioapic_suspend, and will be restored by ioapic_resume. Note that at the point where resume_x2apic gets called the IO-APIC has not yet resumed, and hence all entries should be masked. Note this shouldn't introduce any functional change. Suggested-by: Jan Beulich Signed-off-by: Roger Pau Monné Tested-by: Marek Marczykowski-Górecki Reviewed-by: Jan Beulich --- I'm Ccing Marek since I think he usually tests suspend/resume. Could you give this patch a try? --- Cc: Marek Marczykowski-Górecki Cc: Juergen Gross --- Changes since v2: - New in this version. --- xen/arch/x86/apic.c | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c index 6cdb50cf41..0607eb92a8 100644 --- a/xen/arch/x86/apic.c +++ b/xen/arch/x86/apic.c @@ -492,35 +492,8 @@ static void __enable_x2apic(void) static void resume_x2apic(void) { - struct IO_APIC_route_entry **ioapic_entries = NULL; - - ASSERT(x2apic_enabled); - - ioapic_entries = alloc_ioapic_entries(); - if ( !ioapic_entries ) - { - printk("Allocate ioapic_entries failed\n"); - goto out; - } - - if ( save_IO_APIC_setup(ioapic_entries) ) - { - printk("Saving IO-APIC state failed\n"); - goto out; - } - - mask_8259A(); - mask_IO_APIC_setup(ioapic_entries); - iommu_enable_x2apic(); __enable_x2apic(); - - restore_IO_APIC_setup(ioapic_entries); - unmask_8259A(); - -out: - if ( ioapic_entries ) - free_ioapic_entries(ioapic_entries); } void setup_local_APIC(void)