First-principle calculations on gate/dielectric interfaces: on the origin of work function shifts