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=-9.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable 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 758FFC433E1 for ; Tue, 28 Jul 2020 14:51:53 +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 4220C206D8 for ; Tue, 28 Jul 2020 14:51:53 +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="YyMTsLsX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4220C206D8 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 1k0Qwp-0007Ek-Bj; Tue, 28 Jul 2020 14:51:19 +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 1k0Qwo-0007Ec-CR for xen-devel@lists.xenproject.org; Tue, 28 Jul 2020 14:51:18 +0000 X-Inumbo-ID: c81c34d5-d0e1-11ea-a904-12813bfff9fa Received: from esa3.hc3370-68.iphmx.com (unknown [216.71.145.155]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id c81c34d5-d0e1-11ea-a904-12813bfff9fa; Tue, 28 Jul 2020 14:51:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1595947875; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=lv7DvAEAMGAuUxfBUUIinPORNQOh3EyicsTN4QUqkR8=; b=YyMTsLsXhjTUNaxqdSZ44Z2u0eF/+KO4mjPkTB5z/OmSsmbjYR+URdzK uJPmiruWtiwF+Xf3vTdtGmvyg+BN7QjCvDOyTOrYojZLppOsNWtueNjS+ iULck9bYrcocbJo9R9X+Cma3dUCFXNzx7eERe4fX+7GKz8rZ6gmJuvOV+ E=; Authentication-Results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: cebk8yMFoerV6c2w4zkT4m0X7eegtucwket3KNbUL0/kr50xR0JwdhLCZD+PPifBH7BwUNUZ1T RtLsUrT6mGQZYC1kOyD9GxrVHePVy9pbHVdB0DFYaslkTR4hv7+yYERxpZV2MEU/64pe/v6Yc1 34RtyDQe8bA8G3hLAOPrK1nVlQLEI1l60zFBxcvf/mDfU3qr0xaOdHK+Svejsrj/D0bFG6SDnh G5AgrmGnMh93SLi4txo+gTRX7oZjN4TM+PI0qh0aWKLGqQejU3l+ZxF7z+48Pixh6wxhN1qPXX Glg= X-SBRS: 2.7 X-MesageID: 23349954 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.75,406,1589256000"; d="scan'208";a="23349954" Subject: Re: [PATCH 3/4] x86: drop ASM_{CL,ST}AC To: Jan Beulich , "xen-devel@lists.xenproject.org" References: <58b9211a-f6dd-85da-d0bd-c927ac537a5d@suse.com> <048c3702-f0b0-6f8e-341e-bec6cfaded27@suse.com> From: Andrew Cooper Message-ID: <07750e83-6b9d-a88d-856b-20db4f63fd11@citrix.com> Date: Tue, 28 Jul 2020 15:51:09 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <048c3702-f0b0-6f8e-341e-bec6cfaded27@suse.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Content-Language: en-GB X-ClientProxiedBy: AMSPEX02CAS02.citrite.net (10.69.22.113) To AMSPEX02CL02.citrite.net (10.69.22.126) 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 , =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" On 15/07/2020 11:49, Jan Beulich wrote: > Use ALTERNATIVE directly, such that at the use sites it is visible that > alternative code patching is in use. Similarly avoid hiding the fact in > SAVE_ALL. > > No change to generated code. > > Signed-off-by: Jan Beulich Definitely +1 to not hiding the STAC/CLAC in SAVE_ALL.  I've been meaning to undo that mistake for ages. OOI, what made you change your mind?  I'm pleased that you have. > > --- a/xen/arch/x86/traps.c > +++ b/xen/arch/x86/traps.c > @@ -2165,9 +2165,9 @@ void activate_debugregs(const struct vcp > void asm_domain_crash_synchronous(unsigned long addr) > { > /* > - * We need clear AC bit here because in entry.S AC is set > - * by ASM_STAC to temporarily allow accesses to user pages > - * which is prevented by SMAP by default. > + * We need to clear AC bit here because in entry.S it gets set to > + * temporarily allow accesses to user pages which is prevented by > + * SMAP by default. As you're adjusting the text, It should read "We need to clear the AC bit ..." But I also think it would be clearer to say that exception fixup may leave user access enabled, which we fix up here by unconditionally disabling user access. Preferably with this rewritten, Reviewed-by: Andrew Cooper