Messages in this thread | | | Date | Wed, 13 May 2015 08:58:03 +0200 | From | Paolo Bonzini <> | Subject | Re: [PATCH 09/13] KVM: x86: save/load state on SMM switch |
| |
On 13/05/2015 01:56, Bandan Das wrote: > I think it's ok just to replace the offset number with a name. > If you are concerned about readability, we could probably wrap the > "for loops" in the math calculations with a more serious sounding macro > eg. "#define foreach_smm_offset(val, start_offset, jump, count)" :)
That doesn't help. The problem is that the for loops assume that you know that the offsets are at a constant distance, plus the distance. This is already not trivial for the registers (is RAX at the highest or lowest offset); but it could even be worse than hardcoded offsets for selectors and descriptor caches.
Paolo
| |