Also move some overrides from patches to ctx.h to be defined in simulator, reducing the delta to upstream ctx.h