All of lore.kernel.org
 help / color / mirror / Atom feed
From: Todd Poynor <toddpoynor@gmail.com>
To: Rob Springer <rspringer@google.com>,
	Ben Chan <benchan@chromium.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
	Nick Ewalt <nicholasewalt@google.com>,
	Todd Poynor <toddpoynor@google.com>
Subject: [PATCH 11/11] staging: gasket: Update device virtual address comment
Date: Sun, 14 Oct 2018 21:59:27 -0700	[thread overview]
Message-ID: <20181015045927.156790-12-toddpoynor@gmail.com> (raw)
In-Reply-To: <20181015045927.156790-1-toddpoynor@gmail.com>

From: Nick Ewalt <nicholasewalt@google.com>

Add that number of page table entries and extended address bit offset
are configurable. Update example virtual address format to be more
consistent with typical usage.

Signed-off-by: Nick Ewalt <nicholasewalt@google.com>
Signed-off-by: Todd Poynor <toddpoynor@google.com>
---
 drivers/staging/gasket/gasket_page_table.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/gasket/gasket_page_table.c b/drivers/staging/gasket/gasket_page_table.c
index c2fbab74194f8..5b398b7ba81d3 100644
--- a/drivers/staging/gasket/gasket_page_table.c
+++ b/drivers/staging/gasket/gasket_page_table.c
@@ -10,10 +10,18 @@
  *
  * This file assumes 4kB pages throughout; can be factored out when necessary.
  *
- * Address format is as follows:
+ * There is a configurable number of page table entries, as well as a
+ * configurable bit index for the extended address flag. Both of these are
+ * specified in gasket_page_table_init through the page_table_config parameter.
+ *
+ * The following example assumes:
+ *   page_table_config->total_entries = 8192
+ *   page_table_config->extended_bit = 63
+ *
+ * Address format:
  * Simple addresses - those whose containing pages are directly placed in the
  * device's address translation registers - are laid out as:
- * [ 63 - 40: Unused | 39 - 28: 0 | 27 - 12: page index | 11 - 0: page offset ]
+ * [ 63 - 25: 0 | 24 - 12: page index | 11 - 0: page offset ]
  * page index:  The index of the containing page in the device's address
  *              translation registers.
  * page offset: The index of the address into the containing page.
@@ -21,7 +29,7 @@
  * Extended address - those whose containing pages are contained in a second-
  * level page table whose address is present in the device's address translation
  * registers - are laid out as:
- * [ 63 - 40: Unused | 39: flag | 38 - 37: 0 | 36 - 21: dev/level 0 index |
+ * [ 63: flag | 62 - 34: 0 | 33 - 21: dev/level 0 index |
  *   20 - 12: host/level 1 index | 11 - 0: page offset ]
  * flag:        Marker indicating that this is an extended address. Always 1.
  * dev index:   The index of the first-level page in the device's extended
-- 
2.19.0.605.g01d371f741-goog


  parent reply	other threads:[~2018-10-15  5:00 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-15  4:59 [PATCH 00/11] staging: gasket: fixes Todd Poynor
2018-10-15  4:59 ` [PATCH 01/11] staging: gasket: core: debug log updates Todd Poynor
2018-10-15  7:34   ` Greg Kroah-Hartman
2018-10-15 20:33     ` Todd Poynor
2018-10-15  4:59 ` [PATCH 02/11] staging: gasket: page table: return valid error code on map fail Todd Poynor
2018-10-15  4:59 ` [PATCH 03/11] staging: gasket: page table: remove dead code in coherent mem alloc Todd Poynor
2018-10-15  4:59 ` [PATCH 04/11] staging: gasket: page_table: remove unnecessary PTE status set to free Todd Poynor
2018-10-15  4:59 ` [PATCH 05/11] staging: gasket: page_table: rearrange gasket_page_table_entry Todd Poynor
2018-10-15  7:37   ` Greg Kroah-Hartman
2018-10-15  4:59 ` [PATCH 06/11] staging: gasket: page table: fixup error path allocating coherent mem Todd Poynor
2018-10-15  4:59 ` [PATCH 07/11] staging: gasket: page_table: fix comment in components_to_dev_address Todd Poynor
2018-10-15  4:59 ` [PATCH 08/11] staging: gasket: page_table: simplify gasket_components_to_dev_address Todd Poynor
2018-10-15  4:59 ` [PATCH 09/11] staging: gasket: apex: fix sysfs_show Todd Poynor
2018-10-15  4:59 ` [PATCH 10/11] staging: gasket: sysfs: fix attribute release comment Todd Poynor
2018-10-15  4:59 ` Todd Poynor [this message]
2018-10-15  7:33 ` [PATCH 00/11] staging: gasket: fixes Greg Kroah-Hartman
2018-10-15 10:19   ` Todd Poynor
2018-10-15 10:29 ` Christoph Hellwig
2018-10-15 10:35   ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181015045927.156790-12-toddpoynor@gmail.com \
    --to=toddpoynor@gmail.com \
    --cc=benchan@chromium.org \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nicholasewalt@google.com \
    --cc=rspringer@google.com \
    --cc=toddpoynor@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.