Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3510220pxj; Tue, 15 Jun 2021 02:30:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyYEj6+Z9uNiY/3Mmo0l3TCzKc4vmS+gINyNbRiXDbWU0e+sX4RJvqrwDeXnWgbPSief7r3 X-Received: by 2002:a17:907:d92:: with SMTP id go18mr20367166ejc.317.1623749408399; Tue, 15 Jun 2021 02:30:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623749408; cv=none; d=google.com; s=arc-20160816; b=0SHglaA4qdzLox9wra++vA+ITcyJpuzAdD0rNONoY7+x2KSkeVMvPm2m6rseB6KLSQ O64ph4f+hNG3B3EfKwyqOaKAsQnYC1q/2EJgdONYBVU+nwDWkKywhoTpibZKDabnrGpr Eld3lrbtUswyK5Flxhm67zNWKvgOqEOm1WEXmiIGb0+orgVbbr3X0GtKKWRyxeAudLGI CdmnXatUjLRA1J6L6XSleBeIRSbj5EOER+S7gwMAb7NQkB322NSWCtVFRbBLmGKRuaKM BqVABwjz7Mtavy4yejjEjOeVfKdsZncve4mGdx9S6OC3sfxPpyi3LG2d8VsiKWkVutmS JR2g== 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=NfP0O9xqxAK4b0kkHjQ16XJ4NZNrc5SZulHjGNpuqAw=; b=VCZZDtjH/IVuPdDR7hrka4+t7Ax/pMl97MeVb4L32fUklyrTzWZMcCpOiVoxejlnZf C5HGEnRWCG5qe4NV3uye/hmVE8GlVgnZp3/p30okDahEcdePygpSTjIeMfUKwW+PbWb0 ifxq+rziUwJa5yF7vbVWvT8ZH+9Dx/T+0WZt1wMbiMU1Ve7aXYSXXyNdwY3pap7o3daX HFJIc5E0nqRSBTdrNsNT4KIxOfut0eGPRLe4R1uopqVf1daukQMUg6FPq3NkkhNQXRW3 kep31qF3NeaSvODV/rzjAzZ0VfBIMUzYOJqFHtVkD6k5NSJw+z9c49cTY49d7x90HLC/ /TuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=a3KhUZlH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c16si3235523ejj.702.2021.06.15.02.29.45; Tue, 15 Jun 2021 02:30:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=a3KhUZlH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231309AbhFOJap (ORCPT + 99 others); Tue, 15 Jun 2021 05:30:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:53974 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230242AbhFOJao (ORCPT ); Tue, 15 Jun 2021 05:30:44 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id BE92261433; Tue, 15 Jun 2021 09:28:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1623749320; bh=j5S6FfkLlDjYfSjyx+hqYrqgXmhxauWUu0zvHyqD00k=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=a3KhUZlHloUuEb42snthxC1h+pJDOlnHi4MWxz/lgwZ17fOZVYJQHYIxl/roiHKnx i1HWHDotfuPDtd2w7T0yAaaMFKUH89b3Z/e6rXVJ441KfI+GHtCmljbYFhO+YRfOwX r+NOcgcG1vXMCYCJ6KZrCUKvSY6IcM2EmBXWUtKCGl/TRYnWZ9ta83SdB1hzOeE+GT uHmwgfh4kYvx5DdAA/YmGp0VSzsLQL7SGmG1UKVHbnOgLox7m/4/4eSH0AZ9tBQPRz 7MjjryBFnUdzRNu7dQoUgvHjb5fziEH/oG1u0MjVBINp2njjb09eVJOmCQ5D8bAipA q8aXQxOuXGrWw== Received: by mail-lf1-f49.google.com with SMTP id x24so20285907lfr.10; Tue, 15 Jun 2021 02:28:40 -0700 (PDT) X-Gm-Message-State: AOAM530sw9Q7BPkydwFrLbYZDalstZ1QxGhJVRZ5G0fo4kyQ3M2Ad8dI GAjn2CvO4Pj2g1j6/2LZzwtVS40Tarlngi/+ev4= X-Received: by 2002:a05:6512:3d13:: with SMTP id d19mr14982734lfv.41.1623749319009; Tue, 15 Jun 2021 02:28:39 -0700 (PDT) MIME-Version: 1.0 References: <1623693067-53886-1-git-send-email-guoren@kernel.org> <1623693067-53886-3-git-send-email-guoren@kernel.org> In-Reply-To: From: Guo Ren Date: Tue, 15 Jun 2021 17:28:27 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH v3 2/2] riscv: pgtable: Add "PBMT" extension supported To: Anup Patel Cc: Anup Patel , Palmer Dabbelt , Arnd Bergmann , Chen-Yu Tsai , Maxime Ripard , Drew Fustini , liush , =?UTF-8?B?V2VpIFd1ICjlkLTkvJ8p?= , wefu@redhat.com, linux-riscv , "linux-kernel@vger.kernel.org List" , linux-arch , linux-sunxi@lists.linux.dev, Guo Ren , Christoph Hellwig , Daniel Lustig , Greg Favor , Andrea Mondelli , Jonathan Behrens , Xinhaoqu , Bill Huffman , Nick Kossifidis , Allen Baum , Josh Scheid , Richard Trauben Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 15, 2021 at 12:11 PM Anup Patel wrote: > > On Mon, Jun 14, 2021 at 11:22 PM wrote: > > > > From: Guo Ren > > > > "PBMT" - Page-Based Memory Types (see Link for detail), current it > > has defined 3 memory types [62:61] in PTE: > > - WB 00 "Cacheable 'main memory'" > > - NC 01 "Noncacheable 'main memory'" > > - IO 11 "Non-cacheable non-idempotent 'I/O'" > > > > The patch not only implements the current PBMT extension but also > > considers future scalability. It uses 3 words of image header to > > store 8 memory types' values plus a mask value. That means there > > are still 5 memory types reserved for future scalability. > > This is the worst work-around to the Linux RISC-V patch acceptance > policy. > > Passing PTE attributes in the Linux Image header means boot-loaders > will have to update the image header before jumping to Linux kernel. > Basically, this is changing the Linux boot-process by adding platform > specific image header updation step. > > Further, this patch is doing too many things in one-go. I needs to be > broken down into smaller fine-grained patches. Next time, I'll separate it into below patches: - riscv: pgtable: Fixup _PAGE_CHG_MASK usage - riscv: pgtable: Add "PBMT" extension supported - riscv: pgtable: Add vendor custom "PBMT" definitions interface How? > > I totally disapprove of this patch in it's current shape since the > Linux boot-protocol should not have any platform specific part. I think you mean we shouldn't modify the uImage header. How about parsing dtb before setup_vm (It's a very early stage before mmu enabled)? eg: cpus { ... rv64-pbmt-extension; rv64-pbmt-custom-remapping = <[mask] [type0] [type1] [type2]>; > > Also, please don't CC RVI mailing list for Linux patches because > the people can post to RVI mailing list only by joining it. Okay, I'll remove the RVI mailing list. If I needed to, I would send a notification email to RVI separately. -- Best Regards Guo Ren ML: https://lore.kernel.org/linux-csky/