Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5634174yba; Mon, 13 May 2019 14:27:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqwTupAZ1CU/qj4ZbgIZTkenPY4yyo1U4hbaapre76WWsuYNM/GpThE45oOhNkhcc3Jd2FtZ X-Received: by 2002:aa7:96ec:: with SMTP id i12mr23744141pfq.82.1557782867297; Mon, 13 May 2019 14:27:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557782867; cv=none; d=google.com; s=arc-20160816; b=UpEt1AEnp9V2FB7HZnM4Hbs8JlkSK5HrZlrMHK/LfpLQHhvDGXYSGFO9ms/y+2c/jz kFGvDtYWwUDRLjd1/ZMkvxZKMPW1eZuQ82TjNojzmgWaUv89dyciADtvQfXF9LH9RtRM HmUT0pYfoyLi/8TmdsYHdbmK5bKFVRbnRkZAnGnh1TfXg2jM6tixJQDy0srLuUx3rWgb Ny/Ux1NXRNbfywsKaGEz67votWPh7rfiGFq8qTET9bfYxB2uTfEmJII7ceGK1qVVDcu0 6jfWHpmTVuLhrIyteT8ag2WepHpVYPyJbp54iLHcoMq46XjBgGbHc9Onmm9kL3eMzWg7 P7vQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=565YBW81DzfaRDIS43k2HzjR+yOfbcWDWWoM7zcskn0=; b=juyK4fZhseJDUG4SGXL6J+XjxyTXZnPFp75YNtmk/MZOeY6LrlsYbGLq8uT9947gwz IJw8TmWowY1rDOMKfqYDngME9DQ7TNaQiP8RsSWJyk3QX8oYL+t6dEd+hqxGSpqH70eF Rq9tsECz/37CV8psQCFqN+dZXstHqAJrNEbV5Jj8pXTokos8swOQ1HY8WDlpgPlnKlmo Q2x2es5mqmwDKLEfc31fHeSW4b3UA12RpPJ0aI0FVIRoSjZSytfWE9dwdB3BmFKuw5a3 yYgJcs0V1bV9kz6NewQpViidtJDdZWRscuCOfbP0MTTTBTpaei5vZaDWBo6SVHfnY4nj rj3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=grovnzlG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id f10si7646437pgg.348.2019.05.13.14.27.28; Mon, 13 May 2019 14:27:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=grovnzlG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1726454AbfEMV0c (ORCPT + 99 others); Mon, 13 May 2019 17:26:32 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:42578 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726174AbfEMV0b (ORCPT ); Mon, 13 May 2019 17:26:31 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x4DLOIfI163779; Mon, 13 May 2019 21:25:54 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=content-type : mime-version : subject : from : in-reply-to : date : cc : content-transfer-encoding : message-id : references : to; s=corp-2018-07-02; bh=565YBW81DzfaRDIS43k2HzjR+yOfbcWDWWoM7zcskn0=; b=grovnzlGNhoWxg5qTfZqqCe1IbYlscPPaFCoCsuR8tt3ASzDgZxK2+mT55ONjtQpCEzY kfB5uJIm7OzXwBf4+8TE3xSbFPPVcOCDVWNVFli9RyNtmRNYhiKlGCNLURZHUOscPclr IYNal+CRZA/SCX4yPG2Zpsri3AT60IdEClhmHHTYUgtZ3dAmQr+9vx9HV06zYb8AszYn 9FRvfVgMvL0QV+oO4S7ODYaqwUl2XjF2+9Wo5jDYi7dTaDvu181uHwWAfiIBxuoIDcUx 2VvBeh+jiKiBWjHJ9ibL/22dVxSBMC832kGL/8a4Y5k8XxNOcY+NvuyxL2Iy8p7Lf8mn RQ== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2120.oracle.com with ESMTP id 2sdq1q9ry6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 13 May 2019 21:25:54 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x4DLPIdA126929; Mon, 13 May 2019 21:25:53 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserp3020.oracle.com with ESMTP id 2se0tvsthj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 13 May 2019 21:25:53 +0000 Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x4DLPpxg006777; Mon, 13 May 2019 21:25:52 GMT Received: from [192.168.14.112] (/79.180.238.224) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 13 May 2019 14:25:51 -0700 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.1 \(3445.4.7\)) Subject: Re: [RFC KVM 24/27] kvm/isolation: KVM page fault handler From: Liran Alon In-Reply-To: <20190513151500.GY2589@hirez.programming.kicks-ass.net> Date: Tue, 14 May 2019 00:25:44 +0300 Cc: Alexandre Chartre , pbonzini@redhat.com, rkrcmar@redhat.com, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, dave.hansen@linux.intel.com, luto@kernel.org, kvm@vger.kernel.org, x86@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, konrad.wilk@oracle.com, jan.setjeeilers@oracle.com, jwadams@google.com Content-Transfer-Encoding: quoted-printable Message-Id: <13F2FA4F-116F-40C6-9472-A1DE689FE061@oracle.com> References: <1557758315-12667-1-git-send-email-alexandre.chartre@oracle.com> <1557758315-12667-25-git-send-email-alexandre.chartre@oracle.com> <20190513151500.GY2589@hirez.programming.kicks-ass.net> To: Peter Zijlstra X-Mailer: Apple Mail (2.3445.4.7) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9256 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905130142 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9256 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905130142 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On 13 May 2019, at 18:15, Peter Zijlstra wrote: >=20 > On Mon, May 13, 2019 at 04:38:32PM +0200, Alexandre Chartre wrote: >> diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c >> index 46df4c6..317e105 100644 >> --- a/arch/x86/mm/fault.c >> +++ b/arch/x86/mm/fault.c >> @@ -33,6 +33,10 @@ >> #define CREATE_TRACE_POINTS >> #include >>=20 >> +bool (*kvm_page_fault_handler)(struct pt_regs *regs, unsigned long = error_code, >> + unsigned long address); >> +EXPORT_SYMBOL(kvm_page_fault_handler); >=20 > NAK NAK NAK NAK >=20 > This is one of the biggest anti-patterns around. I agree. I think that mm should expose a mm_set_kvm_page_fault_handler() or = something (give it a better name). Similar to how arch/x86/kernel/irq.c have = kvm_set_posted_intr_wakeup_handler(). -Liran