* [PATCH pve-cluster] pmxcfs: check_memdb: accept the big-endian index checksum @ 2026-11-18 9:07 Yvan Janssens 2026-11-18 9:22 ` Dominik Csapak 0 siblings, 1 reply; 3+ messages in thread From: Yvan Janssens @ 2026-11-18 9:07 UTC (permalink / raw) To: pve-devel The memdb index and its per-entry digests are built from host-endian integers, so the checksum hard-coded in test_indextest1 only matches on little-endian hosts, and the test fails on every big-endian one (for example s390x and big-endian ppc64). Add the big-endian checksum. On s390x, converting all integers to little-endian before hashing reproduces the existing checksum, so both values describe the same index. As the index has only fixed-width fields, the big-endian value holds for any big-endian host. Signed-off-by: Yvan Janssens <yvanj@cyber.gent> --- src/pmxcfs/check_memdb.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/pmxcfs/check_memdb.c b/src/pmxcfs/check_memdb.c index 74728df..616ae61 100644 --- a/src/pmxcfs/check_memdb.c +++ b/src/pmxcfs/check_memdb.c @@ -270,10 +270,13 @@ START_TEST(test_indextest1) { ck_assert(sha256 != NULL); g_checksum_update(sha256, (unsigned char *)idx, idx->bytes); const char *csum = g_checksum_get_string(sha256); - ck_assert_msg( - strcmp(csum, "913fd95015af9d93f10dd51ba2a7bb11351bcfe040be21e95fcba834adc3ec10") == 0, - "wrong idx checksum %s", csum - ); + /* the index and its per-entry digests are built from host-endian integers */ +#if G_BYTE_ORDER == G_BIG_ENDIAN + const char *expected = "efdfcdde67acb6b48e4b415a172d5a1897c725b03a9b2c12d20efe0ab8adad44"; +#else + const char *expected = "913fd95015af9d93f10dd51ba2a7bb11351bcfe040be21e95fcba834adc3ec10"; +#endif + ck_assert_msg(strcmp(csum, expected) == 0, "wrong idx checksum %s", csum); g_free(idx); g_free(testdata); } -- 2.54.0 (Apple Git-157) ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH pve-cluster] pmxcfs: check_memdb: accept the big-endian index checksum 2026-11-18 9:07 [PATCH pve-cluster] pmxcfs: check_memdb: accept the big-endian index checksum Yvan Janssens @ 2026-11-18 9:22 ` Dominik Csapak 2026-11-18 9:29 ` Yvan Janssens 0 siblings, 1 reply; 3+ messages in thread From: Dominik Csapak @ 2026-11-18 9:22 UTC (permalink / raw) To: Yvan Janssens, pve-devel; +Cc: Thomas Lamprecht Hi, just wanted to ask: Is there a specific use case you have to port pve on s390x ? I don't think we want to support s390x currently so adding s390x specific code won't probably come in soon (please correct me if i'm wrong @thomas) I guess changes such as these *could* be integrated since they're not special for s390x, but I don't think there are many big-endian systems left... In any case, did you see our developer docs: https://pve.proxmox.com/wiki/Developer_Documentation especially the part about the signed CLA (since i didn't found any patches prior to this on our mailing list) On 11/18/26 10:07 AM, Yvan Janssens wrote: > The memdb index and its per-entry digests are built from host-endian > integers, so the checksum hard-coded in test_indextest1 only matches on > little-endian hosts, and the test fails on every big-endian one (for > example s390x and big-endian ppc64). > > Add the big-endian checksum. On s390x, converting all integers to > little-endian before hashing reproduces the existing checksum, so both > values describe the same index. As the index has only fixed-width > fields, the big-endian value holds for any big-endian host. > > Signed-off-by: Yvan Janssens <yvanj@cyber.gent> > --- > src/pmxcfs/check_memdb.c | 11 +++++++---- > 1 file changed, 7 insertions(+), 4 deletions(-) > > diff --git a/src/pmxcfs/check_memdb.c b/src/pmxcfs/check_memdb.c > index 74728df..616ae61 100644 > --- a/src/pmxcfs/check_memdb.c > +++ b/src/pmxcfs/check_memdb.c > @@ -270,10 +270,13 @@ START_TEST(test_indextest1) { > ck_assert(sha256 != NULL); > g_checksum_update(sha256, (unsigned char *)idx, idx->bytes); > const char *csum = g_checksum_get_string(sha256); > - ck_assert_msg( > - strcmp(csum, "913fd95015af9d93f10dd51ba2a7bb11351bcfe040be21e95fcba834adc3ec10") == 0, > - "wrong idx checksum %s", csum > - ); > + /* the index and its per-entry digests are built from host-endian integers */ > +#if G_BYTE_ORDER == G_BIG_ENDIAN > + const char *expected = "efdfcdde67acb6b48e4b415a172d5a1897c725b03a9b2c12d20efe0ab8adad44"; > +#else > + const char *expected = "913fd95015af9d93f10dd51ba2a7bb11351bcfe040be21e95fcba834adc3ec10"; > +#endif > + ck_assert_msg(strcmp(csum, expected) == 0, "wrong idx checksum %s", csum); > g_free(idx); > g_free(testdata); > } ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH pve-cluster] pmxcfs: check_memdb: accept the big-endian index checksum 2026-11-18 9:22 ` Dominik Csapak @ 2026-11-18 9:29 ` Yvan Janssens 0 siblings, 0 replies; 3+ messages in thread From: Yvan Janssens @ 2026-11-18 9:29 UTC (permalink / raw) To: Dominik Csapak, pve-devel@lists.proxmox.com; +Cc: Thomas Lamprecht Hi Dominik, A CLA should be in place. Re: use case, I’m trying to bring up Proxmox on s390x here for myself. For each change, I’m trying to make a judgement call to see if they would benefit others - submitting the patches for the FICON, OSA Express networking and zIPL bootloader will probably not make sense and add additional bloat for you to maintain, but eg endianness bugs and /proc/cpuinfo patching did sound useful. The current state here is that LXD containers work, and that Linux under KVM also works. Support for z/OS, z/VM, and VSEn would need more work because that would require managing CKD volumes as opposed to flat disk images for storage. /y ________________________________ From: Dominik Csapak <d.csapak@proxmox.com> Date: Wednesday, 18 November 2026 at 10:22 To: Yvan Janssens <yvanj@cyber.gent>; pve-devel@lists.proxmox.com <pve-devel@lists.proxmox.com> Cc: Thomas Lamprecht <t.lamprecht@proxmox.com> Subject: Re: [PATCH pve-cluster] pmxcfs: check_memdb: accept the big-endian index checksum Hi, just wanted to ask: Is there a specific use case you have to port pve on s390x ? I don't think we want to support s390x currently so adding s390x specific code won't probably come in soon (please correct me if i'm wrong @thomas) I guess changes such as these *could* be integrated since they're not special for s390x, but I don't think there are many big-endian systems left... In any case, did you see our developer docs: https://pve.proxmox.com/wiki/Developer_Documentation especially the part about the signed CLA (since i didn't found any patches prior to this on our mailing list) On 11/18/26 10:07 AM, Yvan Janssens wrote: > The memdb index and its per-entry digests are built from host-endian > integers, so the checksum hard-coded in test_indextest1 only matches on > little-endian hosts, and the test fails on every big-endian one (for > example s390x and big-endian ppc64). > > Add the big-endian checksum. On s390x, converting all integers to > little-endian before hashing reproduces the existing checksum, so both > values describe the same index. As the index has only fixed-width > fields, the big-endian value holds for any big-endian host. > > Signed-off-by: Yvan Janssens <yvanj@cyber.gent> > --- > src/pmxcfs/check_memdb.c | 11 +++++++---- > 1 file changed, 7 insertions(+), 4 deletions(-) > > diff --git a/src/pmxcfs/check_memdb.c b/src/pmxcfs/check_memdb.c > index 74728df..616ae61 100644 > --- a/src/pmxcfs/check_memdb.c > +++ b/src/pmxcfs/check_memdb.c > @@ -270,10 +270,13 @@ START_TEST(test_indextest1) { > ck_assert(sha256 != NULL); > g_checksum_update(sha256, (unsigned char *)idx, idx->bytes); > const char *csum = g_checksum_get_string(sha256); > - ck_assert_msg( > - strcmp(csum, "913fd95015af9d93f10dd51ba2a7bb11351bcfe040be21e95fcba834adc3ec10") == 0, > - "wrong idx checksum %s", csum > - ); > + /* the index and its per-entry digests are built from host-endian integers */ > +#if G_BYTE_ORDER == G_BIG_ENDIAN > + const char *expected = "efdfcdde67acb6b48e4b415a172d5a1897c725b03a9b2c12d20efe0ab8adad44"; > +#else > + const char *expected = "913fd95015af9d93f10dd51ba2a7bb11351bcfe040be21e95fcba834adc3ec10"; > +#endif > + ck_assert_msg(strcmp(csum, expected) == 0, "wrong idx checksum %s", csum); > g_free(idx); > g_free(testdata); > } ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-11-18 9:29 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-11-18 9:07 [PATCH pve-cluster] pmxcfs: check_memdb: accept the big-endian index checksum Yvan Janssens 2026-11-18 9:22 ` Dominik Csapak 2026-11-18 9:29 ` Yvan Janssens
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox