)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"6ecee48e48f23a9d8395ccbe6cf5d871cbef98a8","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"e539ae0f_94c5d9aa","updated":"2025-10-18 07:09:20.000000000","message":"Thanks, I haven\u0027t tested it but it looks a reasonable fix","commit_id":"2dbf6c9ebe514cb09e65379736f4d4f09a29f191"},{"author":{"_account_id":1002450,"name":"Heinrich Schuchardt","email":"xypron.glpk@gmx.de","username":"xypron"},"change_message_id":"5d20ae9eaaac28fc2a43401d6ef67ee65e28eec3","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":3,"id":"929ec038_7a769f9e","updated":"2025-10-18 07:13:28.000000000","message":"The issue with the current implementation is that files with file sizes over 4 GiB will be reported as file size \u003c 4 -GiB on 32bit systems. Thanks for addressing this.\n\nBut unfortunately with your change you are additionally dropping support for file sizes 2 GiB to 4 GiB on 32bit devices. This should be avoided.\n\nThe semihosting specification specifies that the value returned in r0 should be -1 if an error occurs. So on 32 bit systems 0xffffffff should be returned.\n\nAs file sizes cannot be negative there is not reason to assume that the value in r0 has to be interpreted by semihosting clients as signed.\n\nPlease, change your commit to check against 0xffffffff.\n\nIt might make sense to contact ARM to make their specification clearer.","commit_id":"2dbf6c9ebe514cb09e65379736f4d4f09a29f191"},{"author":{"_account_id":1001960,"name":"sean-anderson-seco","email":"sean.anderson@seco.com","username":"sean-anderson-seco"},"change_message_id":"57d5c5bf608e5bf94954e68da3801bdc8f293663","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":3,"id":"ae50fd9a_c3d71fac","in_reply_to":"929ec038_7a769f9e","updated":"2025-10-20 14:22:45.000000000","message":"stat(2) will return -1/EOVERFLOW on 32-bit hosts for files over 2 GiB. I believe we should be consistent.","commit_id":"2dbf6c9ebe514cb09e65379736f4d4f09a29f191"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"beb528ea7a8472eca883dfb426f355743d3e276e","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":3,"id":"8d1ac314_865cd5c8","in_reply_to":"96ae0576_a904a8c3","updated":"2025-10-21 11:44:00.000000000","message":"So, at least newlib implementation of semihosting only handle file size in the range from 0 to (2GiB-1), thus this patch looks correct.\nAny other library out there?","commit_id":"2dbf6c9ebe514cb09e65379736f4d4f09a29f191"},{"author":{"_account_id":1001960,"name":"sean-anderson-seco","email":"sean.anderson@seco.com","username":"sean-anderson-seco"},"change_message_id":"0fe7d4b520b4d1341492c7165b0ddfd2a7e5f055","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":3,"id":"c6bdfe99_72e5a10b","in_reply_to":"96ae0576_a904a8c3","updated":"2025-10-21 14:37:01.000000000","message":"U-Boot currently errors on any negative return value. There has been a proposal to just error on -1, but I think that\u0027s a bit dicey given the disagreements in current implementations.\n\n(xtensa has no implementation because they have a stat semihosting call instead of an FLEN)","commit_id":"2dbf6c9ebe514cb09e65379736f4d4f09a29f191"},{"author":{"_account_id":1001960,"name":"sean-anderson-seco","email":"sean.anderson@seco.com","username":"sean-anderson-seco"},"change_message_id":"b4e956dc9d3df53c75bbd283587f48a2a6148fd2","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":3,"id":"a9836f64_a4be56db","in_reply_to":"9c54b6ac_6d4dc443","updated":"2025-10-20 16:41:27.000000000","message":"32-bit semihosting targets effectively have 32-bit off_t. So comparisons with a 64-bit off_t are not relevant.\n\nAdditionally, transferring large (multi-GiB) files will take multiple hours, so I don\u0027t really see the point of supporting such an exotic use case.","commit_id":"2dbf6c9ebe514cb09e65379736f4d4f09a29f191"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"13ff5169e0845050b26f909c4258fdbeeb8ecadc","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":3,"id":"96ae0576_a904a8c3","in_reply_to":"ae50fd9a_c3d71fac","updated":"2025-10-20 16:52:09.000000000","message":"ARM spec don\u0027t specify such details.\n\nChecking the implementation in newlib/libgloss\nhttps://sourceware.org/git/gitweb.cgi?p\u003dnewlib-cygwin.git\n\nThe macro for FLEN depends on the architecture:\n- aarch64: AngelSVC_Reason_FLen\n- arm:     AngelSWI_Reason_FLen\n- riscv:   SEMIHOST_flen\n- xtensa:  SYS_flen\n\nThe handling in the library:\n- aarch64 result is `int`\n- arm result is `int`\n- riscv result is `int` for `stat()`, but `long` during `lseek()` !\n- xtensa, no implementation. Probably in another repository.","commit_id":"2dbf6c9ebe514cb09e65379736f4d4f09a29f191"},{"author":{"_account_id":1002450,"name":"Heinrich Schuchardt","email":"xypron.glpk@gmx.de","username":"xypron"},"change_message_id":"2aedc988480f6955664eeb1b809e5c0ff00cc379","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":3,"id":"9c54b6ac_6d4dc443","in_reply_to":"ae50fd9a_c3d71fac","updated":"2025-10-20 16:20:00.000000000","message":"Hello Sean,\n\nI don\u0027t know which operating system you are running but on 32-bit Debian Trixie off_t is 64 bit long and file sizes over 4 GiB are correctly supported:\n\n$ cat test.c\n    #include \u003cstdio.h\u003e\n    #include \u003csys/stat.h\u003e\n\n    int main()\n    {\n        struct stat statbuf \u003d {};\n        int ret;\n\n        ret \u003d stat(\"5G\", \u0026statbuf);\n        if (ret) {\n                perror(\"stat\");\n                return 1;\n        }\n        printf(\"sizeof(statbuf.st_size %zu), filesize %lld\\n\",\n               sizeof(statbuf.st_size), statbuf.st_size);\n        return 0;\n    }\n$ ls -la 5G\n-rw-rw-r-- 1 zfsdt zfsdt 5368709120 20. Okt 18:13 5G\n$ ./test\nsizeof(statbuf.st_size 8), filesize 5368709120\n\nAnd as you want to be consistent, don\u0027t drop support for 2 GiB to 4 GiB size files.\n\nBest regards\n\nHeinrich","commit_id":"2dbf6c9ebe514cb09e65379736f4d4f09a29f191"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"fbd9d1fe14dbb1346a6e1e60d4806687f5e348ed","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":3,"id":"ed3d0ca4_d64130cb","in_reply_to":"c6bdfe99_72e5a10b","updated":"2025-10-21 15:06:08.000000000","message":"Didn\u0027t know about U-Boot support for semihosting. Interesting.\nIn `common/spl/spl_semihosting.c` the returned value is assigned to an `int`. If it is between 2GiB and 4GiB it will be interpreted as error.\nThe other use cases use `long`, that can be 32 or 64 bits, depending on the CPU.\nI start thinking that we need an OpenOCD command to specify the support for FILE_OFFSET64 by semihosting FLEN.\nI added more reviewers for this change.","commit_id":"2dbf6c9ebe514cb09e65379736f4d4f09a29f191"},{"author":{"_account_id":1000202,"name":"Tom Rini","email":"trini@konsulko.com","username":"trini"},"change_message_id":"26ae7763004389abf638b379a17c4af3a080a279","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":3,"id":"a0d424d9_173ec3a8","in_reply_to":"ed3d0ca4_d64130cb","updated":"2025-10-24 18:42:38.000000000","message":"Just noting that on the U-Boot side my position is that we need to get all of the projects aware of the discrepancies between each-other and figure out next steps. This is (part of) Sean\u0027s motivation and there\u0027s a QEMU thread at https://lore.kernel.org/qemu-devel/20251017213529.998267-1-sean.anderson@linux.dev/ as well.","commit_id":"2dbf6c9ebe514cb09e65379736f4d4f09a29f191"}]}
