Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1826764ybl; Sun, 18 Aug 2019 11:20:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqzK/kA4o5dXBnIPQO6Q1hBz4rA03iw+IbyBB1kVeXuwCoN5qbgSXNkGqbxi1r2id6dl4WKP X-Received: by 2002:a17:902:b202:: with SMTP id t2mr19378327plr.303.1566152429677; Sun, 18 Aug 2019 11:20:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566152429; cv=none; d=google.com; s=arc-20160816; b=OE93IbN0ydR+S1CAF+4sbBBYt2or3o4X424uAPCTJHqkRAhrswjl2Q1FVx9QkdUUvN eZGsuyGfpmWgUgNeDDsiA5hl6XGSvIyUtIz9qNegPzkl30Fm/HtAnruzeAmfCGvuFs2j tMRTK+qYC6mTj+PVyRo3LIe2HANKWk818aYR6fBLopn8JfPcgifLFlndMcO7HUzAcbOi QsDokYcBupWVUVId5j8MORBed8389B0cs3lMQL+EtOQM9ChZUJ1SehOJvIZjesfsKfgs 6Ztw4tN0B+stFntAK/1ibKgQEey14XfX1PbWDzbQD0vpL3Flz3NWT1cfr7KUgfVCuzUX 8RWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=UZxwsS+sToCSVH9D1qHD3g7wQSdFK43iName/Mf/0gQ=; b=f//gVprkyD1SlAX3y9KLu6diCKdOCTHaQBt/HqP+SayWOc1UgswuuLi6jySIbcknQp kyW44B2bbBkDwbNAnsflJnxZWuH/IwUiXKZaWqUi6JwhWPjn0E667xXydfMs4wh6BbkJ wJzEDHrjnO1UTpz/nvwHgnkDzAWBxpWa3J0sD0y5iTBQ+AmbN0GIl5+eH0BLLrGgeRR5 9siGmVzl2+7q9WM8u6o6gzHNLCHHrkDBAsapuuhHn4Au9FyqNosH1MIgEdUYo6zTNlOY 38Pxa7G0Qw8lP5BTlTRjKmPe86LxLWzTuXe3HZ39iQVGUf9IBFNizK29svyJw5FrHSwZ anIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=UNGECtfw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h13si5007096plr.12.2019.08.18.11.20.15; Sun, 18 Aug 2019 11:20:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=UNGECtfw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727019AbfHRSTQ (ORCPT + 99 others); Sun, 18 Aug 2019 14:19:16 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:52464 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726089AbfHRSTP (ORCPT ); Sun, 18 Aug 2019 14:19:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=UZxwsS+sToCSVH9D1qHD3g7wQSdFK43iName/Mf/0gQ=; b=UNGECtfwZ/M/wg7BohzTIdWDx ys7a7IjrLjwX75/mJaxwDNI3TZn73eiazi4SiwlEHPJTgOM/+yGAP6BsvkYtqNhpmY3sq3XzpNLqP L+HTZJid+x79jiiH11kQPO1yLC8X2DPUDOGsXl+OiZZH3+7wfSjEgX5BkADe/q1tQCt6Jd+dtP5qi l8mTLYEnPAhhDlMxXo5huGn7JAoWcVogDlNNypLi5RHpe1S4hmFPbXJF5pnoEKc652NspXA3XCOjB hyV1SI4Oyp63a1aHa3guXn9nH7VfpQ6wwnKXYcB7zroyvwZlnacvkK6infzRCfEF16Z1do9bt1I5V qlXnAM2mQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.92 #3 (Red Hat Linux)) id 1hzPlq-0006mQ-4u; Sun, 18 Aug 2019 18:19:14 +0000 Date: Sun, 18 Aug 2019 11:19:14 -0700 From: Christoph Hellwig To: Anup Patel Cc: Palmer Dabbelt , Paul Walmsley , Anup Patel , "linux-kernel@vger.kernel.org" , Christoph Hellwig , Atish Patra , Alistair Francis , "linux-riscv@lists.infradead.org" Subject: Re: [PATCH] RISC-V: Fix FIXMAP area corruption on RV32 systems Message-ID: <20190818181914.GB20217@infradead.org> References: <20190816114915.4648-1-anup.patel@wdc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190816114915.4648-1-anup.patel@wdc.com> User-Agent: Mutt/1.11.4 (2019-03-13) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > +#define FIXADDR_TOP (VMALLOC_START) Nit: no need for the braces, the definitions below don't use it either. > +#ifdef CONFIG_64BIT > +#define FIXADDR_SIZE PMD_SIZE > +#else > +#define FIXADDR_SIZE PGDIR_SIZE > +#endif > +#define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE) > + > /* > - * Task size is 0x4000000000 for RV64 or 0xb800000 for RV32. > + * Task size is 0x4000000000 for RV64 or 0x9fc00000 for RV32. > * Note that PGDIR_SIZE must evenly divide TASK_SIZE. > */ > #ifdef CONFIG_64BIT > #define TASK_SIZE (PGDIR_SIZE * PTRS_PER_PGD / 2) > #else > -#define TASK_SIZE VMALLOC_START > +#define TASK_SIZE FIXADDR_START > #endif Mentioning the addresses is a little weird. IMHO this would be a much nicer place to explain the high-level memory layout, including maybe a little ASCII art. Also we could have one #ifdef CONFIG_64BIT for both related values. Last but not least instead of saying that something should be dividable it would be nice to have a BUILD_BUG_ON to enforce it. Either way we are late in the cycle, so I guess this is ok for now: Reviewed-by: Christoph Hellwig But I'd love to see this area improved a little further as it is full of mine fields.