From 430a4b04412ed934dfa4ebe682853cac9da466dd Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Fri, 15 May 2009 16:00:32 +1000 Subject: [PATCH] --- yaml --- r: 148813 b: refs/heads/master c: 858576bdc5d65edf1fffd2e65b2165ec1dc68486 h: refs/heads/master i: 148811: c298ec35c54e05b0749524d5ad0e6ee84355336c v: v3 --- [refs] | 2 +- trunk/drivers/char/hw_random/via-rng.c | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 8acd250478ea..83158f139295 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 608d1cd5d375580a49d01b5ed1f9944f5141ae19 +refs/heads/master: 858576bdc5d65edf1fffd2e65b2165ec1dc68486 diff --git a/trunk/drivers/char/hw_random/via-rng.c b/trunk/drivers/char/hw_random/via-rng.c index 02ee63906713..794aacb715c1 100644 --- a/trunk/drivers/char/hw_random/via-rng.c +++ b/trunk/drivers/char/hw_random/via-rng.c @@ -132,6 +132,19 @@ static int via_rng_init(struct hwrng *rng) struct cpuinfo_x86 *c = &cpu_data(0); u32 lo, hi, old_lo; + /* VIA Nano CPUs don't have the MSR_VIA_RNG anymore. The RNG + * is always enabled if CPUID rng_en is set. There is no + * RNG configuration like it used to be the case in this + * register */ + if ((c->x86 == 6) && (c->x86_model >= 0x0f)) { + if (!cpu_has_xstore_enabled) { + printk(KERN_ERR PFX "can't enable hardware RNG " + "if XSTORE is not enabled\n"); + return -ENODEV; + } + return 0; + } + /* Control the RNG via MSR. Tread lightly and pay very close * close attention to values written, as the reserved fields * are documented to be "undefined and unpredictable"; but it