Understanding and Enhancing Performance and Microarchitecture Security in Modern and Emerging Computer Systems