Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp840913yba; Thu, 9 May 2019 06:48:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqx0hvYtIdhAMrTQhKJHR0e4dL2y9P1o9CWVpFFz2rfw35Zh0JDQWqIKtzi4eRqcyFywkJDq X-Received: by 2002:aa7:9214:: with SMTP id 20mr5218793pfo.202.1557409727793; Thu, 09 May 2019 06:48:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557409727; cv=none; d=google.com; s=arc-20160816; b=hVxHuOejXLGaWHk5j42qJi5JpyRaGEBUuQi2s3dyhCeaEWRfYsaK8WgtahM9jBskcG zjXxM+iJaIet0k6kviNCi4yHNr1JvYCf4uLOFqITS/Gdld4b+W71lrGUkKgK6+E0Uja9 F/6sWZT0w9eX5COoWPsCwLzOS2kuO4zm7R+NS2v+5DJfGSMmtmBIlXVRAOMKVbHmRgPg 7I29nOLNaHZS/Qxg4FX4hXAYmRv1KOj/tq31J6XI22cYwuXsJZIPHsF2G75uFEfusjpS 5n9YNo6Z19VEP+4N6q/+HUpaFKsuyXyt+3oGkEb+YxPqyzM97zDpf7zy2gwIB9BVbv3Y 39Hg== 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:mime-version :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=LniMxljbQ/EMM8SNK0OPemPn9WrvgcDQ3FB2BZyLhmI=; b=Br/MC8C2sFMidqJ+Xc8XSW1XsCggmcpnmaPXPOkiTqQ4sg21IzpHOP32wXuLtb7mM0 XqkF2T827IJQoNzQD4hTcFqAuCt2RPAJWVTwsQItItgLczzjTKu1nEuk0pHWTBQcuqxJ 1D/pPkDrWjGrTfwgiwZXMQTR85wE+r1cd4I58mhuyBmHklq6knu0O07FvnQR4tZW7m3/ LlYJvwDaWTO8GBV2X2nQY+eSgKCvKhdLugCL1hyRGA1MS6A3s2vZItmk/XFm26JXZiwD tO+7wgr9aQLJMK5AxO28DF1m4rafHf+F3o6E1g6rU+xslq+HGptWXg2TnU3C/EBYn9Br /iqw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c13si2815086pga.507.2019.05.09.06.48.30; Thu, 09 May 2019 06:48: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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726640AbfEINrG convert rfc822-to-8bit (ORCPT + 99 others); Thu, 9 May 2019 09:47:06 -0400 Received: from eu-smtp-delivery-151.mimecast.com ([207.82.80.151]:35843 "EHLO eu-smtp-delivery-151.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726600AbfEINrG (ORCPT ); Thu, 9 May 2019 09:47:06 -0400 Received: from AcuMS.aculab.com (156.67.243.126 [156.67.243.126]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-2-cILVDsqaNZKuy6_7SA1Hbw-1; Thu, 09 May 2019 14:47:00 +0100 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b::d117) by AcuMS.aculab.com (fd9f:af1c:a25b::d117) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Thu, 9 May 2019 14:46:59 +0100 Received: from AcuMS.Aculab.com ([fe80::43c:695e:880f:8750]) by AcuMS.aculab.com ([fe80::43c:695e:880f:8750%12]) with mapi id 15.00.1347.000; Thu, 9 May 2019 14:46:59 +0100 From: David Laight To: =?iso-8859-1?Q?=27Michal_Such=E1nek=27?= , Petr Mladek CC: Linus Torvalds , "linux-arch@vger.kernel.org" , Sergey Senozhatsky , Heiko Carstens , "linux-s390@vger.kernel.org" , Rasmus Villemoes , "linux-kernel@vger.kernel.org" , Steven Rostedt , Michal Hocko , Sergey Senozhatsky , Stephen Rothwell , "Andy Shevchenko" , "linuxppc-dev@lists.ozlabs.org" , "Martin Schwidefsky" , "Tobin C . Harding" Subject: RE: [PATCH] vsprintf: Do not break early boot with probing addresses Thread-Topic: [PATCH] vsprintf: Do not break early boot with probing addresses Thread-Index: AQHVBmyk/iTC8Q7sI0elwkZY5/gFJaZizfQA Date: Thu, 9 May 2019 13:46:59 +0000 Message-ID: <8ad8bb83b7034f7e92df12040fb8c2c2@AcuMS.aculab.com> References: <20190509121923.8339-1-pmladek@suse.com> <20190509153829.06319d0c@kitsune.suse.cz> In-Reply-To: <20190509153829.06319d0c@kitsune.suse.cz> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 X-MC-Unique: cILVDsqaNZKuy6_7SA1Hbw-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Michal Suchánek > Sent: 09 May 2019 14:38 ... > > The problem is the combination of some new code called via printk(), > > check_pointer() which calls probe_kernel_read(). That then calls > > allow_user_access() (PPC_KUAP) and that uses mmu_has_feature() too early > > (before we've patched features). > > There is early_mmu_has_feature for this case. mmu_has_feature does not > work before patching so parts of kernel that can run before patching > must use the early_ variant which actually runs code reading the > feature bitmap to determine the answer. Does the early_ variant get patched so the it is reasonably efficient after the 'patching' is done? Or should there be a third version which gets patched across? David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)