Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2392011pxb; Wed, 9 Feb 2022 18:05:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJwFvRzq4Fspg2B1pJMEBUNJCsJCjtq3fkVFsJUNgwX79Dt99IaQfHDZZ92iGn35nDuV5p4t X-Received: by 2002:a63:84c3:: with SMTP id k186mr4229911pgd.534.1644458721686; Wed, 09 Feb 2022 18:05:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644458721; cv=none; d=google.com; s=arc-20160816; b=RZOiz1KLq4qzURVEHZ1nuseDqp2hSkUIL2c6sDPduw8zYOMfpEPSXX6RCHJCUwRVUh MhbLnQmdErV0TP1z2P/LMxkAYQyqeAHTk2ECXl+VJvBW2gJBa0UFOAPkYEWW0sfiRlef 9D4VFSZih0u2srlIn9jSbHMKcZQ+FqjW1G/3ydt9JF9Yu40ziDZoYHoXizcjszCrSrzI z4filCF6otgiX7taqT3Ooze/mg0DFfS9WKQrkTJPTEG4OF7xR+y7S5d/tmdvE48bZWqF WY6V3vTnMptItEt9xylnIKz8Y+S+KU4cK/+U1LyYiM1qxjFyzoedzNdIdlhSOMW1mtfK tHyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=0be7h+85+9jG8IuBbBtLefHUdkRLHbiS72EqcCefKnM=; b=baoxhLzDGmzr6bYualMlLawSAMJsWuP0Hz7/AJYTztcsH7TdjDTn9WFlBxdTiDZMF2 YYRYeQN3VLXz09yzDxNXv1NXpXf1JCw8DI2Xn3kqCECh/a42znm/UIefQc5PUHOz+kAw lCTg5L9tVkNd2HDRQXiLLY1pGTr5jLjFu+oskcMdQciHBYgGNqvrm3Z95y0eSxQa5uj0 u1EmqyxpK0TqLolBP6DPGLPbMxsc/lg0gmhHqluvP4Rn4UrU8K39xIi7wzP4N1p7/RyX lRrxvWcXgqAxtEZUTHIdPkEP/gjyZsfMT7H4ixmA7Hs3d1ch6r03/+nPj9uM93CspMq4 7ISg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=HWE31+xI; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id d13si753994plh.148.2022.02.09.18.05.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 18:05:21 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=HWE31+xI; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0539AB08; Wed, 9 Feb 2022 17:56:18 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231148AbiBJBz4 (ORCPT + 99 others); Wed, 9 Feb 2022 20:55:56 -0500 Received: from gmail-smtp-in.l.google.com ([23.128.96.19]:60024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233094AbiBJBzm (ORCPT ); Wed, 9 Feb 2022 20:55:42 -0500 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 095B92B6BF for ; Wed, 9 Feb 2022 17:48:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644457683; x=1675993683; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=BLre5/OKQreEUzM09SlpEwYktEpXzat0t85VCB8h+zE=; b=HWE31+xIN3hBrpOoTG+u6o73p2ZzARHB87vRVJJL7ExoGsw4R2pKbLPr Ws4/9FtrvJX9EI32u6X7mWN6Ar3yjacQtRTE94q43UG453ddZIx6KZtvL fyHkxXOD24gprLdVtmskMtKdnG+KRiVpILrkGci82oThPu77gYLZHOvwu iiLIl6ke4ZVsaKiVMBgARmQJcELK1Wx2hWQC1F3b9oUwkfEbsKcy3ZRbb w36w1JL+ylr1Pgq2dUoSy3IdL/8h/UqT9ytbPRwIhSspSviAyqgtTbQoT MGT81WCqyEbdqhPKRSJlK+VUdbgHu3+092WPSJPMFUay++VnlbywR6oRI w==; X-IronPort-AV: E=McAfee;i="6200,9189,10253"; a="246950848" X-IronPort-AV: E=Sophos;i="5.88,357,1635231600"; d="scan'208";a="246950848" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2022 15:44:41 -0800 X-IronPort-AV: E=Sophos;i="5.88,357,1635231600"; d="scan'208";a="526228822" Received: from iweiny-desk2.sc.intel.com (HELO localhost) ([10.3.52.147]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2022 15:44:41 -0800 Date: Wed, 9 Feb 2022 15:44:41 -0800 From: Ira Weiny To: "Edgecombe, Rick P" Cc: "hpa@zytor.com" , "Williams, Dan J" , "dave.hansen@linux.intel.com" , "Yu, Fenghua" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH V8 13/44] mm/pkeys: Add initial PKS Test code Message-ID: <20220209234441.GO785175@iweiny-DESK2.sc.intel.com> References: <20220127175505.851391-1-ira.weiny@intel.com> <20220127175505.851391-14-ira.weiny@intel.com> <1ac1daf90285869ddfdf52daa8d39bc462253883.camel@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1ac1daf90285869ddfdf52daa8d39bc462253883.camel@intel.com> User-Agent: Mutt/1.11.1 (2018-12-01) X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Mon, Jan 31, 2022 at 11:30:14AM -0800, Edgecombe, Rick P wrote: > On Thu, 2022-01-27 at 09:54 -0800, ira.weiny@intel.com wrote: > > +static void crash_it(void) > > +{ > > + struct pks_test_ctx *ctx; > > + void *ptr; > > + > > + pr_warn(" ***** BEGIN: Unhandled fault test *****\n"); > > + > > + ctx = alloc_ctx(PKS_KEY_TEST); > > + if (IS_ERR(ctx)) { > > + pr_err("Failed to allocate context???\n"); > > + return; > > + } > > + > > + ptr = alloc_test_page(ctx->pkey); > > + if (!ptr) { > > + pr_err("Failed to vmalloc page???\n"); > > + return; > > + } > > + > > + /* This purposely faults */ > > + memcpy(ptr, ctx->data, 8); > > + > > + /* Should never get here if so the test failed */ > > + last_test_pass = false; > > + > > + vfree(ptr); > > + free_ctx(ctx); > > So these only gets cleaned up if the test fails? Could you clean them > up in pks_release_file() like the later test patch? Not a bad idea. Although if someone is running this they are most likely not concerned with it. > > > +} > > snip > > > + > > +static void __exit pks_test_exit(void) > > +{ > > + debugfs_remove(pks_test_dentry); > > + pr_info("test exit\n"); > > +} > > How does this get called? Left over from when this was a module. Thanks for catching. Ira