From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A091AC433E0 for ; Fri, 26 Jun 2020 15:08:12 +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 79E86206DD for ; Fri, 26 Jun 2020 15:08:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 79E86206DD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=pass 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.92) (envelope-from ) id 1jopxN-0003vo-Aa; Fri, 26 Jun 2020 15:07:57 +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.92) (envelope-from ) id 1jopxL-0003vj-RB for xen-devel@lists.xenproject.org; Fri, 26 Jun 2020 15:07:55 +0000 X-Inumbo-ID: cfc8d188-b7be-11ea-82ce-12813bfff9fa Received: from esa5.hc3370-68.iphmx.com (unknown [216.71.155.168]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id cfc8d188-b7be-11ea-82ce-12813bfff9fa; Fri, 26 Jun 2020 15:07:55 +0000 (UTC) Authentication-Results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: bfqrn94nP2go7apZzwt9TQE+Uacg+I/K53KWJkcnA7d6kHo0kELQVuHjMvy6bL6mwiLQf8l0Rd cLufiwfoBqBsf42vtQAJo3bdd9VOn2GIU0Dyv+SspCJ3FR4eXddEBW2D2s9VbNdsIivfS3v+RQ Ex0KbZKJCY2cVw+TT4ssfnEucVOUIDoTUpJqTjGfDp7cDmxqekC16e506+qcx7TcTMc61mXP5h KIDS7REjdzRwmBgoUpUlYEXBPinmwanFvBsuqGiAI9g4b1CL83K1h8KAL6Xsf0UI3BMbDpZjS1 lYA= X-SBRS: 2.7 X-MesageID: 21250307 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.75,284,1589256000"; d="scan'208";a="21250307" Subject: Re: [PATCH v2 for-4.14] x86/livepatch: Make livepatching compatible with CET Shadow Stacks To: Andrew Cooper , Jan Beulich References: <20200626122408.19151-1-andrew.cooper3@citrix.com> <4bd8ab3e-37d0-fde9-10a3-b6b2f9ca4da6@citrix.com> <29ae3614-a73e-de01-f10f-8f3a32c3372a@suse.com> <5756a404-2d0a-3146-0682-dc89ad4a3c61@citrix.com> From: Ross Lagerwall Message-ID: <2e0f93a1-29da-9457-a548-41e2c51ce75b@citrix.com> Date: Fri, 26 Jun 2020 16:07:49 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <5756a404-2d0a-3146-0682-dc89ad4a3c61@citrix.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Wei Liu , Paul Durrant , Konrad Rzeszutek Wilk , Pawel Wieczorkiewicz , Xen-devel , =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" On 2020-06-26 15:46, Andrew Cooper wrote: > On 26/06/2020 15:26, Jan Beulich wrote: >> On 26.06.2020 15:59, Ross Lagerwall wrote: >>> On 2020-06-26 13:24, Andrew Cooper wrote: >>>> @@ -56,18 +57,48 @@ int arch_livepatch_safety_check(void) >>>> return -EBUSY; >>>> } >>>> >>>> -int arch_livepatch_quiesce(void) >>>> +int noinline arch_livepatch_quiesce(void) >>>> { >>>> + /* If Shadow Stacks are in use, disable CR4.CET so we can modify CR0.WP. */ >>>> + if ( cpu_has_xen_shstk ) >>> Should this be: >>> if ( IS_ENABLED(CONFIG_XEN_SHSTK) && cpu_has_xen_shstk ) >>> >>> to match arch_livepatch_revive? >> While it may look a little asymmetric, I think it's preferable >> to is IS_ENABLED() only where really needed, i.e. here it >> guarding code that otherwise may not build. > > The reason for the asymmetry is because of the asm() block, which needs > compiling out when we detect that we don't have a compatible assembler. > In that case, Reviewed-by: Ross Lagerwall Thanks