[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v1] xen/riscv: Increase XEN_VIRT_SIZE
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
- Date: Fri, 4 Apr 2025 09:31:43 +0200
- Cc: Alistair Francis <alistair.francis@xxxxxxx>, Bob Eshleman <bobbyeshleman@xxxxxxxxx>, Connor Davis <connojdavis@xxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Julien Grall <julien@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
- Delivery-date: Fri, 04 Apr 2025 07:31:54 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 4/4/25 8:56 AM, Jan Beulich wrote:
On 03.04.2025 18:20, Oleksii Kurochko wrote:
On 4/1/25 6:04 PM, Jan Beulich wrote:
On 01.04.2025 17:58, Oleksii Kurochko wrote:
On 3/31/25 6:14 PM, Jan Beulich wrote:
On 31.03.2025 17:20, Oleksii Kurochko wrote:
+ _AC(XEN_VIRT_START, UL) >> vpn1_shift;
+ const unsigned long xen_virt_end_vpn =
+ xen_virt_starn_vpn + ((XEN_VIRT_SIZE >> vpn1_shift) - 1);
+
if ((va >= DIRECTMAP_VIRT_START) &&
(va <= DIRECTMAP_VIRT_END))
return directmapoff_to_maddr(va - directmap_virt_start);
- BUILD_BUG_ON(XEN_VIRT_SIZE != MB(2));
- ASSERT((va >> (PAGETABLE_ORDER + PAGE_SHIFT)) ==
- (_AC(XEN_VIRT_START, UL) >> (PAGETABLE_ORDER + PAGE_SHIFT)));
+ BUILD_BUG_ON(XEN_VIRT_SIZE != MB(8));
Is it necessary to be != ? Won't > suffice?
It could be just > MB(2). Or perphaps >=.
= would make the build fail, wouldn't it?
I just realized that BUILD_BUG_ON() condition is compared to zero so actually everything what
will make the condition true will cause a build fail as inside it used !(condition).
???
BUILD_BUG_ON() forces a compilation error if the given condition is true. Therefore, if the condition
XEN_VIRT_SIZE != MB(2) is changed to XEN_VIRT_SIZE > MB(2), the condition will always evaluate to true
(assuming XEN_VIRT_SIZE is greater than 2 MB), which will result in a compilation error.
~ Oleksii
So it seems like we have to check for XEN_VIRT_SIZE != MB(16) and change each time when XEN_VIRT_SIZE
is increased.
I don't think so, but I need to first understand the point you make above.
|