Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp827721ybj; Thu, 7 May 2020 08:30:34 -0700 (PDT) X-Google-Smtp-Source: APiQypJYPc5uarBkSvYSnuxWL85D4D1qbmHNfbfKxwruL9O2DWfz9g//BB2N80Jv5TQzStwMugDl X-Received: by 2002:aa7:d2cd:: with SMTP id k13mr12758412edr.116.1588865434341; Thu, 07 May 2020 08:30:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588865434; cv=none; d=google.com; s=arc-20160816; b=zfirWSIQrotn5xGBxsiCBztUDuXJKDw5pMTMzkZTovxBuzDi4tDYTSyS7Qcyh68ekU z5EiqzoFpVOaqSpGn3mnKS0eVlPZ607EWoazKz17SeLVeJaSxmPJD5usgHlrKSbm3iOH 05AqBmdJpiB6xOycC2WzwEsDr925d8zGQw0nH7EQMZjhkD7lffdE/N5xjZ1uZV3iTcU8 AT8LUsPso8M+wJp2ckJeaPR0k9EGYhV92aeEKHXx4k41yxKB3QXoWmKFHE95w+6v4pro Pf8gf1JDVhw4WhNrcy5p0nyI5Gks7tLWtmbH28JtGRoVqyj/DWZjB2cV1pYjLGOIP6tJ s0Qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=C8WOwvn7FyfQFJKI0VEW/oC4rt5Brcw47m53AfhP1FA=; b=zvRR3tTMB+FXRDXKxPX3scnb2rqtl7OhGLw7bQ6TbRWztsXDxlko0HgGhV7hmMmpw+ +JsPLJHBdOaEdyY04EfhxSXTCyZbLCUNGAjqoe/Ghkq6x0YEtRD+du5XEhEL5kaKBF6s 7vrNGcUUJ1nVHny/zwz7hQ6OqAfYVtyDObbA42Bo4ZGIlu9emzoD5kyUpU77utBomQ3D YUqj+7+D1wOepu/NPE1bIbw2tsygWgn+Y8jdf/cqlZJ6GMpGpGaFZbrPcdV2e+B/zjIQ MBJhnpaAOLB2l8zF5Edym1NCJaJZZSD0+OmzX1nZCCMxk3dCGpctbfMKoEgNqgSYlCaO kgng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=ZaX8Bq1i; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id kt5si3561613ejb.455.2020.05.07.08.30.05; Thu, 07 May 2020 08:30:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=ZaX8Bq1i; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726222AbgEGP16 (ORCPT + 99 others); Thu, 7 May 2020 11:27:58 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:42076 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725914AbgEGP16 (ORCPT ); Thu, 7 May 2020 11:27:58 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 047FJSLv096762; Thu, 7 May 2020 15:27:09 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=C8WOwvn7FyfQFJKI0VEW/oC4rt5Brcw47m53AfhP1FA=; b=ZaX8Bq1igkK4JT2UBd9+SBtgpCECZgPTLv5f1sPcCi7WCvQ49+A9DIiYsU580lXVbmig ovU6PWORIxv5ToMCVZImok5oG1xMoq6lccIjfhpgSVilahsMh50UtZCHBSFU2Utxosbe VxuQdSIZ5TlmT0snQPDrIPI2cZw80adlpSB6LGFCpJh+L3+qP3uQKau5ZnHBLkTmZs0S w5AD4xaK9n+XVPbjfFx5Jc6fJ0NLMF9+S83YA/P7bym65lKRJmPRofqkGDhKrLHnmwOc oezXIOGh2rxAmw3Orss/1qHSBCJPADNfG0hkdToLQUYZW0vZv6W0SbL3mp5xxcyqfWAi YQ== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2120.oracle.com with ESMTP id 30usgq7wvj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 07 May 2020 15:27:09 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 047FGxcB046376; Thu, 7 May 2020 15:27:09 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userp3020.oracle.com with ESMTP id 30us7qtn4t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 07 May 2020 15:27:08 +0000 Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 047FR5Sn007254; Thu, 7 May 2020 15:27:05 GMT Received: from linux-1.home (/92.157.36.49) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 07 May 2020 08:27:05 -0700 Subject: Re: [patch V4 part 3 04/29] x86/traps: Make interrupt enable/disable symmetric in C code To: Thomas Gleixner , LKML Cc: x86@kernel.org, "Paul E. McKenney" , Andy Lutomirski , Frederic Weisbecker , Paolo Bonzini , Sean Christopherson , Masami Hiramatsu , Petr Mladek , Steven Rostedt , Joel Fernandes , Boris Ostrovsky , Juergen Gross , Brian Gerst , Mathieu Desnoyers , Josh Poimboeuf , Will Deacon References: <20200505134354.774943181@linutronix.de> <20200505134903.622702796@linutronix.de> From: Alexandre Chartre Message-ID: <4b13ee35-da6f-a77d-cb19-1b32657cb939@oracle.com> Date: Thu, 7 May 2020 17:25:56 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <20200505134903.622702796@linutronix.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9613 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 adultscore=0 suspectscore=0 mlxlogscore=835 malwarescore=0 phishscore=0 mlxscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2005070124 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9613 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 impostorscore=0 mlxscore=0 priorityscore=1501 lowpriorityscore=0 malwarescore=0 clxscore=1015 mlxlogscore=870 spamscore=0 adultscore=0 bulkscore=0 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2005070124 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/5/20 3:43 PM, Thomas Gleixner wrote: > Traps enable interrupts conditionally but rely on the ASM return code to > disable them again. That results in redundant interrupt disable and trace > calls. > > Make the trap handlers disable interrupts before returning to avoid that, > which allows simplification of the ASM entry code. > > Originally-by: Peter Zijlstra > Signed-off-by: Thomas Gleixner > > --- > arch/x86/kernel/traps.c | 28 +++++++++++++++++++--------- > arch/x86/mm/fault.c | 15 +++++++++++++-- > 2 files changed, 32 insertions(+), 11 deletions(-) > So this patch makes C trap handlers disable interrupts on return but there's no change to the ASM entry code, which will still (also) disable interrupts. I suppose this is cleaned up in a next patch. So it's worth mentioning that the "simplification of the ASM entry code" is not in this patch. alex.