  We use idealized 3D hydrodynamic simulations to study the dynamics and
thermal structure of the circumgalactic medium (CGM). Our simulations quantify
the role of cooling, stellar feedback driven galactic winds and cosmological
gas accretion in setting the properties of the CGM in dark matter haloes
ranging from $10^{11}$ to $10^{12}$ M$_\odot$. Our simulations support a
conceptual picture in which the properties of the CGM, and the key physics
governing it, change markedly near a critical halo mass of M$_{\rm crit}
\approx 10^{11.5}$ M$_\odot$. As in calculations without stellar feedback,
above M$_{\rm crit}$ halo gas is supported by thermal pressure created in the
virial shock. The thermal properties at small radii are regulated by feedback
triggered when $t_{\rm cool}/t_{\rm ff}\lesssim10$ in the hot gas. Below
M$_{\rm crit}$, however, there is no thermally supported halo and
self-regulation at $t_{\rm cool}/t_{\rm ff}\sim10$ does not apply. Instead, the
gas is out of hydrostatic equilibrium and largely supported against gravity by
bulk flows (turbulence and coherent inflow/outflow) arising from the
interaction between cosmological gas inflow and outflowing galactic winds. In
these lower mass haloes, the phase structure depends sensitively on the
outflows' energy per unit mass and mass-loading, which may allow measurements
of the CGM thermal state to constrain the nature of galactic winds. Our
simulations account for some of the properties of the multiphase halo gas
inferred from quasar absorption line observations, including the presence of
significant mass at a wide range of temperatures, and the characteristic OVI
and CIV column densities and kinematics. However, we underpredict the neutral
hydrogen content of the $z\sim0$ CGM.
