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 X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9DFFDC433DB for ; Fri, 19 Feb 2021 19:45:28 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E098964D99 for ; Fri, 19 Feb 2021 19:45:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E098964D99 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=soleen.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 66C7B6B0071; Fri, 19 Feb 2021 14:45:27 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 61CDF6B0072; Fri, 19 Feb 2021 14:45:27 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5327E6B0073; Fri, 19 Feb 2021 14:45:27 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0206.hostedemail.com [216.40.44.206]) by kanga.kvack.org (Postfix) with ESMTP id 3B7516B0071 for ; Fri, 19 Feb 2021 14:45:27 -0500 (EST) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id DE06C8248D7C for ; Fri, 19 Feb 2021 19:45:26 +0000 (UTC) X-FDA: 77836046652.15.878EF49 Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) by imf03.hostedemail.com (Postfix) with ESMTP id 049EAC000C66 for ; Fri, 19 Feb 2021 19:45:23 +0000 (UTC) Received: by mail-ej1-f48.google.com with SMTP id d8so15693744ejc.4 for ; Fri, 19 Feb 2021 11:45:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=vNXss2R439WReA4A5p2aVRtiZkryvFn/KdsgQqDMpz8=; b=UGIej+Y90hr2tcZqfj6uEvrLTS/vpeYC4x6P6hOI08vsf67gC7FUzKWPuALawpLvpp xILpSNf7Fa7PznY65dx4RgT+lcZ9uYWVmi2F+3BzLXGTQll34qJuz2eO3SmJVggG6Oac 7gKtbRoKe8f2THu394yw8nGyphMxvKZ17E+ls4lXCx196oqtxWg/9kORGlRigJ6R2IYz wViSQurw95LjF3LgzXzKB8AzBt7nM2airi2EnEgSgTdsxzeiEYal1ATQVY+Nf4co7xZz Ict8+c2QOzuhIbDE+aqQbhuXZUKY6D1H2L3wu3VDuvWYIVDdDrzXl2lCJ2abrm2OItnC Tvng== 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=vNXss2R439WReA4A5p2aVRtiZkryvFn/KdsgQqDMpz8=; b=JA08QfP03k8Npc7hLJktavOL0yDy5M/yXzLw3CuulOzs87G+PftSXCSQTYyAGQ4+Q0 2quip/yO9TY1xylkYB015x3j59wyZZ4zaxETQLChn9nXjjSRog3UBMVg7GLS9Mk/xX5P OJF4NzQvvM6C+WyjYcdzoOfPcaA+RIOZ94CxN9GeAs7LW8MAuASlC6BSPh4Qgk/a1hhJ 9J9I9UPP1OGgMN9I/8rBVq3NLGlXSdKoATIXD+1Zx5kacCoa5r1A8EN0dKAEXdKo5PVM iUJwruOsUCKOVf7xAuaC1WgKBHNIk+Gg+vCLrXury99jQCccyR+yxMW1BIYRdgVh3Jf5 hJzw== X-Gm-Message-State: AOAM533veKbuol0sEwiDvhukNzrzGL+GNh2PqanxhusrHzLWWGAcY+kZ DBGNAiou2bc87AIZxlWZLrAKPHr0VcgXGTGbH5ESTw== X-Google-Smtp-Source: ABdhPJzz9ma1y8TEtYg/cIfXA1568VmifuPk++cNwcZ4+5SidEFivtvGtejnx/f3t9SmxhagutwJzw6f6GWzr3bBolQ= X-Received: by 2002:a17:906:17d5:: with SMTP id u21mr10394249eje.541.1613763924973; Fri, 19 Feb 2021 11:45:24 -0800 (PST) MIME-Version: 1.0 References: <20210216150351.129018-1-pasha.tatashin@soleen.com> <20210216150351.129018-2-pasha.tatashin@soleen.com> <20210219191807.GB6683@willie-the-truck> In-Reply-To: <20210219191807.GB6683@willie-the-truck> From: Pavel Tatashin Date: Fri, 19 Feb 2021 14:44:49 -0500 Message-ID: Subject: Re: [PATCH v3 1/1] arm64: mm: correct the inside linear map range during hotplug check To: Will Deacon Cc: Tyler Hicks , James Morris , Catalin Marinas , Andrew Morton , Anshuman Khandual , Mike Rapoport , Logan Gunthorpe , Ard Biesheuvel , Linux ARM , LKML , Michal Hocko , linux-mm Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 049EAC000C66 X-Stat-Signature: xytmqop1ek58cwhwr85ge68qqegxh8it Received-SPF: none (soleen.com>: No applicable sender policy available) receiver=imf03; identity=mailfrom; envelope-from=""; helo=mail-ej1-f48.google.com; client-ip=209.85.218.48 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1613763923-272073 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 Fri, Feb 19, 2021 at 2:18 PM Will Deacon wrote: > > On Tue, Feb 16, 2021 at 10:03:51AM -0500, Pavel Tatashin wrote: > > Memory hotplug may fail on systems with CONFIG_RANDOMIZE_BASE because the > > linear map range is not checked correctly. > > > > The start physical address that linear map covers can be actually at the > > end of the range because of randomization. Check that and if so reduce it > > to 0. > > > > This can be verified on QEMU with setting kaslr-seed to ~0ul: > > > > memstart_offset_seed = 0xffff > > START: __pa(_PAGE_OFFSET(vabits_actual)) = ffff9000c0000000 > > END: __pa(PAGE_END - 1) = 1000bfffffff > > > > Signed-off-by: Pavel Tatashin > > Fixes: 58284a901b42 ("arm64/mm: Validate hotplug range before creating linear mapping") > > Tested-by: Tyler Hicks > > --- > > arch/arm64/mm/mmu.c | 21 +++++++++++++++++++-- > > 1 file changed, 19 insertions(+), 2 deletions(-) > > I tried to queue this as a fix, but unfortunately it doesn't apply. > Please can you send a v4 based on the arm64 for-next/fixes branch? Hi Will, The previous version, that is not built against linux-next would still applies against current mainlein/for-next/fixes https://lore.kernel.org/lkml/20210215192237.362706-2-pasha.tatashin@soleen.com/ I just tried it. I think it would make sense to take v2 fix, so it could also be backported to stables. Thank you, Pasha