From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 96B26C4332F for ; Fri, 18 Nov 2022 10:33:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1EB736B0072; Fri, 18 Nov 2022 05:33:08 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 174CE6B0073; Fri, 18 Nov 2022 05:33:08 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F30878E0001; Fri, 18 Nov 2022 05:33:07 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id E43F76B0072 for ; Fri, 18 Nov 2022 05:33:07 -0500 (EST) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 9CE3A16128D for ; Fri, 18 Nov 2022 10:33:07 +0000 (UTC) X-FDA: 80146200414.21.DB2CBF2 Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) by imf11.hostedemail.com (Postfix) with ESMTP id 11EB840004 for ; Fri, 18 Nov 2022 10:33:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=ery4e7DXynGUHcFDdPwXSq/cHJt8hNQ6mXrrfbI6xLk=; b=EIGeQOPHkYWExKKZj8puEdHFeG 3uF7oA7oIK4hx+OZebNmAvZGuL3ecRuBR9gvsGIjdiUJ4yC4uURrDvGR5k+ITrfnIN4oHVlgyPR5I D9nZ0xZyxdjb+JrMOYqCiin876QRJQN+hx3l3Kdd7sf95yKGzo+idh+uVVmFnzn/hzMNR5/urvAlT dI0QMG5YBg+sT7jGX8Y/UcIR9S5TIJaVeN4N+oByK2TayIcf1aO/CQna0NxS+JOnz/bXR8zP7S7nx rwBIlkL8NIzGToNjO6PMoZIv2z3mfsN649W0Rk7hDNd6kOEMR2AtDQYZ3UWuq2cV9hf8p6LN//MVv nrWWxBEQ==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1ovyg3-001x27-EE; Fri, 18 Nov 2022 10:32:55 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 6F817300462; Fri, 18 Nov 2022 11:32:54 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 527C520C9821C; Fri, 18 Nov 2022 11:32:54 +0100 (CET) Date: Fri, 18 Nov 2022 11:32:54 +0100 From: Peter Zijlstra To: Dave Hansen Cc: Marco Elver , Naresh Kamboju , kasan-dev , X86 ML , open list , linux-mm , regressions@lists.linux.dev, lkft-triage@lists.linaro.org, Andrew Morton , Alexander Potapenko Subject: Re: WARNING: CPU: 0 PID: 0 at arch/x86/include/asm/kfence.h:46 kfence_protect Message-ID: References: <4208866d-338f-4781-7ff9-023f016c5b07@intel.com> <41ac24c4-6c95-d946-2679-c1be2cb20536@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41ac24c4-6c95-d946-2679-c1be2cb20536@intel.com> ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1668767586; a=rsa-sha256; cv=none; b=wi1Gm2iOc5F6sD9V+AI9Lm0djHx4eKO6xFaHpdnR9EEonxcknXSviMTXPbGJ+WxqElMVvA LSnO9rXmxE9ib7CRt3w/wOfyTZNDKdc7Ul4WIpqj+dj2XS3cElFODciGZKmG44/8/Ntuyj JXG/L1dcA1BLBWXP/9JUrT2MoWNt6oE= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=infradead.org header.s=desiato.20200630 header.b=EIGeQOPH; dmarc=none; spf=none (imf11.hostedemail.com: domain of peterz@infradead.org has no SPF policy when checking 90.155.92.199) smtp.mailfrom=peterz@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1668767586; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ery4e7DXynGUHcFDdPwXSq/cHJt8hNQ6mXrrfbI6xLk=; b=i3wxIPY0oE6qavj3TDftpglFWgd5929lOtYgZ7LdbrTCpxhF7cacqKwTYwvIrtiL4cX2/R kHrmyvRJhfpG97X0vZq3EY+RtAbc6YAKGrtdZJRF5xlULGQA/yohvI27quqm/Am90ERUky oM7EGLY80CztNjTzYWANaTKnEKtAC5w= X-Stat-Signature: ykodbnwiodxgpte77hpoqn6fcx1q4kgk X-Rspamd-Queue-Id: 11EB840004 X-Rspam-User: Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=infradead.org header.s=desiato.20200630 header.b=EIGeQOPH; dmarc=none; spf=none (imf11.hostedemail.com: domain of peterz@infradead.org has no SPF policy when checking 90.155.92.199) smtp.mailfrom=peterz@infradead.org X-Rspamd-Server: rspam09 X-HE-Tag: 1668767585-219145 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Nov 17, 2022 at 03:54:21PM -0800, Dave Hansen wrote: > On 11/17/22 15:23, Marco Elver wrote: > > Yes - it's the 'level != PG_LEVEL_4K'. > > That plus the bisect made it pretty easy to find, thanks for the effort! > > Could you double-check that the attached patch fixes it? It seemed to > for me. > > The issue was that the new "No changes, easy!" check in the suspect > commit didn't check the cpa->force_split option. It didn't split down > to 4k and then all hell broke loose. > > Oh, and I totally misread the kfence ability to tolerate partial TLB > flushes. Sorry for the noise there! > diff --git a/arch/x86/mm/pat/set_memory.c b/arch/x86/mm/pat/set_memory.c > index 220361ceb997..9b4e2ad957f6 100644 > --- a/arch/x86/mm/pat/set_memory.c > +++ b/arch/x86/mm/pat/set_memory.c > @@ -1727,7 +1727,8 @@ static int __change_page_attr_set_clr(struct cpa_data *cpa, int primary) > /* > * No changes, easy! > */ > - if (!(pgprot_val(cpa->mask_set) | pgprot_val(cpa->mask_clr))) > + if (!(pgprot_val(cpa->mask_set) | pgprot_val(cpa->mask_clr)) > + && !cpa->force_split) (operators go at the end of the previous line) > return ret; > > while (rempages) { Urgh.. sorry about that.