Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1892898ybk; Mon, 11 May 2020 06:58:35 -0700 (PDT) X-Google-Smtp-Source: APiQypIHgQMkDhx8FtJsVcPmSwjNHXuDRj58VjYB2BGULrT0IREVIxizQuGjl3JXidfPI7BZY7CV X-Received: by 2002:a17:906:17c1:: with SMTP id u1mr13672221eje.47.1589205514819; Mon, 11 May 2020 06:58:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589205514; cv=none; d=google.com; s=arc-20160816; b=QPE6A4WQfWj0x1fAne1i7uGJPByhOqg/DAB3pD9Eg0l4Duh1XvOuR5WfNkaelfIUeg 3gbQxQwDGRyziirrL7tNRJXGkZpTixcV/dBKYLtZ3NdFgRLrpu+0XsJgEe0TG00Zd7C0 9b1eLpjzU+UtXW/akKibamLT00aZE5g6YGh/mjKEcGQVlPbMeGp9YCCgVnfxJkJpN5YQ u5tsMA66uGYDQ513UELOuwxzXJDuxFZuzY8WttXs+KPpLkvOVt8FQJzS1cUnixnbKAm8 5xseTJQY1lwsHUpfC3fQzE1u7xeswBlRnjRiIB2BiqhRCop65G6zYWbTK0uuGgpq41GC Bs6g== 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=l8+HMXEE9aB0aOSWY8gkTyeJdorvKTxSlVmAOSdcjqA=; b=ZW6JeWHyPqfNuyHKwmkXiKZKcPQZxODnGmNzHQTrhHvDAL87HPa3Ecap06OHHImCNG T+UK0jwBGzbVkQLfm78cMU29Zj223ENazw1DB08bCuhUUs9ERPRbeExhA7/Ac2wDHyzi irAIISnXfi5AlHB6uDhWcQmMZ4p04qhMImOIfrb5hQXGsZYm/TWI0oCDQD/uN6QF4NXN iniTnwSP+cLPZHxc3HKvr2YdGQS11RB85kH+mjC9NxRQVraGZCEXvqOa3ssa0KRTatzC EkAlmCyjhrM8CDIc+MdxP4qKqnrc24BY/f6O0LYAmZM/FJirEPIzuCq6h6z6SXIhC4+N 6T3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=g+4PnH9b; 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 rp4si6133239ejb.205.2020.05.11.06.58.11; Mon, 11 May 2020 06:58: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=g+4PnH9b; 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 S1730523AbgEKNzX (ORCPT + 99 others); Mon, 11 May 2020 09:55:23 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:44028 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729881AbgEKNzW (ORCPT ); Mon, 11 May 2020 09:55:22 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 04BDWmQi076390; Mon, 11 May 2020 13:54:26 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=l8+HMXEE9aB0aOSWY8gkTyeJdorvKTxSlVmAOSdcjqA=; b=g+4PnH9b6IUUTsD5shCXGlMc9mf404vXB7+3/VxoJKWA5XFa/brzGF9lJqPihs/sRuCM oCYa+DkhZjCft844U5qlEm7deV0FLYSFqut++LP4dTRVbMYXE3TpcIin/RKuKeC2vLzj otJngqrymF0mbpX+msnfzoA1SSbgJNBsrTC5J5TYrmy/C6gjjMf+5g/ZLxa6h+l2kXUN sQKogI/jdkEz9u045BrjzUB1Me9aDPjuSP1A4ta8NkcWp/K/OEfNP1GyuV2Z7YSuUKbW YGuDw4QYd4l9dglhLMj4RRNI3XXL7VVjOEr+M5kJLLNUqUKgyR7Vk4BjLTWxGBi+9NmE ow== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2130.oracle.com with ESMTP id 30x3gmd71b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 11 May 2020 13:54:26 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 04BDXY8X016654; Mon, 11 May 2020 13:54:25 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserp3030.oracle.com with ESMTP id 30x63mrmgg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 11 May 2020 13:54:25 +0000 Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 04BDsLQE010452; Mon, 11 May 2020 13:54:22 GMT Received: from linux-1.home (/92.157.36.49) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 11 May 2020 06:54:20 -0700 Subject: Re: [patch V4 part 5 07/31] x86/entry: Provide idtentry_entry/exit_cond_rcu() 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: <20200505135341.730586321@linutronix.de> <20200505135828.808686575@linutronix.de> From: Alexandre Chartre Message-ID: <72cb3e24-3f82-7e2a-7630-233749c780c4@oracle.com> Date: Mon, 11 May 2020 15:53:17 +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: <20200505135828.808686575@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=9617 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 mlxlogscore=940 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2005110112 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9617 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 mlxlogscore=976 clxscore=1015 spamscore=0 lowpriorityscore=0 phishscore=0 bulkscore=0 malwarescore=0 priorityscore=1501 mlxscore=0 suspectscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2005110112 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/5/20 3:53 PM, Thomas Gleixner wrote: > The pagefault handler cannot use the regular idtentry_enter() because on > that invokes rcu_irq_enter() the pagefault was caused in the kernel. I am struggling to understand this part of the sentence: "because on that invokes rcu_irq_enter() the pagefault was caused in the kernel." Do you mean: "because that invokes rcu_irq_enter() if the pagefault was caused in the kernel." ? alex. > Not a > problem per se, but kernel side page faults can schedule which is not > possible without invoking rcu_irq_exit(). > > Adding rcu_irq_exit() and a matching rcu_irq_enter() into the actual > pagefault handling code is possible, but not pretty either. > > Provide idtentry_entry/exit_cond_rcu() which calls rcu_irq_enter() only > when RCU is not watching. While this is not a legit kernel #PF establishing > RCU before handling it avoids RCU side effects which might affect > debugability. > > The function is also useful for implementing lightweight scheduler IPI > entry handling later. > > Signed-off-by: Thomas Gleixner > --- > arch/x86/entry/common.c | 119 ++++++++++++++++++++++++++++++++++------ > arch/x86/include/asm/idtentry.h | 3 + > 2 files changed, 106 insertions(+), 16 deletions(-)