From patchwork Sun Jul 10 11:47:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Condrea X-Patchwork-Id: 9222575 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D4E9960890 for ; Sun, 10 Jul 2016 11:54:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C5E5E2521F for ; Sun, 10 Jul 2016 11:54:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BA9E2264FB; Sun, 10 Jul 2016 11:54:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 46D0A2521F for ; Sun, 10 Jul 2016 11:54:04 +0000 (UTC) Received: from localhost ([::1]:54234 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMDJC-0003Rh-Su for patchwork-qemu-devel@patchwork.kernel.org; Sun, 10 Jul 2016 07:54:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59000) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMDE8-0006Om-4N for qemu-devel@nongnu.org; Sun, 10 Jul 2016 07:48:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bMDE6-0001oe-9h for qemu-devel@nongnu.org; Sun, 10 Jul 2016 07:48:47 -0400 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:33436) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMDE6-0001oa-2y for qemu-devel@nongnu.org; Sun, 10 Jul 2016 07:48:46 -0400 Received: by mail-wm0-x241.google.com with SMTP id o80so1667893wme.0 for ; Sun, 10 Jul 2016 04:48:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=SD2EbxARoVECrz0nnJGB9h3iCDuSqSw5Z7SCXd4cXnE=; b=oNlF4a/nQJgfqxaxpnABPeyI/0pRa2f4beiYrwLkNOW+jxA+YLuWh8i7vW8OQyrs0K h5Dm36PUKO2b4qLYLZN6mvawKaCMiGvnTFs0oDI9NgQOeyde7SKghxzru/W9+7JOXOHt XUAZ+zoMB3nm1s8Qae0AtNw5zf8at6HFuOXp4fZMGB2IzgjVWWEDv0WWUg+ZtVp0chTd L6KSfQkROP1JMUraiC2WxUl1xuayLIntY//+3Mm3IMy5xYRFhE0uziTSXLA8R4Y6B159 dlFDKjeEkA/yi1SErCQOn3qIfDwak7/JL0+gUFYkt1x2gYJfE/va1ytST0pHl5ZR8O5P hH0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=SD2EbxARoVECrz0nnJGB9h3iCDuSqSw5Z7SCXd4cXnE=; b=mM7KsF8RXsBqNdiWDs9pvOMzoLEKKCzcaR2FJCfuRbW2TvK78U4IHuet7QsaxI+Yev f+UpvAK6eLDN30o8THz0ySXMndRB3hOFD7Si3b9mxrvdfVV75Kd71aFSKy21WS18Jr8G qck4S9pm7wKBztTZbWRLsNhWb+3BOM1Wt7/RBRs5stsg54ij3m4w+cAnSSNCBXMA5nRI yIubVjMvWEARVhVzchKq2/eQIV8NAnZenkTHpZ402mwMa5m1JrgbpNsYOOaP4q1DNnQV ApkFO8iUhTPyT7JSBp4yBiGfe48gMy38Z6A5xPtRm+5gx8BtM2Sm148ykKgQWrawRF2e kaBw== X-Gm-Message-State: ALyK8tKsvv2DxgpmAItiBfT5sKmNRvTuBqucGb5o6DqIbs2ePyEkVzm2nXGJ6ShIczKakg== X-Received: by 10.28.36.136 with SMTP id k130mr11323950wmk.4.1468151325489; Sun, 10 Jul 2016 04:48:45 -0700 (PDT) Received: from localhost.localdomain ([79.112.8.37]) by smtp.gmail.com with ESMTPSA id d137sm6888378wmd.12.2016.07.10.04.48.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 10 Jul 2016 04:48:44 -0700 (PDT) From: Emil Condrea To: qemu-devel@nongnu.org Date: Sun, 10 Jul 2016 14:47:50 +0300 Message-Id: <1468151270-12984-20-git-send-email-emilcondrea@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1468151270-12984-1-git-send-email-emilcondrea@gmail.com> References: <1468151270-12984-1-git-send-email-emilcondrea@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::241 Subject: [Qemu-devel] [PATCH 19/19] Qemu-Xen-vTPM: QEMU machine class is initialized before tpm_init() 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: , Cc: wei.liu2@citrix.com, stefanb@linux.vnet.ibm.com, stefano.stabellini@eu.citrix.com, xen-devel@lists.xen.org, quan.xu@intel.com, dgdegra@tycho.nsa.gov, emilcondrea@gmail.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP make sure QEMU machine class is initialized and QEMU has registered Xen stubdom vTPM driver when call tpm_init() Signed-off-by: Quan Xu Signed-off-by: Emil Condrea Reviewed-by: Stefan Berger --- vl.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/vl.c b/vl.c index 5cd0f2a..a22b0c9 100644 --- a/vl.c +++ b/vl.c @@ -4353,12 +4353,6 @@ int main(int argc, char **argv, char **envp) exit(1); } -#ifdef CONFIG_TPM - if (tpm_init() < 0) { - exit(1); - } -#endif - /* init the bluetooth world */ if (foreach_device_config(DEV_BT, bt_parse)) exit(1); @@ -4477,6 +4471,17 @@ int main(int argc, char **argv, char **envp) exit(1); } + /* + * For compatible with Xen stubdom vTPM driver, make + * sure QEMU machine class is initialized and QEMU has + * registered Xen stubdom vTPM driver. + */ +#ifdef CONFIG_TPM + if (tpm_init() < 0) { + exit(1); + } +#endif + /* Check if IGD GFX passthrough. */ igd_gfx_passthru();