From patchwork Wed Jun 16 20:43:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12325925 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 42FC5C48BE6 for ; Wed, 16 Jun 2021 20:49:15 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D9B7A611BE for ; Wed, 16 Jun 2021 20:49:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D9B7A611BE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:41144 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ltcTJ-0002ZS-Su for qemu-devel@archiver.kernel.org; Wed, 16 Jun 2021 16:49:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49752) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltcO7-0001JY-Nk for qemu-devel@nongnu.org; Wed, 16 Jun 2021 16:43:51 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:46922) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltcO4-0000Yl-LA for qemu-devel@nongnu.org; Wed, 16 Jun 2021 16:43:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623876227; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=p5nJW7GzOlB+OjmQ+29ZyDcsW+yUWhYkO5dsX/39F4M=; b=JnQvzQHUNphWU2i+bmr1v14Gcrar27Fe7XQDeaNDM7pKjSSK7I2k3mVEfMF+HNJ5Ts+p0u Yr6cVAcqN/aE7HJEII5oTkI3D+71UDM2ku2WIvL+E2mjze1ZbsW8Hznwun7aaZUuf3j6ZF g5GcvqsrrJuAaR2urJVXln3pILkEc+o= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-125-Dbz_2vkMNxKnbvwFsqEhqA-1; Wed, 16 Jun 2021 16:43:38 -0400 X-MC-Unique: Dbz_2vkMNxKnbvwFsqEhqA-1 Received: by mail-wr1-f70.google.com with SMTP id l13-20020adfe9cd0000b0290119a0645c8fso1862929wrn.8 for ; Wed, 16 Jun 2021 13:43:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=p5nJW7GzOlB+OjmQ+29ZyDcsW+yUWhYkO5dsX/39F4M=; b=CpCKEVq3ik9CABRS+7G2AAqQo91FOxERmzMXJsAv6cDZ+9mnZdrWlO+SF7ODxzBKZT QiTaip2FIOSOZKZk2dNoE1xeUg0HZ7MAA+mmxkdIv2I00V3b6mmOXZQziHLmrCpFViy+ 86Urxom8Zwvx3nSCV7xJ5z6amQOWblMETRl8mU+OIPFTVaBeyNurttmtmSsQ1AMbLZm3 qnZWEC7C/TqYFQtGCp5/MO9Nfr49kkSv4TjXswSrHkcD/rN4u74O7BMLsOdxA9ya7eOf 7XYFsP1Kf+cSr7OEdwEeHLUG+20OyP5h4yse4NPbD3UGgK7t8OgFZkQ5VG59iF/8iqQy sEAQ== X-Gm-Message-State: AOAM533BoKOROeScWRJJRTMXBVeDoIx931l0c9eBnDIBmg+t9BXd81wn SFGVZh7biHxxk71XelVp2T/Y8ORoldgAInsoDuo47WUhpfNhGbj57oYERQfPtj+a5DJbWuzwQpg 0Ye841UH1z0+va5xIzucUOGu6hPP6fpNSNdeciwecTVaI2roNAlX4x2hLlnJPHCB6 X-Received: by 2002:a5d:47cb:: with SMTP id o11mr1206100wrc.38.1623876217732; Wed, 16 Jun 2021 13:43:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwxzfVDe9Le5QIWMAnO/CnzKYxXfzaVeVird4uqsJsQdTOKfE0MzqO+PYmR36IOxzeZJuKcIQ== X-Received: by 2002:a5d:47cb:: with SMTP id o11mr1206072wrc.38.1623876217584; Wed, 16 Jun 2021 13:43:37 -0700 (PDT) Received: from x1w.. (93.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.93]) by smtp.gmail.com with ESMTPSA id v7sm3216962wru.66.2021.06.16.13.43.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Jun 2021 13:43:37 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 01/23] MAINTAINERS: Add Connor Kuehl as reviewer for AMD SEV Date: Wed, 16 Jun 2021 22:43:06 +0200 Message-Id: <20210616204328.2611406-2-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210616204328.2611406-1-philmd@redhat.com> References: <20210616204328.2611406-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.199, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laszlo Ersek , Brijesh Singh , Eduardo Habkost , Sergio Lopez , "Michael S. Tsirkin" , Connor Kuehl , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , James Bottomley , Richard Henderson , "Dr . David Alan Gilbert" , Markus Armbruster , Dov Murik , Gerd Hoffmann , Igor Mammedov , Paolo Bonzini , Eric Blake Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Connor Kuehl It may not be appropriate for me to take over as a maintainer at this time, but I would consider myself familiar with AMD SEV and what this code is meant to be doing as part of a VMM for launching SEV-protected guests. To that end, I would be happy to volunteer as a reviewer for SEV-related changes so that I am CC'd on them and can help share the review burden with whoever does maintain this code. Signed-off-by: Connor Kuehl Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20210608192537.103584-1-ckuehl@redhat.com> [PMD: Cover more files] Signed-off-by: Philippe Mathieu-Daudé --- MAINTAINERS | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index ccdb81c9f62..fbfaaa54721 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2937,6 +2937,13 @@ F: hw/core/clock-vmstate.c F: hw/core/qdev-clock.c F: docs/devel/clocks.rst +AMD Secure Encrypted Virtualization (SEV) +R: Connor Kuehl +F: docs/amd-memory-encryption.txt +F: accel/kvm/sev-stub.c +F: target/i386/sev* +F: include/sysemu/sev.h + Usermode Emulation ------------------ Overall usermode emulation From patchwork Wed Jun 16 20:43:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12325929 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3C4B1C48BE5 for ; Wed, 16 Jun 2021 20:51:14 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C73E0611BE for ; Wed, 16 Jun 2021 20:51:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C73E0611BE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:46204 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ltcVE-0005ze-Vm for qemu-devel@archiver.kernel.org; Wed, 16 Jun 2021 16:51:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49730) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltcO5-0001HF-2n for qemu-devel@nongnu.org; Wed, 16 Jun 2021 16:43:50 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:32861) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltcO2-0000Wr-7c for qemu-devel@nongnu.org; Wed, 16 Jun 2021 16:43:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623876225; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=f27vlBksGaI+niJES8qihuGdOvYPg6DANZZdhWGvvvs=; b=Go/oIV5FE6AjFgtzJdH5nL+VoNuX33ElBN0LMd4EjuiSSL+z9WsRQeGn0ufjwiT5xwlnyf gca85CUAW4QW34fuCIcQkI15TSI4esyVasEsPlzBgCUpztPu95Qzqf9pEH2vM9lbtjdq9q 8UdmCkCBx0YQY5Sj1hB++SZ2P+zJgac= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-302-7-OF2EISOO6bTALFQwIwwA-1; Wed, 16 Jun 2021 16:43:44 -0400 X-MC-Unique: 7-OF2EISOO6bTALFQwIwwA-1 Received: by mail-wr1-f70.google.com with SMTP id k25-20020a5d52590000b0290114dee5b660so1857191wrc.16 for ; Wed, 16 Jun 2021 13:43:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=f27vlBksGaI+niJES8qihuGdOvYPg6DANZZdhWGvvvs=; b=jbM7m2B4MJnOrFSbK5dxE4dNFuBBvjbiFDF25zJDdMTgXTAb6emibYf7UM0rx7Sgfy iXihuw/4fiNbCdJ4xv0Eq5UN03hQi3ipo97tJWVv1dEruZsWZBoz9a3t67nPrl7E4kiP 0j0Gg2Ql/KlfMbqb5Ky/uvlfC5u0/oppZ0FWc26YUc7LFjWpPKL5iMhPj4zpJdzBN85U 5SsuM+zWdWCkwnXbo1PaJwgxZgIAqaKcJqBQpZBjUFwytIB+vz4alBjfT8vAmkqDbY0q NBYBb7eq1iHH2RFhzSkKY7rY+0mU+KM1NOsa4pJxTzq7wiI6eEKNnQpLP+apW0eNQZZo G9kg== X-Gm-Message-State: AOAM532huon8YBduYxTpOjQ1anuaifx/4koJ8uGN53FKRR0UumrTM6fb nuXwfArwO0tTnB46caKYvkhoqfUKny87a3gxBOhsbERm/1vRDhUgDddkxm6oa328Bnpy/vE3hNw UGWBrfRyy8thkoHiVUmD8E+0nGO9HCeTG7fUsYnLRx/9TSUlsC2hoPNt8Sz2vDdFa X-Received: by 2002:adf:ef06:: with SMTP id e6mr1122926wro.393.1623876222837; Wed, 16 Jun 2021 13:43:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyPYvJewK2vRAkCpO/ycM+faWpflOVGubRIFJXIAOJg0CaB9TsKFUae0tpe7UL59HYhOCaMNA== X-Received: by 2002:adf:ef06:: with SMTP id e6mr1122888wro.393.1623876222541; Wed, 16 Jun 2021 13:43:42 -0700 (PDT) Received: from x1w.. (93.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.93]) by smtp.gmail.com with ESMTPSA id m65sm2716810wmm.19.2021.06.16.13.43.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Jun 2021 13:43:42 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 02/23] qapi/misc-target: Wrap long 'SEV Attestation Report' long lines Date: Wed, 16 Jun 2021 22:43:07 +0200 Message-Id: <20210616204328.2611406-3-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210616204328.2611406-1-philmd@redhat.com> References: <20210616204328.2611406-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.133.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.199, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laszlo Ersek , Brijesh Singh , Eduardo Habkost , Sergio Lopez , "Michael S. Tsirkin" , Connor Kuehl , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , James Bottomley , Richard Henderson , "Dr . David Alan Gilbert" , Markus Armbruster , Dov Murik , Gerd Hoffmann , Igor Mammedov , Paolo Bonzini , Eric Blake Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Wrap long lines before 70 characters for legibility. Suggested-by: Markus Armbruster Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Markus Armbruster --- Note: it would be nice if checkpatch enforce 70 char for json (or at least QAPI json), that would save future developer modifying QAPI definitions reformating time. --- qapi/misc-target.json | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/qapi/misc-target.json b/qapi/misc-target.json index 5573dcf8f08..81646126267 100644 --- a/qapi/misc-target.json +++ b/qapi/misc-target.json @@ -290,8 +290,8 @@ ## # @SevAttestationReport: # -# The struct describes attestation report for a Secure Encrypted Virtualization -# feature. +# The struct describes attestation report for a Secure Encrypted +# Virtualization feature. # # @data: guest attestation report (base64 encoded) # @@ -305,10 +305,11 @@ ## # @query-sev-attestation-report: # -# This command is used to get the SEV attestation report, and is supported on AMD -# X86 platforms only. +# This command is used to get the SEV attestation report, and is +# supported on AMD X86 platforms only. # -# @mnonce: a random 16 bytes value encoded in base64 (it will be included in report) +# @mnonce: a random 16 bytes value encoded in base64 (it will be +# included in report) # # Returns: SevAttestationReport objects. # @@ -316,10 +317,12 @@ # # Example: # -# -> { "execute" : "query-sev-attestation-report", "arguments": { "mnonce": "aaaaaaa" } } +# -> { "execute" : "query-sev-attestation-report", + "arguments": { "mnonce": "aaaaaaa" } } # <- { "return" : { "data": "aaaaaaaabbbddddd"} } # ## -{ 'command': 'query-sev-attestation-report', 'data': { 'mnonce': 'str' }, +{ 'command': 'query-sev-attestation-report', + 'data': { 'mnonce': 'str' }, 'returns': 'SevAttestationReport', 'if': 'defined(TARGET_I386)' } From patchwork Wed Jun 16 20:43:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12325941 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5994AC48BE5 for ; Wed, 16 Jun 2021 20:53:28 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DD07D61076 for ; Wed, 16 Jun 2021 20:53:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DD07D61076 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:54754 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ltcXO-0003Ka-N6 for qemu-devel@archiver.kernel.org; Wed, 16 Jun 2021 16:53:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49802) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltcOE-0001P1-0l for qemu-devel@nongnu.org; Wed, 16 Jun 2021 16:43:59 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:40483) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltcOA-0000b3-VY for qemu-devel@nongnu.org; Wed, 16 Jun 2021 16:43:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623876232; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=P0MVNMPFT2iPgR7XnSOdieFnhCqfHwDB3FuH7adTvvs=; b=fEJq+mNWavrJf9DnqB15tD/Pum1+hWbnJgv6hSjoBG54weqWkf0sllu3YlfxFAi8zpLNTQ tpq6+a0KSEzCscLx8Sw6+f0Fo3SD0IJSM196VjIqy+2zAx5Q4VxIU7azU/L3tzY2B8tPGF HP7ezY1iG5tV77BunHkqNmY+oLQVEsE= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-267-Ik1KJs5eNw-DV749V1KN0w-1; Wed, 16 Jun 2021 16:43:51 -0400 X-MC-Unique: Ik1KJs5eNw-DV749V1KN0w-1 Received: by mail-wr1-f72.google.com with SMTP id x9-20020a5d49090000b0290118d8746e06so1862912wrq.10 for ; Wed, 16 Jun 2021 13:43:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=P0MVNMPFT2iPgR7XnSOdieFnhCqfHwDB3FuH7adTvvs=; b=pwKSRTUfMfwlMDAcmqk2lzTK59anHbp2WzmETi7eVIurPWcwjTApCW+JuPMgN33dQD VrSKcbcm4r0NTduSFfecx5QlTJmjpuFq69CCsV4Go+jpKo/dxQFvX5XjrgMtM1HEmU/G /SRGYSVvtNhewgBCBXMcSfWNuGosY8iE76FlohTuDK3W4Ck3dNsAcOa/cBP/WNRX9V0w c76JTVJLxHypl6mUp+aMnYVos7cJp7F6g76KdHLylgH7mIjBoExiM0cfu706o/tjIEi3 F3w7iuVnOd89q4gQ6bxgHf/7OQJrDwiOniYxiRr2zHST55+wi8wBajMDqmlwdBdczd8q qbKw== X-Gm-Message-State: AOAM533AtxZqqK7DpGcu/N3E/jOQ2dX1ZVrzdrhbv1Ea12+gHu+OzL4S kivbUwRcurtYm+6DIUBrRqJbFvPrfIwnFXwriC9IwkI/BtJ/78V0hntE41oG7cQzzM0h4bNwoqA ycmCBtCL4vqFYBm1yqyTDjyCq7pEdGhuH9frUa9sWALHrXqy8B4tFWwtq0rpL4F6x X-Received: by 2002:a5d:67cf:: with SMTP id n15mr1200957wrw.228.1623876229995; Wed, 16 Jun 2021 13:43:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwplhFANU5pzuPNxWZIeJm7JQpPrDirmo3H9Ue0VCXVvQOvNJwE61ASe3BEOXvjHMx/sFefjw== X-Received: by 2002:a5d:67cf:: with SMTP id n15mr1200918wrw.228.1623876229733; Wed, 16 Jun 2021 13:43:49 -0700 (PDT) Received: from x1w.. (93.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.93]) by smtp.gmail.com with ESMTPSA id m37sm2445006wms.46.2021.06.16.13.43.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Jun 2021 13:43:49 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 03/23] qapi/misc-target: Group SEV QAPI definitions Date: Wed, 16 Jun 2021 22:43:08 +0200 Message-Id: <20210616204328.2611406-4-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210616204328.2611406-1-philmd@redhat.com> References: <20210616204328.2611406-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.199, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laszlo Ersek , Brijesh Singh , Eduardo Habkost , Sergio Lopez , "Michael S. Tsirkin" , Connor Kuehl , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , James Bottomley , Richard Henderson , "Dr . David Alan Gilbert" , Markus Armbruster , Dov Murik , Gerd Hoffmann , Igor Mammedov , Paolo Bonzini , Eric Blake Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" There is already a section with various SEV commands / types, so move the SEV guest attestation together. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Markus Armbruster --- qapi/misc-target.json | 81 +++++++++++++++++++++---------------------- 1 file changed, 40 insertions(+), 41 deletions(-) diff --git a/qapi/misc-target.json b/qapi/misc-target.json index 81646126267..7db94206212 100644 --- a/qapi/misc-target.json +++ b/qapi/misc-target.json @@ -219,6 +219,46 @@ 'data': { 'packet-header': 'str', 'secret': 'str', '*gpa': 'uint64' }, 'if': 'defined(TARGET_I386)' } +## +# @SevAttestationReport: +# +# The struct describes attestation report for a Secure Encrypted +# Virtualization feature. +# +# @data: guest attestation report (base64 encoded) +# +# +# Since: 6.1 +## +{ 'struct': 'SevAttestationReport', + 'data': { 'data': 'str'}, + 'if': 'defined(TARGET_I386)' } + +## +# @query-sev-attestation-report: +# +# This command is used to get the SEV attestation report, and is +# supported on AMD X86 platforms only. +# +# @mnonce: a random 16 bytes value encoded in base64 (it will be +# included in report) +# +# Returns: SevAttestationReport objects. +# +# Since: 6.1 +# +# Example: +# +# -> { "execute" : "query-sev-attestation-report", +# "arguments": { "mnonce": "aaaaaaa" } } +# <- { "return" : { "data": "aaaaaaaabbbddddd"} } +# +## +{ 'command': 'query-sev-attestation-report', + 'data': { 'mnonce': 'str' }, + 'returns': 'SevAttestationReport', + 'if': 'defined(TARGET_I386)' } + ## # @dump-skeys: # @@ -285,44 +325,3 @@ ## { 'command': 'query-gic-capabilities', 'returns': ['GICCapability'], 'if': 'defined(TARGET_ARM)' } - - -## -# @SevAttestationReport: -# -# The struct describes attestation report for a Secure Encrypted -# Virtualization feature. -# -# @data: guest attestation report (base64 encoded) -# -# -# Since: 6.1 -## -{ 'struct': 'SevAttestationReport', - 'data': { 'data': 'str'}, - 'if': 'defined(TARGET_I386)' } - -## -# @query-sev-attestation-report: -# -# This command is used to get the SEV attestation report, and is -# supported on AMD X86 platforms only. -# -# @mnonce: a random 16 bytes value encoded in base64 (it will be -# included in report) -# -# Returns: SevAttestationReport objects. -# -# Since: 6.1 -# -# Example: -# -# -> { "execute" : "query-sev-attestation-report", - "arguments": { "mnonce": "aaaaaaa" } } -# <- { "return" : { "data": "aaaaaaaabbbddddd"} } -# -## -{ 'command': 'query-sev-attestation-report', - 'data': { 'mnonce': 'str' }, - 'returns': 'SevAttestationReport', - 'if': 'defined(TARGET_I386)' } From patchwork Wed Jun 16 20:43:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12325945 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 582B8C48BE5 for ; Wed, 16 Jun 2021 20:54:16 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 04B6A61076 for ; Wed, 16 Jun 2021 20:54:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 04B6A61076 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:58442 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ltcYB-0005o9-4J for qemu-devel@archiver.kernel.org; Wed, 16 Jun 2021 16:54:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49852) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltcON-0001e3-W0 for qemu-devel@nongnu.org; Wed, 16 Jun 2021 16:44:08 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:37385) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltcOL-0000gc-6K for qemu-devel@nongnu.org; Wed, 16 Jun 2021 16:44:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623876244; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=y+XSms8lsmaWxWcSMyaabFLhR1SIAMwTYvlPcGQF/+0=; b=fuxmPK5qC5TDEp0P53krkpx0sYi+CJeCr114ZVm63mzqgNHv+hW650sjNXzwUx2SxTwiLw rOpJQImfAsAseAwQZ7CgI+mANJC1GjOy/P4i/IlacjwE7GCf0nmtJnXLwld3GzRgqrygRc ZQbC4R5l16qWb1PvOYisT6P7Nzuhj2g= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-234-6ANMH-XCMMOksGMotS7Mjw-1; Wed, 16 Jun 2021 16:43:56 -0400 X-MC-Unique: 6ANMH-XCMMOksGMotS7Mjw-1 Received: by mail-wm1-f71.google.com with SMTP id n21-20020a7bcbd50000b02901a2ee0826aeso1732499wmi.7 for ; Wed, 16 Jun 2021 13:43:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=y+XSms8lsmaWxWcSMyaabFLhR1SIAMwTYvlPcGQF/+0=; b=Qp+H2vsWpvvxGqozA7gDKz5HMrm8VtELd4YEfuglnRVCCEAd47UNumaYkVGNmwR/c6 T3a8dPue5glSSrl5sCmJrF+EbD2F4jQrJr0pv3iMYfFao+nKL1+VTdEqAgUVcOdBltAS gGzUmPYVk4bQD5aqhRkFjVR3THd2HP69qTUlCCjXkkn2xnd6eME2xZDF279YbStwaNq8 JTZU9ckF0s+vChmvLZQ1AOrviCrN8OwIsMVZOTld05LCchfc2/UdIkBwJI5s98yJ/pJe iBKWnwp7mt3VQBukU5qB3Pxili2FC/DV2PuL/fyZ04y/T13Zwi7gXHhCEKJpliriG5im 1/qg== X-Gm-Message-State: AOAM532zF3oAaYadioGPVODsranJ8XC4VNM6SYb66U5Kkvo6dlHcLKkI E3KCD3q0QUr9ksv7vHGJbyaFqsiL9X+Vu7d+wuyv1QvcBNU4YCzfoVxUHp8RyLwrD2esDKVDGJK 2Z/dveY7NiPDH4XVyvVVdm46qs2qiWNOIutP+3MyiDEiHJPZbHmCA9Nhlx2caKZdP X-Received: by 2002:adf:d227:: with SMTP id k7mr1128724wrh.271.1623876235263; Wed, 16 Jun 2021 13:43:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCFjv4rL99lSTphSmutBg0e/eHY24V0R7vvtUv4PPiA85ngHRUEZlvcC1MGBknBDMOlyPo3A== X-Received: by 2002:adf:d227:: with SMTP id k7mr1128695wrh.271.1623876235124; Wed, 16 Jun 2021 13:43:55 -0700 (PDT) Received: from x1w.. (93.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.93]) by smtp.gmail.com with ESMTPSA id k11sm5887058wmj.1.2021.06.16.13.43.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Jun 2021 13:43:54 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 04/23] target/i386/monitor: Return QMP error when SEV is disabled in build Date: Wed, 16 Jun 2021 22:43:09 +0200 Message-Id: <20210616204328.2611406-5-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210616204328.2611406-1-philmd@redhat.com> References: <20210616204328.2611406-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.133.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.199, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laszlo Ersek , Brijesh Singh , Eduardo Habkost , Sergio Lopez , "Michael S. Tsirkin" , Connor Kuehl , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , James Bottomley , Richard Henderson , "Dr . David Alan Gilbert" , Markus Armbruster , Dov Murik , Gerd Hoffmann , Igor Mammedov , Paolo Bonzini , Eric Blake Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" If the management layer tries to inject a secret, it gets an empty response in case the binary built without SEV: { "execute": "sev-inject-launch-secret", "arguments": { "packet-header": "mypkt", "secret": "mypass", "gpa": 4294959104 } } { "return": { } } Make it clearer by returning an error, mentioning the feature is disabled: { "execute": "sev-inject-launch-secret", "arguments": { "packet-header": "mypkt", "secret": "mypass", "gpa": 4294959104 } } { "error": { "class": "GenericError", "desc": "this feature or command is not currently supported" } } Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Connor Kuehl Signed-off-by: Philippe Mathieu-Daudé --- target/i386/monitor.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/target/i386/monitor.c b/target/i386/monitor.c index 119211f0b06..c83cca80dc2 100644 --- a/target/i386/monitor.c +++ b/target/i386/monitor.c @@ -28,6 +28,7 @@ #include "monitor/hmp-target.h" #include "monitor/hmp.h" #include "qapi/qmp/qdict.h" +#include "qapi/qmp/qerror.h" #include "sysemu/kvm.h" #include "sysemu/sev.h" #include "qapi/error.h" @@ -742,6 +743,10 @@ void qmp_sev_inject_launch_secret(const char *packet_hdr, bool has_gpa, uint64_t gpa, Error **errp) { + if (!sev_enabled()) { + error_setg(errp, QERR_UNSUPPORTED); + return; + } if (!has_gpa) { uint8_t *data; struct sev_secret_area *area; From patchwork Wed Jun 16 20:43:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12325935 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A5FA9C48BE5 for ; Wed, 16 Jun 2021 20:52:13 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 44B44611BE for ; Wed, 16 Jun 2021 20:52:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 44B44611BE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:49900 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ltcWC-00005R-Em for qemu-devel@archiver.kernel.org; Wed, 16 Jun 2021 16:52:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49836) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltcOM-0001YF-Fj for qemu-devel@nongnu.org; Wed, 16 Jun 2021 16:44:06 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:56694) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltcOK-0000gU-O0 for qemu-devel@nongnu.org; Wed, 16 Jun 2021 16:44:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623876244; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OS+iR2EbHbrCh3GIR2NY+qAi6yiZecwyyt8l9LOb9LA=; b=awXbKzEO69RhIFeIdBNN31tuzizAvwCaMnnjgyHhk84ZMtE+dYUZWgBl3x3qDZhaBL+iQ6 sA9puemvJY/QrW3aHyQovwDvOXOFbQiou700bq9waQChpuapkOplJuXLK9HbXuKGYiwlX3 1K5gEJa7gtKpRUIfRwW0pDYDR6iOT6s= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-90-lPGtveevPsewcXQpMOk1yQ-1; Wed, 16 Jun 2021 16:44:02 -0400 X-MC-Unique: lPGtveevPsewcXQpMOk1yQ-1 Received: by mail-wr1-f69.google.com with SMTP id z4-20020adfe5440000b0290114f89c9931so1841603wrm.17 for ; Wed, 16 Jun 2021 13:44:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OS+iR2EbHbrCh3GIR2NY+qAi6yiZecwyyt8l9LOb9LA=; b=Wy79LEmjTVk+KJQ8XvIe3cdLnEk5C2AbmrnENFg6Ym9qd+8s10HBUFfmYmEVByMo1a F2DnnYEWbB+XW8mS5b0cZVCkaw61+u3RXFAaZfUNxVJaqriGzZdcYjxBJ5CkeCNrV3qO YAb+Hp0BQ2S2IY7Ssqeor7OJLsqiCN368Sq1pTKyV6fNvHZuumjaKnmJONuna9+oi3+l Bzw7fG42t2XWPCSrbzUEKaf//Zx1EVA1BWw9qbj/JPLJNleCec3zkl+PTwWugjGr1gnS NZaShbjyj4B8bZGsS4CVQYDOlVD0fcVnWCeyWqaXUJeoqdd3sb0h0aAV/j2uwqGaElDJ mdFw== X-Gm-Message-State: AOAM532UvyGoE+6auod+9zxKTzVGXFAMfs5fRp71J5vlJX1y49tix9O/ iYuLjvig9QhrpPQBS9EZyY3p6Qf5L05Jq7iwaaftrBWfsjrNt4LZbDOciZAasjQhQMs2KRCVewp XMn6qG33y/EWbTcx3qkw3KwEkfKvKDiCJxMZVg80UhPZLgDnLZATubSjx1lcg00XX X-Received: by 2002:a05:6000:180f:: with SMTP id m15mr1194026wrh.102.1623876241556; Wed, 16 Jun 2021 13:44:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxlypmYLZSy5nbOxxeZgwxAYN44cERdqWbJ2rG7fb91lYXzRYluBpjGFmb5vPNXvFIZlc6m5w== X-Received: by 2002:a05:6000:180f:: with SMTP id m15mr1193995wrh.102.1623876241362; Wed, 16 Jun 2021 13:44:01 -0700 (PDT) Received: from x1w.. (93.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.93]) by smtp.gmail.com with ESMTPSA id w2sm368281wrp.14.2021.06.16.13.43.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Jun 2021 13:44:00 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 05/23] target/i386/cpu: Add missing 'qapi/error.h' header Date: Wed, 16 Jun 2021 22:43:10 +0200 Message-Id: <20210616204328.2611406-6-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210616204328.2611406-1-philmd@redhat.com> References: <20210616204328.2611406-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.133.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.199, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laszlo Ersek , Brijesh Singh , Eduardo Habkost , Sergio Lopez , "Michael S. Tsirkin" , Connor Kuehl , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , James Bottomley , Richard Henderson , "Dr . David Alan Gilbert" , Markus Armbruster , Dov Murik , Gerd Hoffmann , Igor Mammedov , Paolo Bonzini , Eric Blake Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Commit 00b81053244 ("target-i386: Remove assert_no_error usage") forgot to add the "qapi/error.h" for &error_abort, add it now. Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Connor Kuehl Signed-off-by: Philippe Mathieu-Daudé --- target/i386/cpu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index a9fe1662d39..694031e4aec 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -27,6 +27,7 @@ #include "sysemu/hvf.h" #include "kvm/kvm_i386.h" #include "sev_i386.h" +#include "qapi/error.h" #include "qapi/qapi-visit-machine.h" #include "qapi/qmp/qerror.h" #include "qapi/qapi-commands-machine-target.h" From patchwork Wed Jun 16 20:43:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12325917 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F3EEBC48BE5 for ; Wed, 16 Jun 2021 20:46:55 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 939786128B for ; Wed, 16 Jun 2021 20:46:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 939786128B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:60650 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ltcR4-0005D1-Gn for qemu-devel@archiver.kernel.org; Wed, 16 Jun 2021 16:46:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49876) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltcOV-00022S-8n for qemu-devel@nongnu.org; Wed, 16 Jun 2021 16:44:15 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:35475) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltcOR-0000l9-TS for qemu-devel@nongnu.org; Wed, 16 Jun 2021 16:44:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623876251; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=J6Nu9xcD/1mLwA45H6T/mwE1HK3rKCkbuT6P4bJEEQ4=; b=PiEBC4GUOi6SLPEVzvo5TVG+H3ckOBeh12uJCgP98pZ5mkvOHYm7xSkIzPryIjyOe8SgRh qUHGfIEVbvcFM0Sl/PAclefDffn7lz3kreV+O6MzIwRedZ63oD9bNqetJLQoAyDAhBH+M1 dxuau8KEHT0P6yk5DvJY6oJxyCiuab8= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-4-1CHz4bDwNriLzqAIgVKDfw-1; Wed, 16 Jun 2021 16:44:08 -0400 X-MC-Unique: 1CHz4bDwNriLzqAIgVKDfw-1 Received: by mail-wr1-f69.google.com with SMTP id d9-20020adffbc90000b029011a3b249b10so1861229wrs.3 for ; Wed, 16 Jun 2021 13:44:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=J6Nu9xcD/1mLwA45H6T/mwE1HK3rKCkbuT6P4bJEEQ4=; b=J4izB9ttN9oobhZsHCp6HV0R+s8kFDJsY3yzwaBYPFXuNXZ6Rwyg8akkuxjQC/fcZi eXtOEM58zFIwCzG6jJTxblSuFHf7BTSMcYZOuEF/qD3T+u6eZbRmuy66W3iJgLQ0Mm46 dhLfQI07WyNlHnNnFFjlATcKvRrlztRM0ECJFtDXjuNtDBohhhejnztoHM9YYzqtHCg6 Z9f1eFqEREs6miN5C+P8dcJb9l7WnJSxmzyLKEFSnbwwFU5SP5DsEPZQychRmw249iSf CIJpOhigmsb86vYwHtzeMvF/owFveV7c/k4TuGVfaNUZn7uD9MYsNN/cW0+Ttxh7WtPT i7Hg== X-Gm-Message-State: AOAM5320prlZKx9iBbW2EVu4mDXEikLz4bPicwbtAo/lxrHEX9y9OpC0 CA1MHVjCd43+xBnzQTLGEPxq0CNR1rmT/1DmZeTtYVDTKa922Cx7imayG8WdhZrsH+Z7RBW6Wp/ xKakz00WRyuiHkOnh81SLhKGdc5pS/BY5tXbvB4xytPgL3h7VtotJhwTZ3EzMcZx3 X-Received: by 2002:a5d:64ca:: with SMTP id f10mr1103016wri.331.1623876246980; Wed, 16 Jun 2021 13:44:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJytoEdybsfOvsUor5A6euhFwHS4grr/3OauXO6/JvEz13BVI23CIHa2utjR37nfmwhIA0qxfw== X-Received: by 2002:a5d:64ca:: with SMTP id f10mr1102984wri.331.1623876246785; Wed, 16 Jun 2021 13:44:06 -0700 (PDT) Received: from x1w.. (93.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.93]) by smtp.gmail.com with ESMTPSA id g10sm3219377wrq.12.2021.06.16.13.44.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Jun 2021 13:44:06 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 06/23] target/i386/sev_i386.h: Remove unused headers Date: Wed, 16 Jun 2021 22:43:11 +0200 Message-Id: <20210616204328.2611406-7-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210616204328.2611406-1-philmd@redhat.com> References: <20210616204328.2611406-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.133.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.199, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laszlo Ersek , Brijesh Singh , Eduardo Habkost , Sergio Lopez , "Michael S. Tsirkin" , Connor Kuehl , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , James Bottomley , Richard Henderson , "Dr . David Alan Gilbert" , Markus Armbruster , Dov Murik , Gerd Hoffmann , Igor Mammedov , Paolo Bonzini , Eric Blake Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Declarations don't require these headers, remove them. Reviewed-by: Connor Kuehl Signed-off-by: Philippe Mathieu-Daudé --- target/i386/sev_i386.h | 4 ---- target/i386/sev-stub.c | 1 + 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/target/i386/sev_i386.h b/target/i386/sev_i386.h index ae6d8404787..f4223f1febf 100644 --- a/target/i386/sev_i386.h +++ b/target/i386/sev_i386.h @@ -14,11 +14,7 @@ #ifndef QEMU_SEV_I386_H #define QEMU_SEV_I386_H -#include "qom/object.h" -#include "qapi/error.h" -#include "sysemu/kvm.h" #include "sysemu/sev.h" -#include "qemu/error-report.h" #include "qapi/qapi-types-misc-target.h" #define SEV_POLICY_NODBG 0x1 diff --git a/target/i386/sev-stub.c b/target/i386/sev-stub.c index 0227cb51778..d91c2ece784 100644 --- a/target/i386/sev-stub.c +++ b/target/i386/sev-stub.c @@ -12,6 +12,7 @@ */ #include "qemu/osdep.h" +#include "qapi/error.h" #include "sev_i386.h" SevInfo *sev_get_info(void) From patchwork Wed Jun 16 20:43:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12325923 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 08629C48BE5 for ; Wed, 16 Jun 2021 20:49:13 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A734D611BE for ; Wed, 16 Jun 2021 20:49:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A734D611BE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:41006 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ltcTH-0002Tn-Q3 for qemu-devel@archiver.kernel.org; Wed, 16 Jun 2021 16:49:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49888) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltcOZ-00024z-42 for qemu-devel@nongnu.org; Wed, 16 Jun 2021 16:44:19 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:40755) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltcOX-0000op-DY for qemu-devel@nongnu.org; Wed, 16 Jun 2021 16:44:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623876256; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lyEuGJyDY/iwrGffQi3EPfdZgXrWvKYQavNdAaLhpEs=; b=Q/sZoWC8xEmu8EN5h2hnDHd+pF+AZnFsS4vY0l8T1UnVdMNF7gGu8DnujCM0JxFOlNBCw/ VJeA94hUeyNiGd2XDnODze/ZlAg93FRgiahSIEd938z7Hin+LjF9ZAu8BFdqRvc6NrZeSE jKSK/rxx+tosdwtuFMW6gB1xsRelD4k= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-552-lmban89-PAug5ZElxNiMbA-1; Wed, 16 Jun 2021 16:44:15 -0400 X-MC-Unique: lmban89-PAug5ZElxNiMbA-1 Received: by mail-wr1-f69.google.com with SMTP id l2-20020adfe5820000b029011a64161d6aso1876505wrm.6 for ; Wed, 16 Jun 2021 13:44:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lyEuGJyDY/iwrGffQi3EPfdZgXrWvKYQavNdAaLhpEs=; b=n6tF/zbwXpfUHNy3tlQezaSBuDpNSna7zfGazJj7W8Grx91BYJ/zTwP60uMijUpMFi 1u6UT4DVJZQ501v63fIOBjwJqviI/Bg2GhYpZ1GBoWQGYMeJ2g3I7bgvwSlongmCLW9l IxsiYP4X4Y4XwFzQYfPu/KIQWgt6uAReGLa/mk3fiZfHq/B7Whc8QEsXVMKom6C7iIho +x+JU0q4l5Ce/YayVsycWbm05hN/U7Np12a3WYP1PBG/0taf7UDzBwa3isYgyofTLW/m GTNjiJl9IFyEHSBLGK5+WiEffe9dIMaAz54lD6X3vQbPc62H1eEdCZjTRPurmMD+fz+H oYpg== X-Gm-Message-State: AOAM532LA8HFQvo/0qLVlti8TI2HTCNDYk6ccS7VQXBjXZyB5E6Q/H5j ZKel6jJLqmoybE4blq0RFx8zd4n8lU4gBz2Vf7Jr6H0JM7BPGKBGuHNaeeskKncstNH7cUa1Rgt 8bF3vMh4XVcMdj6LHfCHjO0qJs3WZkjYCNOgKPX6V5LBK+oEVlw2UM/Tn4FOUl2Bs X-Received: by 2002:a05:6000:cb:: with SMTP id q11mr1224049wrx.72.1623876253989; Wed, 16 Jun 2021 13:44:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxg/i1kUfPCSrh0kRNDAN6fwmslSTeKFy3ltDKkdCVocLvH+ZDAGrnTtDljT1hpxmWsb0QFBQ== X-Received: by 2002:a05:6000:cb:: with SMTP id q11mr1224022wrx.72.1623876253788; Wed, 16 Jun 2021 13:44:13 -0700 (PDT) Received: from x1w.. (93.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.93]) by smtp.gmail.com with ESMTPSA id r18sm3098709wro.62.2021.06.16.13.44.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Jun 2021 13:44:13 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 07/23] target/i386/sev: Remove sev_get_me_mask() Date: Wed, 16 Jun 2021 22:43:12 +0200 Message-Id: <20210616204328.2611406-8-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210616204328.2611406-1-philmd@redhat.com> References: <20210616204328.2611406-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.133.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.199, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laszlo Ersek , Brijesh Singh , Eduardo Habkost , Sergio Lopez , "Michael S. Tsirkin" , Connor Kuehl , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , James Bottomley , Richard Henderson , "Dr . David Alan Gilbert" , Markus Armbruster , Dov Murik , Gerd Hoffmann , Igor Mammedov , Paolo Bonzini , Eric Blake Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Unused dead code makes review harder, so remove it. Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Connor Kuehl Signed-off-by: Philippe Mathieu-Daudé --- target/i386/sev_i386.h | 1 - target/i386/sev-stub.c | 5 ----- target/i386/sev.c | 9 --------- 3 files changed, 15 deletions(-) diff --git a/target/i386/sev_i386.h b/target/i386/sev_i386.h index f4223f1febf..afa19a0a161 100644 --- a/target/i386/sev_i386.h +++ b/target/i386/sev_i386.h @@ -25,7 +25,6 @@ #define SEV_POLICY_SEV 0x20 extern bool sev_es_enabled(void); -extern uint64_t sev_get_me_mask(void); extern SevInfo *sev_get_info(void); extern uint32_t sev_get_cbit_position(void); extern uint32_t sev_get_reduced_phys_bits(void); diff --git a/target/i386/sev-stub.c b/target/i386/sev-stub.c index d91c2ece784..eb0c89bf2be 100644 --- a/target/i386/sev-stub.c +++ b/target/i386/sev-stub.c @@ -25,11 +25,6 @@ bool sev_enabled(void) return false; } -uint64_t sev_get_me_mask(void) -{ - return ~0; -} - uint32_t sev_get_cbit_position(void) { return 0; diff --git a/target/i386/sev.c b/target/i386/sev.c index 83df8c09f6a..0a36e81f66c 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -64,7 +64,6 @@ struct SevGuestState { uint8_t api_major; uint8_t api_minor; uint8_t build_id; - uint64_t me_mask; int sev_fd; SevState state; gchar *measurement; @@ -362,12 +361,6 @@ sev_es_enabled(void) return sev_enabled() && (sev_guest->policy & SEV_POLICY_ES); } -uint64_t -sev_get_me_mask(void) -{ - return sev_guest ? sev_guest->me_mask : ~0; -} - uint32_t sev_get_cbit_position(void) { @@ -810,8 +803,6 @@ int sev_kvm_init(ConfidentialGuestSupport *cgs, Error **errp) goto err; } - sev->me_mask = ~(1UL << sev->cbitpos); - devname = object_property_get_str(OBJECT(sev), "sev-device", NULL); sev->sev_fd = open(devname, O_RDWR); if (sev->sev_fd < 0) { From patchwork Wed Jun 16 20:43:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12325931 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B3E0DC48BE5 for ; Wed, 16 Jun 2021 20:52:07 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6B26361076 for ; Wed, 16 Jun 2021 20:52:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6B26361076 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:49520 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ltcW6-0008IV-J1 for qemu-devel@archiver.kernel.org; Wed, 16 Jun 2021 16:52:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49924) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltcOg-0002Ag-Nv for qemu-devel@nongnu.org; Wed, 16 Jun 2021 16:44:29 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:40770) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltcOc-0000r2-75 for qemu-devel@nongnu.org; Wed, 16 Jun 2021 16:44:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623876261; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KJdW6m0Ma56hwzjCy1teOEHrEH20tchf6AQogJnEfxU=; b=fRo3bgKGTolBWeIEhc+TuMjbpq2dB2oNwzZjNj2tQIdiPcgOvB/sdc0SCi37Og/irRmAQL 0PI/lYbNz+sxS7Jx5os1l0dd635qJcUjO5sS++x1P65EeBBH58zol8auupTPHHUS/+k5SO xQFwx40YhAisLfEPOOwusjtnTVxv07U= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-217-FfnR7SPGMZ2UfQiPZvrDPg-1; Wed, 16 Jun 2021 16:44:20 -0400 X-MC-Unique: FfnR7SPGMZ2UfQiPZvrDPg-1 Received: by mail-wr1-f70.google.com with SMTP id f22-20020a5d58f60000b029011634e39889so1857914wrd.7 for ; Wed, 16 Jun 2021 13:44:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KJdW6m0Ma56hwzjCy1teOEHrEH20tchf6AQogJnEfxU=; b=NEa5+lTeB0atFSusgaWzmTWIB/sNm1eFQwKWt55sYLwJvlwcoyWlo5UpsuHVoMjYYj Id9ttXOakeAaXjuh70qWkiC7YTzhbklChgnxuEIc4207VbJ56JolmZ+01Sz/cc4NG9pO QixAt5CYr7jjKtiAtOd/powNXUYGi3+G/hOt6D+HqeE3a0WRwvVOuja+U6aUO2ajBOzj sB9ECzSS11iUZpxMhxhVItOOH51UdA3YLii6VRi0aitdjh/wVcmgsVJjARlAE1YYdWOw Q4ZdY/CbhoUTfpkmxDfSCb3ifUMYVKJWvD6ZwBSmhkNDEBlDrcXpdub9ZbMyTXxfrWOi yhNw== X-Gm-Message-State: AOAM530YPQQXTWVClMYw8xzindhUARflYqHY4ASOBIomiB6nyX7leBfy cniPO6AZbPkhlwChxqEodmDxz5M0JiIh9YN4x5QtxvW8X5LbpaVYD4Iqq4LrWSaGseR4TAwwKXo F6tr9fAtnOA5IoULXjtweZkAzwndHbv5zSPb6OoxeVP62aICi9PFrTJkTEF3L+UpR X-Received: by 2002:a5d:60c8:: with SMTP id x8mr1208711wrt.382.1623876259424; Wed, 16 Jun 2021 13:44:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyixwQR7l27UKVWaZuT5XHYcGzirQFtRhxb+W0+ewb+ZpkQ+NgluuvAJoiytEWi2zigltASA== X-Received: by 2002:a5d:60c8:: with SMTP id x8mr1208682wrt.382.1623876259297; Wed, 16 Jun 2021 13:44:19 -0700 (PDT) Received: from x1w.. (93.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.93]) by smtp.gmail.com with ESMTPSA id b8sm6048742wmd.35.2021.06.16.13.44.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Jun 2021 13:44:19 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 08/23] target/i386/sev: Mark unreachable code with g_assert_not_reached() Date: Wed, 16 Jun 2021 22:43:13 +0200 Message-Id: <20210616204328.2611406-9-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210616204328.2611406-1-philmd@redhat.com> References: <20210616204328.2611406-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.199, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laszlo Ersek , Brijesh Singh , Eduardo Habkost , Sergio Lopez , "Michael S. Tsirkin" , Connor Kuehl , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , James Bottomley , Richard Henderson , "Dr . David Alan Gilbert" , Markus Armbruster , Dov Murik , Gerd Hoffmann , Igor Mammedov , Paolo Bonzini , Eric Blake Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" The unique sev_encrypt_flash() invocation (in pc_system_flash_map) is protected by the "if (sev_enabled())" check, so is not reacheable. Replace the abort() call in sev_es_save_reset_vector() by g_assert_not_reached() which meaning is clearer. Reviewed-by: Connor Kuehl Signed-off-by: Philippe Mathieu-Daudé --- target/i386/sev-stub.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/i386/sev-stub.c b/target/i386/sev-stub.c index eb0c89bf2be..4668365fd3e 100644 --- a/target/i386/sev-stub.c +++ b/target/i386/sev-stub.c @@ -54,7 +54,7 @@ int sev_inject_launch_secret(const char *hdr, const char *secret, int sev_encrypt_flash(uint8_t *ptr, uint64_t len, Error **errp) { - return 0; + g_assert_not_reached(); } bool sev_es_enabled(void) @@ -68,7 +68,7 @@ void sev_es_set_reset_vector(CPUState *cpu) int sev_es_save_reset_vector(void *flash_ptr, uint64_t flash_size) { - abort(); + g_assert_not_reached(); } SevAttestationReport * From patchwork Wed Jun 16 20:43:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12325943 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EE8EFC48BE5 for ; Wed, 16 Jun 2021 20:54:02 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9CCFA611BE for ; Wed, 16 Jun 2021 20:54:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9CCFA611BE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:57884 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ltcXx-0005RD-OY for qemu-devel@archiver.kernel.org; Wed, 16 Jun 2021 16:54:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49956) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltcOk-0002BL-N2 for qemu-devel@nongnu.org; Wed, 16 Jun 2021 16:44:30 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:46504) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltcOh-0000uW-VJ for qemu-devel@nongnu.org; Wed, 16 Jun 2021 16:44:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623876267; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eDwwyP6lYjqDrcaWITpcvIceEJU79Gyjn65Ig5GC5tE=; b=YoNXnAwqiaeCa2wyAiDXNnI7rBKQSOe+amg6QmaPT+lCDxf9nMyQhzfKZs0Ih/PIjN8NFA mF0Dv+jlT5GzSRbMRQSqFTxG4jomiJN5dmt53QN9VcqjnEqRatLtwcBP1PJn/0sCRsORq5 0FdYha7Zmoq74PhGt9npHN5ybUWtqzA= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-551-neNSTVzkMSCbdtusoVbrYg-1; Wed, 16 Jun 2021 16:44:26 -0400 X-MC-Unique: neNSTVzkMSCbdtusoVbrYg-1 Received: by mail-wm1-f72.google.com with SMTP id u17-20020a05600c19d1b02901af4c4deac5so1517372wmq.7 for ; Wed, 16 Jun 2021 13:44:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=eDwwyP6lYjqDrcaWITpcvIceEJU79Gyjn65Ig5GC5tE=; b=V88EHrx5LffBdBrnylyBduc9NpnHsgHOCSiWSmr/TS5yOTVGpvhWkgp5N60IITB1dM MP4qEpkiMX/3XBV1ZXdORyPY0hRAgKmqZl8WncWrYsyPWnEBG93POfiPeVGv3VR9iqKg FoR7DXjK6V1+OvY54Y/6bIJ16pyVuPKTOk33iha4Vgb7Lq30xGL/ZMpzfd7HhvOu8nDm g6pJ+Gn9Xuvbkgfjq62eSxOPhn0ry43y3XFNtltgeH7sboo7+w3Ct5MIBKGFrYmOYgSO IHyYlqrZqE08MgCj6Yp6zofIzQTOO1F18dJJlur3B0cDzEWuMhmTbi1Lu7EB14vIQMvL Y8Xw== X-Gm-Message-State: AOAM533io2CgEn++GIRh+kEDUCcWyyC6OG4UI49oTB1tlSsimCREhFMZ IVVNB6mQiM/ouApVvlZw1Y/+6EUKZQS6TLRuaAKyZwFl4XBatuQ6KBTQbsnu8djJPfb2V3/bLE+ 9YJHhF1Y/ZilHs0p+g6o9UQ4VeEvh8jdVXKdRY43XBgqEK3V8gMvjd2S+AmmymKtr X-Received: by 2002:adf:efc3:: with SMTP id i3mr1174630wrp.356.1623876265104; Wed, 16 Jun 2021 13:44:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3PqYcrrqPsLKDnRRXq3vXJrVRnLpbTpFOE+h4u5jWkRmc9vkGMmrzbFL5ov587c4rEpv0Eg== X-Received: by 2002:adf:efc3:: with SMTP id i3mr1174594wrp.356.1623876264901; Wed, 16 Jun 2021 13:44:24 -0700 (PDT) Received: from x1w.. (93.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.93]) by smtp.gmail.com with ESMTPSA id k16sm3242227wrn.96.2021.06.16.13.44.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Jun 2021 13:44:24 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 09/23] target/i386/sev: sev_get_attestation_report use g_autofree Date: Wed, 16 Jun 2021 22:43:14 +0200 Message-Id: <20210616204328.2611406-10-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210616204328.2611406-1-philmd@redhat.com> References: <20210616204328.2611406-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.199, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laszlo Ersek , Brijesh Singh , Eduardo Habkost , Sergio Lopez , "Michael S. Tsirkin" , Connor Kuehl , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , James Bottomley , Richard Henderson , "Dr . David Alan Gilbert" , Markus Armbruster , Dov Murik , Gerd Hoffmann , Igor Mammedov , Paolo Bonzini , Eric Blake Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: "Dr. David Alan Gilbert" Removes a whole bunch of g_free's and a goto. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Connor Kuehl Reviewed-by: Brijesh Singh Message-Id: <20210603113017.34922-1-dgilbert@redhat.com> Signed-off-by: Philippe Mathieu-Daudé --- target/i386/sev.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/target/i386/sev.c b/target/i386/sev.c index 0a36e81f66c..791804954e9 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -493,8 +493,8 @@ sev_get_attestation_report(const char *mnonce, Error **errp) struct kvm_sev_attestation_report input = {}; SevAttestationReport *report = NULL; SevGuestState *sev = sev_guest; - guchar *data; - guchar *buf; + g_autofree guchar *data = NULL; + g_autofree guchar *buf = NULL; gsize len; int err = 0, ret; @@ -514,7 +514,6 @@ sev_get_attestation_report(const char *mnonce, Error **errp) if (len != sizeof(input.mnonce)) { error_setg(errp, "SEV: mnonce must be %zu bytes (got %" G_GSIZE_FORMAT ")", sizeof(input.mnonce), len); - g_free(buf); return NULL; } @@ -525,7 +524,6 @@ sev_get_attestation_report(const char *mnonce, Error **errp) if (err != SEV_RET_INVALID_LEN) { error_setg(errp, "failed to query the attestation report length " "ret=%d fw_err=%d (%s)", ret, err, fw_error_to_str(err)); - g_free(buf); return NULL; } } @@ -540,7 +538,7 @@ sev_get_attestation_report(const char *mnonce, Error **errp) if (ret) { error_setg_errno(errp, errno, "Failed to get attestation report" " ret=%d fw_err=%d (%s)", ret, err, fw_error_to_str(err)); - goto e_free_data; + return NULL; } report = g_new0(SevAttestationReport, 1); @@ -548,9 +546,6 @@ sev_get_attestation_report(const char *mnonce, Error **errp) trace_kvm_sev_attestation_report(mnonce, report->data); -e_free_data: - g_free(data); - g_free(buf); return report; } From patchwork Wed Jun 16 20:43:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12325949 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8DE80C48BE5 for ; Wed, 16 Jun 2021 20:55:51 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1BCFD61076 for ; Wed, 16 Jun 2021 20:55:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1BCFD61076 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:35124 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ltcZi-0000h7-4G for qemu-devel@archiver.kernel.org; Wed, 16 Jun 2021 16:55:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49988) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltcOq-0002Fe-Em for qemu-devel@nongnu.org; Wed, 16 Jun 2021 16:44:36 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:59357) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltcOn-0000xh-3r for qemu-devel@nongnu.org; Wed, 16 Jun 2021 16:44:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623876272; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AZLS+m7xAvvk2uRB++FAfryJbzXnCIDe39YBz1qMJyo=; b=gPA5mrl9Zmcxny2cvnuIHzkcN9D6Ps61IHukGMf+TVYQkbfPW9us/4uGyLFnJh2vM6soeD NgbZ9z74a0aQxLuiGVj0M78HKmxPNRJ8iTNh5AKYuZ9Jym+cqwCojs3ThCqcnP2uP+qgRr ODY8eLLO4EJoObB7C2huWIJ3r6ywzIk= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-269-UM5eMkHPOy2-Lyol2akw4Q-1; Wed, 16 Jun 2021 16:44:31 -0400 X-MC-Unique: UM5eMkHPOy2-Lyol2akw4Q-1 Received: by mail-wr1-f71.google.com with SMTP id h104-20020adf90710000b029010de8455a3aso1856507wrh.12 for ; Wed, 16 Jun 2021 13:44:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=AZLS+m7xAvvk2uRB++FAfryJbzXnCIDe39YBz1qMJyo=; b=q70q7Zwc7SvktpYGYk2iKkNtu3P4sLbOlP6GHGosiygYTiHDpltgcozUoEo7wPt81O LTuvVRb+mKjReevMftR5aZLwm+IpvP1Ty8NT3SsKEC21hJXzTzcPqRwo921a1JO+wEhh +f/4eXaoVpGOJ070TQhfwQt4hYRqrq2sV5jXtRbswBUFQae/za/V6kaY/nD/bptoI5ml 1UjPmB699jevBgm8PGNjWoG/vmCXfnnAEErGMmJuar0hh8fYPSmlwJLxn8NVrWhwnPy4 Un1UN2UMZBlBe1/WES1aTkfiERrMG3+ZUJ2u00l4VUKAm/6aaBjEVP5F/yFcuBBIE9zN 5BbQ== X-Gm-Message-State: AOAM533vunVqNjC7OeC/WTDsLIQTku6shXhmVO+CCbAUWNSpOa5DkQ5b 4K1C3+qtjrdU2hWqNb6GDbNcKav2Iqv7ASCZEpUJbjjcajghnYlh5oB51g2o7tU3jzWpnKlW1YE 9qiXCaSy+g3kz24g3GQL7+42yfTf3bZVf2iw5Wxk9Z+vJW1Qsllz9gRoPIKwPs+VZ X-Received: by 2002:adf:e8cb:: with SMTP id k11mr1122350wrn.127.1623876270434; Wed, 16 Jun 2021 13:44:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzv1QtrHVuIiKQIVbYKn8PlR0K7pmHNt/rPvhHLLZNkTjXErbA7lySXCe0JCJniz1FHFkjHAg== X-Received: by 2002:adf:e8cb:: with SMTP id k11mr1122314wrn.127.1623876270220; Wed, 16 Jun 2021 13:44:30 -0700 (PDT) Received: from x1w.. (93.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.93]) by smtp.gmail.com with ESMTPSA id f12sm3804968wru.81.2021.06.16.13.44.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Jun 2021 13:44:29 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 10/23] target/i386/sev: Restrict SEV to system emulation Date: Wed, 16 Jun 2021 22:43:15 +0200 Message-Id: <20210616204328.2611406-11-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210616204328.2611406-1-philmd@redhat.com> References: <20210616204328.2611406-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.199, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laszlo Ersek , Brijesh Singh , Eduardo Habkost , Sergio Lopez , "Michael S. Tsirkin" , Connor Kuehl , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , James Bottomley , Richard Henderson , "Dr . David Alan Gilbert" , Markus Armbruster , Dov Murik , Gerd Hoffmann , Igor Mammedov , Paolo Bonzini , Eric Blake Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" SEV is irrelevant on user emulation, so restrict it to sysemu. Some stubs are still required because used in cpu.c by x86_register_cpudef_types(), so move the sysemu specific stubs to sev-sysemu-stub.c instead. This will allow us to simplify monitor.c (which is not available in user emulation) in the next commit. Signed-off-by: Philippe Mathieu-Daudé --- target/i386/sev-stub.c | 43 ------------------------- target/i386/sev-sysemu-stub.c | 60 +++++++++++++++++++++++++++++++++++ target/i386/meson.build | 4 ++- 3 files changed, 63 insertions(+), 44 deletions(-) create mode 100644 target/i386/sev-sysemu-stub.c diff --git a/target/i386/sev-stub.c b/target/i386/sev-stub.c index 4668365fd3e..8eae5d2fa8d 100644 --- a/target/i386/sev-stub.c +++ b/target/i386/sev-stub.c @@ -15,11 +15,6 @@ #include "qapi/error.h" #include "sev_i386.h" -SevInfo *sev_get_info(void) -{ - return NULL; -} - bool sev_enabled(void) { return false; @@ -35,45 +30,7 @@ uint32_t sev_get_reduced_phys_bits(void) return 0; } -char *sev_get_launch_measurement(void) -{ - return NULL; -} - -SevCapability *sev_get_capabilities(Error **errp) -{ - error_setg(errp, "SEV is not available in this QEMU"); - return NULL; -} - -int sev_inject_launch_secret(const char *hdr, const char *secret, - uint64_t gpa, Error **errp) -{ - return 1; -} - -int sev_encrypt_flash(uint8_t *ptr, uint64_t len, Error **errp) -{ - g_assert_not_reached(); -} - bool sev_es_enabled(void) { return false; } - -void sev_es_set_reset_vector(CPUState *cpu) -{ -} - -int sev_es_save_reset_vector(void *flash_ptr, uint64_t flash_size) -{ - g_assert_not_reached(); -} - -SevAttestationReport * -sev_get_attestation_report(const char *mnonce, Error **errp) -{ - error_setg(errp, "SEV is not available in this QEMU"); - return NULL; -} diff --git a/target/i386/sev-sysemu-stub.c b/target/i386/sev-sysemu-stub.c new file mode 100644 index 00000000000..d556b4f091f --- /dev/null +++ b/target/i386/sev-sysemu-stub.c @@ -0,0 +1,60 @@ +/* + * QEMU SEV system stub + * + * Copyright Advanced Micro Devices 2018 + * + * Authors: + * Brijesh Singh + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + * + */ + +#include "qemu/osdep.h" +#include "qapi/qapi-commands-misc-target.h" +#include "qapi/error.h" +#include "sev_i386.h" + +SevInfo *sev_get_info(void) +{ + return NULL; +} + +char *sev_get_launch_measurement(void) +{ + return NULL; +} + +SevCapability *sev_get_capabilities(Error **errp) +{ + error_setg(errp, "SEV is not available in this QEMU"); + return NULL; +} + +int sev_inject_launch_secret(const char *hdr, const char *secret, + uint64_t gpa, Error **errp) +{ + return 1; +} + +int sev_encrypt_flash(uint8_t *ptr, uint64_t len, Error **errp) +{ + g_assert_not_reached(); +} + +void sev_es_set_reset_vector(CPUState *cpu) +{ +} + +int sev_es_save_reset_vector(void *flash_ptr, uint64_t flash_size) +{ + g_assert_not_reached(); +} + +SevAttestationReport *sev_get_attestation_report(const char *mnonce, + Error **errp) +{ + error_setg(errp, "SEV is not available in this QEMU"); + return NULL; +} diff --git a/target/i386/meson.build b/target/i386/meson.build index dac19ec00d4..a4f45c3ec1d 100644 --- a/target/i386/meson.build +++ b/target/i386/meson.build @@ -6,7 +6,7 @@ 'xsave_helper.c', 'cpu-dump.c', )) -i386_ss.add(when: 'CONFIG_SEV', if_true: files('host-cpu.c', 'sev.c'), if_false: files('sev-stub.c')) +i386_ss.add(when: 'CONFIG_SEV', if_true: files('host-cpu.c'), if_false: files('sev-stub.c')) # x86 cpu type i386_ss.add(when: 'CONFIG_KVM', if_true: files('host-cpu.c')) @@ -20,6 +20,8 @@ 'monitor.c', 'cpu-sysemu.c', )) +i386_softmmu_ss.add(when: 'CONFIG_SEV', if_true: files('sev.c'), if_false: files('sev-sysemu-stub.c')) + i386_user_ss = ss.source_set() subdir('kvm') From patchwork Wed Jun 16 20:43:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12325957 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNWANTED_LANGUAGE_BODY, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B08B4C48BE5 for ; Wed, 16 Jun 2021 20:58:36 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4AFE36128C for ; Wed, 16 Jun 2021 20:58:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4AFE36128C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:43750 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ltccN-0006Xp-F7 for qemu-devel@archiver.kernel.org; Wed, 16 Jun 2021 16:58:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50012) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltcOu-0002Kq-Ug for qemu-devel@nongnu.org; Wed, 16 Jun 2021 16:44:40 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:27126) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltcOs-000127-Vw for qemu-devel@nongnu.org; Wed, 16 Jun 2021 16:44:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623876278; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=INPj6wpcOgYFSeBtjomYW3KmRr5tUwX7C5l9vqP5JIA=; b=MPoO3CUjPgWWMJT8vs/y4iVKfPkyV4K9+z67M+PyujUxE0xTb+rbWg9mXKJftCHbJBi4v/ MeT6wYRjitkr56yfGr76v0wpLCb0tvqYbkSzAgLmDZ2/i8gvxb9rMRQ9v/U4nRuVq5YcnE JIRm58ZL+X3LVDa3aYe3OquJr3hWdAk= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-511-2HBpgrI4N3akef6aqFDxFA-1; Wed, 16 Jun 2021 16:44:37 -0400 X-MC-Unique: 2HBpgrI4N3akef6aqFDxFA-1 Received: by mail-wm1-f72.google.com with SMTP id r4-20020a7bc0840000b02901b7cb5713ecso1573412wmh.1 for ; Wed, 16 Jun 2021 13:44:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=INPj6wpcOgYFSeBtjomYW3KmRr5tUwX7C5l9vqP5JIA=; b=GpeHdjUnZ4WF9zTE2Kg4LEhsAHMxPB/k0aOk5rrUvV/8vOqOAZvbhxReTKz6ibtMT9 NPWBsOISHkunH0eBLhpR59f/xCDYRe05rpBWrzGzQInywInCy4g5GPU8jpqjq/SK8UKs y8zjHd08L0O0ollIiWT8hURRSgA249g+8hBUe6s2tbPWhqCA/QMbaBX1Dko//ZCcabna oM5SB4Nr4u9NhBcby4Nm5YRFzqo4/3t+k2Q4p48/jHCtJbRhLpyQC6VYVLXXRRolbsK7 Dnzow33StHRISI6xvDugYCAo0egYaV/qHO+XcEoWFdxKEVq/5kK1ivnGer/w/5TovKZm tQwg== X-Gm-Message-State: AOAM531kCOeH+a2YglgkhdS+4l9Bf0rhXkpEozTIYffMl1waVq4J71uK EoZQ095c/BUVqkUEv2WT01nRPCc2zn7n5L30lpbZeQ0A4lSEzjQbrZ4Vv5mkQoRTe6+BH/UIX2I FWW0homQZzdidZCZ0Q9jhoOaonHIKQfyQDBY0sdq3cJl+17slYnabk72izKBu15A2 X-Received: by 2002:adf:c3d4:: with SMTP id d20mr1137026wrg.183.1623876275928; Wed, 16 Jun 2021 13:44:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzKOVUAhCAMFG+cpVVIYhc1tW4j/mspmrfRWcWRUchw+dJOK5+j4msRliRG32VTnIFXrzX6zg== X-Received: by 2002:adf:c3d4:: with SMTP id d20mr1136993wrg.183.1623876275629; Wed, 16 Jun 2021 13:44:35 -0700 (PDT) Received: from x1w.. (93.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.93]) by smtp.gmail.com with ESMTPSA id k8sm6269653wmo.18.2021.06.16.13.44.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Jun 2021 13:44:35 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 11/23] target/i386/sev: Move qmp_query_sev_attestation_report() to sev.c Date: Wed, 16 Jun 2021 22:43:16 +0200 Message-Id: <20210616204328.2611406-12-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210616204328.2611406-1-philmd@redhat.com> References: <20210616204328.2611406-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.199, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laszlo Ersek , Brijesh Singh , Eduardo Habkost , Sergio Lopez , "Michael S. Tsirkin" , Connor Kuehl , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , James Bottomley , Richard Henderson , "Dr . David Alan Gilbert" , Markus Armbruster , Dov Murik , Gerd Hoffmann , Igor Mammedov , Paolo Bonzini , Eric Blake Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Move qmp_query_sev_attestation_report() from monitor.c to sev.c and make sev_get_attestation_report() static. We don't need the stub anymore, remove it. Signed-off-by: Philippe Mathieu-Daudé --- target/i386/sev_i386.h | 2 -- target/i386/monitor.c | 6 ------ target/i386/sev-sysemu-stub.c | 6 +++--- target/i386/sev.c | 12 ++++++++++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/target/i386/sev_i386.h b/target/i386/sev_i386.h index afa19a0a161..cb5702a2397 100644 --- a/target/i386/sev_i386.h +++ b/target/i386/sev_i386.h @@ -30,7 +30,5 @@ extern uint32_t sev_get_cbit_position(void); extern uint32_t sev_get_reduced_phys_bits(void); extern char *sev_get_launch_measurement(void); extern SevCapability *sev_get_capabilities(Error **errp); -extern SevAttestationReport * -sev_get_attestation_report(const char *mnonce, Error **errp); #endif diff --git a/target/i386/monitor.c b/target/i386/monitor.c index c83cca80dc2..eb4539bf88b 100644 --- a/target/i386/monitor.c +++ b/target/i386/monitor.c @@ -762,9 +762,3 @@ void qmp_sev_inject_launch_secret(const char *packet_hdr, sev_inject_launch_secret(packet_hdr, secret, gpa, errp); } - -SevAttestationReport * -qmp_query_sev_attestation_report(const char *mnonce, Error **errp) -{ - return sev_get_attestation_report(mnonce, errp); -} diff --git a/target/i386/sev-sysemu-stub.c b/target/i386/sev-sysemu-stub.c index d556b4f091f..1f7573ad528 100644 --- a/target/i386/sev-sysemu-stub.c +++ b/target/i386/sev-sysemu-stub.c @@ -13,6 +13,7 @@ #include "qemu/osdep.h" #include "qapi/qapi-commands-misc-target.h" +#include "qapi/qmp/qerror.h" #include "qapi/error.h" #include "sev_i386.h" @@ -52,9 +53,8 @@ int sev_es_save_reset_vector(void *flash_ptr, uint64_t flash_size) g_assert_not_reached(); } -SevAttestationReport *sev_get_attestation_report(const char *mnonce, - Error **errp) +SevAttestationReport *qmp_query_sev_attestation_report(const char *mnonce, Error **errp) { - error_setg(errp, "SEV is not available in this QEMU"); + error_setg(errp, QERR_UNSUPPORTED); return NULL; } diff --git a/target/i386/sev.c b/target/i386/sev.c index 791804954e9..809054a84f2 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -31,6 +31,8 @@ #include "migration/blocker.h" #include "qom/object.h" #include "monitor/monitor.h" +#include "qapi/qapi-commands-misc-target.h" +#include "qapi/qmp/qerror.h" #include "exec/confidential-guest-support.h" #include "hw/i386/pc.h" @@ -487,8 +489,8 @@ out: return cap; } -SevAttestationReport * -sev_get_attestation_report(const char *mnonce, Error **errp) +static SevAttestationReport *sev_get_attestation_report(const char *mnonce, + Error **errp) { struct kvm_sev_attestation_report input = {}; SevAttestationReport *report = NULL; @@ -549,6 +551,12 @@ sev_get_attestation_report(const char *mnonce, Error **errp) return report; } +SevAttestationReport *qmp_query_sev_attestation_report(const char *mnonce, + Error **errp) +{ + return sev_get_attestation_report(mnonce, errp); +} + static int sev_read_file_base64(const char *filename, guchar **data, gsize *len) { From patchwork Wed Jun 16 20:43:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12325963 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DC047C48BE5 for ; Wed, 16 Jun 2021 21:00:22 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 697AB6109D for ; Wed, 16 Jun 2021 21:00:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 697AB6109D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:52252 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ltce3-0003mh-U6 for qemu-devel@archiver.kernel.org; Wed, 16 Jun 2021 17:00:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50040) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltcP2-0002ae-BV for qemu-devel@nongnu.org; Wed, 16 Jun 2021 16:44:48 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:29421) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltcOy-00015F-V3 for qemu-devel@nongnu.org; Wed, 16 Jun 2021 16:44:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623876284; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6Qhs5Kaq2kwAeqkE8Rl6FNf/UagyAFBSfq4AHlQjz5U=; b=QVvrw6exWpcnnp8nb0rVJRLGRlWyor6vat2JPNEkzgkXMEFkw1SFStxUfp9Mq2GlDCL+Rz GUL0KhhGP2b7qdhm4hoZ4NGaFbRVF1P+fznKuTiEBbuO5ktmOeL7GnYDh0fIJOrfA5CsHb GBK8KMr41/d3I8GoJpO+wHHCCcMEKQU= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-597-q5J0g7AoNhW8uNQ_6n3znQ-1; Wed, 16 Jun 2021 16:44:43 -0400 X-MC-Unique: q5J0g7AoNhW8uNQ_6n3znQ-1 Received: by mail-wr1-f72.google.com with SMTP id f9-20020a5d64c90000b029011a3c2a0337so1884811wri.0 for ; Wed, 16 Jun 2021 13:44:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6Qhs5Kaq2kwAeqkE8Rl6FNf/UagyAFBSfq4AHlQjz5U=; b=EaCiR5uGZ13LlzOWftcFvpP0RuTnvXhM9zWwkJMfxvUnwK5ppPymUPDfVIoQKFM9P6 qGMk4W9avB3LkyIkXnNmXAO8ko6Y+qus3zMT8JZ3WsH6tM0d+GMAQqVUs4ceGJSHvVuU aA07+CJsi6vAhD+z1Ykdn01GmpPOQb0zDzesF4nj88+GN1eTmyPkDJHKIcfB0jSu33pn 2aWAXBU2+LY+k+yM3OxbzxdMCNU8fqPvcBeqUTK+SVJG9gWBQ+ogrxjwwETqbqY7qcfn R2Nk5xKz9l0UUlXXNanEgMvNBlI6XYh1vPvrhFAgmLCDZnnWCQgOMsoE/Zx/vIKL6Z5f x07A== X-Gm-Message-State: AOAM531vbtaKGS1MAHjavqIKK8a5eNkquEraBFVngfbU+P0ufwksyrhP c2E+TN+95PAurrUW23VU2ooZNxhOFNNT/ZD4mT17q37ZTJ0JDYOWS4KyZUIEsgxyXYk2R1/gMl9 zCb833nlCvWY0reNqFY5MdBLO1nj7PiJS8TBWteyc2VzBcDfRN+YN1wP2e++zx8DZ X-Received: by 2002:a1c:5413:: with SMTP id i19mr976145wmb.12.1623876282058; Wed, 16 Jun 2021 13:44:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMbDqWgrIVYtvX6JNR7PcIPKcThRnUplFPf217UThn8MrR9IcG/XNIUpoiLFSpPT/JeLAfcQ== X-Received: by 2002:a1c:5413:: with SMTP id i19mr976116wmb.12.1623876281777; Wed, 16 Jun 2021 13:44:41 -0700 (PDT) Received: from x1w.. (93.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.93]) by smtp.gmail.com with ESMTPSA id t11sm3211509wrz.7.2021.06.16.13.44.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Jun 2021 13:44:41 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 12/23] target/i386/sev: Move qmp_sev_inject_launch_secret() to sev.c Date: Wed, 16 Jun 2021 22:43:17 +0200 Message-Id: <20210616204328.2611406-13-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210616204328.2611406-1-philmd@redhat.com> References: <20210616204328.2611406-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.199, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laszlo Ersek , Brijesh Singh , Eduardo Habkost , Sergio Lopez , "Michael S. Tsirkin" , Connor Kuehl , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , James Bottomley , Richard Henderson , "Dr . David Alan Gilbert" , Markus Armbruster , Dov Murik , Gerd Hoffmann , Igor Mammedov , Paolo Bonzini , Eric Blake Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Move qmp_sev_inject_launch_secret() from monitor.c to sev.c and make sev_inject_launch_secret() static. We don't need the stub anymore, remove it. Signed-off-by: Philippe Mathieu-Daudé --- target/i386/monitor.c | 31 ------------------------------- target/i386/sev-sysemu-stub.c | 6 +++--- target/i386/sev.c | 31 +++++++++++++++++++++++++++++++ 3 files changed, 34 insertions(+), 34 deletions(-) diff --git a/target/i386/monitor.c b/target/i386/monitor.c index eb4539bf88b..95b9ada189e 100644 --- a/target/i386/monitor.c +++ b/target/i386/monitor.c @@ -731,34 +731,3 @@ SevCapability *qmp_query_sev_capabilities(Error **errp) { return sev_get_capabilities(errp); } - -#define SEV_SECRET_GUID "4c2eb361-7d9b-4cc3-8081-127c90d3d294" -struct sev_secret_area { - uint32_t base; - uint32_t size; -}; - -void qmp_sev_inject_launch_secret(const char *packet_hdr, - const char *secret, - bool has_gpa, uint64_t gpa, - Error **errp) -{ - if (!sev_enabled()) { - error_setg(errp, QERR_UNSUPPORTED); - return; - } - if (!has_gpa) { - uint8_t *data; - struct sev_secret_area *area; - - if (!pc_system_ovmf_table_find(SEV_SECRET_GUID, &data, NULL)) { - error_setg(errp, "SEV: no secret area found in OVMF," - " gpa must be specified."); - return; - } - area = (struct sev_secret_area *)data; - gpa = area->base; - } - - sev_inject_launch_secret(packet_hdr, secret, gpa, errp); -} diff --git a/target/i386/sev-sysemu-stub.c b/target/i386/sev-sysemu-stub.c index 1f7573ad528..a66ae4f5efb 100644 --- a/target/i386/sev-sysemu-stub.c +++ b/target/i386/sev-sysemu-stub.c @@ -33,10 +33,10 @@ SevCapability *sev_get_capabilities(Error **errp) return NULL; } -int sev_inject_launch_secret(const char *hdr, const char *secret, - uint64_t gpa, Error **errp) +void qmp_sev_inject_launch_secret(const char *packet_header, const char *secret, + bool has_gpa, uint64_t gpa, Error **errp) { - return 1; + error_setg(errp, QERR_UNSUPPORTED); } int sev_encrypt_flash(uint8_t *ptr, uint64_t len, Error **errp) diff --git a/target/i386/sev.c b/target/i386/sev.c index 809054a84f2..7cdf8d857c8 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -955,6 +955,37 @@ int sev_inject_launch_secret(const char *packet_hdr, const char *secret, return 0; } +#define SEV_SECRET_GUID "4c2eb361-7d9b-4cc3-8081-127c90d3d294" +struct sev_secret_area { + uint32_t base; + uint32_t size; +}; + +void qmp_sev_inject_launch_secret(const char *packet_hdr, + const char *secret, + bool has_gpa, uint64_t gpa, + Error **errp) +{ + if (!sev_enabled()) { + error_setg(errp, QERR_UNSUPPORTED); + return; + } + if (!has_gpa) { + uint8_t *data; + struct sev_secret_area *area; + + if (!pc_system_ovmf_table_find(SEV_SECRET_GUID, &data, NULL)) { + error_setg(errp, "SEV: no secret area found in OVMF," + " gpa must be specified."); + return; + } + area = (struct sev_secret_area *)data; + gpa = area->base; + } + + sev_inject_launch_secret(packet_hdr, secret, gpa, errp); +} + static int sev_es_parse_reset_block(SevInfoBlock *info, uint32_t *addr) { From patchwork Wed Jun 16 20:43:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12325969 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 691B3C48BE5 for ; Wed, 16 Jun 2021 21:03:34 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D948560698 for ; Wed, 16 Jun 2021 21:03:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D948560698 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:58882 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ltchA-0008Ol-ST for qemu-devel@archiver.kernel.org; Wed, 16 Jun 2021 17:03:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50054) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltcP7-0002q2-Ce for qemu-devel@nongnu.org; Wed, 16 Jun 2021 16:44:53 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:36178) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltcP4-00018X-Mw for qemu-devel@nongnu.org; Wed, 16 Jun 2021 16:44:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623876290; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mTw6coySU0nJcHmY2S2py9HmFIvO1l0fChn4YRCOlgU=; b=WbO122IBGPSlIMKjGBYpwfqlxy8EoIIDF0i4+YbBBwOqPng7G6Dx2F890/yhFldTJKiahf yLz1KIezTlidzEYmPyYC/G05hr1f63xJddg7JuKZCMFYF2umzFgTun7JgaO0nXpLQ2MCtK U6gUyURn7WkRIWc/MgAhSc5go5D4Epw= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-47-Q7eICvoDMnekqVI49tUvOg-1; Wed, 16 Jun 2021 16:44:49 -0400 X-MC-Unique: Q7eICvoDMnekqVI49tUvOg-1 Received: by mail-wr1-f69.google.com with SMTP id y12-20020adffa4c0000b0290119c11bd29eso1880212wrr.2 for ; Wed, 16 Jun 2021 13:44:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mTw6coySU0nJcHmY2S2py9HmFIvO1l0fChn4YRCOlgU=; b=ePCS7AeSI87DbLT7tM/CpLIwPhrgOD7c6qgAv6tXEbswGNYK0TeM++Kwe54WJifKKw klzhH9eoSppiHlXFBaBi/dpAL7qEu30kGPGOjAw4a8u5lpeyR9Rj64Jxr/ABSM5DpOsx 9NdOh2rKWIEKJ1W97UTayEqV1BRnyPGJgSqVR8OHJhAtaBOoW2WYNeUvVyw22W5ZgaJV +Kc4CLJp4nmBW9twnfcaVB5UMIrtearDRxAG9gNB58RZoO8h6t9R9SKHv2Iqvp/u1ZqD OFb6DthxroK3u/HU9BFwXKHM+hYFznGWjlGCC74alb/Zav/Xg+yKcNq7QnmvlYdlGmCi e8/g== X-Gm-Message-State: AOAM530xZrO2lItilAT0YHdSRA6yp8lEqqB5vXcSDZsdnIegI4pMQj4J T6EiDBQA+LQSQGQxA53+5BcliVHDV3ZDPjyTFDl5CTTG/E077Pi6ibQ+PWsdS7+t7Yy1JtfLqKK qxoO0ZYj9p1VQOyIxatIihlY5+7MBfVvQrphjrs8xx10VLNeNgvXynraYi7eJmWQO X-Received: by 2002:a1c:4e03:: with SMTP id g3mr873142wmh.127.1623876287570; Wed, 16 Jun 2021 13:44:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzSo8Vje44Byvcni5YZ1Gy6T4dbU1s/gAfyqgBltfLzVwVkSAn7fAd1HH4psiTiXypj7W0VrQ== X-Received: by 2002:a1c:4e03:: with SMTP id g3mr873111wmh.127.1623876287327; Wed, 16 Jun 2021 13:44:47 -0700 (PDT) Received: from x1w.. (93.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.93]) by smtp.gmail.com with ESMTPSA id c12sm3204088wrw.46.2021.06.16.13.44.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Jun 2021 13:44:46 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 13/23] target/i386/sev: Move qmp_query_sev_capabilities() to sev.c Date: Wed, 16 Jun 2021 22:43:18 +0200 Message-Id: <20210616204328.2611406-14-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210616204328.2611406-1-philmd@redhat.com> References: <20210616204328.2611406-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.199, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laszlo Ersek , Brijesh Singh , Eduardo Habkost , Sergio Lopez , "Michael S. Tsirkin" , Connor Kuehl , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , James Bottomley , Richard Henderson , "Dr . David Alan Gilbert" , Markus Armbruster , Dov Murik , Gerd Hoffmann , Igor Mammedov , Paolo Bonzini , Eric Blake Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Move qmp_query_sev_capabilities() from monitor.c to sev.c and make sev_get_capabilities() static. We don't need the stub anymore, remove it. Signed-off-by: Philippe Mathieu-Daudé --- target/i386/sev_i386.h | 1 - target/i386/monitor.c | 5 ----- target/i386/sev-sysemu-stub.c | 4 ++-- target/i386/sev.c | 8 ++++++-- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/target/i386/sev_i386.h b/target/i386/sev_i386.h index cb5702a2397..62ee2e1b16a 100644 --- a/target/i386/sev_i386.h +++ b/target/i386/sev_i386.h @@ -29,6 +29,5 @@ extern SevInfo *sev_get_info(void); extern uint32_t sev_get_cbit_position(void); extern uint32_t sev_get_reduced_phys_bits(void); extern char *sev_get_launch_measurement(void); -extern SevCapability *sev_get_capabilities(Error **errp); #endif diff --git a/target/i386/monitor.c b/target/i386/monitor.c index 95b9ada189e..6c6d0b5d707 100644 --- a/target/i386/monitor.c +++ b/target/i386/monitor.c @@ -726,8 +726,3 @@ SevLaunchMeasureInfo *qmp_query_sev_launch_measure(Error **errp) return info; } - -SevCapability *qmp_query_sev_capabilities(Error **errp) -{ - return sev_get_capabilities(errp); -} diff --git a/target/i386/sev-sysemu-stub.c b/target/i386/sev-sysemu-stub.c index a66ae4f5efb..e62ac5edd83 100644 --- a/target/i386/sev-sysemu-stub.c +++ b/target/i386/sev-sysemu-stub.c @@ -27,9 +27,9 @@ char *sev_get_launch_measurement(void) return NULL; } -SevCapability *sev_get_capabilities(Error **errp) +SevCapability *qmp_query_sev_capabilities(Error **errp) { - error_setg(errp, "SEV is not available in this QEMU"); + error_setg(errp, QERR_UNSUPPORTED); return NULL; } diff --git a/target/i386/sev.c b/target/i386/sev.c index 7cdf8d857c8..23295d74c8b 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -438,8 +438,7 @@ e_free: return 1; } -SevCapability * -sev_get_capabilities(Error **errp) +static SevCapability *sev_get_capabilities(Error **errp) { SevCapability *cap = NULL; guchar *pdh_data = NULL; @@ -489,6 +488,11 @@ out: return cap; } +SevCapability *qmp_query_sev_capabilities(Error **errp) +{ + return sev_get_capabilities(errp); +} + static SevAttestationReport *sev_get_attestation_report(const char *mnonce, Error **errp) { From patchwork Wed Jun 16 20:43:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12325973 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35B3AC48BE5 for ; Wed, 16 Jun 2021 21:05:36 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8B11D6109D for ; Wed, 16 Jun 2021 21:05:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8B11D6109D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:39114 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ltcj8-0005d7-Lk for qemu-devel@archiver.kernel.org; Wed, 16 Jun 2021 17:05:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50066) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltcPC-000347-D5 for qemu-devel@nongnu.org; Wed, 16 Jun 2021 16:44:58 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:37167) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltcP9-0001BY-LS for qemu-devel@nongnu.org; Wed, 16 Jun 2021 16:44:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623876295; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YwN9k9erMbxP28zXm+/E3BtjsxL5FFiaHo0p4KwDA5c=; b=B+P8Sno8Qq8Uzvi0fZo3rWemkSSWYBRqD/RACEhXAT2MoXZtGCOBjDhL+64AKoAEfQoImY KiclWSHj6QxeQKV+3WUG0B1t+tjQipJw2tYw0gmhB68MRJAotGWZz8DmBelbL2ch1oI7V+ 47zYfCPSc0N+01VYFe9ndaFE895Jzkk= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-385-AN-VyG1HPvGXDOd9-GZEoA-1; Wed, 16 Jun 2021 16:44:54 -0400 X-MC-Unique: AN-VyG1HPvGXDOd9-GZEoA-1 Received: by mail-wr1-f72.google.com with SMTP id l2-20020adfe5820000b029011a64161d6aso1877279wrm.6 for ; Wed, 16 Jun 2021 13:44:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YwN9k9erMbxP28zXm+/E3BtjsxL5FFiaHo0p4KwDA5c=; b=WQii36Cic/U32lw8N1aseANJQHfEeB2fya9xDffHudBZLpBGidYoBbCo38jU49CU9G A1ciRjvry7IvL/wBUZhxq6sfZxFG/99CiEuZApXI0DNot0x8CNryiS9T87Ed5aLTUe+q O4sM3oSpCdb9j7GghEafk471f1me/ClJuPNNd5eBClxeBye7CmvsOv2MaTAVoZPhm9D2 OTdY9hYSQIhWtRbrEmc31cPGu3drZgixNirh447mGKNwkAehk5NS1+bL8gNmEtjzbQaF FZn2pdmQmVvXhM0KWmIay/DkT6ge/s5OBceYfQLmd6VRGGOZbk6KHV/c6VZ7JpcJlY0W 7BvA== X-Gm-Message-State: AOAM530m1SMJwSo4fB/iqK9C9dnn3Z8ylcsEB45uwB4xNTQpzeRZLBLw akauuFr+iYfJplybRWoq+tI3ojSAZh1WjfPxguPxDpaAc9pdYhTBwUV3PU16TAA96W5wwjd9jt8 SaGgP8uakqdHqNgQCKKhiWNskhTDWDE1YncbmiQhTQJtOZuyCCfvoNFKssE2XO3wH X-Received: by 2002:a05:6000:10e:: with SMTP id o14mr1207089wrx.76.1623876292653; Wed, 16 Jun 2021 13:44:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwPtcGMuuCPV6j8X7fX2Wamjki6bV6QuxuLKex07GP+vJnlF7gENNSAEE/zq/pgF9lx/lpF/A== X-Received: by 2002:a05:6000:10e:: with SMTP id o14mr1207058wrx.76.1623876292473; Wed, 16 Jun 2021 13:44:52 -0700 (PDT) Received: from x1w.. (93.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.93]) by smtp.gmail.com with ESMTPSA id l4sm3209991wru.41.2021.06.16.13.44.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Jun 2021 13:44:52 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 14/23] target/i386/sev: Move qmp_query_sev_launch_measure() to sev.c Date: Wed, 16 Jun 2021 22:43:19 +0200 Message-Id: <20210616204328.2611406-15-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210616204328.2611406-1-philmd@redhat.com> References: <20210616204328.2611406-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.199, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laszlo Ersek , Brijesh Singh , Eduardo Habkost , Sergio Lopez , "Michael S. Tsirkin" , Connor Kuehl , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , James Bottomley , Richard Henderson , "Dr . David Alan Gilbert" , Markus Armbruster , Dov Murik , Gerd Hoffmann , Igor Mammedov , Paolo Bonzini , Eric Blake Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Move qmp_query_sev_launch_measure() from monitor.c to sev.c and make sev_get_launch_measurement() static. We don't need the stub anymore, remove it. Signed-off-by: Philippe Mathieu-Daudé --- target/i386/sev_i386.h | 1 - target/i386/monitor.c | 17 ----------------- target/i386/sev-sysemu-stub.c | 3 ++- target/i386/sev.c | 20 ++++++++++++++++++-- 4 files changed, 20 insertions(+), 21 deletions(-) diff --git a/target/i386/sev_i386.h b/target/i386/sev_i386.h index 62ee2e1b16a..615cebea1a8 100644 --- a/target/i386/sev_i386.h +++ b/target/i386/sev_i386.h @@ -28,6 +28,5 @@ extern bool sev_es_enabled(void); extern SevInfo *sev_get_info(void); extern uint32_t sev_get_cbit_position(void); extern uint32_t sev_get_reduced_phys_bits(void); -extern char *sev_get_launch_measurement(void); #endif diff --git a/target/i386/monitor.c b/target/i386/monitor.c index 6c6d0b5d707..d2289d1fb47 100644 --- a/target/i386/monitor.c +++ b/target/i386/monitor.c @@ -709,20 +709,3 @@ void hmp_info_sev(Monitor *mon, const QDict *qdict) qapi_free_SevInfo(info); } - -SevLaunchMeasureInfo *qmp_query_sev_launch_measure(Error **errp) -{ - char *data; - SevLaunchMeasureInfo *info; - - data = sev_get_launch_measurement(); - if (!data) { - error_setg(errp, "Measurement is not available"); - return NULL; - } - - info = g_malloc0(sizeof(*info)); - info->data = data; - - return info; -} diff --git a/target/i386/sev-sysemu-stub.c b/target/i386/sev-sysemu-stub.c index e62ac5edd83..f5e7536f987 100644 --- a/target/i386/sev-sysemu-stub.c +++ b/target/i386/sev-sysemu-stub.c @@ -22,8 +22,9 @@ SevInfo *sev_get_info(void) return NULL; } -char *sev_get_launch_measurement(void) +SevLaunchMeasureInfo *qmp_query_sev_launch_measure(Error **errp) { + error_setg(errp, QERR_UNSUPPORTED); return NULL; } diff --git a/target/i386/sev.c b/target/i386/sev.c index 23295d74c8b..4ddd24f6bdd 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -718,8 +718,7 @@ free_measurement: g_free(measurement); } -char * -sev_get_launch_measurement(void) +static char *sev_get_launch_measurement(void) { if (sev_guest && sev_guest->state >= SEV_STATE_LAUNCH_SECRET) { @@ -729,6 +728,23 @@ sev_get_launch_measurement(void) return NULL; } +SevLaunchMeasureInfo *qmp_query_sev_launch_measure(Error **errp) +{ + char *data; + SevLaunchMeasureInfo *info; + + data = sev_get_launch_measurement(); + if (!data) { + error_setg(errp, "Measurement is not available"); + return NULL; + } + + info = g_malloc0(sizeof(*info)); + info->data = data; + + return info; +} + static Notifier sev_machine_done_notify = { .notify = sev_launch_get_measure, }; From patchwork Wed Jun 16 20:43:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12325953 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D6A54C48BE5 for ; Wed, 16 Jun 2021 20:57:19 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 77A406109D for ; Wed, 16 Jun 2021 20:57:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 77A406109D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:38866 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ltcb8-0003FY-NE for qemu-devel@archiver.kernel.org; Wed, 16 Jun 2021 16:57:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50088) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltcPI-0003Gr-3d for qemu-devel@nongnu.org; Wed, 16 Jun 2021 16:45:05 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:28161) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltcPF-0001Fn-MR for qemu-devel@nongnu.org; Wed, 16 Jun 2021 16:45:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623876301; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ijj3oNp2VS3kgk+CrwqOtjV8Sk3tYYaTdyhsxAOEaz8=; b=CV9ZtxYgFUNXrJdDnqw5Qcsj0yYtCOFBO5YuDTtiVdekJULjGdeuYGuUR6NYhLxYSRRGo3 +WSezqWT/K5nkIDyORvaXGMwdCgwgnlLBQDSUYOtvPtL3BjMK7hfLzpqjHNd4LRc++Hrmb 7P6ueTHIwgKxN1prWnvkai2uOHwQ0q8= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-43-TbAqhnLuMLuWD3FhadMT3Q-1; Wed, 16 Jun 2021 16:44:59 -0400 X-MC-Unique: TbAqhnLuMLuWD3FhadMT3Q-1 Received: by mail-wm1-f71.google.com with SMTP id r23-20020a05600c2f17b02901d166ff8239so346569wmn.8 for ; Wed, 16 Jun 2021 13:44:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Ijj3oNp2VS3kgk+CrwqOtjV8Sk3tYYaTdyhsxAOEaz8=; b=PoCFgxYc6CeHyDdLpOAubKGUhziTrd5gmHF+Bcy/Xs226yRh3yOACqthMpXS35v5P8 KZn9LrjDYhh2HNejk10QO3GuJ4eKopDaJ2434pLgueeC9C4wksojfXx9TkrlvRlim4dJ Kw3EA4BMer6AyHZn6YoH1g8DdaRjJQ4Am5yTfExux+aIB+Q8I1hKdFZwJF2RgTsnpb49 XrsWbywh9YV42oOL3icVHF0ff+u3JxybuSMxYMUI2IHy8kOyrkA5zxxJQ9TCyseOvvn+ lorp+nwCzKqWAYYbGYdmA4NkLjIjXwQ9VaQqPUHeLxUbTOxvX5Us4pnJpt5bCg1dL0fV ja0g== X-Gm-Message-State: AOAM530YuH4/bI5tqRi16X70Oi3XixV6E8ukrBh0jCwsncNbKNxGlzUI IT+kz0teU/byVZKcMNmgfAuMHV8WKpGGYAzsV6JJOTEYSjDG7+xfXHiuZsJ9zFCptcDcp9rqoJU xuJ3d0rcvKzrctd57owxtq/ZVNazrEw/Daigd0V1Z52fKuDCrNOc/4/casKtq1TQJ X-Received: by 2002:a5d:65cf:: with SMTP id e15mr1204756wrw.310.1623876298124; Wed, 16 Jun 2021 13:44:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5+X+8fHj1VhpPJYK+cZ3JWp58yIDid/zhKB9G0SHcAxyJVhhQM2jWI39yuYLUvzA6Gv/VFw== X-Received: by 2002:a5d:65cf:: with SMTP id e15mr1204724wrw.310.1623876297901; Wed, 16 Jun 2021 13:44:57 -0700 (PDT) Received: from x1w.. (93.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.93]) by smtp.gmail.com with ESMTPSA id z10sm2835758wmb.26.2021.06.16.13.44.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Jun 2021 13:44:57 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 15/23] target/i386/sev: Move qmp_query_sev() & hmp_info_sev() to sev.c Date: Wed, 16 Jun 2021 22:43:20 +0200 Message-Id: <20210616204328.2611406-16-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210616204328.2611406-1-philmd@redhat.com> References: <20210616204328.2611406-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.199, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laszlo Ersek , Brijesh Singh , Eduardo Habkost , Sergio Lopez , "Michael S. Tsirkin" , Connor Kuehl , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , James Bottomley , Richard Henderson , "Dr . David Alan Gilbert" , Markus Armbruster , Dov Murik , Gerd Hoffmann , Igor Mammedov , Paolo Bonzini , Eric Blake Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Move qmp_query_sev() & hmp_info_sev()() from monitor.c to sev.c and make sev_get_info() static. We don't need the stub anymore, remove it. Add a stub for hmp_info_sev(). Signed-off-by: Philippe Mathieu-Daudé --- Note: what is left in sev_i386.h eventually belong to "sysemu/sev.h" meaning we could remove this local header. --- target/i386/sev_i386.h | 2 -- target/i386/monitor.c | 37 --------------------------------- target/i386/sev-sysemu-stub.c | 10 ++++++++- target/i386/sev.c | 39 +++++++++++++++++++++++++++++++++-- 4 files changed, 46 insertions(+), 42 deletions(-) diff --git a/target/i386/sev_i386.h b/target/i386/sev_i386.h index 615cebea1a8..1ddb8df9c99 100644 --- a/target/i386/sev_i386.h +++ b/target/i386/sev_i386.h @@ -15,7 +15,6 @@ #define QEMU_SEV_I386_H #include "sysemu/sev.h" -#include "qapi/qapi-types-misc-target.h" #define SEV_POLICY_NODBG 0x1 #define SEV_POLICY_NOKS 0x2 @@ -25,7 +24,6 @@ #define SEV_POLICY_SEV 0x20 extern bool sev_es_enabled(void); -extern SevInfo *sev_get_info(void); extern uint32_t sev_get_cbit_position(void); extern uint32_t sev_get_reduced_phys_bits(void); diff --git a/target/i386/monitor.c b/target/i386/monitor.c index d2289d1fb47..af3501095e5 100644 --- a/target/i386/monitor.c +++ b/target/i386/monitor.c @@ -28,11 +28,8 @@ #include "monitor/hmp-target.h" #include "monitor/hmp.h" #include "qapi/qmp/qdict.h" -#include "qapi/qmp/qerror.h" #include "sysemu/kvm.h" -#include "sysemu/sev.h" #include "qapi/error.h" -#include "sev_i386.h" #include "qapi/qapi-commands-misc-target.h" #include "qapi/qapi-commands-misc.h" #include "hw/i386/pc.h" @@ -675,37 +672,3 @@ void hmp_info_io_apic(Monitor *mon, const QDict *qdict) monitor_printf(mon, "This command is obsolete and will be " "removed soon. Please use 'info pic' instead.\n"); } - -SevInfo *qmp_query_sev(Error **errp) -{ - SevInfo *info; - - info = sev_get_info(); - if (!info) { - error_setg(errp, "SEV feature is not available"); - return NULL; - } - - return info; -} - -void hmp_info_sev(Monitor *mon, const QDict *qdict) -{ - SevInfo *info = sev_get_info(); - - if (info && info->enabled) { - monitor_printf(mon, "handle: %d\n", info->handle); - monitor_printf(mon, "state: %s\n", SevState_str(info->state)); - monitor_printf(mon, "build: %d\n", info->build_id); - monitor_printf(mon, "api version: %d.%d\n", - info->api_major, info->api_minor); - monitor_printf(mon, "debug: %s\n", - info->policy & SEV_POLICY_NODBG ? "off" : "on"); - monitor_printf(mon, "key-sharing: %s\n", - info->policy & SEV_POLICY_NOKS ? "off" : "on"); - } else { - monitor_printf(mon, "SEV is not enabled\n"); - } - - qapi_free_SevInfo(info); -} diff --git a/target/i386/sev-sysemu-stub.c b/target/i386/sev-sysemu-stub.c index f5e7536f987..7a35f0432b2 100644 --- a/target/i386/sev-sysemu-stub.c +++ b/target/i386/sev-sysemu-stub.c @@ -12,13 +12,16 @@ */ #include "qemu/osdep.h" +#include "monitor/monitor.h" +#include "monitor/hmp.h" #include "qapi/qapi-commands-misc-target.h" #include "qapi/qmp/qerror.h" #include "qapi/error.h" #include "sev_i386.h" -SevInfo *sev_get_info(void) +SevInfo *qmp_query_sev(Error **errp) { + error_setg(errp, QERR_UNSUPPORTED); return NULL; } @@ -59,3 +62,8 @@ SevAttestationReport *qmp_query_sev_attestation_report(const char *mnonce, Error error_setg(errp, QERR_UNSUPPORTED); return NULL; } + +void hmp_info_sev(Monitor *mon, const QDict *qdict) +{ + monitor_printf(mon, "SEV is not available in this QEMU\n"); +} diff --git a/target/i386/sev.c b/target/i386/sev.c index 4ddd24f6bdd..faa3a4015c4 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -27,10 +27,12 @@ #include "sev_i386.h" #include "sysemu/sysemu.h" #include "sysemu/runstate.h" +#include "sysemu/sev.h" #include "trace.h" #include "migration/blocker.h" #include "qom/object.h" #include "monitor/monitor.h" +#include "monitor/hmp.h" #include "qapi/qapi-commands-misc-target.h" #include "qapi/qmp/qerror.h" #include "exec/confidential-guest-support.h" @@ -375,8 +377,7 @@ sev_get_reduced_phys_bits(void) return sev_guest ? sev_guest->reduced_phys_bits : 0; } -SevInfo * -sev_get_info(void) +static SevInfo *sev_get_info(void) { SevInfo *info; @@ -395,6 +396,40 @@ sev_get_info(void) return info; } +SevInfo *qmp_query_sev(Error **errp) +{ + SevInfo *info; + + info = sev_get_info(); + if (!info) { + error_setg(errp, "SEV feature is not available"); + return NULL; + } + + return info; +} + +void hmp_info_sev(Monitor *mon, const QDict *qdict) +{ + SevInfo *info = sev_get_info(); + + if (info && info->enabled) { + monitor_printf(mon, "handle: %d\n", info->handle); + monitor_printf(mon, "state: %s\n", SevState_str(info->state)); + monitor_printf(mon, "build: %d\n", info->build_id); + monitor_printf(mon, "api version: %d.%d\n", + info->api_major, info->api_minor); + monitor_printf(mon, "debug: %s\n", + info->policy & SEV_POLICY_NODBG ? "off" : "on"); + monitor_printf(mon, "key-sharing: %s\n", + info->policy & SEV_POLICY_NOKS ? "off" : "on"); + } else { + monitor_printf(mon, "SEV is not enabled\n"); + } + + qapi_free_SevInfo(info); +} + static int sev_get_pdh_info(int fd, guchar **pdh, size_t *pdh_len, guchar **cert_chain, size_t *cert_chain_len, Error **errp) From patchwork Wed Jun 16 20:43:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12325961 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E2E63C48BE5 for ; Wed, 16 Jun 2021 20:59:16 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8EDD46109D for ; Wed, 16 Jun 2021 20:59:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8EDD46109D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:47394 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ltcd1-0000Xq-Mo for qemu-devel@archiver.kernel.org; Wed, 16 Jun 2021 16:59:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50118) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltcPP-0003Pt-Cd for qemu-devel@nongnu.org; Wed, 16 Jun 2021 16:45:11 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:39726) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltcPL-0001IP-9h for qemu-devel@nongnu.org; Wed, 16 Jun 2021 16:45:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623876306; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3bGf8QhwYTyqtZDoJsvakD6t0hbGYHq/YSQMhMqEONQ=; b=h2FNSbBKV3DvecB3kPaO+lyQTidI8OrnHFJbXMYg78QPCPpn08k1RvcVOtrOxGhEI7fF03 Y+f5uLkAxeSeRPJiEVV7IBaXn1G0Qlzo3o1OVtnEOjeB0+8c0t7X9uvRBixiwYYcXyqLYq Ys7KEhVVOI3dvozwltClQ3hc4OK46+8= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-455-UV-P0bgHM4uu_fic0UbFRw-1; Wed, 16 Jun 2021 16:45:05 -0400 X-MC-Unique: UV-P0bgHM4uu_fic0UbFRw-1 Received: by mail-wr1-f70.google.com with SMTP id y12-20020adffa4c0000b0290119c11bd29eso1880533wrr.2 for ; Wed, 16 Jun 2021 13:45:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3bGf8QhwYTyqtZDoJsvakD6t0hbGYHq/YSQMhMqEONQ=; b=AwcPfaNCuam9NkOtvSOQ1gaA+XOsYGV+9/dY6DgKcpT8kqxDs4rbBVITUxaKFVNBlx iQLHd44l8YjTHoaa4lSRYV6bo6KuY9bA5fkUOT8If3BKYofVA3aHs8BszXz2MdoOMBBk eqUmTecP6vkW56FDgDjehZEiyhI+dBT+alGC3itIIUJsKxHj3PnPjbgWr2F+cdONC0Pp TOrhrFvUc94rYpCgaNQskNvNA08c0LdK2HS28Lse0U1sb6k1GYIjgcjhMNREumVW8pjn tuoHNFyzFjc1FQJi09TdKg9ETsYjsc+GthlOcTTfEi8pqfTwb76LNiGV4bWWZ7g7omSV P0nA== X-Gm-Message-State: AOAM531lRAC4Ehv6XcfIsqfB20DnoGsqeSBpUqpZJwt1Db6KOWQT86Xx dy+MRJ+GsHByEqCnqz2x6AHFsytZlXzMk/ZIOJIUHTC6II7T1GTk1QVWZWdOZu1CsMIQejQfgCz AhP9bEm6KaYT46fJMO77hatrnZ2JB+fh54rVL3TE/sEcxoP8AhE6RA9N2qHGwLg1F X-Received: by 2002:a5d:6409:: with SMTP id z9mr1113397wru.279.1623876303622; Wed, 16 Jun 2021 13:45:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJynwZXpcVLlZib7B8sx/BV0PpHR0qDK53qhbU9+sYtzFjcVbaZzc4WW1jr+vva0jaTmh1HbvQ== X-Received: by 2002:a5d:6409:: with SMTP id z9mr1113354wru.279.1623876303416; Wed, 16 Jun 2021 13:45:03 -0700 (PDT) Received: from x1w.. (93.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.93]) by smtp.gmail.com with ESMTPSA id x7sm3370919wre.8.2021.06.16.13.45.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Jun 2021 13:45:03 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 16/23] monitor: Restrict 'info sev' to x86 targets Date: Wed, 16 Jun 2021 22:43:21 +0200 Message-Id: <20210616204328.2611406-17-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210616204328.2611406-1-philmd@redhat.com> References: <20210616204328.2611406-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.199, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laszlo Ersek , Brijesh Singh , Eduardo Habkost , Sergio Lopez , "Michael S. Tsirkin" , Connor Kuehl , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , James Bottomley , Richard Henderson , "Dr . David Alan Gilbert" , Markus Armbruster , Dov Murik , Gerd Hoffmann , Igor Mammedov , Paolo Bonzini , Eric Blake Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- include/monitor/hmp-target.h | 1 + include/monitor/hmp.h | 1 - target/i386/sev-sysemu-stub.c | 2 +- target/i386/sev.c | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/monitor/hmp-target.h b/include/monitor/hmp-target.h index 60fc92722ae..20adbea5154 100644 --- a/include/monitor/hmp-target.h +++ b/include/monitor/hmp-target.h @@ -49,5 +49,6 @@ void hmp_info_tlb(Monitor *mon, const QDict *qdict); void hmp_mce(Monitor *mon, const QDict *qdict); void hmp_info_local_apic(Monitor *mon, const QDict *qdict); void hmp_info_io_apic(Monitor *mon, const QDict *qdict); +void hmp_info_sev(Monitor *mon, const QDict *qdict); #endif /* MONITOR_HMP_TARGET_H */ diff --git a/include/monitor/hmp.h b/include/monitor/hmp.h index 3baa1058e2c..6bc27639e01 100644 --- a/include/monitor/hmp.h +++ b/include/monitor/hmp.h @@ -124,7 +124,6 @@ void hmp_info_ramblock(Monitor *mon, const QDict *qdict); void hmp_hotpluggable_cpus(Monitor *mon, const QDict *qdict); void hmp_info_vm_generation_id(Monitor *mon, const QDict *qdict); void hmp_info_memory_size_summary(Monitor *mon, const QDict *qdict); -void hmp_info_sev(Monitor *mon, const QDict *qdict); void hmp_info_replay(Monitor *mon, const QDict *qdict); void hmp_replay_break(Monitor *mon, const QDict *qdict); void hmp_replay_delete_break(Monitor *mon, const QDict *qdict); diff --git a/target/i386/sev-sysemu-stub.c b/target/i386/sev-sysemu-stub.c index 7a35f0432b2..aba02f3c332 100644 --- a/target/i386/sev-sysemu-stub.c +++ b/target/i386/sev-sysemu-stub.c @@ -13,7 +13,7 @@ #include "qemu/osdep.h" #include "monitor/monitor.h" -#include "monitor/hmp.h" +#include "monitor/hmp-target.h" #include "qapi/qapi-commands-misc-target.h" #include "qapi/qmp/qerror.h" #include "qapi/error.h" diff --git a/target/i386/sev.c b/target/i386/sev.c index faa3a4015c4..339564ad2c8 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -32,7 +32,7 @@ #include "migration/blocker.h" #include "qom/object.h" #include "monitor/monitor.h" -#include "monitor/hmp.h" +#include "monitor/hmp-target.h" #include "qapi/qapi-commands-misc-target.h" #include "qapi/qmp/qerror.h" #include "exec/confidential-guest-support.h" From patchwork Wed Jun 16 20:43:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12325951 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AD7CAC48BE5 for ; Wed, 16 Jun 2021 20:56:57 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 405EB610CA for ; Wed, 16 Jun 2021 20:56:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 405EB610CA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:38276 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ltcam-0002s9-7d for qemu-devel@archiver.kernel.org; Wed, 16 Jun 2021 16:56:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50140) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltcPS-0003UQ-7F for qemu-devel@nongnu.org; Wed, 16 Jun 2021 16:45:14 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:44437) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltcPQ-0001LF-9J for qemu-devel@nongnu.org; Wed, 16 Jun 2021 16:45:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623876311; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=B1OGMC38jawyGu8IsSixsuh7u6q/pZHdAwAhcewq1IY=; b=eDdrXE7mInebAuyExlXaepXU1dMaifwWLbYod+wHWENr+BvsLq56W4Tu8wBpyUmty6LMMT JmL8VPccXvpCzJoGX+NrxRIU3sOD4wWPARGA915WMvpggLM0Ikh3Qr2qjYImS9JdK1toWa rnpDfpjqbmBjGEzejc3lnfg+QE6oYBc= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-566-9VkF-CgfN5W_owjuu5J3aQ-1; Wed, 16 Jun 2021 16:45:10 -0400 X-MC-Unique: 9VkF-CgfN5W_owjuu5J3aQ-1 Received: by mail-wr1-f70.google.com with SMTP id j2-20020a5d61820000b029011a6a8149b5so1423373wru.14 for ; Wed, 16 Jun 2021 13:45:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=B1OGMC38jawyGu8IsSixsuh7u6q/pZHdAwAhcewq1IY=; b=IOs1RE2aujqg4r8TsFHX3eU+wcKU69GwbH4fNkPJOA6GV2XVepSNrVOJhGs/5CgE/J MhfVLnSu+HvumudhuNPSzD5j29H0FtmnJvFKneQ54enn+779m+p88uTX/Iu//HUOTmeT +tSarx/5GcRTHpYQyqN+LADVPTHgCe2SV7yA00HNQFRPhCQOIpyqW+7GtZtrFTvXSygN g4iTkF0LrFk7T4IX2yBpBC4dQHucADFI690f1lhGodytXE6oFXcXZZqY8TZWd/7TAfIz 4BistAONtuNpkc/gf+CBuOIh3r+qKALdopUVEYUdZUJam1puyA4cG9Qhpdt1pT6xG/j4 aN3Q== X-Gm-Message-State: AOAM5332IfcrD1KvW1eqIscP2KUsCGTG2MDyE1lRtkiDH/OfdlG5kNb+ k+ZtqhjmkWvPkFEEx5WrZki69tEnjZmknNPNCQe1yUsNkvEZzE4VP3hw7QvqfeOxAPF/XbSMpm9 x7x2zqpmMeSVTWqV4Z4fWvllhYgr0wibCA4m4zvgNe4T5YlZr0+s5q7hnM99AFrQI X-Received: by 2002:adf:e8cb:: with SMTP id k11mr1125145wrn.127.1623876309360; Wed, 16 Jun 2021 13:45:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJznoXgpV3ZF9r/NrrherIdtT7FfLJzQ7uzNWIHVNB4jd8A6ysHUcSR2jeIZq88fHG/p0YjIwQ== X-Received: by 2002:adf:e8cb:: with SMTP id k11mr1125112wrn.127.1623876309208; Wed, 16 Jun 2021 13:45:09 -0700 (PDT) Received: from x1w.. (93.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.93]) by smtp.gmail.com with ESMTPSA id o26sm2696766wms.27.2021.06.16.13.45.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Jun 2021 13:45:08 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 17/23] hw/i386/acpi-common: Remove unused includes Date: Wed, 16 Jun 2021 22:43:22 +0200 Message-Id: <20210616204328.2611406-18-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210616204328.2611406-1-philmd@redhat.com> References: <20210616204328.2611406-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.133.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.199, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laszlo Ersek , Brijesh Singh , Eduardo Habkost , Sergio Lopez , "Michael S. Tsirkin" , Connor Kuehl , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , James Bottomley , Richard Henderson , "Dr . David Alan Gilbert" , Markus Armbruster , Dov Murik , Gerd Hoffmann , Igor Mammedov , Paolo Bonzini , Eric Blake Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/acpi-common.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/hw/i386/acpi-common.c b/hw/i386/acpi-common.c index 1f5947fcf96..77afebd9e1f 100644 --- a/hw/i386/acpi-common.c +++ b/hw/i386/acpi-common.c @@ -21,15 +21,10 @@ */ #include "qemu/osdep.h" -#include "qapi/error.h" - -#include "exec/memory.h" #include "hw/acpi/acpi.h" #include "hw/acpi/aml-build.h" -#include "hw/acpi/utils.h" #include "hw/i386/pc.h" #include "target/i386/cpu.h" - #include "acpi-build.h" #include "acpi-common.h" From patchwork Wed Jun 16 20:43:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12325947 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 12312C48BE5 for ; Wed, 16 Jun 2021 20:54:54 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C940661076 for ; Wed, 16 Jun 2021 20:54:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C940661076 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:33370 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ltcYn-0007un-11 for qemu-devel@archiver.kernel.org; Wed, 16 Jun 2021 16:54:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50206) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltcPc-0003gF-E6 for qemu-devel@nongnu.org; Wed, 16 Jun 2021 16:45:26 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:34131) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltcPY-0001Qw-0w for qemu-devel@nongnu.org; Wed, 16 Jun 2021 16:45:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623876319; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cY8oP9xa0KaEyRIW/MhQjUz22bVRjld90OclKILOu7M=; b=g57ZijlV1YZE53JVPV1g2zJnnhvd3fqxilXACcslL1pbuSey2yQ3pnCVPqn0IBvREmV4pl Y7rCppNQ0dLf6/+UA2b6UG9tzrOJXe4qekV2UpkSZ13M1Yvi0ellRMaYVLNl8ogSmcjYC8 C+ypKwTJV1Zs9RdwgqX5rNFp+RyMbpE= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-406-ga6YDfgEOUmFJRYeGxFpFw-1; Wed, 16 Jun 2021 16:45:16 -0400 X-MC-Unique: ga6YDfgEOUmFJRYeGxFpFw-1 Received: by mail-wr1-f72.google.com with SMTP id h104-20020adf90710000b029010de8455a3aso1857489wrh.12 for ; Wed, 16 Jun 2021 13:45:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cY8oP9xa0KaEyRIW/MhQjUz22bVRjld90OclKILOu7M=; b=D5KupSj+UWSyYadNS2TxLjw7ggPIY+SWW0hzRf0bPuxxAYkTyLNUXdcsxRWYWYHWUJ 9jsA6m9y9nS+BUauraB4EgHcpYBt6QK2X7YtwnhJgN+SlT2BiBeupr7//yWic8VxKi43 m2t7qwtxasX3x6lAo145jEl5VRoUan1jK2sLAnAb4Lj79BMfzxLUHkwv5M2BWhOXbkX9 K29lRfWkZMK5nQgtxv6b0Zgmzh+Snafh/CRw/l5yWSqIAlbC3Vbt2X6tWNtLiGiq06nB Iv9BLtTG64WeS6TRFYBzmRRA7AeDcx4lYsbJYrVHNT4nkh/GEGCT5FSCD4rpMcP/pprz xp9w== X-Gm-Message-State: AOAM531mI16ASKtrH0ZgvbhhSb0D5a8r/ittTwl57ss0N8Pzh2rq5M+H 9fiXBNSmvfVA/0mMfPRMfKqC5JZQX3R/TfhDVIyW7AiR+85l7bYdFMjBl+AQfN6sPfWqCwmBFLR +h67frG/F3CvwfcyDFwkG0hHSZqnb/PR/W4Ki/JE599n8EPkfsiC05fM/p3e3uza6 X-Received: by 2002:a5d:59ae:: with SMTP id p14mr1152664wrr.188.1623876314729; Wed, 16 Jun 2021 13:45:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJL7+57hA3Ci6zTGOC9hdKtg+H8NP/5W6EQysPZtoO37Flp2m7fbS7SkJRIDhaoHQNBGO5FQ== X-Received: by 2002:a5d:59ae:: with SMTP id p14mr1152629wrr.188.1623876314522; Wed, 16 Jun 2021 13:45:14 -0700 (PDT) Received: from x1w.. (93.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.93]) by smtp.gmail.com with ESMTPSA id o3sm3881680wrc.0.2021.06.16.13.45.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Jun 2021 13:45:14 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 18/23] hw/i386: Rename acpi-build.c -> acpi-pc.c Date: Wed, 16 Jun 2021 22:43:23 +0200 Message-Id: <20210616204328.2611406-19-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210616204328.2611406-1-philmd@redhat.com> References: <20210616204328.2611406-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.133.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.199, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laszlo Ersek , Brijesh Singh , Eduardo Habkost , Sergio Lopez , "Michael S. Tsirkin" , Connor Kuehl , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , James Bottomley , Richard Henderson , "Dr . David Alan Gilbert" , Markus Armbruster , Dov Murik , Gerd Hoffmann , Igor Mammedov , Paolo Bonzini , Eric Blake Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" The acpi-build.c file contains routines common to the QEMU "PC" machines (Q35+ICH & i440FX+PIIX), rename it as acpi-pc.c. Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/{acpi-build.c => acpi-pc.c} | 0 hw/i386/meson.build | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename hw/i386/{acpi-build.c => acpi-pc.c} (100%) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-pc.c similarity index 100% rename from hw/i386/acpi-build.c rename to hw/i386/acpi-pc.c diff --git a/hw/i386/meson.build b/hw/i386/meson.build index e5d109f5c64..f95ed7d4efe 100644 --- a/hw/i386/meson.build +++ b/hw/i386/meson.build @@ -22,7 +22,7 @@ i386_ss.add(when: 'CONFIG_PC', if_true: files( 'pc.c', 'pc_sysfw.c', - 'acpi-build.c', + 'acpi-pc.c', 'port92.c')) subdir('kvm') From patchwork Wed Jun 16 20:43:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12325975 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E1F3FC48BE6 for ; Wed, 16 Jun 2021 21:06:27 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4A0056109D for ; Wed, 16 Jun 2021 21:06:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4A0056109D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:42212 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ltcjy-0007o0-Fu for qemu-devel@archiver.kernel.org; Wed, 16 Jun 2021 17:06:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50404) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltcQA-0004SY-0K for qemu-devel@nongnu.org; Wed, 16 Jun 2021 16:45:58 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:43594) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltcPz-0001cw-2r for qemu-devel@nongnu.org; Wed, 16 Jun 2021 16:45:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623876346; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4OKxB9aMXMBUxq8Iq2kay9+mSOYnNmtBdcnlzYkDQcU=; b=dmYF1D5My7yPclBwtzHWWg+P0ser9jeAMOcjKTX7tdspDmvim71ac4LM3GwfnkGO68mDdm oPPLAs9477xL2kG1Xs4kvW45f2mO+9VxTKXgvwvN05kNTSF9pB1ij4Gu77eA61GVYa0bOy A/8LOA9A0mOWvxeOOe4WqBxc+sRHC3w= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-324-cmZ8qeVZNBuuzV87iRMHDw-1; Wed, 16 Jun 2021 16:45:21 -0400 X-MC-Unique: cmZ8qeVZNBuuzV87iRMHDw-1 Received: by mail-wr1-f70.google.com with SMTP id f9-20020a5d64c90000b029011a3c2a0337so1885707wri.0 for ; Wed, 16 Jun 2021 13:45:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4OKxB9aMXMBUxq8Iq2kay9+mSOYnNmtBdcnlzYkDQcU=; b=RItnQSNIjv2793GWvP5V0zfzLnWpkXbD93HNBOt4TErBHZNy0otwpA3h2ojCw+yavv 8tUnsJtWJ9DuJbXFFJZUPZhciNOfAdR9o8Yn2z4/sHuj247jeHrhqjLv/6+wDWh/FTLM +mpPBjrNi9lt9ugv0zVTM+LreYvnY5rXitUlhh/Bg4n64c9+z9aoP4Cn1E1+leNFjhlu MjYCUVRXyskMPnQnjcsS1n5t2Z5UPdre54MOwt1UmdXnkDmyIfRb6sbaGmumLxBxA6lZ gZXQWsZMRkO/pWpmZjvhvZvsYntUF7ZsA2Mj4eNRPdRsdwZQs4rKpjGAyAYnH4dtsDCy 7Lig== X-Gm-Message-State: AOAM532awfZCO73guhNy2kqtpsPqCUq5rBcmnA+wgUJWk3NTh2vaw1v9 0MQI4qaoUlpwHmcbYgLYCY58C7Me1uhIVhvDwIrQ+PYrUM+uPj1EbsS0Zc9h4co5MMQtbug8Rzs +KivbJ2H4SDsVSrxGCH3vExQQv5GhrymIshk+fI3B3XlIc+Hy1Hr/GTQcthTJHUEt X-Received: by 2002:a5d:58cc:: with SMTP id o12mr1166948wrf.384.1623876320497; Wed, 16 Jun 2021 13:45:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwyQaHC0ie/vly8Si7yvMMjFP3v1pG07LHIZmK1LAAi87HsEbRlhFl/GiE+k+VwjRriBxAq9w== X-Received: by 2002:a5d:58cc:: with SMTP id o12mr1166907wrf.384.1623876320254; Wed, 16 Jun 2021 13:45:20 -0700 (PDT) Received: from x1w.. (93.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.93]) by smtp.gmail.com with ESMTPSA id c21sm2705517wme.38.2021.06.16.13.45.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Jun 2021 13:45:19 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 19/23] hw/i386: Move pc_madt_cpu_entry() to acpi-pc.c Date: Wed, 16 Jun 2021 22:43:24 +0200 Message-Id: <20210616204328.2611406-20-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210616204328.2611406-1-philmd@redhat.com> References: <20210616204328.2611406-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.133.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.199, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laszlo Ersek , Brijesh Singh , Eduardo Habkost , Sergio Lopez , "Michael S. Tsirkin" , Connor Kuehl , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , James Bottomley , Richard Henderson , "Dr . David Alan Gilbert" , Markus Armbruster , Dov Murik , Gerd Hoffmann , Igor Mammedov , Paolo Bonzini , Eric Blake Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" pc_madt_cpu_entry() is specific to QEMU 'PC' machines, move it to acpi-pc.c. Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/acpi-common.c | 40 ---------------------------------------- hw/i386/acpi-pc.c | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 40 deletions(-) diff --git a/hw/i386/acpi-common.c b/hw/i386/acpi-common.c index 77afebd9e1f..5ae1853b6f2 100644 --- a/hw/i386/acpi-common.c +++ b/hw/i386/acpi-common.c @@ -23,49 +23,10 @@ #include "qemu/osdep.h" #include "hw/acpi/acpi.h" #include "hw/acpi/aml-build.h" -#include "hw/i386/pc.h" #include "target/i386/cpu.h" #include "acpi-build.h" #include "acpi-common.h" -void pc_madt_cpu_entry(AcpiDeviceIf *adev, int uid, - const CPUArchIdList *apic_ids, GArray *entry) -{ - uint32_t apic_id = apic_ids->cpus[uid].arch_id; - - /* ACPI spec says that LAPIC entry for non present - * CPU may be omitted from MADT or it must be marked - * as disabled. However omitting non present CPU from - * MADT breaks hotplug on linux. So possible CPUs - * should be put in MADT but kept disabled. - */ - if (apic_id < 255) { - AcpiMadtProcessorApic *apic = acpi_data_push(entry, sizeof *apic); - - apic->type = ACPI_APIC_PROCESSOR; - apic->length = sizeof(*apic); - apic->processor_id = uid; - apic->local_apic_id = apic_id; - if (apic_ids->cpus[uid].cpu != NULL) { - apic->flags = cpu_to_le32(1); - } else { - apic->flags = cpu_to_le32(0); - } - } else { - AcpiMadtProcessorX2Apic *apic = acpi_data_push(entry, sizeof *apic); - - apic->type = ACPI_APIC_LOCAL_X2APIC; - apic->length = sizeof(*apic); - apic->uid = cpu_to_le32(uid); - apic->x2apic_id = cpu_to_le32(apic_id); - if (apic_ids->cpus[uid].cpu != NULL) { - apic->flags = cpu_to_le32(1); - } else { - apic->flags = cpu_to_le32(0); - } - } -} - void acpi_build_madt(GArray *table_data, BIOSLinker *linker, X86MachineState *x86ms, AcpiDeviceIf *adev, const char *oem_id, const char *oem_table_id) @@ -155,4 +116,3 @@ void acpi_build_madt(GArray *table_data, BIOSLinker *linker, (void *)(table_data->data + madt_start), "APIC", table_data->len - madt_start, 1, oem_id, oem_table_id); } - diff --git a/hw/i386/acpi-pc.c b/hw/i386/acpi-pc.c index 796ffc6f5c4..a3cd60d81e6 100644 --- a/hw/i386/acpi-pc.c +++ b/hw/i386/acpi-pc.c @@ -2707,3 +2707,42 @@ void acpi_setup(void) */ acpi_build_tables_cleanup(&tables, false); } + +void pc_madt_cpu_entry(AcpiDeviceIf *adev, int uid, + const CPUArchIdList *apic_ids, GArray *entry) +{ + uint32_t apic_id = apic_ids->cpus[uid].arch_id; + + /* + * ACPI spec says that LAPIC entry for non present + * CPU may be omitted from MADT or it must be marked + * as disabled. However omitting non present CPU from + * MADT breaks hotplug on linux. So possible CPUs + * should be put in MADT but kept disabled. + */ + if (apic_id < 255) { + AcpiMadtProcessorApic *apic = acpi_data_push(entry, sizeof *apic); + + apic->type = ACPI_APIC_PROCESSOR; + apic->length = sizeof(*apic); + apic->processor_id = uid; + apic->local_apic_id = apic_id; + if (apic_ids->cpus[uid].cpu != NULL) { + apic->flags = cpu_to_le32(1); + } else { + apic->flags = cpu_to_le32(0); + } + } else { + AcpiMadtProcessorX2Apic *apic = acpi_data_push(entry, sizeof *apic); + + apic->type = ACPI_APIC_LOCAL_X2APIC; + apic->length = sizeof(*apic); + apic->uid = cpu_to_le32(uid); + apic->x2apic_id = cpu_to_le32(apic_id); + if (apic_ids->cpus[uid].cpu != NULL) { + apic->flags = cpu_to_le32(1); + } else { + apic->flags = cpu_to_le32(0); + } + } +} From patchwork Wed Jun 16 20:43:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12325967 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30EC8C48BE5 for ; Wed, 16 Jun 2021 21:01:55 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C2E9F601FC for ; Wed, 16 Jun 2021 21:01:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C2E9F601FC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:55678 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ltcfa-0006Cg-0O for qemu-devel@archiver.kernel.org; Wed, 16 Jun 2021 17:01:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50230) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltcPn-0003nq-PQ for qemu-devel@nongnu.org; Wed, 16 Jun 2021 16:45:39 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:30971) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltcPj-0001Vp-QS for qemu-devel@nongnu.org; Wed, 16 Jun 2021 16:45:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623876330; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kB/lnjMU7yko7yxzqp5L1QJkdTuRfvKiLBaXoDmFI74=; b=fY4BuIpaotiFHq83JGcJcsh1bAw4zVy5eOQpC/zJjJn576CSFiJ7+gdzRQ6TPaMTVy6ejw 96MaF36E8ye5pki68ugcd2z/j7RTkrBrIdeuxyNqOcXCw7alnSXCzKXwQkIYONHoU6VUTI PE2KCw+HrWDj3htL90jZEJ47Pdv3Scs= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-454-fN2cl6ylM0iyItjP-mKRAQ-1; Wed, 16 Jun 2021 16:45:29 -0400 X-MC-Unique: fN2cl6ylM0iyItjP-mKRAQ-1 Received: by mail-wr1-f70.google.com with SMTP id l2-20020adfe5820000b029011a64161d6aso1878198wrm.6 for ; Wed, 16 Jun 2021 13:45:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kB/lnjMU7yko7yxzqp5L1QJkdTuRfvKiLBaXoDmFI74=; b=QmXFlapurCCv+XZtuJI9rX/ppe4uEYThjUtZ3PKMt2mlABGwR7sUulj2/9EjMKjebT xZA/2HS+jNGUcYwbLF5ZR1Oul932ng7m7EPLRfVROACSpww0+ilBF8i0TUgSkjS4+8cP 6txpbQSKreOio+jN8EE6YPj0RMeRzlwB91UV26Mp3wzGP/ejEFN8fqfATGrGSwuFyg6+ C+Jfk4v8/aYC5JRhIBIoWgCdOmDutW/ewJbIuyOfNqnBEzoo870XapK1fD4ejQwzkskB wEzBMJLARRL55/UjPiSccEQbI5tHejXP43CV+ZqwnOcOGtkNMmI5ejD4kXL5OqWolguC M9Eg== X-Gm-Message-State: AOAM533bxw+Kxh7YqgI8F+oZzsWGt1ZrOZjbe1ETUaERkIQXzOdfLNh5 oUnrleJY1C8n5wWGGbSx6qDYJzqh7tvPPxOaB/j/RH5UvVBafzUw9RHF/f6VEsIFTuqP4vdk+mJ P/Yb/fIBVvQ/i7HwiL3mxr0LjLHyQ6ypoqr/wT58tA/7t/TuH1TENaL29Mj0kPLSr X-Received: by 2002:adf:cc8d:: with SMTP id p13mr1127412wrj.239.1623876325783; Wed, 16 Jun 2021 13:45:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw53BQ1SMsPqvO4fURGSFllRvkC0CXmHJChOxJiIEabG7B6FsV35smhBRFBfOjNPyOy/OCoKw== X-Received: by 2002:adf:cc8d:: with SMTP id p13mr1127374wrj.239.1623876325579; Wed, 16 Jun 2021 13:45:25 -0700 (PDT) Received: from x1w.. (93.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.93]) by smtp.gmail.com with ESMTPSA id x18sm3116234wrw.19.2021.06.16.13.45.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Jun 2021 13:45:25 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 20/23] hw/acpi: Do not restrict ACPI core routines to x86 architecture Date: Wed, 16 Jun 2021 22:43:25 +0200 Message-Id: <20210616204328.2611406-21-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210616204328.2611406-1-philmd@redhat.com> References: <20210616204328.2611406-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.133.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.199, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laszlo Ersek , Brijesh Singh , Eduardo Habkost , Sergio Lopez , "Michael S. Tsirkin" , Connor Kuehl , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , James Bottomley , Richard Henderson , "Dr . David Alan Gilbert" , Markus Armbruster , Dov Murik , Gerd Hoffmann , Igor Mammedov , Paolo Bonzini , Eric Blake Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" ACPI core routines (in core.c) are not really x86-specific. Signed-off-by: Philippe Mathieu-Daudé --- hw/acpi/meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/acpi/meson.build b/hw/acpi/meson.build index dd69577212a..c23c67f4283 100644 --- a/hw/acpi/meson.build +++ b/hw/acpi/meson.build @@ -3,6 +3,7 @@ 'acpi_interface.c', 'aml-build.c', 'bios-linker-loader.c', + 'core.c', 'utils.c', )) acpi_ss.add(when: 'CONFIG_ACPI_CPU_HOTPLUG', if_true: files('cpu.c')) @@ -14,7 +15,7 @@ acpi_ss.add(when: 'CONFIG_ACPI_HW_REDUCED', if_true: files('generic_event_device.c')) acpi_ss.add(when: 'CONFIG_ACPI_HMAT', if_true: files('hmat.c')) acpi_ss.add(when: 'CONFIG_ACPI_APEI', if_true: files('ghes.c')) -acpi_ss.add(when: 'CONFIG_ACPI_X86', if_true: files('core.c', 'piix4.c', 'pcihp.c'), if_false: files('acpi-stub.c')) +acpi_ss.add(when: 'CONFIG_ACPI_X86', if_true: files('piix4.c', 'pcihp.c')) acpi_ss.add(when: 'CONFIG_ACPI_X86_ICH', if_true: files('ich9.c', 'tco.c')) acpi_ss.add(when: 'CONFIG_IPMI', if_true: files('ipmi.c'), if_false: files('ipmi-stub.c')) acpi_ss.add(when: 'CONFIG_PC', if_false: files('acpi-x86-stub.c')) From patchwork Wed Jun 16 20:43:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12325955 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E832DC48BE5 for ; Wed, 16 Jun 2021 20:58:04 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 874BD600EF for ; Wed, 16 Jun 2021 20:58:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 874BD600EF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:41880 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ltcbr-0005IB-KY for qemu-devel@archiver.kernel.org; Wed, 16 Jun 2021 16:58:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50260) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltcPt-0003w6-OA for qemu-devel@nongnu.org; Wed, 16 Jun 2021 16:45:41 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:34405) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltcPm-0001XB-T1 for qemu-devel@nongnu.org; Wed, 16 Jun 2021 16:45:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623876334; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GCjF8F/1VJOBX/ktZ6oKHcbI63O5csahyL1IvsamaYk=; b=J5VdQel7KN2vGwoahMVIL3hQhK/ZECihKNy+ZZqzB7xQZ9JGYv5jq5twJ5ZACLOPTef6U5 e32CDnMcmnHXQedRpQBylfjcXacArm2Y/g+XGp5AWN8AttHBhHysm2pRRafif015Xa5aek F8mCG3bgLLuw8ysYn5PwUw7WIUc4gBo= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-143-3IkJHwdKNeiyT1yU8JdCKA-1; Wed, 16 Jun 2021 16:45:33 -0400 X-MC-Unique: 3IkJHwdKNeiyT1yU8JdCKA-1 Received: by mail-wr1-f69.google.com with SMTP id s8-20020adff8080000b0290114e1eeb8c6so1845148wrp.23 for ; Wed, 16 Jun 2021 13:45:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GCjF8F/1VJOBX/ktZ6oKHcbI63O5csahyL1IvsamaYk=; b=nj1tkRjfkXDcgcqQGSiFGG9Q1GJYViIF/+Rr61tm750HMRnOkiZT3NoALar5uO3uFE KvDnzPQqOQptahyeF4KKQvSQ2Xj2VvPXyj+esdQcph1Y62RTQwQPZAPfulnTE8pOvGyj hzZCMo0greWcszDv91hBmCdxqVx9A4aRA/vEHpq6sC4jfYvd+msLtfov7EbIhjhEsGTm 30RwoLCcku0aP1X8KT8fzPhX83gxWhXYWJe/RJJFTQIjrZ01P9Gt3GiphEzqRDZuCm/l 7aUOPSUX5BJinXo5yObJp0alXm+TyCdVDc7bOoahb6ZWktuia09L92bpJljEabcdKh0a GHgA== X-Gm-Message-State: AOAM532/YogzGpNMV4atmfvqzMuu6ndZk3O5abAVvacv9y1QQG9fryhu paVj7QMqKV/4tOEpV1xWStkYLB/OvMgtDoKAYwEu8VwjR/s6wpLP1WKADnc9FqWCrF/wra94oS3 VSmDA1q/C6hxmcyH6g16OTH9pvNYk150Vife3ChosexKktBjovsGsGjtJyshPU47C X-Received: by 2002:a5d:698a:: with SMTP id g10mr169073wru.129.1623876331795; Wed, 16 Jun 2021 13:45:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz6FEGynUJEPpQ9k1WO7HdqXA186x9NP+4wqCc1bZn9woeNRs7H5fWQJ6eXwmyiBKTex6yvsA== X-Received: by 2002:a5d:698a:: with SMTP id g10mr169039wru.129.1623876331572; Wed, 16 Jun 2021 13:45:31 -0700 (PDT) Received: from x1w.. (93.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.93]) by smtp.gmail.com with ESMTPSA id l16sm5624876wmq.28.2021.06.16.13.45.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Jun 2021 13:45:31 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 21/23] hw/i386: Introduce X86_FW_OVMF Kconfig symbol Date: Wed, 16 Jun 2021 22:43:26 +0200 Message-Id: <20210616204328.2611406-22-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210616204328.2611406-1-philmd@redhat.com> References: <20210616204328.2611406-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.199, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laszlo Ersek , Brijesh Singh , Eduardo Habkost , Sergio Lopez , "Michael S. Tsirkin" , Connor Kuehl , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , James Bottomley , Richard Henderson , "Dr . David Alan Gilbert" , Markus Armbruster , Dov Murik , Gerd Hoffmann , Igor Mammedov , Paolo Bonzini , Eric Blake Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Introduce the X86_FW_OVMF Kconfig symbol for OVMF-specific code. Move the OVMF-specific code from pc_sysfw.c to pc_sysfw_ovmf.c, adding a pair of stubs. Update MAINTAINERS to reach OVMF maintainers when these new files are modified. This fixes when building the microvm machine standalone: /usr/bin/ld: libqemu-i386-softmmu.fa.p/target_i386_monitor.c.o: in function `qmp_sev_inject_launch_secret': target/i386/monitor.c:749: undefined reference to `pc_system_ovmf_table_find' Fixes: f522cef9b35 ("sev: update sev-inject-launch-secret to make gpa optional") Signed-off-by: Philippe Mathieu-Daudé --- Note: 1/ Obviously the MAINTAINERS change is pending Laszlo Ack. 2/ Various declarations from "hw/i386/pc.h" actually belong to a local header in hw/i386/, such pc_system_parse_ovmf_flash(). --- include/hw/i386/pc.h | 1 + hw/i386/pc_sysfw.c | 107 --------------------------- hw/i386/pc_sysfw_ovmf-stubs.c | 26 +++++++ hw/i386/pc_sysfw_ovmf.c | 135 ++++++++++++++++++++++++++++++++++ MAINTAINERS | 1 + hw/i386/Kconfig | 4 + hw/i386/meson.build | 2 + 7 files changed, 169 insertions(+), 107 deletions(-) create mode 100644 hw/i386/pc_sysfw_ovmf-stubs.c create mode 100644 hw/i386/pc_sysfw_ovmf.c diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 1522a3359a9..6d5699f1ee8 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -191,6 +191,7 @@ void pc_system_flash_cleanup_unused(PCMachineState *pcms); void pc_system_firmware_init(PCMachineState *pcms, MemoryRegion *rom_memory); bool pc_system_ovmf_table_find(const char *entry, uint8_t **data, int *data_len); +void pc_system_parse_ovmf_flash(uint8_t *flash_ptr, size_t flash_size); /* acpi-build.c */ diff --git a/hw/i386/pc_sysfw.c b/hw/i386/pc_sysfw.c index 6ce37a2b052..68d6b1f783e 100644 --- a/hw/i386/pc_sysfw.c +++ b/hw/i386/pc_sysfw.c @@ -124,113 +124,6 @@ void pc_system_flash_cleanup_unused(PCMachineState *pcms) } } -#define OVMF_TABLE_FOOTER_GUID "96b582de-1fb2-45f7-baea-a366c55a082d" - -static uint8_t *ovmf_table; -static int ovmf_table_len; - -static void pc_system_parse_ovmf_flash(uint8_t *flash_ptr, size_t flash_size) -{ - uint8_t *ptr; - QemuUUID guid; - int tot_len; - - /* should only be called once */ - if (ovmf_table) { - return; - } - - if (flash_size < TARGET_PAGE_SIZE) { - return; - } - - /* - * if this is OVMF there will be a table footer - * guid 48 bytes before the end of the flash file. If it's - * not found, silently abort the flash parsing. - */ - qemu_uuid_parse(OVMF_TABLE_FOOTER_GUID, &guid); - guid = qemu_uuid_bswap(guid); /* guids are LE */ - ptr = flash_ptr + flash_size - 48; - if (!qemu_uuid_is_equal((QemuUUID *)ptr, &guid)) { - return; - } - - /* if found, just before is two byte table length */ - ptr -= sizeof(uint16_t); - tot_len = le16_to_cpu(*(uint16_t *)ptr) - sizeof(guid) - sizeof(uint16_t); - - if (tot_len <= 0) { - return; - } - - ovmf_table = g_malloc(tot_len); - ovmf_table_len = tot_len; - - /* - * ptr is the foot of the table, so copy it all to the newly - * allocated ovmf_table and then set the ovmf_table pointer - * to the table foot - */ - memcpy(ovmf_table, ptr - tot_len, tot_len); - ovmf_table += tot_len; -} - -bool pc_system_ovmf_table_find(const char *entry, uint8_t **data, - int *data_len) -{ - uint8_t *ptr = ovmf_table; - int tot_len = ovmf_table_len; - QemuUUID entry_guid; - - if (qemu_uuid_parse(entry, &entry_guid) < 0) { - return false; - } - - if (!ptr) { - return false; - } - - entry_guid = qemu_uuid_bswap(entry_guid); /* guids are LE */ - while (tot_len >= sizeof(QemuUUID) + sizeof(uint16_t)) { - int len; - QemuUUID *guid; - - /* - * The data structure is - * arbitrary length data - * 2 byte length of entire entry - * 16 byte guid - */ - guid = (QemuUUID *)(ptr - sizeof(QemuUUID)); - len = le16_to_cpu(*(uint16_t *)(ptr - sizeof(QemuUUID) - - sizeof(uint16_t))); - - /* - * just in case the table is corrupt, wouldn't want to spin in - * the zero case - */ - if (len < sizeof(QemuUUID) + sizeof(uint16_t)) { - return false; - } else if (len > tot_len) { - return false; - } - - ptr -= len; - tot_len -= len; - if (qemu_uuid_is_equal(guid, &entry_guid)) { - if (data) { - *data = ptr; - } - if (data_len) { - *data_len = len - sizeof(QemuUUID) - sizeof(uint16_t); - } - return true; - } - } - return false; -} - /* * Map the pcms->flash[] from 4GiB downward, and realize. * Map them in descending order, i.e. pcms->flash[0] at the top, diff --git a/hw/i386/pc_sysfw_ovmf-stubs.c b/hw/i386/pc_sysfw_ovmf-stubs.c new file mode 100644 index 00000000000..aabe78b2710 --- /dev/null +++ b/hw/i386/pc_sysfw_ovmf-stubs.c @@ -0,0 +1,26 @@ +/* + * QEMU PC System Firmware (OVMF stubs) + * + * Copyright (c) 2021 Red Hat, Inc. + * + * Author: + * Philippe Mathieu-Daudé + * + * SPDX-License-Identifier: GPL-2.0-or-later + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ + +#include "qemu/osdep.h" +#include "hw/i386/pc.h" + +bool pc_system_ovmf_table_find(const char *entry, uint8_t **data, int *data_len) +{ + g_assert_not_reached(); +} + +void pc_system_parse_ovmf_flash(uint8_t *flash_ptr, size_t flash_size) +{ + g_assert_not_reached(); +} diff --git a/hw/i386/pc_sysfw_ovmf.c b/hw/i386/pc_sysfw_ovmf.c new file mode 100644 index 00000000000..85b3044c59a --- /dev/null +++ b/hw/i386/pc_sysfw_ovmf.c @@ -0,0 +1,135 @@ +/* + * QEMU PC System Firmware (OVMF specific) + * + * Copyright (c) 2003-2004 Fabrice Bellard + * Copyright (c) 2011-2012 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "qemu/osdep.h" +#include "hw/i386/pc.h" +#include "cpu.h" + +#define OVMF_TABLE_FOOTER_GUID "96b582de-1fb2-45f7-baea-a366c55a082d" + +static uint8_t *ovmf_table; +static int ovmf_table_len; + +void pc_system_parse_ovmf_flash(uint8_t *flash_ptr, size_t flash_size) +{ + uint8_t *ptr; + QemuUUID guid; + int tot_len; + + /* should only be called once */ + if (ovmf_table) { + return; + } + + if (flash_size < TARGET_PAGE_SIZE) { + return; + } + + /* + * if this is OVMF there will be a table footer + * guid 48 bytes before the end of the flash file. If it's + * not found, silently abort the flash parsing. + */ + qemu_uuid_parse(OVMF_TABLE_FOOTER_GUID, &guid); + guid = qemu_uuid_bswap(guid); /* guids are LE */ + ptr = flash_ptr + flash_size - 48; + if (!qemu_uuid_is_equal((QemuUUID *)ptr, &guid)) { + return; + } + + /* if found, just before is two byte table length */ + ptr -= sizeof(uint16_t); + tot_len = le16_to_cpu(*(uint16_t *)ptr) - sizeof(guid) - sizeof(uint16_t); + + if (tot_len <= 0) { + return; + } + + ovmf_table = g_malloc(tot_len); + ovmf_table_len = tot_len; + + /* + * ptr is the foot of the table, so copy it all to the newly + * allocated ovmf_table and then set the ovmf_table pointer + * to the table foot + */ + memcpy(ovmf_table, ptr - tot_len, tot_len); + ovmf_table += tot_len; +} + +bool pc_system_ovmf_table_find(const char *entry, uint8_t **data, + int *data_len) +{ + uint8_t *ptr = ovmf_table; + int tot_len = ovmf_table_len; + QemuUUID entry_guid; + + if (qemu_uuid_parse(entry, &entry_guid) < 0) { + return false; + } + + if (!ptr) { + return false; + } + + entry_guid = qemu_uuid_bswap(entry_guid); /* guids are LE */ + while (tot_len >= sizeof(QemuUUID) + sizeof(uint16_t)) { + int len; + QemuUUID *guid; + + /* + * The data structure is + * arbitrary length data + * 2 byte length of entire entry + * 16 byte guid + */ + guid = (QemuUUID *)(ptr - sizeof(QemuUUID)); + len = le16_to_cpu(*(uint16_t *)(ptr - sizeof(QemuUUID) - + sizeof(uint16_t))); + + /* + * just in case the table is corrupt, wouldn't want to spin in + * the zero case + */ + if (len < sizeof(QemuUUID) + sizeof(uint16_t)) { + return false; + } else if (len > tot_len) { + return false; + } + + ptr -= len; + tot_len -= len; + if (qemu_uuid_is_equal(guid, &entry_guid)) { + if (data) { + *data = ptr; + } + if (data_len) { + *data_len = len - sizeof(QemuUUID) - sizeof(uint16_t); + } + return true; + } + } + return false; +} diff --git a/MAINTAINERS b/MAINTAINERS index fbfaaa54721..0856a10e83a 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2900,6 +2900,7 @@ EDK2 Firmware M: Laszlo Ersek M: Philippe Mathieu-Daudé S: Supported +F: hw/i386/*ovmf* F: pc-bios/descriptors/??-edk2-*.json F: pc-bios/edk2-* F: roms/Makefile.edk2 diff --git a/hw/i386/Kconfig b/hw/i386/Kconfig index 66838fa397b..722f70eaeb8 100644 --- a/hw/i386/Kconfig +++ b/hw/i386/Kconfig @@ -1,5 +1,9 @@ +config X86_FW_OVMF + bool + config SEV bool + select X86_FW_OVMF depends on KVM config PC diff --git a/hw/i386/meson.build b/hw/i386/meson.build index f95ed7d4efe..ca81875aa3d 100644 --- a/hw/i386/meson.build +++ b/hw/i386/meson.build @@ -24,6 +24,8 @@ 'pc_sysfw.c', 'acpi-pc.c', 'port92.c')) +i386_ss.add(when: 'CONFIG_X86_FW_OVMF', if_true: files('pc_sysfw_ovmf.c'), + if_false: files('pc_sysfw_ovmf-stubs.c')) subdir('kvm') subdir('xen') From patchwork Wed Jun 16 20:43:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12325971 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 91BFAC48BE6 for ; Wed, 16 Jun 2021 21:04:14 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 332A26109D for ; Wed, 16 Jun 2021 21:04:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 332A26109D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:34332 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ltchp-0002S2-BR for qemu-devel@archiver.kernel.org; Wed, 16 Jun 2021 17:04:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50284) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltcPu-0003zp-K1 for qemu-devel@nongnu.org; Wed, 16 Jun 2021 16:45:42 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:48178) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltcPs-0001Yd-2f for qemu-devel@nongnu.org; Wed, 16 Jun 2021 16:45:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623876339; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0afWzhBhI6klZY1Mb1UVWAL8VD89TP6dUzvV5tmy8sQ=; b=RfgX7MebQLau+1CmkDwzA6NDJ8b2QrK55VVGjotiBCealbUVSpzyzgGcxoS49jKKM19LzF TYrjqwHrzrwo1x/o+T5nILqc+mti6Z06UrRFqERb6hE0C2hnJzBG6doKjCiFDeNz0xs3Pz WA1B6kZnbedO+pIQX4Rw1tvNHRhqYhk= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-536-IWkQOw7xPmOtl6zInDqWPA-1; Wed, 16 Jun 2021 16:45:38 -0400 X-MC-Unique: IWkQOw7xPmOtl6zInDqWPA-1 Received: by mail-wr1-f71.google.com with SMTP id q15-20020adfc50f0000b0290111f48b865cso1868082wrf.4 for ; Wed, 16 Jun 2021 13:45:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0afWzhBhI6klZY1Mb1UVWAL8VD89TP6dUzvV5tmy8sQ=; b=nzH0HE51li+hqw0LNn9pEiiim4uhgixJX1JAQxlaiHgkxIRjYMfhMFqnjKlNNxjPL7 6iI373DLvimytojxSPQinpHhzlTcZIolMD89AhlXDLsV0X6vc+JZafbf02qq6zJJgEFR I+WuPI97LlEiYWEG+J4LkYsSuVE6ZPo7QxJc14wyB/d/ToAyhQKYoZPZmX5e/phdh75L RoQKS33IigLK3R0PseCCycFtPaiMntDK+R7XT+6D+AgjcIpIQi3wd8t4idPIJTPLrTK7 SRn2KuAigPGCWxELskqqilZXhB053b8BeB6iRxhk0ryCFmov6oxKl+fnuYlpqGFZlFNN CInw== X-Gm-Message-State: AOAM530PCJGYSGwCy4u27GKEEl8etWgR3D7Vr8PH4VcPbnzw39QUAUqM t43n5T7gEKd56vIFVUIMXtd2iKFQWpXDsKokMY8V7wZ26odZ/wgIYYI/fFNj6Jo/JCeNkUAPBaU 9q869ofhbLrCPT1s5KDenz4wDPeJ5oWbKx+DmHHnqFLCng2K6ivj6e5Vok+muPz1A X-Received: by 2002:a5d:4cd1:: with SMTP id c17mr1155106wrt.295.1623876336834; Wed, 16 Jun 2021 13:45:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUC/tZ8s6XNrVekxXp5jptFYsfWEF20aEVsOupWx3tUUgx67GngNVDdl2X1IRcoU7sqbFGCw== X-Received: by 2002:a5d:4cd1:: with SMTP id c17mr1155077wrt.295.1623876336679; Wed, 16 Jun 2021 13:45:36 -0700 (PDT) Received: from x1w.. (93.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.93]) by smtp.gmail.com with ESMTPSA id z17sm3218172wrt.60.2021.06.16.13.45.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Jun 2021 13:45:36 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 22/23] hw/acpi/Kconfig: Add missing Kconfig dependencies (build error) Date: Wed, 16 Jun 2021 22:43:27 +0200 Message-Id: <20210616204328.2611406-23-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210616204328.2611406-1-philmd@redhat.com> References: <20210616204328.2611406-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.133.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.199, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laszlo Ersek , Brijesh Singh , Eduardo Habkost , Sergio Lopez , "Michael S. Tsirkin" , Connor Kuehl , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , James Bottomley , Richard Henderson , "Dr . David Alan Gilbert" , Markus Armbruster , Dov Murik , Gerd Hoffmann , Igor Mammedov , Paolo Bonzini , Eric Blake Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" The 'microvm' machine misses various dependencies: /usr/bin/ld: libqemu-i386-softmmu.fa.p/hw_i386_acpi-microvm.c.o: in function `acpi_setup_microvm': hw/i386/acpi-microvm.c:247: undefined reference to `acpi_build_tables_init' /usr/bin/ld: libqemu-i386-softmmu.fa.p/hw_i386_acpi-microvm.c.o: in function `acpi_build_microvm': hw/i386/acpi-microvm.c:192: undefined reference to `bios_linker_loader_alloc' /usr/bin/ld: libqemu-i386-softmmu.fa.p/hw_i386_acpi-microvm.c.o: in function `build_dsdt_microvm': hw/i386/acpi-microvm.c:121: undefined reference to `init_aml_allocator' /usr/bin/ld: hw/i386/acpi-microvm.c:124: undefined reference to `acpi_data_push' /usr/bin/ld: hw/i386/acpi-microvm.c:126: undefined reference to `aml_scope' /usr/bin/ld: hw/i386/acpi-microvm.c:129: undefined reference to `build_ged_aml' /usr/bin/ld: hw/i386/acpi-microvm.c:131: undefined reference to `acpi_dsdt_add_power_button' /usr/bin/ld: libqemu-i386-softmmu.fa.p/hw_i386_acpi-microvm.c.o: in function `acpi_dsdt_add_virtio': hw/i386/acpi-microvm.c:77: undefined reference to `aml_string' /usr/bin/ld: libqemu-i386-softmmu.fa.p/hw_i386_acpi-microvm.c.o: in function `build_dsdt_microvm': hw/i386/acpi-microvm.c:138: undefined reference to `aml_scope' /usr/bin/ld: hw/i386/acpi-microvm.c:149: undefined reference to `build_header' /usr/bin/ld: hw/i386/acpi-microvm.c:152: undefined reference to `free_aml_allocator' /usr/bin/ld: libqemu-i386-softmmu.fa.p/hw_i386_acpi-microvm.c.o: in function `acpi_build_microvm': hw/i386/acpi-microvm.c:202: undefined reference to `acpi_add_table' /usr/bin/ld: hw/i386/acpi-microvm.c:203: undefined reference to `build_fadt' /usr/bin/ld: hw/i386/acpi-microvm.c:206: undefined reference to `acpi_add_table' /usr/bin/ld: hw/i386/acpi-microvm.c:207: undefined reference to `acpi_build_madt' /usr/bin/ld: hw/i386/acpi-microvm.c:212: undefined reference to `build_xsdt' /usr/bin/ld: hw/i386/acpi-microvm.c:224: undefined reference to `build_rsdp' /usr/bin/ld: libqemu-i386-softmmu.fa.p/hw_i386_acpi-microvm.c.o: in function `acpi_setup_microvm': hw/i386/acpi-microvm.c:251: undefined reference to `acpi_add_rom_blob' /usr/bin/ld: hw/i386/acpi-microvm.c:253: undefined reference to `acpi_add_rom_blob' /usr/bin/ld: hw/i386/acpi-microvm.c:255: undefined reference to `acpi_add_rom_blob' /usr/bin/ld: hw/i386/acpi-microvm.c:258: undefined reference to `acpi_build_tables_cleanup' /usr/bin/ld: libqemu-i386-softmmu.fa.p/hw_i386_acpi-microvm.c.o: in function `acpi_dsdt_add_pci': hw/i386/acpi-microvm.c:105: undefined reference to `acpi_dsdt_add_gpex' collect2: error: ld returned 1 exit status ninja: build stopped: subcommand failed. Update the ACPI_HW_REDUCED symbol to select ACPI_MEMORY_HOTPLUG / ACPI_NVDIMM / ACPI. Fixes: 8045df14bcc ("microvm/acpi: add minimal acpi support") Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Gerd Hoffmann --- hw/acpi/Kconfig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/acpi/Kconfig b/hw/acpi/Kconfig index 1932f66af8d..cfc4ede8d91 100644 --- a/hw/acpi/Kconfig +++ b/hw/acpi/Kconfig @@ -42,3 +42,7 @@ config ACPI_VMGENID depends on PC config ACPI_HW_REDUCED + bool + select ACPI + select ACPI_MEMORY_HOTPLUG + select ACPI_NVDIMM From patchwork Wed Jun 16 20:43:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12325959 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0556FC48BE6 for ; Wed, 16 Jun 2021 20:59:10 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B9FDD600EF for ; Wed, 16 Jun 2021 20:59:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B9FDD600EF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:46714 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ltccu-00005J-Sc for qemu-devel@archiver.kernel.org; Wed, 16 Jun 2021 16:59:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50436) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltcQB-0004Vy-M8 for qemu-devel@nongnu.org; Wed, 16 Jun 2021 16:45:59 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:36361) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltcQ2-0001dz-2m for qemu-devel@nongnu.org; Wed, 16 Jun 2021 16:45:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623876348; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JxnpTnfrSc/SaJ3Gl4Vf5kVk0k2nHRHvjFPx1fnte0M=; b=KO2Kat1jYziCuBKtHyoA7OJvL4ZooXn3BGyw0vw53vuLtWFH0KlP9tRN1i+4Lc3FnL0IUw piGcEjSt/sT+4JqsWNF5MxGsOLXaL6Q7z3d5jX/wiLdzJHbXrHD1ko9m0Fv3BlvOaRg907 +uvJ5R/S+2v6hO0t0AuPoFeIh+rFg5A= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-342-rfCeoRoPOYe0WweEl8eM1w-1; Wed, 16 Jun 2021 16:45:44 -0400 X-MC-Unique: rfCeoRoPOYe0WweEl8eM1w-1 Received: by mail-wr1-f69.google.com with SMTP id n4-20020a5d42040000b0290119fef97609so1850498wrq.18 for ; Wed, 16 Jun 2021 13:45:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JxnpTnfrSc/SaJ3Gl4Vf5kVk0k2nHRHvjFPx1fnte0M=; b=U+LftBMgJq8EvVspX3dKIxo41CW8bjMimQk7cGpNB/PG0rx0SM92hben+mUphKM/wp cH3KTNDSPKMNx1CojvtAat2dbQQ1mp/0Gv0K5CUmAgCZfU3wLhHeEBNhmnSHvPEIJxFB qNkyCCdHxBR2HEDIXNWy4ARcUKdJD11Bg18HWQQNnbwGLjo1bLpiH+xAoeyk6PY4FrXI pazw9RDyxJpjLKLwkj449p+u/9+dF2ejvGgDosix7SP18LBY0NtOkZ0VjXMY+Niik5uo drkhAV/jiyaV3StlpY9q3rUOMoUZ7CKQga2BLBCoWy0cC68OltHUv84ZRA8hZgCWJ6Uw dxOg== X-Gm-Message-State: AOAM530ZIdb7QKF+F0silvVigvzRcxyDFqtZpE62jdcwH5gPz/OOJXpF 0FGuq7qkwEjtIpkePvyZgpUy83QJboCGrFp/DRnfAeB6ZyRffCti8mQilt7Vjy4Tf6EEZGXfHfS Qv9rvj8F65xGFD5zFgehxD7nNB/c1Ibwq2lHoTM7L6Y/WVLjcip1WA8QGHC3/XgT1 X-Received: by 2002:a05:6000:50d:: with SMTP id a13mr1163859wrf.130.1623876342591; Wed, 16 Jun 2021 13:45:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7ZlLysA9BUyUaj6h2bKARsKuRIsHcW93WghXSpgDPLrAaeDj8hIuS+tgJVgZ1ECYDES/dXQ== X-Received: by 2002:a05:6000:50d:: with SMTP id a13mr1163827wrf.130.1623876342432; Wed, 16 Jun 2021 13:45:42 -0700 (PDT) Received: from x1w.. (93.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.93]) by smtp.gmail.com with ESMTPSA id j12sm3231199wrt.69.2021.06.16.13.45.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Jun 2021 13:45:42 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 23/23] hw/i386/Kconfig: Add missing Kconfig dependency (runtime error) Date: Wed, 16 Jun 2021 22:43:28 +0200 Message-Id: <20210616204328.2611406-24-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210616204328.2611406-1-philmd@redhat.com> References: <20210616204328.2611406-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.133.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.199, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laszlo Ersek , Brijesh Singh , Eduardo Habkost , Sergio Lopez , "Michael S. Tsirkin" , Connor Kuehl , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , James Bottomley , Richard Henderson , "Dr . David Alan Gilbert" , Markus Armbruster , Dov Murik , Gerd Hoffmann , Igor Mammedov , Paolo Bonzini , Eric Blake Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" When building the 'microvm' machine stand-alone we get: $ qemu-system-x86_64 -M microvm ** ERROR:qom/object.c:714:object_new_with_type: assertion failed: (type != NULL) Bail out! ERROR:qom/object.c:714:object_new_with_type: assertion failed: (type != NULL) Aborted (core dumped) Looking at the backtrace: (gdb) bt #3 0x00007ff2330492ff in g_assertion_message_expr () at /lib64/libglib-2.0.so.0 #4 0x000055a878c18341 in object_new_with_type (type=) at qom/object.c:714 #5 0x000055a878c18399 in object_new (typename=typename@entry=0x55a878dec36a "isa-pit") at qom/object.c:747 #6 0x000055a878cc8146 in qdev_new (name=name@entry=0x55a878dec36a "isa-pit") at hw/core/qdev.c:153 #7 0x000055a878a8b439 in isa_new (name=name@entry=0x55a878dec36a "isa-pit") at hw/isa/isa-bus.c:160 #8 0x000055a878adb782 in i8254_pit_init (base=64, isa_irq=0, alt_irq=0x0, bus=0x55a87ab38760) at include/hw/timer/i8254.h:54 #9 microvm_devices_init (mms=0x55a87ac36800) at hw/i386/microvm.c:263 #10 microvm_machine_state_init (machine=) at hw/i386/microvm.c:471 #11 0x000055a878a944ab in machine_run_board_init (machine=machine@entry=0x55a87ac36800) at hw/core/machine.c:1239 The "isa-pit" type (TYPE_I8254) is missing. Add it. Fixes: 0ebf007ddac ("hw/i386: Introduce the microvm machine type") Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Gerd Hoffmann --- hw/i386/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/i386/Kconfig b/hw/i386/Kconfig index 722f70eaeb8..e723962be56 100644 --- a/hw/i386/Kconfig +++ b/hw/i386/Kconfig @@ -111,6 +111,7 @@ config MICROVM select ACPI_HW_REDUCED select PCI_EXPRESS_GENERIC_BRIDGE select USB_XHCI_SYSBUS + select I8254 config X86_IOMMU bool