From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752400AbaEAXAx (ORCPT ); Thu, 1 May 2014 19:00:53 -0400 Received: from terminus.zytor.com ([198.137.202.10]:41658 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751014AbaEAXAv (ORCPT ); Thu, 1 May 2014 19:00:51 -0400 Message-ID: <5362D20F.6010401@zytor.com> Date: Thu, 01 May 2014 16:00:31 -0700 From: "H. Peter Anvin" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Andy Lutomirski CC: "Theodore Ts'o" , "linux-kernel@vger.kernel.org" , kvm list , Florian Weimer , Kees Cook Subject: Re: random: Providing a seed value to VM guests References: <20140501192618.GA25829@thunk.org> <900441a0-24e8-4976-ad35-3971805b9f34@email.android.com> <20140501203910.GB25829@thunk.org> <5362B618.50602@zytor.com> <20140501222832.GD25829@thunk.org> <5362CEBC.9090705@zytor.com> In-Reply-To: X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/01/2014 03:56 PM, Andy Lutomirski wrote: > > I think we're comparing: > > a) cpuid to detect rdrand *or* emulated rdrand followed by rdrand > > to > > b) cpuid to detect rdrand or the paravirt seed msr/cpuid call, > followed by rdrand or the msr or cpuid read > > this seems like it barely makes a difference, especially since (a) > probably requires detecting KVM anyway. Well, it lets one do something like: if (boot_cpu_has(X86_FEATURE_RDRAND) || boot_cpu_has(X86_FEATURE_RDRAND_SIMULATED)) rdrand_long(...); We need the ifs anyway for early code; the arch_*() interfaces are only available after alternatives run. -hpa