On 13/09/2023 14:53, Tudor Cretu wrote:
Hi Kofi,
Great start! Make the commit title to contain the morello tag as well, similar to the previous commits. Instead of "Begin translating" maybe just "translate"? Also, don't need the full stop:
arm64: morello: Translate helpers from asm to C
On 12-09-2023 17:41, Kofi Wilkinson wrote:
From: Kofi Wilkinson kofwil01@e129687.arm.com
I wonder how this "From: ..." ended up here. Anyway, no need for it, just remove it.
I suspect that is because sendemail.from was not configured (git config --global sendemail.from "...").
[...]
+ return (perms >> MORELLO_CAP_PERM_EXECUTIVE_BIT) & 1;
nit: I would rewrite this as just: return perms & MORELLO_CAP_PERM_EXECUTIVE_MASK;
Worth mentioning that this is exactly equivalent (though indeed more idiomatic) because assigning any non-zero value to a bool (i.e. the fundamental C99 type _Bool) results in a value of 1.
+}
void __morello_thread_init_user(struct task_struct *tsk, uintcap_t ddc); +void *morello_capcpy(void *dst, const void *src, size_t len) +{ + void *original_dst = dst; + uintcap_t *cdst = (uintcap_t *) dst; + uintcap_t *csrc = (uintcap_t *) src; > + + while (len > 0) { + *cdst = *csrc; + csrc++; + cdst++; + len -= 16; + } + return original_dst; +}
There is only one instance where this helper is used and in that instance you could just replace it with memcpy(dst, src, len). memcpy() preserves the tags as well. If you also agree that we can get rid of this helper, don't forget to also remove its prototype from "arch/arm64/include/asm/morello.h".
This is patch 1 in my "morello.h / cheri.h cleanups" series, which is now merged.
Kevin