Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3628224imm; Mon, 25 Jun 2018 01:42:26 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKF6XpEIlmCJ72juyeRyS3zwMEblcaJjnAQaI68pEmiSt9wUm/XI93NGvMLwZ1aexOAvoNz X-Received: by 2002:a17:902:6b09:: with SMTP id o9-v6mr11357930plk.256.1529916146506; Mon, 25 Jun 2018 01:42:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529916146; cv=none; d=google.com; s=arc-20160816; b=GL1jKgNT3edsuleVHJ5F5Ui/aSykKfnG2ebsSQI4Iveot4hrXaxRNU3vZOG4xCJcg8 BwrUtVUi+iXja3SHU5dRk3e6ogx5VNHt/IGUKQaTaWkyCW/FQsWqMHMucObcfovcTAxS YSeQNccIKI8aVgu4nFh4Amfm4cJWem7wquPcIx1Y+uEX2dGJ/fjzRluj+Z+bYSQesD1d cltBlUb2/2IsIFfriL2RrGI9dRvIi0Wvaw15XjiWRZqUtYc6wdmcKc536NBA1Vjq7w3V 2+U7qyImuH1gPPBt6+oJqKstkkBWxKAPEErg+1cr+p1fewielrKVDJhAb+PaAxcykGrr h1VA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=2aHDWcYDtmbiBVqyXow8Cz/uJDrr//W4gz2BBWwGJf4=; b=sPm79lE7vI/UcJjWv3g5Ag63FVUlQd6QH3HqXl7sRIRlIoxsVXFRo7GSZxHYzvDEQp /vX+TiOEk3t08PFrv2FdGZsTK/0sBeBq6NWNAAGH9OtjMY1fV1tveG2Gz8D2ncH4XKPd O/gwdMEqXP8ntiCiyxXzqzReQH5l+5RyaTqyVGIrn0R+ddtwYt/x8wcGkxNca+SFgax2 fdoU2VSp38Ku/ura8v0TdAJ7BinOtVPIn30Gf9C5sbV6FCq7asftB8Fid2D5LV3dxEWD n/f3e2M/o6iObCW+BpPPjWAN12DfmRf6TvHsWG8XR+kqCAIkcQBaKM/Ber5RLpDXgeZA AD8w== 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 p25-v6si12707140pfn.131.2018.06.25.01.42.11; Mon, 25 Jun 2018 01:42:26 -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 S1754600AbeFYIlA (ORCPT + 99 others); Mon, 25 Jun 2018 04:41:00 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:45840 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754563AbeFYIk6 (ORCPT ); Mon, 25 Jun 2018 04:40:58 -0400 Received: from p4fea482e.dip0.t-ipconnect.de ([79.234.72.46] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1fXN1x-0004hD-Uw; Mon, 25 Jun 2018 10:39:26 +0200 Date: Mon, 25 Jun 2018 10:39:24 +0200 (CEST) From: Thomas Gleixner To: Peter Zijlstra cc: Pavel Tatashin , steven.sistare@oracle.com, daniel.m.jordan@oracle.com, linux@armlinux.org.uk, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com, john.stultz@linaro.org, sboyd@codeaurora.org, x86@kernel.org, linux-kernel@vger.kernel.org, mingo@redhat.com, hpa@zytor.com, douly.fnst@cn.fujitsu.com, prarit@redhat.com, feng.tang@intel.com, pmladek@suse.com, gnomes@lxorguk.ukuu.org.uk, linux-s390@vger.kernel.org, Steven Rostedt Subject: Re: [PATCH v12 01/11] x86: text_poke() may access uninitialized struct pages In-Reply-To: <20180625081429.GS2494@hirez.programming.kicks-ass.net> Message-ID: References: <20180621212518.19914-1-pasha.tatashin@oracle.com> <20180621212518.19914-2-pasha.tatashin@oracle.com> <20180625081429.GS2494@hirez.programming.kicks-ass.net> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 25 Jun 2018, Peter Zijlstra wrote: > On Thu, Jun 21, 2018 at 05:25:08PM -0400, Pavel Tatashin wrote: > > -void *text_poke(void *addr, const void *opcode, size_t len) > > +void __ref *text_poke(void *addr, const void *opcode, size_t len) > > { > > unsigned long flags; > > char *vaddr; > > struct page *pages[2]; > > int i; > > > > + /* While boot memory allocator is runnig we cannot use struct > > Broken comment style.. > > > + * pages as they are not yet initialized. However, we also know > > + * that this is early in boot, and it is safe to fallback to > > + * text_poke_early. > > + */ > > + if (unlikely(!after_bootmem)) > > + return text_poke_early(addr, opcode, len); > > I'm not entirely sure this is right.. Because not only do we need the > whole fixmap stuff working, we also need #DB and the IPI handlers set-up > and working. IPI? That's early UP boot why would you need an IPI? Thanks, tglx