I don't think the context switch support is really needed. It's only needed for saving/restoring LBRs, and we only do that with LBR callstacks. In any other LBR mode that LBRs are only flushed on context switch But LBR callstacks will never put kernel addresses into the LBRs because they are forced to set a ring 3 filter. So you can't have kernel addresses in the LBR when saving/restoring them (unless I missed some case)
Dropping that will likely simplify the patch somewhat. -Andi