On the regularity of abstract Cauchy problems and boundary value problems