Patents and Code Reviews

Tuesday, January 15, 2019

A question from MST on my idea. Looked up some existing patents, and tried to see what the status was for the original patch. It's not been accepted yet, still applies cleanly on master. I noticed today that the method to find the first non-zero bit is not as inefficient as I initially thought, it's actually using the GCC builtin for counting. I wonder if GCC is smart enough to optimize away the loop when the function is called with a size of 1 word.

Ah, after reading the code more, the problem is that the function is not using the find_first_bit function but the much less efficient find_next_zero_bit function.

Spent a bit more time exploring the SEV-handling code in the Linux kernel, notably to understand the usage of /dev/sev and what permissions it should get. A DuckDuckGo search led me to SEVered, which is a way to defeat SEV using a malicious hypervisor. At first sight, this does not seem to impact RHEL8 unless you find a way to get KVM to become malicious in the right way (which if I understand correctly requires to control memory mappings, no less).