[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [RFC PATCH v3 08/10] arm/mem_access: Add long-descriptor based gpt





On 19/06/17 16:43, Sergej Proskurin wrote:
Hi Julien,

[...]

On 06/19/2017 02:45 PM, Julien Grall wrote:
Hi Sergej,

+/* Normalized page granule size indices. */
+#define GRANULE_SIZE_INDEX_4K               (0)
+#define GRANULE_SIZE_INDEX_16K              (1)
+#define GRANULE_SIZE_INDEX_64K              (2)

Why this is exported? You only use them internally.


In v2 you pointed out that it is hard to read hardcoded values. I would
gladly change these changes back as I agree on this point: I also don't
like having exported indices, as well. Or would you like to see these
defines (and the TTBRx_VALID values beyond) directly within the
guest_walk.c?

The latter please + probably using enum rather than define to make them safe. But...


+
+/* Represent whether TTBR0 or TTBR1 is valid. */
+#define TTBR0_VALID                         (0)
+#define TTBR1_VALID                         (1)

look at that again. You are using bool as the type. So they should be true/false. Or if it is an index, they type should be int. Though, the enum would make it clearer.

Cheers,

--
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.