Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp393709rwb; Fri, 18 Nov 2022 03:05:47 -0800 (PST) X-Google-Smtp-Source: AA0mqf7vQLG9G8xuQ3PhAW/ArZ0NiDtmhb/XG54mp3XAMv7rUVNNeD/5j80M54brkOY1uihvt3Gf X-Received: by 2002:a17:903:40ca:b0:182:2589:db21 with SMTP id t10-20020a17090340ca00b001822589db21mr6956358pld.151.1668769547466; Fri, 18 Nov 2022 03:05:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668769547; cv=none; d=google.com; s=arc-20160816; b=X9GRJem1hKDcwzS1A1HZ+lmpduipeurudwHrVsXSn1LMEdeuXJx2uyV2Co1Cvn2BlT E+6jA3cTYsHToQ7Xs4n7BMQW9xe280cH5MmGgB94xMjnDZqRqeVYVhKw2Qx1OtyKiIEd JgKnefrHXe9V/DErInZqZdcy9jWZwgzV+ePb3g8ZoNCNsaoGlxgwvbTWWVAzTLDKztcA 72XQ/qnA7pbCEbH3HRMd36DEGGkfzdK9V5AfdjA4mYVD4orWXMwKfdfA4b7fXqpb65Yf VqyjLzdWs4n6oyFeAwnN6tedWOYjVRyjYB9K3CjLgplmmlOEYJls4VQIaPiiymrkkb+I E+8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ery4e7DXynGUHcFDdPwXSq/cHJt8hNQ6mXrrfbI6xLk=; b=hp6M5fndpukbLhgDB3g3/UPGMy4DKP+0G0f7N/mbLYDvpZt0vas4YT8Dysd2gPpQ2Q p2Mkw7sHNK1EZ43PvvtyqgyvdFUm5MLVHfJQdqy7XcRynjM4TxYDXB3uzMLfO5uhSgMB GQkh94z1H58h9isE/wWRpTZo+j+HfrzdKcKjYIXPJhdyFbpt/Moo86Lnk6iScLy7v1Eu dho4FD6obox9p1zv3hr+REY66PkxTsyX75fwOwL3LbY/a0t3XV2gz3jR+AuxX7n07obH letmvEDUPrUGqYH6VUwpm4r6o5Vjp/ZVuPEXpmS/gt6WDagVQIc2NG+ihCoPuislGR1r ThYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=EIGeQOPH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id on1-20020a17090b1d0100b002180eb2c6e3si3372496pjb.139.2022.11.18.03.05.26; Fri, 18 Nov 2022 03:05:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=EIGeQOPH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241540AbiKRKdR (ORCPT + 91 others); Fri, 18 Nov 2022 05:33:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241499AbiKRKdO (ORCPT ); Fri, 18 Nov 2022 05:33:14 -0500 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 52D33922EE for ; Fri, 18 Nov 2022 02:33:12 -0800 (PST) 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> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.