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=-4.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 59E49C433DB for ; Mon, 15 Feb 2021 19:35:47 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1B33A64E23 for ; Mon, 15 Feb 2021 19:35:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1B33A64E23 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=7JkEn4cyhsfUGxTxj2vF34JZc9nBR+BpX/0bdU8ZyYs=; b=GZdqpmT6Ghl1rTB1EBjRthZRd KAiDdufDdGGJgeKcf6SSC5GauZV3VbsmBNwbMg/mPp4HT3i+gwnhJt+iYY6XzguzpcK7/4x6cSn+N NRDTjtFdO6desPRlrrhwGF1B7DEDMlbzLUCiMy2ISlUBR2rOphvGskgOU/L1U4BpFGhZ/BR9sO8OK adaor5Uq8T7SR/vPOAwMN0WArTDegkPJEVUfH9lxViIlgw/h0sBN9IQgUBewr1JQLZo7U7VLS/iE4 q3+0ADBSBsWWVCSSh29VnQCdbnpBltQIvRnIsZbCMOU+WenUpNwOK5KYgMnUrns3HUzUdVV7uI8T1 XdflKQwQg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lBjdp-0002PK-1p; Mon, 15 Feb 2021 19:34:41 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lBjdn-0002Ou-Dw for linux-arm-kernel@lists.infradead.org; Mon, 15 Feb 2021 19:34:40 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id CD7C061606 for ; Mon, 15 Feb 2021 19:34:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1613417677; bh=bWW3ztjLwdLysqq6kBGDDWGlZ+5T/kzIxKXxekKWt+Q=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=cyrSee38Mj5sE4lF7TcopM2B5NpCHx7QjYsoavOLcxYbS6uYwbPbK6askh2679hdn avTZfPvESAYepIs6xUAqv3io5v4j3xTjlBrKVC9UpvmnabRimGVrKuOQOmtDs6bz/C 2dpd4++Ys80hGN9AnRDJI1SecD07a9ylCBfIFo1sBTczMtsCBj2ustAZzmsipttsyM XQ843j0a0NTGzo8UbUpgmj52aYqQs3VslPeS+TdqgrX50r0eh9pRAmUZPqugRypCtV lhkhifCcFbwd4z5sMvhuV7Bg8e9N8BvIdzjKmtIwPnyuagu+PhRJnK4GEIrY9cR6Bb pBrQCo8YGH1Mg== Received: by mail-oo1-f47.google.com with SMTP id l5so1773259ooj.7 for ; Mon, 15 Feb 2021 11:34:37 -0800 (PST) X-Gm-Message-State: AOAM530wKlD1lyR/n0x9x97g1m8uAD18zdeFe58rJEUK73Zd1cYwdJfe n8fpibHn61t9hHCKojxlSWZ98zElv8T184ERXZE= X-Google-Smtp-Source: ABdhPJzjo6WFdJnn3FxDpmpYoaxAbUqD1J+deOYYEklSiCFb1mYImlUiIvPE7V4IuGPab5HBHMjIjdOe4Xzie48tYlo= X-Received: by 2002:a4a:e0d3:: with SMTP id e19mr7675802oot.45.1613417677178; Mon, 15 Feb 2021 11:34:37 -0800 (PST) MIME-Version: 1.0 References: <20210215192237.362706-1-pasha.tatashin@soleen.com> <20210215192237.362706-2-pasha.tatashin@soleen.com> In-Reply-To: From: Ard Biesheuvel Date: Mon, 15 Feb 2021 20:34:26 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 1/1] arm64: mm: correct the inside linear map boundaries during hotplug check To: Pavel Tatashin X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210215_143439_574661_915E60DE X-CRM114-Status: GOOD ( 13.97 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Anshuman Khandual , Catalin Marinas , James Morris , Linux Kernel Mailing List , Logan Gunthorpe , Tyler Hicks , Linux ARM , Andrew Morton , Will Deacon , Mike Rapoport Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, 15 Feb 2021 at 20:30, Pavel Tatashin wrote: > > > Can't we simply use signed arithmetic here? This expression works fine > > if the quantities are all interpreted as s64 instead of u64 > > I was thinking about that, but I do not like the idea of using sign > arithmetics for physical addresses. Also, I am worried that someone in > the future will unknowingly change it to unsigns or to phys_addr_t. It > is safer to have start explicitly set to 0 in case of wrap. memstart_addr is already a s64 for this exact reason. Btw, the KASLR check is incorrect: memstart_addr could also be negative when running the 52-bit VA kernel on hardware that is only 48-bit VA capable. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel