Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp318796iog; Thu, 30 Jun 2022 01:08:47 -0700 (PDT) X-Google-Smtp-Source: AGRyM1scTZgNi0ybe5a6uHapb+L8sZmtfHAijHvugc/h+Y/o3SREaBfG6/12eZaa5BZZPrNK3Rev X-Received: by 2002:a63:e54e:0:b0:40d:5507:f471 with SMTP id z14-20020a63e54e000000b0040d5507f471mr6720054pgj.410.1656576527501; Thu, 30 Jun 2022 01:08:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656576527; cv=none; d=google.com; s=arc-20160816; b=Y/uVHgzUxXPz/qshV4aby8ku05RRliM/GmLqtOTkegaylVpy3dQ2Kop2w8/LiCq9G+ OvYqAIfp2OM0otz0oH2u16armTorsctajUJrzOn2e5d8q7kBVgE1OvggbLr70YbHCnVC F1pabGfv8aI4vvvEBui7YfaYPfnoE1N9NT6aKoDe1nzOS6HrvCNZzBXqD+cAQzkSDsKP p/CxTJ87DzCyfXGM0N7tHbDNwC6q0b1R6H1ZcaLxK0L2FWmNKTnQ08WLAA7ltPh3UwyV ypQQNhGlZG4HSFs0wwQMt3/bj35tagINqUUPeGB/BV3N/w0UWB9/59xDOsLTXxpupFA/ fy5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=OPenx2DEXVp18KG97S9VeM/W6b6px6tnzzbH3qfsGBI=; b=zkMVyOjWENxr6UvHKgVufF02CStNC9VIF68HO7rcNw7Rk7VdN/uhP2tQKaMxUhKccr 9q65nO0uxiQ6EXYHhPhWfnuEHF8/v32wUj9B43R0PQXDQ9rhlmGXieTtXz3z+f9JxDBe ZlVlF6ibOk8ShhCNTtSzYJjAj5DSX7zGiSlbrD+sTzm6jUfGHgSw36VAkb5hHkfhCK5A jMBpQUiQjzy6KIRMn38+J1fsnt9mE1R7gusorjmZY05o/TGso8dB2yji1yXzEG5RM74+ Ex2xzzsDuDaCQEpHU/vBGKhfC6V48TzLnCVfPBasBFJ3Xk8FuZWHOF66M89R5qQXuv3y mC3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=SQDAD9Xw; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h71-20020a636c4a000000b0041183daa0ffsi5171248pgc.761.2022.06.30.01.08.35; Thu, 30 Jun 2022 01:08:46 -0700 (PDT) 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=@google.com header.s=20210112 header.b=SQDAD9Xw; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232866AbiF3Hxi (ORCPT + 99 others); Thu, 30 Jun 2022 03:53:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232753AbiF3Hxg (ORCPT ); Thu, 30 Jun 2022 03:53:36 -0400 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 562BF2AE3D for ; Thu, 30 Jun 2022 00:53:35 -0700 (PDT) Received: by mail-wr1-x432.google.com with SMTP id s1so25961216wra.9 for ; Thu, 30 Jun 2022 00:53:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=OPenx2DEXVp18KG97S9VeM/W6b6px6tnzzbH3qfsGBI=; b=SQDAD9XwZspvRxeNfsr+pOjUoNApFavriP5lapR9p2Ytufz+05CiLOcpYQOrIwA2T4 bWrv3Z0aO+YAU9gJU1cWv9jnqNAdBQ44LibyoE1W1Q4dRb9RhiIk8ETVo++RvRGVfy3l 7XlMrRPqB0F2X6JlAjVMi6hLIc/YR1AnP96CzG0qXtJ+nnfmiy1xbdo+nn6/Wpo+WfMJ +hTqLK21nwuFGLeEn5loxiAQx1dkGrvJWKmusVNidWZWrtgs+4jMAUI8Aw3U+YeGqRGY dzBDqK+jDWZlLj2uVOzMWVkB6/OId1+b63ddeiofvnG/zRCrYH1073k3QVbpNuG4Qsra EF3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=OPenx2DEXVp18KG97S9VeM/W6b6px6tnzzbH3qfsGBI=; b=aj+iFrSeyh60VBuJxpENr+nxZipose6kDv7U3qg+t83JCrDrcBiFmAAERWOVgjLi00 mCxFEoUhPMLWeiLK94lr7NuMEAqUhqNuBRcEwFZwlaRimYuaEyldeXIJMm4mmGMITM+K 11LX7EHZWi6M6Cmb4xjx2wmioH34vNdZyarIcIas3iEE8y/MtUElgq28m61Zpa5DcpNI jg6JE/BfCew9b0NdVB1Vf+tM8aZUhHv95KbL+UslR5KpjLpftUngTG9hWlXvkrcHO4ty JssgO8jnLw20EI1lPgifCEWVv1i5xLXOLh2Yl2YadVNhFkBYn4mLx18AEhLxtGQ33NID 5vaw== X-Gm-Message-State: AJIora+JiRsiccBb+dSXWleZdtz2+f3Wn66/dioWTwSXoL/SsgwXRiUT Oloo1tj9ekJl1j0l3yh0D0DXstF8OQMzf44AsRimMQ== X-Received: by 2002:a05:6000:144d:b0:21b:b3cc:162e with SMTP id v13-20020a056000144d00b0021bb3cc162emr7099100wrx.433.1656575613798; Thu, 30 Jun 2022 00:53:33 -0700 (PDT) MIME-Version: 1.0 References: <20220527185600.1236769-1-davidgow@google.com> <20220527185600.1236769-2-davidgow@google.com> <1a4e51a4d2ed51e7ae1ff55bd4da6a47fad7c0bf.camel@sipsolutions.net> In-Reply-To: <1a4e51a4d2ed51e7ae1ff55bd4da6a47fad7c0bf.camel@sipsolutions.net> From: David Gow Date: Thu, 30 Jun 2022 15:53:22 +0800 Message-ID: Subject: Re: [PATCH v2 2/2] UML: add support for KASAN under x86_64 To: Johannes Berg Cc: Vincent Whitchurch , Patricia Alfonso , Jeff Dike , Richard Weinberger , Anton Ivanov , Dmitry Vyukov , Brendan Higgins , Andrew Morton , Andrey Konovalov , Andrey Ryabinin , kasan-dev , linux-um , LKML , Daniel Latypov , Linux Memory Management List Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="00000000000005a63405e2a59168" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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 --00000000000005a63405e2a59168 Content-Type: text/plain; charset="UTF-8" On Mon, May 30, 2022 at 1:04 AM Johannes Berg wrote: > > On Fri, 2022-05-27 at 11:56 -0700, David Gow wrote: > > > > The UML-specific KASAN initializer uses mmap to map the roughly 2.25TB > > You say 2.25TB here, and > > > +config KASAN_SHADOW_OFFSET > > + hex > > + depends on KASAN > > + default 0x100000000000 > > + help > > + This is the offset at which the ~2.25TB of shadow memory is > > here too, of course. > > But I notice that I get ~16TB address space use when running, > > > +/* used in kasan_mem_to_shadow to divide by 8 */ > > +#define KASAN_SHADOW_SCALE_SHIFT 3 > > + > > +#ifdef CONFIG_X86_64 > > +#define KASAN_HOST_USER_SPACE_END_ADDR 0x00007fffffffffffUL > > +/* KASAN_SHADOW_SIZE is the size of total address space divided by 8 */ > > +#define KASAN_SHADOW_SIZE ((KASAN_HOST_USER_SPACE_END_ADDR + 1) >> \ > > + KASAN_SHADOW_SCALE_SHIFT) > > because this ends up being 0x100000000000, i.e. 16 TiB. > > Is that intentional? Was something missed? Maybe > KASAN_HOST_USER_SPACE_END_ADDR was too big? > > It doesn't really matter, but I guess then the documentation should be > updated. Whoops, the amount of shadow memory allocated was changed for v1 of this patch (it was ~2.25 TB in the original RFC). I've updated these comments in v3: https://lore.kernel.org/lkml/20220630074757.2739000-2-davidgow@google.com/ -- David --00000000000005a63405e2a59168 Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIIPnwYJKoZIhvcNAQcCoIIPkDCCD4wCAQExDzANBglghkgBZQMEAgEFADALBgkqhkiG9w0BBwGg ggz5MIIEtjCCA56gAwIBAgIQeAMYYHb81ngUVR0WyMTzqzANBgkqhkiG9w0BAQsFADBMMSAwHgYD VQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UE AxMKR2xvYmFsU2lnbjAeFw0yMDA3MjgwMDAwMDBaFw0yOTAzMTgwMDAwMDBaMFQxCzAJBgNVBAYT AkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMSowKAYDVQQDEyFHbG9iYWxTaWduIEF0bGFz IFIzIFNNSU1FIENBIDIwMjAwggEiMA0GCSqGSIb3DQEBAQUAA4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