From patchwork Thu Mar 14 04:55:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 1056324 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="abT7deME"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44Kbyj6NrYz9s55 for ; Thu, 14 Mar 2019 15:56:25 +1100 (AEDT) Received: from localhost ([127.0.0.1]:56845 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h4IPk-0004TA-Ux for incoming@patchwork.ozlabs.org; Thu, 14 Mar 2019 00:56:21 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56082) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h4IOy-0004T1-QC for qemu-devel@nongnu.org; Thu, 14 Mar 2019 00:55:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h4IOx-0007LD-TA for qemu-devel@nongnu.org; Thu, 14 Mar 2019 00:55:32 -0400 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]:43535) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h4IOx-0007Kf-Hz for qemu-devel@nongnu.org; Thu, 14 Mar 2019 00:55:31 -0400 Received: by mail-pf1-x42a.google.com with SMTP id q17so2992478pfh.10 for ; Wed, 13 Mar 2019 21:55:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id; bh=ITAcbfnZsTq9Rn2xxLqK9B83VzX6TCgNSCNVNDHmvfI=; b=abT7deME8ffBxPKft80FN0QrbG1ebTX//n76BMGIW7jo9/VuqYuwhEd1cugQ4P6I2u PCa9Jd94m+q51ZsBjHXHVEuiwIHZTSeJc+3vuSEK4V4GPPpsTgQVtdx9mJkG8yWJ7LF9 ykGs/q9uNVAvcuCRJsr9xRPxDolXtQl7QwNWPg01Um7iOEikIm2sppoNWM5t2L4OQVYj lg9V/pEFDxalLsZAyR0HaHeXjYw/UxvzqxUjSXHaB8BPsKvpNU17DnELYqi7oSjHi2Ma MxW1YfhXLPOk0GMsJGehOaIBPOciMsK/Y7j8AXMe8ffzeSWLxe+b6Zaak1qgASinj3RO pmnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=ITAcbfnZsTq9Rn2xxLqK9B83VzX6TCgNSCNVNDHmvfI=; b=LCx+AZerBkGQzmKdBDi+4vHDYP1KU5uJEACmbsKQqwIo7XHiYAnqlqe7REIZICpbJy 6Ff9LtdlvbIOh2dPPHXOvbqwFR9dfunvjjs3O/kWZGvuiWI4twJYaCOhTyfeoszroSxm +yK3vjEFFzZi84kVFHE3TdyDT5/vm3auySxqJkQANru8dpthb71aZXXwM6WVodkrMtes MDjbkQHoYMRgP8/zEJ9Ud6l9Sz4sWkneLYWmlwJY9DU9P1QDYafGQBQ1rV95UaBZyOTs 8BqgaeoKZOsw7HU5Jm6SJKjNRCNgOvbrD1al+CG+FUE9hPLHY+5murEhKeR/TVjlDa+F leiA== X-Gm-Message-State: APjAAAU+p0tMyapla/ieuLfPyCeRkZtqQFO94Epo2+oNQT7d/+wGiT7p RB4UWrGkUVynTIItqBYGmSQFAQMTkis= X-Google-Smtp-Source: APXvYqww+MPGVMQPId/uEMhpTleonm9s4+Haml5ag0nAo7dXyZ8XXJoS1D8JI56Q/OmXw6cW1l9CYw== X-Received: by 2002:a17:902:a413:: with SMTP id p19mr50387046plq.337.1552539329133; Wed, 13 Mar 2019 21:55:29 -0700 (PDT) Received: from localhost.localdomain (97-113-188-82.tukw.qwest.net. [97.113.188.82]) by smtp.gmail.com with ESMTPSA id d9sm16185027pgq.6.2019.03.13.21.55.27 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Mar 2019 21:55:27 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 13 Mar 2019 21:55:12 -0700 Message-Id: <20190314045526.13342-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::42a Subject: [Qemu-devel] [PATCH v2 00/14] Add qemu_getrandom and ARMv8.5-RNG X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Changes since v1: * Build crypto-obj-y for linux-user as well. * Several patches to tidy crypto/random-platform.c. * Use getrandom(2) in crypto/random-platform.c. * Use qcrypto_random_bytes in ui/vnc.c. * In qemu_getrandom: - Use g_rand_int instead of srand48. - Use qcrypto_random_bytes instead of getrandom directly. r~ Richard Henderson (14): crypto: Merge crypto-obj-y into libqemuutil.a crypto: Reverse code blocks in random-platform.c crypto: Do not fail for EINTR during qcrypto_random_bytes crypto: Use O_CLOEXEC in qcrypto_random_init crypto: Use getrandom for qcrypto_random_bytes crypto: Change the qcrypto_random_bytes buffer type to void* ui/vnc: Use qcrypto_random_bytes for make_challenge util: Add qemu_getrandom and support functions util: Use qcrypto_random_bytes for qemu_getrandom linux-user: Call qcrypto_init if not using -seed linux-user: Use qemu_getrandom for AT_RANDOM linux-user/aarch64: Use qemu_getrandom for arm_init_pauth_key linux-user: Remove srand call target/arm: Implement ARMv8.5-RNG Makefile | 12 ++-- Makefile.objs | 8 +-- Makefile.target | 4 -- include/crypto/random.h | 2 +- include/qemu/random.h | 58 +++++++++++++++++++ include/qom/cpu.h | 1 + target/arm/cpu.h | 5 ++ cpus.c | 9 +++ crypto/random-gcrypt.c | 2 +- crypto/random-gnutls.c | 2 +- crypto/random-platform.c | 95 +++++++++++++++++------------- linux-user/aarch64/cpu_loop.c | 16 +---- linux-user/elfload.c | 8 +-- linux-user/main.c | 31 +++++----- linux-user/syscall.c | 3 + target/arm/cpu64.c | 1 + target/arm/helper.c | 32 ++++++++++ ui/vnc.c | 8 +-- util/random.c | 106 ++++++++++++++++++++++++++++++++++ vl.c | 4 ++ configure | 27 ++++++--- crypto/Makefile.objs | 5 +- qemu-options.hx | 10 ++++ util/Makefile.objs | 1 + 24 files changed, 340 insertions(+), 110 deletions(-) create mode 100644 include/qemu/random.h create mode 100644 util/random.c