  We present an updated version of the HMcode augmented halo model that can be
used to make accurate predictions of the non-linear matter power spectrum over
a wide range of cosmologies. Major improvements include modelling of BAO
damping in the power spectrum and an updated treatment of massive neutrinos. We
fit our model to simulated power spectra and show that we can match the results
with an RMS error of 2.5 per cent across a range of cosmologies, scales $k <
10\,h\mathrm{Mpc}^{-1}$, and redshifts $z<2$. The error rarely exceeds 5 per
cent and never exceeds 16 per cent. The worst-case errors occur at $z\simeq2$,
or for cosmologies with unusual dark-energy equations of state. This represents
a significant improvement over previous versions of HMcode, and over other
popular fitting functions, particularly for massive-neutrino cosmologies with
high neutrino mass. We also present a simple halo model that can be used to
model the impact of baryonic feedback on the power spectrum. This six-parameter
physical model includes gas expulsion by AGN feedback and encapsulates star
formation. By comparing this model to data from hydrodynamical simulations we
demonstrate that the power spectrum response to feedback is matched at the $<1$
per cent level for $z<1$ and $k<20\,h\mathrm{Mpc}^{-1}$. We also present a
single-parameter variant of this model, parametrized in terms of feedback
strength, which is only slightly less accurate. We make code available for our
non-linear and baryon models at https://github.com/alexander-mead/HMcode and it
is also available within CAMB and soon within CLASS.
