Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp78240ybh; Tue, 21 Jul 2020 16:53:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxsxub/ZFIARByZvSuR3mgcxwlYrqm2ilf/UVaw2KgpKkkdNPLKEMfznYGirbUODw27L2mI X-Received: by 2002:aa7:da4c:: with SMTP id w12mr27332051eds.122.1595375615998; Tue, 21 Jul 2020 16:53:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595375615; cv=none; d=google.com; s=arc-20160816; b=eb1ux1+ZqXxmdywKj+7sbH6+OhYZtZ/Q4nfv128rDIqZ6Xu0nYiTn1RZvGLz+WHDkh hkaoVQhjKpJw+AY26KxYN/kvqkrq22QsYHveJl+/e+QcN3No0O3sXaXVmdiNIDauhRe9 z2hxf0xOIeRpXPDWbLgPwdJDu+pVSNoXvVuGwo8IAAMOf2gABV4MH89vHs8wvr+VxOee GvYM0ARPsDz2Q3lyosAIXzi3MyLAsjv+fpgTcSCyLuxmagVL1USbY/tKby7hZeZ3mptR qn3rNhej2PpSWz5ti2gENvCXQJcVK7K/h49gR/zICAW24iuGWaiNGgrsWb3L7JJRQaYP LChw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=9GAANOVEkg7Oss4DpDH0gr9ifNPUbhRTyDcGnsT2WTE=; b=NlG3arx2M/wXtfCk7/AiprsMNivCF10Kcn3kPuXHwQFsBrcAMZ9tC4ebrSb9X1/Spg AKTbFssIJ53dUDWPCWCWnD09Hz8dxXb5Z8xux+2H1NJEt/y+rvfmQdXcuwXTYmNRTIz+ VmC3PwR3MBBlXhHA/R/+ZmK2FWP5PFuWMUidSMxp4IglNPPlKeEd4XmtOd04T0liQvHb jqkq0Mr3elVE6oQIejGl1iN03DAV0kcJZVD7zVuHIsD5XC0/UWhaRVmZmbzIZkDoxrJg 3NNy/azUw5iti4st3rcBvwdkiugcyCX334iE6kDjtmw7gA2cMtEPO8gLNcwD/nm7zD+2 QANA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=p1xsv+Js; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id od19si12854370ejb.581.2020.07.21.16.53.13; Tue, 21 Jul 2020 16:53:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=p1xsv+Js; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728973AbgGUXxE (ORCPT + 99 others); Tue, 21 Jul 2020 19:53:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726587AbgGUXxD (ORCPT ); Tue, 21 Jul 2020 19:53:03 -0400 Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38CEAC0619DB for ; Tue, 21 Jul 2020 16:53:03 -0700 (PDT) Received: by mail-pj1-x1043.google.com with SMTP id a9so206778pjd.3 for ; Tue, 21 Jul 2020 16:53:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9GAANOVEkg7Oss4DpDH0gr9ifNPUbhRTyDcGnsT2WTE=; b=p1xsv+JsYJXhYalj5ZZCc9wnW1uf56mVn0Gc1i+QWyJBhVm2oAo15ONIoGH5a++qc3 nS8vtFYiWBbBZN/ZbGkIgOWNPX3q2HAp+ZRYAz0yz6yBgjgbaVNRv9jJYBy2nfqY++4s 49RCXlqcN1Khtcr2FHPAlM6wIONJZ/uQkd34FX01Bue6DVy0I1d2B1vmNGTCO94yzDW+ Fsd6zuBB7YB7X0nSbZNQjQSwkxI+h8rk5XJzp/8bgnBgal//1dKnFv7A0QGSbptnJ7tf 1JcrpYnLejhIZ2RRFRpcz+Ki1fmJRs7nlyLeVDnnreujKpiOcnohfnZRviTLvcVEKJgB pezg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9GAANOVEkg7Oss4DpDH0gr9ifNPUbhRTyDcGnsT2WTE=; b=iLd9a1dCG64aKqdT/hTje8sBlO6hnpVvU69y624ssvgqCRbp0HP/xZhdDu/GvCHzPj CixPRUGx5/9d09dgUzBcAeNttnNXXNFy4L/NwCVzOKajF+oPElNwFaRYH9EiyrncgMPz qiRW5ZJ1FCX4rZK7ZFIuRA/ZBSMv7h5mhgrGL/Khoxd5ZEVFqP/4Qzgyy6Q86oikVvsV KRqFpP7dr4jnw3SP0Z15ukDZOVI0utgmW0d0itPatbWL9cAySFB8vcCjwxGBZNTmbEGc ym3gr7LzR9n0opbGSznzRdKR7Dl2FmAca8RxZQk+pcEANRO9fXM5I18FQloylIMXutQj T0ww== X-Gm-Message-State: AOAM532dyAQjjkPJsMHfSs1r8ynt+aeEmPojCR02av4ZRaVWtRLiJff1 gz7hIy8bZcCPKOhQZEARliqSX65XNBTQzPBtQS6YMQ== X-Received: by 2002:a17:902:10e:: with SMTP id 14mr23017886plb.297.1595375582338; Tue, 21 Jul 2020 16:53:02 -0700 (PDT) MIME-Version: 1.0 References: <20200721174036.71072-1-vitor@massaru.org> In-Reply-To: <20200721174036.71072-1-vitor@massaru.org> From: Brendan Higgins Date: Tue, 21 Jul 2020 16:52:51 -0700 Message-ID: Subject: Re: [PATCH v3] lib: kunit: Provides a userspace memory context when tests are compiled as module To: Vitor Massaru Iha Cc: KUnit Development , "open list:KERNEL SELFTEST FRAMEWORK" , Linux Kernel Mailing List , Kees Cook , David Gow , Shuah Khan , linux-kernel-mentees@lists.linuxfoundation.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 21, 2020 at 10:40 AM Vitor Massaru Iha wrote: > > KUnit test cases run on kthreads, and kthreads don't have an > adddress space (current->mm is NULL), but processes have mm. > > The purpose of this patch is to allow to borrow mm to KUnit kthread > after userspace is brought up, because we know that there are processes > running, at least the process that loaded the module to borrow mm. > > This allows, for example, tests such as user_copy_kunit, which uses > vm_mmap, which needs current->mm. > > Signed-off-by: Vitor Massaru Iha Isn't this a dependency for the test_user_copy? Also, don't we also need the change that makes kunit_tool build modules? It seems like you should put these together in a patchset like you did before. If not, you should at least reference the dependencies in each patch.