HKG - PVG is prone to delays because of airspace restrictions, so I would plan in at least a five hour layover considering all the other hassles. Preferably stay overnight and get a transit/single entry visa for China.
PVG is generally not a convenient airport for transfers at all.