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 91797ECAAD3 for ; Wed, 31 Aug 2022 07:13:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 00F818D0001; Wed, 31 Aug 2022 03:13:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id ED9906B0072; Wed, 31 Aug 2022 03:13:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D52D58D0001; Wed, 31 Aug 2022 03:13:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id C05706B0071 for ; Wed, 31 Aug 2022 03:13:58 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 98139C05E4 for ; Wed, 31 Aug 2022 07:13:58 +0000 (UTC) X-FDA: 79859023356.30.20E26B2 Received: from mail-yw1-f180.google.com (mail-yw1-f180.google.com [209.85.128.180]) by imf29.hostedemail.com (Postfix) with ESMTP id 3784C12003D for ; Wed, 31 Aug 2022 07:13:58 +0000 (UTC) Received: by mail-yw1-f180.google.com with SMTP id 00721157ae682-334dc616f86so298796687b3.8 for ; Wed, 31 Aug 2022 00:13:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc; bh=Sfi1gRWe3Pv4hFkp/2mywI4Y2D7k7G63OFzJO6B3Cn8=; b=BelMdRwxcWgK2FmiETN4G0SMTYvwzt3LlM2rfO25SUvWxisPd4IWOIrSByXa1hbiwF vmaRPnWjODVluEAX7l4xmbCRNwk9RAFsQ0sP8K32o7INXBKiULH0UBx2QEZ16KUNp/el 20wTqhpaXdBraJaexGf64vLELpmkvO7Wl4i1ORnixOMIQ6lr20xKynjKXeUR28+kwhTA ZOtgBCMmRmxsWkLUGMiGSQgUQpOkDZ0mZF99D9OjGyGGWwQEt8jjxmgqN2ur4BZkofJs qfS/U5ymRnoqgtV10bC1SZ/s6Gd6C8ltlP2lXZ5zAySrQptuFH8c6QyT9W001JQtxRix /JJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc; bh=Sfi1gRWe3Pv4hFkp/2mywI4Y2D7k7G63OFzJO6B3Cn8=; b=CxR3jJcZvfNznMuAipzoEsasK6Z0s+F/+NKvnp9/QwaIpUgTuzBoExy1fvMc8XgB1C BoLFNNk0Q4AE1SMePRnBOS74Ja7eQefH8jDA36fwhlMwbl48pKalrFx9xkL5MtlO1IUx j2syUQkkbxhDgmjxoS0p+CFefVUhCnyQX5m/9pNW28uoTXKy4MmrzKf+zmRvptDSKt4S C4OdJAv5cGsbfGUJDINZSLNQ9cGH0ODFUn1qYqU7zxJ/E0HhWRa5a1G25nnJOQzJDMFv +hagsi9ihV9mCQAAVIafu401g5LAkOaWXmda4f43tZHunF5YxfzBAL2yOooLPKrhweUd HOqg== X-Gm-Message-State: ACgBeo3i4jPLzS3Txyje73QiTlulze79+rFcR8WInFSiEHgUWFP4YbtU WdRVqiMyDX3YmyS9LqLluCxazrnHYESM1wZTdnZ9gg== X-Google-Smtp-Source: AA6agR7tofDr5ZjrWSlubPMSuX2jZCF3ilRWXqrSsYwrEPX0qY8vGVVVRDGrLg3wF1fahgLzPzyMJTTIzZcZF3k0WMU= X-Received: by 2002:a81:b71c:0:b0:340:bb98:fb38 with SMTP id v28-20020a81b71c000000b00340bb98fb38mr15645113ywh.428.1661930037271; Wed, 31 Aug 2022 00:13:57 -0700 (PDT) MIME-Version: 1.0 References: <20220826150807.723137-1-glider@google.com> <20220826150807.723137-5-glider@google.com> <20220826211729.e65d52e7919fee5c34d22efc@linux-foundation.org> <20220829122452.cce41f2754c4e063f3ae8b75@linux-foundation.org> <20220830150549.afa67340c2f5eb33ff9615f4@linux-foundation.org> <20220830160035.8baf16a7f40cf09963e8bc55@linux-foundation.org> In-Reply-To: From: Alexander Potapenko Date: Wed, 31 Aug 2022 09:13:20 +0200 Message-ID: Subject: Re: [PATCH v5 04/44] x86: asm: instrument usercopy in get_user() and put_user() To: Yu Zhao , Andrew Morton Cc: Marco Elver , Alexander Viro , Alexei Starovoitov , Andrey Konovalov , Andy Lutomirski , Arnd Bergmann , Borislav Petkov , Christoph Hellwig , Christoph Lameter , David Rientjes , Dmitry Vyukov , Eric Dumazet , Greg Kroah-Hartman , Herbert Xu , Ilya Leoshkevich , Ingo Molnar , Jens Axboe , Joonsoo Kim , Kees Cook , Mark Rutland , Matthew Wilcox , "Michael S. Tsirkin" , Pekka Enberg , Peter Zijlstra , Petr Mladek , Steven Rostedt , Thomas Gleixner , Vasily Gorbik , Vegard Nossum , Vlastimil Babka , kasan-dev , Linux Memory Management List , Linux-Arch , LKML Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=BelMdRwx; spf=pass (imf29.hostedemail.com: domain of glider@google.com designates 209.85.128.180 as permitted sender) smtp.mailfrom=glider@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1661930038; a=rsa-sha256; cv=none; b=eDRRT9s3VTBwOzF7onQs+lTaQ4pBPiLwGLidxsnm/oawN2sYeAaBwkp0zBu5Htsf12WYwf cKu8QIhRCDB+t3UN+Nh72b5oq5USXoE87QYl8i9GZUGgQxLsfTqYCdK8DLU/twg3lwUb4S 2qQeCmdPGZ+JLIDLlPwEvUaoJY+Snko= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1661930038; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Sfi1gRWe3Pv4hFkp/2mywI4Y2D7k7G63OFzJO6B3Cn8=; b=Pk1XEonA5q7w8TR2yTljd1Vt9DqO3vRdaFwzszFkxtu1JSjnFSP5PmNKWbmqMo9gBi2WQn GFumQ3/L3jtmS5QIPJqO1YgmA8/FYwWcxIX9K+JxH+geJ4o/PknM+2reDQ5VIh/9+Uo8Nq XiDj0fPAmkcT9/lRIwmz930kvDMa+c4= Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=BelMdRwx; spf=pass (imf29.hostedemail.com: domain of glider@google.com designates 209.85.128.180 as permitted sender) smtp.mailfrom=glider@google.com; dmarc=pass (policy=reject) header.from=google.com X-Stat-Signature: wg54fujqn93ggwjh85qi3gpdt9igsqu9 X-Rspamd-Queue-Id: 3784C12003D X-Rspam-User: X-Rspamd-Server: rspam01 X-HE-Tag: 1661930038-732947 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 Wed, Aug 31, 2022 at 1:07 AM Yu Zhao wrote: > > On Tue, Aug 30, 2022 at 5:00 PM Andrew Morton = wrote: > > > > On Tue, 30 Aug 2022 16:25:24 -0600 Yu Zhao wrote: > > > > > On Tue, Aug 30, 2022 at 4:05 PM Andrew Morton wrote: > > > > > > > > On Tue, 30 Aug 2022 16:23:44 +0200 Alexander Potapenko wrote: > > > > > > > > > > from init/do_mounts.c:2: > > > > > > ./include/linux/page-flags.h: In function =E2=80=98page_fixed_f= ake_head=E2=80=99: > > > > > > ./include/linux/page-flags.h:226:36: error: invalid use of unde= fined type =E2=80=98const struct page=E2=80=99 > > > > > > 226 | test_bit(PG_head, &page->flags)) { > > > > > > | ^~ > > > > > > ./include/linux/bitops.h:50:44: note: in definition of macro = =E2=80=98bitop=E2=80=99 > > > > > > 50 | __builtin_constant_p((uintptr_t)(addr) !=3D (= uintptr_t)NULL) && \ > > > > > > | ^~~~ > > > > > > ./include/linux/page-flags.h:226:13: note: in expansion of macr= o =E2=80=98test_bit=E2=80=99 > > > > > > 226 | test_bit(PG_head, &page->flags)) { > > > > > > | ^~~~~~~~ > > > > > > ... > > > > > > > > > > Gotcha, this is a circular dependency: mm_types.h -> sched.h -> > > > > > kmsan.h -> gfp.h -> mmzone.h -> page-flags.h -> mm_types.h, where= the > > > > > inclusion of sched.h into mm_types.h was only introduced in "mm: > > > > > multi-gen LRU: support page table walks" - that's why the problem= was > > > > > missing in other trees. > > > > > > > > Ah, thanks for digging that out. > > > > > > > > Yu, that inclusion is regrettable. > > > > > > Sorry for the trouble -- it's also superfluous because we don't call > > > lru_gen_use_mm() when switching to the kernel. > > > > > > I've queued the following for now. > > > > Well, the rest of us want it too. > > > > > --- a/include/linux/mm_types.h > > > +++ b/include/linux/mm_types.h > > > @@ -3,7 +3,6 @@ > > > #define _LINUX_MM_TYPES_H > > > > > > #include > > > -#include > > > > > > #include > > > #include > > > @@ -742,8 +741,7 @@ static inline void lru_gen_init_mm(struct mm_stru= ct *mm) > > > > > > static inline void lru_gen_use_mm(struct mm_struct *mm) > > > { > > > - if (!(current->flags & PF_KTHREAD)) > > > - WRITE_ONCE(mm->lru_gen.bitmap, -1); > > > + WRITE_ONCE(mm->lru_gen.bitmap, -1); > > > } > > > > Doesn't apply. I did: > > > > --- a/include/linux/mm_types.h~mm-multi-gen-lru-support-page-table-walk= s-fix > > +++ a/include/linux/mm_types.h > > @@ -3,7 +3,6 @@ > > #define _LINUX_MM_TYPES_H > > > > #include > > -#include > > > > #include > > #include > > @@ -742,11 +741,7 @@ static inline void lru_gen_init_mm(struc > > > > static inline void lru_gen_use_mm(struct mm_struct *mm) > > { > > - /* unlikely but not a bug when racing with lru_gen_migrate_mm()= */ > > - VM_WARN_ON_ONCE(list_empty(&mm->lru_gen.list)); > > Yes. I got a report that somebody tripped over this "unlikely" > condition (and ascertained it's not a bug). So I deleted this part as > well. > > Will refresh the series around rc5. Thanks. Guess I'd still proceed with splitting up kmsan.h just to be on the safe si= de. --=20 Alexander Potapenko Software Engineer Google Germany GmbH Erika-Mann-Stra=C3=9Fe, 33 80636 M=C3=BCnchen Gesch=C3=A4ftsf=C3=BChrer: Paul Manicle, Liana Sebastian Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg