my two cents....
From PVG - HKG, the delay is unpredictable due to Air Force restriction but with a three hours layover, you should be OK. KA tends to be more on-time than others. Don't bet your life on that thought.
Based on my pass flight from China to HKG, KA usually use Gate 15 - 19 & Gate 500-ish... BTW, I don't fly to China for Business that often. And yes you need to go thought security check from Arrival to Departure(No immigration, just identification check). For your case you should be using E1(Closing to KA arrival gate) to do your transfer from Arrival to Departure level. These should not take more than 30 mins
From departure level, it's just a short stroll to Gate 1-4(5 mins?). HKG -SFO flights are 95% departing from Gate 3 or 4. And please note that there's a secondary security check(hand search for liquid, etc.) before boarding(that's for ALL flight departing for US)