  A famous formula of Rodriguez Villegas shows that the Mahler measures $m(k)$
of $P_k(x,y)=x+1/x+y+1/y+k$ can be written as a Kronecker-Eisenstein series. We
prove that the degree of $k$ in Villegas' formula can be bounded by the class
numbers of CM points. This fact allows us to systematically derive $28$ new
identities linking $m(k)$ to $L$-values of cusp forms. Guided by Beilinson's
conjecture, we also prove $5$ formulas that express $L$-values of CM elliptic
curves over real quadratic fields to some $2\times 2$ determinants of $m(k)$.
This extends a recent work of Guo (the second author of this paper), Ji, Liu,
and Qin, in which they dealt with the cases when $k=4\pm 4\sqrt{2}$.
