LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] hwrng: via-rng - support new Centaur CPU
@ 2018-04-13  7:03 David Wang
  2018-04-16  2:30 ` 答复: " David Wang
  2018-04-20 17:05 ` Herbert Xu
  0 siblings, 2 replies; 3+ messages in thread
From: David Wang @ 2018-04-13  7:03 UTC (permalink / raw)
  To: mpm, herbert, arnd, grehkg, linux-kernel, linux-crypto
  Cc: brucechang, cooperyan, qiyuanwang, benjaminpan, lukelin, timguo,
	David Wang

New Centaur CPU(Family > 6) supprt Random Number Generator, but can't
support MSR_VIA_RNG. Just like VIA Nano.

Signed-off-by: David Wang <davidwang@zhaoxin.com>
---
 drivers/char/hw_random/via-rng.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/char/hw_random/via-rng.c b/drivers/char/hw_random/via-rng.c
index d1f5bb5..d9448b1 100644
--- a/drivers/char/hw_random/via-rng.c
+++ b/drivers/char/hw_random/via-rng.c
@@ -135,7 +135,7 @@ static int via_rng_init(struct hwrng *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 (((c->x86 == 6) && (c->x86_model >= 0x0f))  || (c->x86 > 6)){
 		if (!boot_cpu_has(X86_FEATURE_XSTORE_EN)) {
 			pr_err(PFX "can't enable hardware RNG "
 				"if XSTORE is not enabled\n");
-- 
1.9.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* 答复: [PATCH] hwrng: via-rng - support new Centaur CPU
  2018-04-13  7:03 [PATCH] hwrng: via-rng - support new Centaur CPU David Wang
@ 2018-04-16  2:30 ` David Wang
  2018-04-20 17:05 ` Herbert Xu
  1 sibling, 0 replies; 3+ messages in thread
From: David Wang @ 2018-04-16  2:30 UTC (permalink / raw)
  To: mpm, herbert, arnd, gregkh, linux-kernel, linux-crypto
  Cc: brucechang, cooperyan, qiyuanwang, benjaminpan, lukelin, timguo

> -----邮件原件-----
> 发件人: David Wang [mailto:davidwang@zhaoxin.com]
> 发送时间: 2018年4月13日 15:03
> 收件人: mpm@selenic.com; herbert@gondor.apana.org.au; arnd@arndb.de;
> grehkg@linuxfoundation.org; linux-kernel@vger.kernel.org;
> linux-crypto@vger.kernel.org
> 抄送: brucechang@via-alliance.com; cooperyan@zhaoxin.com;
> qiyuanwang@zhaoxin.com; benjaminpan@viatech.com; lukelin@viacpu.com;
> timguo@zhaoxin.com; David Wang <davidwang@zhaoxin.com>
> 主题: [PATCH] hwrng: via-rng - support new Centaur CPU
> 
> New Centaur CPU(Family > 6) supprt Random Number Generator, but can't
> support MSR_VIA_RNG. Just like VIA Nano.
> 
> Signed-off-by: David Wang <davidwang@zhaoxin.com>
> ---
>  drivers/char/hw_random/via-rng.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/char/hw_random/via-rng.c
> b/drivers/char/hw_random/via-rng.c
> index d1f5bb5..d9448b1 100644
> --- a/drivers/char/hw_random/via-rng.c
> +++ b/drivers/char/hw_random/via-rng.c
> @@ -135,7 +135,7 @@ static int via_rng_init(struct hwrng *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 (((c->x86 == 6) && (c->x86_model >= 0x0f))  || (c->x86 > 6)){
>  		if (!boot_cpu_has(X86_FEATURE_XSTORE_EN)) {
>  			pr_err(PFX "can't enable hardware RNG "
>  				"if XSTORE is not enabled\n");
> --
> 1.9.1
Sorry to write wrong email address of Greg.

---
David

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] hwrng: via-rng - support new Centaur CPU
  2018-04-13  7:03 [PATCH] hwrng: via-rng - support new Centaur CPU David Wang
  2018-04-16  2:30 ` 答复: " David Wang
@ 2018-04-20 17:05 ` Herbert Xu
  1 sibling, 0 replies; 3+ messages in thread
From: Herbert Xu @ 2018-04-20 17:05 UTC (permalink / raw)
  To: David Wang
  Cc: mpm, arnd, grehkg, linux-kernel, linux-crypto, brucechang,
	cooperyan, qiyuanwang, benjaminpan, lukelin, timguo

On Fri, Apr 13, 2018 at 03:03:03PM +0800, David Wang wrote:
> New Centaur CPU(Family > 6) supprt Random Number Generator, but can't
> support MSR_VIA_RNG. Just like VIA Nano.
> 
> Signed-off-by: David Wang <davidwang@zhaoxin.com>

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-04-20 17:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-13  7:03 [PATCH] hwrng: via-rng - support new Centaur CPU David Wang
2018-04-16  2:30 ` 答复: " David Wang
2018-04-20 17:05 ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).