Storage of texture and framebuffer attachement

Texture Data: When we call glTexImage() it uploads data on GPU, in which memory (EDRAM or shared memory for Streamline processors) this data is stored? When we call glGenerateMipmap() does it create mipmap levels in GPU memory or CPU creats levels and uploads them on GPU? While sampling all texture data is sampled in Texture filering unit in GPU, right? All these units are shared between all the streamline processors or each processor has one separate?

Framebuffer data: Where are attachments of FBO are stored? Are they stored in main memory from EDRAM?

While doing all fragment tests, where is this data compared from, is it from main memory? or is that the data is cached into EDRAM?