Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp3208840ioo; Sun, 29 May 2022 17:18:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwcrsNOdG0NE0+ShzlxcQ+CpG04laIZhZ4hOuF1rEYfGIcWvId6I0Xd103NOeU2MX6Zn23O X-Received: by 2002:a63:81c6:0:b0:3fa:ec6a:c7f8 with SMTP id t189-20020a6381c6000000b003faec6ac7f8mr19572796pgd.292.1653869924146; Sun, 29 May 2022 17:18:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653869924; cv=none; d=google.com; s=arc-20160816; b=KFWkdccAqUikvu5sFQ0h7KR+5hSHLnLmKp1AAP5LgsU5lwovFW+W5qFXay1WIpRtV/ Y3y+dOF67v32njRVkzdrHS60UHkmFiCSPhDsPUal/NwW3rYbDNgCI7hWPtYuMvNzoKeV U8p01FUWSYJLISqcUZhF38rocBZGQZMgbfs5ptwafbnVjNld+DeMB3M0LyhzTMLwht4t IlaJglIy+n4U2IqTRN8CO2J5V0Nbvx6llPVvRq3ekaQfA/0x362KzdhQ08PqO/+gTkiN Mp8LvT2lPj23EIXw7OJ0rRPKuq1izlYRb9tWwYXwfq0XMQ5XIoOah+FjVejTuS/CnPck WKIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=BLA4aQRvfntqLMm99a+1xZPVRcOluvd10rffKGFrc10=; b=rlq0waSolVPHnHJCHEiNGPZj8kLwdytnB48CZfYJEhMhpVM1JdQcURAI/1LX0yh/Ro Vu1AOdja4zzLkAnD04CQKjJrgtjbX6OP4uRYvEwHruOWGT7EN0l0Oni1zMjp40pEh/sR hZiWXP14HbpTWerEw/nzUjNVAiEsRpXy9hRGVW2iOa54xdvoSbHJkqfgXARmQ2j6fHJA 7eibZntfe/90SFYppAnlN/Z0Iv7vU0JBR1/kdLLI1DsnW0eMfSABFJhEwKoi5GH/z8hw V8R7jodXMPsGmWaW57E2sqxzfxNXAitE4dRXAx78ZVUK+btNrkrWy5Y8c3/4h15Zl/db EacQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=nEM4ayaS; 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=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k20-20020a63f014000000b003fa6b315967si14464835pgh.606.2022.05.29.17.18.10; Sun, 29 May 2022 17:18:43 -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=@sipsolutions.net header.s=mail header.b=nEM4ayaS; 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=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231335AbiE2RE0 (ORCPT + 99 others); Sun, 29 May 2022 13:04:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229533AbiE2REY (ORCPT ); Sun, 29 May 2022 13:04:24 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68BCC84A14 for ; Sun, 29 May 2022 10:04:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=MIME-Version:Content-Transfer-Encoding: Content-Type:References:In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=BLA4aQRvfntqLMm99a+1xZPVRcOluvd10rffKGFrc10=; t=1653843862; x=1655053462; b=nEM4ayaSXa19ifF6VUJVLPIsXrOLCakZlQEfnPxHYRwUNWQ sX6843SuagJYeQkiR6oJNqPHep5/uFNAkqvu0y3Mm+6jrNYuxnqmu8vIFP9Gt1Xg71+CMNigVRl/6 lYUiE0D9+lFJ9MPAyXKKCLR+rQSTT3LIIVm5iGXwoI/gSchcJ3kT1dIpBLg/EcP5DbIXdtl/jgkBK LpO6UQHZ+nG1lI3hI9VlhUM7wDOi6lVhAaxWRGPo5ftlEYZHXk6nY/sAESrtcyvAQwgPA+5CARBbH j386URRSDpJn1Aj3NwsyXwCby7/sJ4QShWKrVHLvWozMGi54dtyhgZKNaQXvjbCQ==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.95) (envelope-from ) id 1nvMKn-007myT-UG; Sun, 29 May 2022 19:04:10 +0200 Message-ID: <1a4e51a4d2ed51e7ae1ff55bd4da6a47fad7c0bf.camel@sipsolutions.net> Subject: Re: [PATCH v2 2/2] UML: add support for KASAN under x86_64 From: Johannes Berg To: David Gow , Vincent Whitchurch , Patricia Alfonso , Jeff Dike , Richard Weinberger , anton.ivanov@cambridgegreys.com, Dmitry Vyukov , Brendan Higgins , Andrew Morton , Andrey Konovalov , Andrey Ryabinin Cc: kasan-dev , linux-um@lists.infradead.org, LKML , Daniel Latypov , linux-mm@kvack.org Date: Sun, 29 May 2022 19:04:08 +0200 In-Reply-To: <20220527185600.1236769-2-davidgow@google.com> References: <20220527185600.1236769-1-davidgow@google.com> <20220527185600.1236769-2-davidgow@google.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.1 (3.44.1-1.fc36) MIME-Version: 1.0 X-malware-bazaar: not-scanned X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 Fri, 2022-05-27 at 11:56 -0700, David Gow wrote: >=20 > The UML-specific KASAN initializer uses mmap to map the roughly 2.25TB You say 2.25TB here, and =20 > +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. johannes