From nobody Fri May 3 04:27:35 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=1563210738; cv=none; d=zoho.com; s=zohoarc; b=ngE7LF+vno7T1Rp4Kp5kKY9WNjH2W0CBjo64F/266lwjmDmDG/Ugm/FN3cvSc7rT4/AYAzqjTecngfgmxNg8wFItcBwUclJ6D914bvUgwnDN4NasBdFgjkP+1X3PQoePFvauJofpQ+QPjKO/2eXBGW9dzQkM5xJG5cyQzVC8uk4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563210738; 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=oxQyTwFBDVYwI+RIghZVjZycF53FwXQVMyEU9921/mo=; b=AaabWIRaiBSfzNPOwbrhMfnR3XFBcnuQzD0DGsQC9gW8BDdMwe6XTKPTM8fhkV0eavmYc4uoeILLKwrYNGbC21du/ogeQ1/LufBR8C+i29M7Io83fQIaDeDK5qH2qyR8BWziTCN4xbWFmT+XdByxLAqrfyRlChFIKU9csGDJA/M= 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 1563210737859889.937129199917; Mon, 15 Jul 2019 10:12:17 -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 1hn4Uv-0001lw-M3; Mon, 15 Jul 2019 17:10:45 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hn4Uv-0001lr-4P for xen-devel@lists.xenproject.org; Mon, 15 Jul 2019 17:10:45 +0000 Received: from esa4.hc3370-68.iphmx.com (unknown [216.71.155.144]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 7a533e60-a723-11e9-8980-bc764e045a96; Mon, 15 Jul 2019 17:10:43 +0000 (UTC) X-Inumbo-ID: 7a533e60-a723-11e9-8980-bc764e045a96 Authentication-Results: esa4.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 (esa4.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=esa4.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa4.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=esa4.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 (esa4.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=esa4.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: BOxSas1f8ZQkrMXHKQzV9Hbv5Hov0ES+r7dQ3CwwVp+71DlKIHtrlDq7jkcM/FXYFIm7a80d8p 8E4SNtuWCgLNJgK/0YL+N+U3p9QmbEdx8kOmOUJaPkXAmhPmLshoZa2t6U99gpvJNx7UeTn9Mm hS5YqHkKBl3SIDcQA9mOAskdaiCrTL2sh0Nd4uxaJvTJrJO6tvYnPSZQ+nDPyzDLIEKTezVHYM A9p55fD6Q9nOi06es2wdZwe00281RuobPdAUpIbAuIARrZCCg3PAPSawO4RNKhBih5HjeNn8ZM grw= X-SBRS: 2.7 X-MesageID: 3061111 X-Ironport-Server: esa4.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.63,493,1557201600"; d="scan'208";a="3061111" From: Andrew Cooper To: Xen-devel Date: Mon, 15 Jul 2019 18:10:34 +0100 Message-ID: <20190715171034.29709-1-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH] x86/suspend: Don't save/restore %cr8 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" %cr8 is an alias of APIC_TASKPRI, which is handled by lapic_{suspend,resume}() with the rest of the Local APIC state. Saving and restoring the TPR state in isolation is not a clever idea. Drop it all. While editing wakeup_prot.S, trim its include list to just the headers which are used, which is precicely none of them. Signed-off-by: Andrew Cooper Acked-by: Jan Beulich --- CC: Jan Beulich CC: Wei Liu CC: Roger Pau Monn=C3=A9 CC: Juergen Gross This is a Xen mirror to my Linux patch of the same effect: https://lore.kernel.org/lkml/20190715151641.29210-1-andrew.cooper3@citrix.c= om/T/#u With a bit of care, I'm pretty sure the whole of wakeup_prot.S can disappear, but -ETIME right now. I've confirmed that after resume TPR retains its value of 0x10. However, a= ll attempts to debug the internals of lapic_suspend/resume have eluded me, including manually poking the UART. Again, -ETIME to investigate further. --- xen/arch/x86/acpi/wakeup_prot.S | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/xen/arch/x86/acpi/wakeup_prot.S b/xen/arch/x86/acpi/wakeup_pro= t.S index 361751d290..4a92627436 100644 --- a/xen/arch/x86/acpi/wakeup_prot.S +++ b/xen/arch/x86/acpi/wakeup_prot.S @@ -1,13 +1,5 @@ .file __FILE__ .text - -#include -#include -#include -#include -#include -#include - .code64 =20 #define GREG(x) %r##x @@ -40,9 +32,6 @@ ENTRY(do_suspend_lowlevel) pushfq; popq SAVED_GREG(flags) =20 - mov %cr8, GREG(ax) - mov GREG(ax), REF(saved_cr8) - mov %ss, REF(saved_ss) =20 sgdt REF(saved_gdt) @@ -90,9 +79,6 @@ ENTRY(__ret_point) pushq %rax lretq 1: - mov REF(saved_cr8), %rax - mov %rax, %cr8 - pushq SAVED_GREG(flags) popfq =20 @@ -149,4 +135,3 @@ saved_ldt: .quad 0,0 =20 saved_cr0: .quad 0 saved_cr3: .quad 0 -saved_cr8: .quad 0 --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel