From nobody Tue May 21 05:39:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1623876258; cv=none; d=zohomail.com; s=zohoarc; b=hla7FHM/jCPHedqenD/SF25I/riR9LsV8lY9dtfMoP10zPMkTq9fqFT5rGM+PdLw8pItoAbYV2LWftOAkIsqT4lG3yeTlZt2ROvDxkAy4cF1ug3jhl8hDnRF3t1nN3rLnKWTRW1kmhgl5+ZyDEviq/GVLTckhzaIbiBEq7ohuNQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623876258; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=p5nJW7GzOlB+OjmQ+29ZyDcsW+yUWhYkO5dsX/39F4M=; b=iQugjgZfLKeN5iDnZk2RjhxqgAumHRmNvpT5Rr7t+1fe0BIY+KhpM+vKipQMORocnL84MqjpyR1F/TbP03j+GYgtOHj/NCeCoWUG/vothunQCtqK8vplkYl3CJQeq+HNDbdiV08Ff5l7diqx3EEOAw+tuQvQ24IdYScxxPF0jwk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1623876258554710.4751277486508; Wed, 16 Jun 2021 13:44:18 -0700 (PDT) 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-65-4vpE1uYcOqem0OPkA0esxw-1; Wed, 16 Jun 2021 16:43:38 -0400 Received: by mail-wr1-f71.google.com with SMTP id x9-20020adfffc90000b02901178add5f60so1869340wrs.5 for ; Wed, 16 Jun 2021 13:43:38 -0700 (PDT) Return-Path: Return-Path: 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623876257; 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=i11ujq9j3ybUwsoDdIUPPoLBAjlj7rMAbcfEefwkmgj2EXMx/vaXeMy5NJE+CcDtOa2Pm/ qbsEYjPFYEU2FhNeTX1JfJPPQaBurD1vXRcb4Z0fSC/38dRyYY9GPtr7iHZ93BxqvdPrhI j83tro7RiJm/OqDYNLYZDz7biZnI3ns= X-MC-Unique: 4vpE1uYcOqem0OPkA0esxw-1 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=Xlld3HGb1v/+pmeiTRz3CQKYUxAyFP+H5xMGTcvKPnyEv5i1LHOaXaUEcQOMqqcK6Q b5riv7hj34zLy+h+xPk+tfy4q2Ci88Mmn7K/74vFE2Yyk3tpYlx2SjCK5KRBauxEr6sr iWlbmAynQddzvkW1XWfbtn4eCmsaCUHJ85lJRonGDS2ExpKx82by7lEFRtS6or+fX6Rh 06XxtRCOIWk5W/OfI+KyOp+WmZtGgmi8vu4RssdkLPkbwwib1YzKCuK01ZDlRN9unbZO VQlwgxFRxig9zWcLAfK03y6SwlRV4ongI/eBEXFxHKy2gmcLEYjKrNydEsVw8LCN4HB6 LbVQ== X-Gm-Message-State: AOAM5307K644Vu4MEVxGhxYpzkH/3VmQqM38pGy+mzAcrt64nJ0NQB/V 91LcJAdw65l6iOOx55dRHpCOC09CYcQ6X5DLa3ihHCGbKu5woCv/n6lxQVNagVgckW2WsTuAeGX R4t3N2Ml+hn6EXA== X-Received: by 2002:a5d:47cb:: with SMTP id o11mr1206094wrc.38.1623876217703; 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Paolo Bonzini , Connor Kuehl , Gerd Hoffmann , Brijesh Singh , "Dr . David Alan Gilbert" , Eric Blake , Eduardo Habkost , Markus Armbruster , Igor Mammedov , James Bottomley , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Sergio Lopez , Marcel Apfelbaum , "Michael S. Tsirkin" , Laszlo Ersek , Dov Murik 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) 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=C3=A9 Message-Id: <20210608192537.103584-1-ckuehl@redhat.com> [PMD: Cover more files] Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Michael S. Tsirkin --- 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 =20 +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 --=20 2.31.1 From nobody Tue May 21 05:39:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1623876226; cv=none; d=zohomail.com; s=zohoarc; b=BDu807EGU4BzEyFEhNvb07PAZ/IJXji/ePQvVl/EChbeT2G8fOMmOtiMkfHewJ6iHGp3z6lteaCF7iBXDLVF7+54XfhG5nzAb4B8UiYiqucs7vEbsWigih+MQvPNqYDENlkbzr0uk5cWA7++pKlH86se3rEoJoR+qMMgMP+uuW8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623876226; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=f27vlBksGaI+niJES8qihuGdOvYPg6DANZZdhWGvvvs=; b=nlvCsyOJngM5KhxCDsfgHVIbWxHIN4RHa+IBto+tPbaeYX+lWuWrqS/047rakn/ZlWLkGCJImV2WfW3uho1HzhIh5jZ0KZ/8Br2qq164RvrRTGXaArEVbFR9c0QBUDCaUs7XK9BomTKheBx93B7nhrIowNMiEHdOSXsi6FV/x3I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1623876226145454.1000122059859; Wed, 16 Jun 2021 13:43:46 -0700 (PDT) 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-560-h9jvGhyNOi2E8Ia4Jvm7bg-1; Wed, 16 Jun 2021 16:43:43 -0400 Received: by mail-wr1-f69.google.com with SMTP id x9-20020a5d49090000b0290118d8746e06so1862799wrq.10 for ; Wed, 16 Jun 2021 13:43:43 -0700 (PDT) Return-Path: Return-Path: 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) 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= X-MC-Unique: h9jvGhyNOi2E8Ia4Jvm7bg-1 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=BhzDuN1LNYNHQe/3qrj6mRBn1QpimPRsKj2yecDkU1mM34lb5/Q9VSVBQhzDShDv5X unIlBUPyYhauhCtG9/ZgsRDUiZFxlbYts8xDoohBLaVNqY9AErYyMKhRu+pA9lVhT5NZ qNgnWLb10a6dMheM6zSxAuN0dzJhTimgF1bXbCOsgl0fRIkA9FL1MdovDOTKu3kEJ8X1 NFCFXKYC1VBlIEcph6ErIIw7XQJvEEk1kV0UvFUK4HJhGHtcdELKZ6gCVoIcYyo3Yj9r I3uEXAv/z1nG8CyD4LXk3JItZIt9m/bDwDXc7r16me0o+uxkZKe2xtPpm0oZ1qsC7Mvl dLsw== X-Gm-Message-State: AOAM532CSNkg+Pzw/wckuRRmMqgH4xCeTVe8xHhVvWgb6U41jW5JWM41 lIcW+Ejzxefo0b1rVrqr/Xedvl6HT9297o0lCpcKfK7nm8MMWvPNTCzqsziYw4NRqGmQxEmmoC4 nIidrH4hsZqiIng== X-Received: by 2002:adf:ef06:: with SMTP id e6mr1122910wro.393.1623876222736; 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Paolo Bonzini , Connor Kuehl , Gerd Hoffmann , Brijesh Singh , "Dr . David Alan Gilbert" , Eric Blake , Eduardo Habkost , Markus Armbruster , Igor Mammedov , James Bottomley , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Sergio Lopez , Marcel Apfelbaum , "Michael S. Tsirkin" , Laszlo Ersek , Dov Murik 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Wrap long lines before 70 characters for legibility. Suggested-by: Markus Armbruster Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Michael S. Tsirkin 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 Virtualiz= ation -# 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)' } --=20 2.31.1 From nobody Tue May 21 05:39:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1623876236; cv=none; d=zohomail.com; s=zohoarc; b=m9/nDLpKa0y0n+rrh15265rtH6fO7IdxCv2/pAXHX8E2ygsYp/5lZkN3RIaNrFSocoKpUj1PeGfA4iD6N9hsRJy0KXk9QcxCpTLkA2OJ+ChSRxZ70p4LtvwBBBfzo9QEchncm+YOVSbpJ/5HCuspIHhjHFKzfUAGIFmSLPYIWQI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623876236; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=P0MVNMPFT2iPgR7XnSOdieFnhCqfHwDB3FuH7adTvvs=; b=PUxYfxYenrKOq5Mub+FiEkYFRCesf3k+v41/k7l47IB5jOlHG6XgQhC+yhXX5UhzC8LGfFB6vdCQql3+uKyhrcpHnCVDfGDCa1+0w2uWHEKbfWqhXQnnfAN2fzAbj4pXLzdVqkPCkJxUO+8xjvxaoeIL5hABL6XhZg4f0HAmTfk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1623876236168649.3725831443243; Wed, 16 Jun 2021 13:43:56 -0700 (PDT) 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-373-RLbdI0wuOk-lqGgbK2Il3g-1; Wed, 16 Jun 2021 16:43:53 -0400 Received: by mail-wr1-f70.google.com with SMTP id x9-20020adfffc90000b02901178add5f60so1869578wrs.5 for ; Wed, 16 Jun 2021 13:43:52 -0700 (PDT) Return-Path: Return-Path: 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623876234; 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=hBXSTq4UyTEVb1v/KwxvY1G7AzyPlQ4fA3ZqgIetM/RylvDxC7MwrM4D6S944LAYYZgG5o IFhplsjUKh4ZmTzqtR8Wj0j8p/yINIE24zCH4Ow8Jtb76G8F6SluKMEaghFSTN3YLLqXJp lzpIsi6zWFTozq5UNwwgo9SJnNdoILM= X-MC-Unique: RLbdI0wuOk-lqGgbK2Il3g-1 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=e0i7K9xpQK5WXXf66+zuQNZHhbLqIVHaX78Wp8IO+hOBey6Fo/wMXOqRZM5uoWl0zX AAZVH8bMW6tEARL8yXX398A1kdYbtJjmi5dQz7Wk0sDNPJtzG3QYqrVmRW3ZmFXInIOD bSpPVLYsDmVbrUowAN0UEbNgCvbFBeLqo40yKwaPOZTCaoHcjzm0scrZHeb6yqS464SV QpCOeUJaIMiEbdd9pMEZzfFRJyQKITWDmOh1S1RCOea7d39JT/pkCO4M5p8nSk73Akz/ tsecXQG/DXTUN9QZDtDhzmlExyZ2JD+gJGqrQ1ahCmddSvQKgZNw2JQpv7duSppqLfgV Liog== X-Gm-Message-State: AOAM532XtGshj+m8Q/1IJhD8ywj5mwGaGMZQUOgtY9iB7t0AMSf2xhsy NA4+X/sTmebrPVFZ2W+3vdsg2/sFplKCsNYjekdTZBnBo6uHlfXQ617AY136mqg1JtOYvMzEgvO B7DUqgiCaVr8hfw== X-Received: by 2002:a5d:67cf:: with SMTP id n15mr1200945wrw.228.1623876229900; 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Paolo Bonzini , Connor Kuehl , Gerd Hoffmann , Brijesh Singh , "Dr . David Alan Gilbert" , Eric Blake , Eduardo Habkost , Markus Armbruster , Igor Mammedov , James Bottomley , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Sergio Lopez , Marcel Apfelbaum , "Michael S. Tsirkin" , Laszlo Ersek , Dov Murik 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) There is already a section with various SEV commands / types, so move the SEV guest attestation together. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Michael S. Tsirkin 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)' } =20 +## +# @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)' } --=20 2.31.1 From nobody Tue May 21 05:39:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1623876240; cv=none; d=zohomail.com; s=zohoarc; b=IWUcVZMFyeaXkBVgMEGrkFGS57CeudrtCish0hermAGS5lX5c2fZ9/uEWBFtwIZQCuIJU86s/tdFxkJ3686WZT8dWk1IQ7hgWb8Z+xV++25Q7F6F0u/I2otSxu1uYYmbPrz2TbfJ6FSDGQIKLivRPBxK1vvqZeghfhumhW8Ow14= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623876240; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=y+XSms8lsmaWxWcSMyaabFLhR1SIAMwTYvlPcGQF/+0=; b=TYaVDQKQlnu9ak6T08d8p3Hrtn2MyPAUODlgr/kw8QTiEgTjR760dtsz9wMShK18rWb6TXwOL9RxcD3NdCgJ1DPWnP1c7xEK72vFy0Cv1iapwqWydhbkYNNIfCQrxL7u4ufoMMEyz6Ehkk7kMlBA0/cYVOlZaMgD95uL7CfhAek= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1623876240577713.6695077074995; Wed, 16 Jun 2021 13:44:00 -0700 (PDT) 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-538--RQH8F74MwKR2Uc9nSAJXA-1; Wed, 16 Jun 2021 16:43:56 -0400 Received: by mail-wr1-f72.google.com with SMTP id e9-20020a5d6d090000b0290119e91be97dso1874313wrq.1 for ; Wed, 16 Jun 2021 13:43:56 -0700 (PDT) Return-Path: Return-Path: 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623876239; 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=GvGduTrbTwqIGNbX5/IIxmZWLeAj1QkDfNY+AhThH3Zeyu4b27OVANjrZmlCA47WvHxiYl Vi/MjMmJZOeXk+gCIkXPcT/cOKgej8PGSyNz3k1ZptIkXJneT4y4ykvTzoTjJTWpd/QARA Hav6JPHlBopx6RrkgX0GKstYULjWoAk= X-MC-Unique: -RQH8F74MwKR2Uc9nSAJXA-1 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=Amyjx/cJsJNQoZ//9e/CRRwnOtcU5/4W39vSOyVTiEY4SExlmbmmZDppj379DHBFLK 7s7hi5MtmvTFq8wb20fZRk7r2rWgtKWXov2HdpdQUwYDQ1p0Dnp20uQJv9P9Sq//A4hH QwSlBSPOayMGtOREJnbz+i5aJPn+xgOZ5hp6X2OYh48kvDG0rsMTTSTamYlCozlPMD2c sw+FbB72hr0y9CL+XzgcQn0hWj4wUMHx8thGoMwGdqSWhBBqxmYiPa9Eoly6JH/Uh2kU MON2fsaIKZD9pYaQ12YcbVVviBgR6eRpPQioh3wX/2kYuEAlYq6by8bF0ldZcqD5ol7+ t8Pg== X-Gm-Message-State: AOAM530R3ROHP8g/5PnFWsj6O3rC8XHIkuxfkBuPY1KolrGBHCIhFG66 Kxzklk0nbNytnKSvJ9XRFBn0iyTYeiDIIug1IaMo5uD2/GXT4CZVlF3HxJFwkr2JF5GetYwUsHJ mlK6/EpWFCALYQA== X-Received: by 2002:adf:d227:: with SMTP id k7mr1128718wrh.271.1623876235237; 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Paolo Bonzini , Connor Kuehl , Gerd Hoffmann , Brijesh Singh , "Dr . David Alan Gilbert" , Eric Blake , Eduardo Habkost , Markus Armbruster , Igor Mammedov , James Bottomley , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Sergio Lopez , Marcel Apfelbaum , "Michael S. Tsirkin" , Laszlo Ersek , Dov Murik 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) 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": 429= 4959104 } } { "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": 429= 4959104 } } { "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=C3=A9 Acked-by: Michael S. Tsirkin --- 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_h= dr, 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; --=20 2.31.1 From nobody Tue May 21 05:39:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1623876245; cv=none; d=zohomail.com; s=zohoarc; b=CQm9uMy9T6N2EXuzNtt4PGb3JsX/XQPpc4TEyB4SeNCVsxCaVmyvcWdAMTC4yRmcAZzlbTgohXxxLUoEFcTHXIUJq6zHXvJJyUgqjXMEpovGPfw5blDD969taPT1n/1W6cENaGE1cwrri0D4FtuADYQI6D8sEKgM5gGGKMj+pZE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623876245; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=OS+iR2EbHbrCh3GIR2NY+qAi6yiZecwyyt8l9LOb9LA=; b=f6e/p0ptEMImgqIDNwKOpW8FoOkhNrAFJq/fdMRfdF8hVJ0BKieB7frFJF7LgkRK1fZwcP1bMdZHp0wWfSMhKXwYPyDR2Ky75fmmiU125y9ymRC/xfH9ZvGCyMTmggL6pD0ZdtndW8YW6tkP+qNMLHljoq7JkSuwCpjxLUb2iHk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1623876245109553.6903908856392; Wed, 16 Jun 2021 13:44:05 -0700 (PDT) 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-154-Ov2Dt8pSPdedT73ktFz-Bg-1; Wed, 16 Jun 2021 16:44:02 -0400 Received: by mail-wr1-f69.google.com with SMTP id d9-20020adffbc90000b029011a3b249b10so1861133wrs.3 for ; Wed, 16 Jun 2021 13:44:02 -0700 (PDT) Return-Path: Return-Path: 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) 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= X-MC-Unique: Ov2Dt8pSPdedT73ktFz-Bg-1 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=kt1YF3zDcH8dPPg1zBdY7M0Ou8JGM8QMG0Zou/2Yj2vTQ3sHjDcPwEXAK78iXFc6uo K5ovgmYBxUk6O1SkZtEHYUmgrdrJiuCcuMI5ZhF/hBFNL8XN609AcFSUHDTuByiQzE1g qOAcCaXAyaFH7YIm8zFxNlufTGTgcsYRJWsRdMoh9MAsAWfxHGc22DwT/HO4sJF3bQjl sT9WA3naHZ4O1emvd/Th7tn8teQTONecExilUDoqFt9UzL61ZaP4p5fyHkQv2f0D43NH AlMELAh2I9uVaxIMpfSbWSpaLikxkNTHOrdiX16HuqAgNnoBceWQJ8VMrhTkeAXQzC4x ETAw== X-Gm-Message-State: AOAM533Hq3bHDgll3FfPT0+lYIf1NWOaJV7yHJkkhSYiZaV/OBtPtVNo 6mGI8n8Zjmm1dByAjD2VyTLiaqr3xXoCyq4G0BNeEzTV+0dBPg4XKka4fbU6VuzdWJIEJsXcSLf 2u4Va3a68VA4uIg== X-Received: by 2002:a05:6000:180f:: with SMTP id m15mr1194010wrh.102.1623876241477; 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Paolo Bonzini , Connor Kuehl , Gerd Hoffmann , Brijesh Singh , "Dr . David Alan Gilbert" , Eric Blake , Eduardo Habkost , Markus Armbruster , Igor Mammedov , James Bottomley , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Sergio Lopez , Marcel Apfelbaum , "Michael S. Tsirkin" , Laszlo Ersek , Dov Murik 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) 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=C3=A9 Acked-by: Michael S. Tsirkin --- 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" --=20 2.31.1 From nobody Tue May 21 05:39:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1623876250; cv=none; d=zohomail.com; s=zohoarc; b=lDI6KasKIRxhgluc7XhIHxAsm26O1T4pJqOkkmRQbvARVk6opyQGEesiPpocNqZCRnHlMX7b4tAdPlt2RTWQZNnzWNAkImYeOW+HIm1VyDG5J5VxvBkO9Lq10c6AhqIF6sZIAJ40AvXXJa7l9fQY7Zf3uL7swb5kKhLpDycn0YU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623876250; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=J6Nu9xcD/1mLwA45H6T/mwE1HK3rKCkbuT6P4bJEEQ4=; b=Rx8Tw450cKFS53muvFBEw/tuvcGam1vdlGARCCLJT42tDH9JZFwhmhwDfFlgaTsMC+iqHCDVXauSYvb+0j7k8F6PapJu8iaqV0e5rW030k614rOwtQ/xIszG+oFh1xU2OOrEtUTkJWG1t458z8DToh8Eb3hNM/oPQrN5BL8lt8Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1623876250289550.4622358775448; Wed, 16 Jun 2021 13:44:10 -0700 (PDT) Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-99-M5hFE_jPNSeAyLDABS_fDQ-1; Wed, 16 Jun 2021 16:44:08 -0400 Received: by mail-wm1-f70.google.com with SMTP id l10-20020a05600c088ab02901d2febdac30so726397wmp.0 for ; Wed, 16 Jun 2021 13:44:07 -0700 (PDT) Return-Path: Return-Path: 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623876249; 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=jJhaKbPoEwXlMDdRnJ37/gndrjriArKe0LyBQcSELkOnL8hWoEoPhDU6K10LhRWzorb8HZ LgyXcD1MMSl8WC3PUaNK3hUuFji5hYobXXN0Oik06EnIdtX6hcJXQyVQnKQBIVp1EQmVaj r/zTQPke0zlz+SgN1gXizAzeIOpzARk= X-MC-Unique: M5hFE_jPNSeAyLDABS_fDQ-1 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=t7/1KO4yw4u+W3y1XJS98UDjp61iUzQATMTMKuSg03pmYT1tzAhofEnhA23HiWM5dV na75PHs9AvwO9EggY1dVl1tGmczmzBJqJZ4dsHxPNB3/Ev36MRYjD1xSbzsBudFfUNTH v3psq3oCEdzApkzLPAPS6JAEd2qowWjZt+IhTS9I7qckmSHkogWeqlV0lPUEEqxSw1Eq phftYUsHaQbaBa5t2HVEIFVNgKAVBr2hM4Gw57kqXGJ1CTchljsRTUEyflNDRZZPm1AV N04VXmnuTFNbSXTKt6TwyYPSHSI1dPkdISAtk/iGj96VE2zXs3MRry6XLKJX7nzMn/0V pw1Q== X-Gm-Message-State: AOAM5305ZUURboCj4nRnJBtySu47S5Pjjc507qi2A8+OJuKwN42uGJBC xYysuwFovyzSERcT8HoZnUA0tMUpZnC9NDgKrVu47kAYy+xtlbC5tUsMubeUqT2yAtpamYEQUGO JN2n7HiV4QORJxg== X-Received: by 2002:a5d:64ca:: with SMTP id f10mr1103005wri.331.1623876246895; 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Paolo Bonzini , Connor Kuehl , Gerd Hoffmann , Brijesh Singh , "Dr . David Alan Gilbert" , Eric Blake , Eduardo Habkost , Markus Armbruster , Igor Mammedov , James Bottomley , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Sergio Lopez , Marcel Apfelbaum , "Michael S. Tsirkin" , Laszlo Ersek , Dov Murik 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Declarations don't require these headers, remove them. Reviewed-by: Connor Kuehl Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Michael S. Tsirkin --- 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 =20 -#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" =20 #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 @@ */ =20 #include "qemu/osdep.h" +#include "qapi/error.h" #include "sev_i386.h" =20 SevInfo *sev_get_info(void) --=20 2.31.1 From nobody Tue May 21 05:39:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1623876257; cv=none; d=zohomail.com; s=zohoarc; b=CMBc7PcjBJz54dYNlWZn+3acoWmetNHVjZ5jBHbKYD1/QsY2vWmmz6R8QoBRX86NmIJKMTQA0UH0e50aUS1MOWAXZjaoGQNWtA68S8jmRjYZ0H5gGN3GYtLpkE4AYQ+P/3hxsIuvEQSZStnty72fGTgBVGmDWizt57X/6gZxSOk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623876257; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=lyEuGJyDY/iwrGffQi3EPfdZgXrWvKYQavNdAaLhpEs=; b=nv6pp/plZNmIUPm1XPBLnPBSV1f4Q7vX94Z8sMt0Aeu3smrJLb2K/ehHBBS5920HS0DVuqreacWaSmoTOnRrZvu+TygNUVHH6njMEWjbl4E24B97/0xJBWF6HjdIy2vpPaa4ienbslq2CeXPlvlz4wDToqZTZ7EiNJk6vExbIwc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1623876257212861.473504655242; Wed, 16 Jun 2021 13:44:17 -0700 (PDT) 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-586-eysHEtTcMdmTfLK1C-09pg-1; Wed, 16 Jun 2021 16:44:15 -0400 Received: by mail-wr1-f72.google.com with SMTP id q15-20020adfc50f0000b0290111f48b865cso1866311wrf.4 for ; Wed, 16 Jun 2021 13:44:14 -0700 (PDT) Return-Path: Return-Path: 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) 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= X-MC-Unique: eysHEtTcMdmTfLK1C-09pg-1 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=VJ7FoiDdS6XI3YbUH0bbpZ47Pkkgv8gAov/AD6R0KHMmAWPrUaHKCvNfcCed8BsElO 9cR8a5RbSvfkYMxGBoatxqUkhvirDfqf3A544QhPq2qCu518mwRjM2a0BNNfmQ93E6b4 cGN93vaII4bAHvadwziqfmKyNtT2RPunLplnbtNGbeBmliUOqhpSJ16GbC7fcCjykvRz nDmxTBBpkgFGRT00Yp/LqITdkK+e14oY+r8+PIRf79ZEaVJOslinGknzw6UoIr1bnz/B DosudVej/YbEHwA7FkGeLIQ9rPTJMXmr0JX3WlAveSRCrtsBKl+C2xnZFvLCOzCuOpyU Gn/A== X-Gm-Message-State: AOAM5338W8SveNIJlCmXaQNjTB9bWpUsiB5BXOLD1vn4nj4KHhnG4hO+ LbC3imfJh0fV//bkL36F8Ga3x4JysUxp7tl1cpb77NbPVOYCriHzetz8hSwH4+Zf0wAzl9kKEdS KNz4nZ3erZRhJnA== X-Received: by 2002:a05:6000:cb:: with SMTP id q11mr1224037wrx.72.1623876253955; 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Paolo Bonzini , Connor Kuehl , Gerd Hoffmann , Brijesh Singh , "Dr . David Alan Gilbert" , Eric Blake , Eduardo Habkost , Markus Armbruster , Igor Mammedov , James Bottomley , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Sergio Lopez , Marcel Apfelbaum , "Michael S. Tsirkin" , Laszlo Ersek , Dov Murik 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) 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=C3=A9 Acked-by: Michael S. Tsirkin --- 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 =20 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; } =20 -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); } =20 -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; } =20 - sev->me_mask =3D ~(1UL << sev->cbitpos); - devname =3D object_property_get_str(OBJECT(sev), "sev-device", NULL); sev->sev_fd =3D open(devname, O_RDWR); if (sev->sev_fd < 0) { --=20 2.31.1 From nobody Tue May 21 05:39:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1623876264; cv=none; d=zohomail.com; s=zohoarc; b=X15PjocyYHi24OfLjAldSGPe9VXG50p8dJQSWiHlGzPr6E9Pyv0XoV9SkOgF01RM/p0qYRuZFRNnfZyQjlmCsTpsm9m8iaLn2NFM9KWfoS+7gCxJumA6t0REurZNN6LEH6eq9YTntWBm+7lK+1fq2+r9CJ9cpnYZqYFxfnhEkNw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623876264; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=KJdW6m0Ma56hwzjCy1teOEHrEH20tchf6AQogJnEfxU=; b=g2RYzKw16RCpHUfL7Peg8C6EC5nXZFHk+Frnj9IeweB/7PgYTbzcVXmCisT/OlbURD+iWT0kkAf8lsJP5w/SyFc06HO2eOWdWGq/65QnwkcB1BO06Nj9J/pe+UZ0d4T/uMxllCRP3kAT/ERX14iRbxcAjVBujNqRVGRHCxg9Lvw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1623876264255787.5368972240659; Wed, 16 Jun 2021 13:44:24 -0700 (PDT) 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-202-O6b_ktYsNyqV1DcNyQfoEQ-1; Wed, 16 Jun 2021 16:44:21 -0400 Received: by mail-wr1-f72.google.com with SMTP id h104-20020adf90710000b029010de8455a3aso1856338wrh.12 for ; Wed, 16 Jun 2021 13:44:20 -0700 (PDT) Return-Path: Return-Path: 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623876263; 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=XNi7bsc9JAkY4XVunIZQSShOiZPLHLWX0CP0iaEjA0OQN9s/qdAHhstRcgTpqM5hV23DhU +1hTDNSl3+POUhfOD7kBM8qb3n6J2fi1viEsQz8CS5vJzME+FNOR07DQt0l58RvgTGiX71 w3UclG96NbmRrCI6o8nzzraJwainHts= X-MC-Unique: O6b_ktYsNyqV1DcNyQfoEQ-1 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=PYN8SKJkQqL2PTVd9ueSEo9TrTtdEEn/oFOmFVSBO5Xum4pcP9PasHthnsgh2wIo+k xQjSKDeoaDuBVW4P2jkYRnXmouVjMG6RvkIrw3HKawNDn2tTbThHgR5OqeGUnoZlmtGB muqZSAaea3obSa0GGtEcR7D+hLn8kHkkOBptUSpGH0TV3SfUE5AxzFzdnA/v6A8m/RIR FqhhMjEtzqbOIzg0VdOPp67yMZtth3ryDZNSVvoU1I4OmorWbGYstijCsogykN9jBXYG w45GJONMKdTJFsGjlmlVVRwSLXszXf7UjtxXWs86GACNLYISwytg6Nsz/j8LNcKc192J x8YQ== X-Gm-Message-State: AOAM532Cj1loxg8gmUWVmomOxNL0C2o7JjyO4TMrJXbdsH8u8lsiQDri aNAZJVxLdrnMBknP4weONix1IOvmJbR68Pg0IT/pgcTA3lovbpoFOAzTYCl5J0+HT8Wxvsj0nHO H7UUAaRuwMH81cw== X-Received: by 2002:a5d:60c8:: with SMTP id x8mr1208696wrt.382.1623876259405; 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Paolo Bonzini , Connor Kuehl , Gerd Hoffmann , Brijesh Singh , "Dr . David Alan Gilbert" , Eric Blake , Eduardo Habkost , Markus Armbruster , Igor Mammedov , James Bottomley , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Sergio Lopez , Marcel Apfelbaum , "Michael S. Tsirkin" , Laszlo Ersek , Dov Murik 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) 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=C3=A9 Acked-by: Michael S. Tsirkin --- 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, =20 int sev_encrypt_flash(uint8_t *ptr, uint64_t len, Error **errp) { - return 0; + g_assert_not_reached(); } =20 bool sev_es_enabled(void) @@ -68,7 +68,7 @@ void sev_es_set_reset_vector(CPUState *cpu) =20 int sev_es_save_reset_vector(void *flash_ptr, uint64_t flash_size) { - abort(); + g_assert_not_reached(); } =20 SevAttestationReport * --=20 2.31.1 From nobody Tue May 21 05:39:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1623876268; cv=none; d=zohomail.com; s=zohoarc; b=aEVGs5MO+BHHCl+tkqoESEN3B1FLOlMGjDhtkqrL7plaPqS4VfLTdoTlRrhWpDaS4NJOA8HdzFSEjON1KQPKSKQ+B3/+VslH0DyJd6wU4Y49OLz+y4MadbEBnYMp+INZjMPCC4heIQXNkCJmIgU483BivfQUBrD0FuxTzjnNAME= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623876268; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=eDwwyP6lYjqDrcaWITpcvIceEJU79Gyjn65Ig5GC5tE=; b=Ph/C79layO3QDd7PPcDNDvnficxlWjzjyCmVXyhVoCUV2IN+h8JVTfPEagBW8/7b4XjR4cvIQcgUVCU4ZLhljIb5KGronEU+BEYCPN0lLkKVi279hlmoUt0sVBP+lldqFWIOWPztOh7iYpjyDsX4TFoXLv/AdXrJ89dbVWNLlrg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1623876268290195.7956536663279; Wed, 16 Jun 2021 13:44:28 -0700 (PDT) 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-510-P08g5DD2Mhui60GdK7PtAg-1; Wed, 16 Jun 2021 16:44:26 -0400 Received: by mail-wm1-f72.google.com with SMTP id z25-20020a1c4c190000b029019f15b0657dso1511431wmf.8 for ; Wed, 16 Jun 2021 13:44:25 -0700 (PDT) Return-Path: Return-Path: 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) 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= X-MC-Unique: P08g5DD2Mhui60GdK7PtAg-1 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=G74IfsVZPsPkrmjisF4aIVpq+t5i8BgRU73lS+MpdLlILciPT/wFutosbN58Q3uL9l Ku4fqbXfRL+bx+bYPLfZSwvohD00TE0+WnPC4FOkmI7dn93TG/eRMyE/EQpqL0LueQB5 GIjKHOAVPbRAdP/efFljcSnEGJ4FIrlBQyz3UI311ExQZYcYvuBK0rEmVqfotZfVQFrI 8sZC2UllmswfdRSpmcH6gkgMnRj1u1RI/0Qs/nO5CsvAO9ZpNB6o3gnkVQJC2cn8LQT4 i2CyeHqfO2w9xv8U5gL9D93i1HIwNbHWU9iDbT9XvEiICXevOYe+7swDWn6+ZtR/zmC9 6xAA== X-Gm-Message-State: AOAM530iEjUqbZsmqjhVTww0Yv8fTTjZYmbo+POFWMEwi+TQcK9Ercd/ bh2YCUXnaAihX/zGr1bkH5JK4tqL7R9kwO/QjjU5+Md4FbE6rYJAeGNN7WDUmFT7HRBFbuhqwXz lL5vrC2moeOGLPA== X-Received: by 2002:adf:efc3:: with SMTP id i3mr1174623wrp.356.1623876265069; 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Paolo Bonzini , Connor Kuehl , Gerd Hoffmann , Brijesh Singh , "Dr . David Alan Gilbert" , Eric Blake , Eduardo Habkost , Markus Armbruster , Igor Mammedov , James Bottomley , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Sergio Lopez , Marcel Apfelbaum , "Michael S. Tsirkin" , Laszlo Ersek , Dov Murik 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) 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=C3=A9 Acked-by: Michael S. Tsirkin --- 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 =3D {}; SevAttestationReport *report =3D NULL; SevGuestState *sev =3D sev_guest; - guchar *data; - guchar *buf; + g_autofree guchar *data =3D NULL; + g_autofree guchar *buf =3D NULL; gsize len; int err =3D 0, ret; =20 @@ -514,7 +514,6 @@ sev_get_attestation_report(const char *mnonce, Error **= errp) if (len !=3D sizeof(input.mnonce)) { error_setg(errp, "SEV: mnonce must be %zu bytes (got %" G_GSIZE_FO= RMAT ")", sizeof(input.mnonce), len); - g_free(buf); return NULL; } =20 @@ -525,7 +524,6 @@ sev_get_attestation_report(const char *mnonce, Error **= errp) if (err !=3D SEV_RET_INVALID_LEN) { error_setg(errp, "failed to query the attestation report lengt= h " "ret=3D%d fw_err=3D%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=3D%d fw_err=3D%d (%s)", ret, err, fw_error_to_str(er= r)); - goto e_free_data; + return NULL; } =20 report =3D g_new0(SevAttestationReport, 1); @@ -548,9 +546,6 @@ sev_get_attestation_report(const char *mnonce, Error **= errp) =20 trace_kvm_sev_attestation_report(mnonce, report->data); =20 -e_free_data: - g_free(data); - g_free(buf); return report; } =20 --=20 2.31.1 From nobody Tue May 21 05:39:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1623876273; cv=none; d=zohomail.com; s=zohoarc; b=Ia1GrwtmAUc8/jxhQTFBODTtU1S5awcsk9pTiN5C7zgfkyOFzUkKe5umsq1PhodJt+OighQ316ftLzxaEMuCmRloEnbZExq563mBPhcd73fC2d7rod1l9ntpgs+PkJzRQbG6UlrkDqw5zr7yvCVs7qAUtWg08HtffJcasaLZxas= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623876273; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=AZLS+m7xAvvk2uRB++FAfryJbzXnCIDe39YBz1qMJyo=; b=JltH4zJ7s8SX0UlPb1TxdLqh7MOMJv226QeicPaCQHQzL8duoeEeDNioL2Lr4pa2WS9FirjNkjbSnY/U5Gdpis7pgFPxD3sEVDuAsa02vxyJEGtQxSIgqcQrOe8RJavqrX2LIPbbO9DWg6fMMbb6WKkpSHeS580RMt+Gx0LfQM0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1623876273734301.2715992518001; Wed, 16 Jun 2021 13:44:33 -0700 (PDT) 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-546-ZWZUFGmFOrar3B8gn9ziPw-1; Wed, 16 Jun 2021 16:44:31 -0400 Received: by mail-wr1-f70.google.com with SMTP id e9-20020a5d6d090000b0290119e91be97dso1874898wrq.1 for ; Wed, 16 Jun 2021 13:44:31 -0700 (PDT) Return-Path: Return-Path: 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) 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= X-MC-Unique: ZWZUFGmFOrar3B8gn9ziPw-1 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=TeME3bemhSjuPtPC7ghxtEAfqYS61UTqJW2ztDoIlhrVPcLCy1yxPog0ZN3Hnz0M4s FBIr/ZvulIHveozSO+zpfb/8g0ZZduzd8j3LrlaudQcez0bNAWJCC9RtX8nb62fFK0lk yCbGQmCZuU0oxBr1Ha1c2tEGnHIvMK+vR+TFhNwXGPbYvdsZSkMSsFQ2XQgi4UVEwg78 4pNzFWDKobTJaATzLEkhEC0HtLo3+ntYbYi5Xz51YcGpNeXMw6VKG8+bEiHN/xnG0UBq tOqeA0EcZWmA2EtnSQ9zJkS4hOUxgxvy6rakurLNY41wbRHUK8Sq7QwG4tC/XR3MmgGf DMHw== X-Gm-Message-State: AOAM532EjkP2anJEbXYngJooLt5Kda5H9jRYLZLfyhXABqdpqQkVmVD3 DaqWIgorVbnnwiJZ5v/6uPMZG8kRFQAYBrN4MeGxugVw56L95H8SS/e5krbGvTum5neSmxc7JhA P3d8Un6hHJyUenA== X-Received: by 2002:adf:e8cb:: with SMTP id k11mr1122345wrn.127.1623876270409; 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Paolo Bonzini , Connor Kuehl , Gerd Hoffmann , Brijesh Singh , "Dr . David Alan Gilbert" , Eric Blake , Eduardo Habkost , Markus Armbruster , Igor Mammedov , James Bottomley , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Sergio Lopez , Marcel Apfelbaum , "Michael S. Tsirkin" , Laszlo Ersek , Dov Murik 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) 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=C3=A9 Acked-by: Michael S. Tsirkin --- 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" =20 -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; } =20 -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 late= r. + * 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: fi= les('sev-stub.c')) =20 # 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 =3D ss.source_set() =20 subdir('kvm') --=20 2.31.1 From nobody Tue May 21 05:39:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1623876279; cv=none; d=zohomail.com; s=zohoarc; b=lIdHpJ8dU8o1RDhjYVJ/EQobyPGxDcQEB8wT97siTaG+54uYAmIw9wKPzUBuzyD6zzSxf+Kvo9lBHaL8Cj77uRX91U0hY4GX2KnRKl+45nEcpdqP0KDUXHhITNanvwvfKK5LlCA2ss5/UXE1RJ8Hn8r0BTBjCVIBhT7q75xrcZA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623876279; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=INPj6wpcOgYFSeBtjomYW3KmRr5tUwX7C5l9vqP5JIA=; b=cH4KxKwdqz1ziHY4M5ed88cEEkSg1dLROlUtH/fNwMQMg53QF6TXcFQdavHgX9DAtgFXv0gY9IR8nGFvUjqJGk7rryOKacEXDKUcJ8DVhhYmjELUk+bQ+TjOOsQaC1mmyqQZyoD+kObz5wuAjYZLmpSSicUID/w7ZkePGd97Qe0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1623876279228367.2693774852095; Wed, 16 Jun 2021 13:44:39 -0700 (PDT) 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-374-Q3MfAglNN2uCGGgq9z7FCg-1; Wed, 16 Jun 2021 16:44:37 -0400 Received: by mail-wr1-f71.google.com with SMTP id y12-20020adffa4c0000b0290119c11bd29eso1879920wrr.2 for ; Wed, 16 Jun 2021 13:44:36 -0700 (PDT) Return-Path: Return-Path: 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) 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= X-MC-Unique: Q3MfAglNN2uCGGgq9z7FCg-1 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=fov4biA1ZPTcEpaNjs7nkpvXxQq4eVzAaguK+78B+ogjjY4/c9SJkLY7xQjNBL+UOF kexUkyDRdqBaiC0UTPnAyswVn+BNe+mMMu0o3XVtbzGIX/xg/GcsuJOvC6NjiBn9DDhR ePi6wTG4omLwoT2TMUTI0DfBWsTnC6bkgXVLS3nXxa8ZiAuk9O4f7/Ryo8W7sF9l+TFq wFsaB5kszBK1NleX/mIZFKcP9wU4PiJv5fIQRwLY8Nrh0qyhlQnGNDiiilpr3KGH+cw3 f33CexXPe3ueIBeQCLjgQ5HCpMkTeoKmuMLu9xkUTCDG0ou6lfrPks2+GXHStw4sgkrP rMhg== X-Gm-Message-State: AOAM533Dh2x742SvF2ERd/L3uBToTDMYrk5XbrIARt5UbqglA8QM3b+V 27lHb5lQobcHrA7vV3LRA1bHmJ7jPNs3XowCs8t6ge1rJmJSTV1+tRvtW0VrKX4hURsvq9ZQqxa 8YpS76oK2aVMxWw== X-Received: by 2002:adf:c3d4:: with SMTP id d20mr1137009wrg.183.1623876275829; 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Paolo Bonzini , Connor Kuehl , Gerd Hoffmann , Brijesh Singh , "Dr . David Alan Gilbert" , Eric Blake , Eduardo Habkost , Markus Armbruster , Igor Mammedov , James Bottomley , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Sergio Lopez , Marcel Apfelbaum , "Michael S. Tsirkin" , Laszlo Ersek , Dov Murik 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) 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=C3=A9 Acked-by: Michael S. Tsirkin --- 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); =20 #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_hd= r, =20 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 @@ =20 #include "qemu/osdep.h" #include "qapi/qapi-commands-misc-target.h" +#include "qapi/qmp/qerror.h" #include "qapi/error.h" #include "sev_i386.h" =20 @@ -52,9 +53,8 @@ int sev_es_save_reset_vector(void *flash_ptr, uint64_t fl= ash_size) g_assert_not_reached(); } =20 -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" =20 @@ -487,8 +489,8 @@ out: return cap; } =20 -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 =3D {}; SevAttestationReport *report =3D NULL; @@ -549,6 +551,12 @@ sev_get_attestation_report(const char *mnonce, Error *= *errp) return report; } =20 +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) { --=20 2.31.1 From nobody Tue May 21 05:39:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1623876285; cv=none; d=zohomail.com; s=zohoarc; b=j+YuWTj3NpcL0uitVPsrxTvbOf5+u8aQSPRiATPV/5SYhg7A+OuZpILs5eSz9Xv8xJ5ilAml8GtddDZEFTzd/YKELsNfSxe7RTYnV+e+pPo2s6haTtZnTzu0BbO/uAhE6XZc2BMnIcx0CdcfHdIUtRD76Gi4mgrYWemQ8BO/d/A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623876285; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=6Qhs5Kaq2kwAeqkE8Rl6FNf/UagyAFBSfq4AHlQjz5U=; b=h+plSS1lwBelvm0fmtPeoOn9lxSqeatmZ5HSRbBi9WgcpmIu6We8sTaoAs/Say7cU96MnlsmzUn7hsIKr5rJ67hwD8T2n0w2KyO+yoOVc4AyfMG1jC2ryrVjj8YZZ4kY8SByUrK7Zan3TqFNtNcFUTun2f0bDM1c57EU2Xh6G8c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1623876285454596.1366436932883; Wed, 16 Jun 2021 13:44:45 -0700 (PDT) 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-191-0qU_vK93MmiHjZkI9-2o8w-1; Wed, 16 Jun 2021 16:44:43 -0400 Received: by mail-wr1-f72.google.com with SMTP id q15-20020adfc50f0000b0290111f48b865cso1866801wrf.4 for ; Wed, 16 Jun 2021 13:44:43 -0700 (PDT) Return-Path: Return-Path: 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) 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= X-MC-Unique: 0qU_vK93MmiHjZkI9-2o8w-1 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=VWA72xckhoFiYWQrJUh9Ma8klQqAImMUkqUnig8o//oiK1pFdmm/iEnZAiOnznLPct X9f2kgqo0cuzpghO72/EuJe56s+WwVEbl6UZHsPEee6b/cjL96IwybNu/P4t7Er5SXlV ifCciJQWxGpPnXTx2Edqf3e3bSCllxSxYpqk5/sl84l2GWfNrmScQwOd0z3moSsW3ikw PIOeSpuSy4vSLAtGSxtj+CEL5JUef9zf6fyMiSsSsPjMp+xSIqkBCs2jFWIh7Y1JTHkk pE4mMbC+8LHHwCCGnpep02J399Swmb+D9y7w32rllI6IvBAP8+tEdziLy094x9Oc+SRu YwnA== X-Gm-Message-State: AOAM530qsmH7n9m6/V/ytH25lzJbfzIwfj0Ei4zKRFeFABxc1uL5iCBL zCiPsofPZvzJGCRwH5u99hBmGgQ5jvonx2u2o7b79PC6JPQUKqxOTRERXknei3eoSg4a0w7CIbM p1vyAwnpZW7Ue8Q== X-Received: by 2002:a1c:5413:: with SMTP id i19mr976139wmb.12.1623876281995; Wed, 16 Jun 2021 13:44:41 -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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Paolo Bonzini , Connor Kuehl , Gerd Hoffmann , Brijesh Singh , "Dr . David Alan Gilbert" , Eric Blake , Eduardo Habkost , Markus Armbruster , Igor Mammedov , James Bottomley , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Sergio Lopez , Marcel Apfelbaum , "Michael S. Tsirkin" , Laszlo Ersek , Dov Murik 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) 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=C3=A9 Acked-by: Michael S. Tsirkin --- 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 =3D (struct sev_secret_area *)data; - gpa =3D 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; } =20 -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 *s= ecret, + bool has_gpa, uint64_t gpa, Error **errp) { - return 1; + error_setg(errp, QERR_UNSUPPORTED); } =20 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, c= onst char *secret, return 0; } =20 +#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 =3D (struct sev_secret_area *)data; + gpa =3D area->base; + } + + sev_inject_launch_secret(packet_hdr, secret, gpa, errp); +} + static int sev_es_parse_reset_block(SevInfoBlock *info, uint32_t *addr) { --=20 2.31.1 From nobody Tue May 21 05:39:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1623876290; cv=none; d=zohomail.com; s=zohoarc; b=ShdVkufojd3QsKIcdWc+16xjlQzr1XYBT1m3Eqta1Lij2nqG1sxD1b9G1cYcxzRkx+vYTRvswORQmVug8y20UDO2vaNWjsJEreq4DktlkprZyxl5W89wm6rjbT/y2YnNueh0hEZpR/HN1Vv6sNPAJPBU3ioyviO4bJovKskal/s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623876290; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=mTw6coySU0nJcHmY2S2py9HmFIvO1l0fChn4YRCOlgU=; b=jMiMqgS9X207exjaim4RD0HAh5kz1lEAfOngKqyrIXtgsm9UbHWaqcAzEC62dmaR7g8GtyAGjnC7D5m/DVq5vt2ed/mB9VdPiS1TJJc7oFs8F1+GFHTz4hn7k2UUtHaiBb5oJxCB5XxIy/AgbyfnCiS6oDmBjqNmzNOaovhWkWU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1623876290945417.14557987421836; Wed, 16 Jun 2021 13:44:50 -0700 (PDT) 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-175-5ecbIED8OKydXnQ8mfGjKQ-1; Wed, 16 Jun 2021 16:44:48 -0400 Received: by mail-wr1-f69.google.com with SMTP id x9-20020a5d49090000b0290118d8746e06so1864017wrq.10 for ; Wed, 16 Jun 2021 13:44:48 -0700 (PDT) Return-Path: Return-Path: 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) 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= X-MC-Unique: 5ecbIED8OKydXnQ8mfGjKQ-1 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=EMUVLe/MrA6mD7hVe6xZV+oHCO+O/MU7cVMmJDg7YPlL2IajQ2rIChJRcND4g6zQON +Jr8YpHY/XGlIkmnlXz7D67TJ3Lg4Jrmt+JkPTfafoxUiUPB6yZHbcD6KWOhvzlSTJ7+ IPHk5h2w9vAtIeUqDznerTzyOacwYMsAKwGEQdRY9JL4guEcsQ6aL4/WOo2C0MCgqgTi nbacUFavVpEtVyxBHjj9LeuECgxFHc4/DDO+IlV55kxP4JdHE7ZbAq/VrX0hSMavCT20 sX8BOvbA5Ycu4nqytm1wXq9UpTIHh7k5u9IT8L+ZHGq4bayyyGRX2aVkL5/+E3QyxGlv IK/A== X-Gm-Message-State: AOAM532VRAxNUKPuPSMa0X3jSpimiPSkz+9MVDGDn2T/udAu9uajhrcO yVTORPxpjX6eeg6t+M7kxfDu65caxfBnoyCjU/Yt5E/Q3v81d5U9Y3kVUk6xX+vWQZ6LsWeQuoS Ym7V/TA4aLZR5Yw== X-Received: by 2002:a1c:4e03:: with SMTP id g3mr873138wmh.127.1623876287532; 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Paolo Bonzini , Connor Kuehl , Gerd Hoffmann , Brijesh Singh , "Dr . David Alan Gilbert" , Eric Blake , Eduardo Habkost , Markus Armbruster , Igor Mammedov , James Bottomley , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Sergio Lopez , Marcel Apfelbaum , "Michael S. Tsirkin" , Laszlo Ersek , Dov Murik 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) 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=C3=A9 Acked-by: Michael S. Tsirkin --- 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); =20 #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(Erro= r **errp) =20 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; } =20 -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; } =20 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; } =20 -SevCapability * -sev_get_capabilities(Error **errp) +static SevCapability *sev_get_capabilities(Error **errp) { SevCapability *cap =3D NULL; guchar *pdh_data =3D NULL; @@ -489,6 +488,11 @@ out: return cap; } =20 +SevCapability *qmp_query_sev_capabilities(Error **errp) +{ + return sev_get_capabilities(errp); +} + static SevAttestationReport *sev_get_attestation_report(const char *mnonce, Error **errp) { --=20 2.31.1 From nobody Tue May 21 05:39:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1623876298; cv=none; d=zohomail.com; s=zohoarc; b=SHXnVt/oMxkK6R17QymbuIrmfzpvQbAFyG331DwXtutKaVdtoTBaaXzie3aAwWK3qwZV5jZ2Eu2VvJjDeUCpI6EB+1gtjl2vTinulmx7kVS5+vFHF8Lni7oEtQeB3OGyKvbx0CvxekK2R/Vo942f0djMDQWxHXqBG9VJQmZkmw0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623876298; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=YwN9k9erMbxP28zXm+/E3BtjsxL5FFiaHo0p4KwDA5c=; b=OKdfkHpSRtGDEZsbpIHfR1sT+NABQpkP8pImL9Ek45lLJZNXQ+j+kSCx4R3mzsQwvxfqL6uZwj71W66enMoFkIQc0pf4ZtLTj2FsRijEzm49GXqRablPSO5I5zwQ1GSJ1UHTVQ/Vnt5aOmcOQxJHZIUubpsBh9ZjkiYawPYtt5s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1623876298211140.2527762986182; Wed, 16 Jun 2021 13:44:58 -0700 (PDT) Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-5-X_PDyGlCOIWb9z3Raqi2qg-1; Wed, 16 Jun 2021 16:44:53 -0400 Received: by mail-wm1-f70.google.com with SMTP id v2-20020a7bcb420000b0290146b609814dso1546079wmj.0 for ; Wed, 16 Jun 2021 13:44:53 -0700 (PDT) Return-Path: Return-Path: 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623876297; 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=N5YQcl73IXpHfSkFKszxWjVkJ1deTzgTUw6l2BW+ZTTL/TqJvBI2ZmMXb/wHbmZ++lvXQ8 dElOEdyVRlHA3pOCKuk/z5LX7lmtTnGgRzU9y3fMwVEy5LJI6zMfQ07P2yYSMwGXD0G+7b L8+8FkAQS0CFhjiJCT1M7GcaNEUz4eM= X-MC-Unique: X_PDyGlCOIWb9z3Raqi2qg-1 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=HtOv3WgbS/Zs5G6t3DwvaGIs1eseCxB0XTEM+/UArgqnMi3QVlzeFGC/0lXD75Wi6j t2xUFZsX50808x9Mw0a9k1Pc1KQ/5GAjouKlD1OuedROKlZxRL6C/XMD/z4VEIMuu182 OzpHbebqH2Xq1opP/2EmYkG/phoC9xD90yTGZfJjHI3K5S99xiOjpydvTjMAMwA6nhUg EkEnJWD6MQDoMnvG/6dL/HaJEOBAAV9fEGvakc5aI3rRrxmdEboY+0t4jklRl7OpGrqG npFN+8VETrroRFE4GMzKSHckC2rrS391YcWygMi8eOhzbNdU7s0G9Zqn4Tjrc/VxcbUe 1OgA== X-Gm-Message-State: AOAM5310mW17HuIoc0Coeb8Si6XVIACbhLgNpXmeWX8DzJpo8kk7e5WB 7Ybt2lphHSVjtAwznNfcUqxem9FenlUkxSljO3CnUMhG4YJZ0t2ugdf55v77VxQ82BzDZBBBsIz zQbQ08iaHZce26A== X-Received: by 2002:a05:6000:10e:: with SMTP id o14mr1207080wrx.76.1623876292614; 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Paolo Bonzini , Connor Kuehl , Gerd Hoffmann , Brijesh Singh , "Dr . David Alan Gilbert" , Eric Blake , Eduardo Habkost , Markus Armbruster , Igor Mammedov , James Bottomley , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Sergio Lopez , Marcel Apfelbaum , "Michael S. Tsirkin" , Laszlo Ersek , Dov Murik 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) 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=C3=A9 Acked-by: Michael S. Tsirkin --- 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); =20 #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) =20 qapi_free_SevInfo(info); } - -SevLaunchMeasureInfo *qmp_query_sev_launch_measure(Error **errp) -{ - char *data; - SevLaunchMeasureInfo *info; - - data =3D sev_get_launch_measurement(); - if (!data) { - error_setg(errp, "Measurement is not available"); - return NULL; - } - - info =3D g_malloc0(sizeof(*info)); - info->data =3D 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; } =20 -char *sev_get_launch_measurement(void) +SevLaunchMeasureInfo *qmp_query_sev_launch_measure(Error **errp) { + error_setg(errp, QERR_UNSUPPORTED); return NULL; } =20 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); } =20 -char * -sev_get_launch_measurement(void) +static char *sev_get_launch_measurement(void) { if (sev_guest && sev_guest->state >=3D SEV_STATE_LAUNCH_SECRET) { @@ -729,6 +728,23 @@ sev_get_launch_measurement(void) return NULL; } =20 +SevLaunchMeasureInfo *qmp_query_sev_launch_measure(Error **errp) +{ + char *data; + SevLaunchMeasureInfo *info; + + data =3D sev_get_launch_measurement(); + if (!data) { + error_setg(errp, "Measurement is not available"); + return NULL; + } + + info =3D g_malloc0(sizeof(*info)); + info->data =3D data; + + return info; +} + static Notifier sev_machine_done_notify =3D { .notify =3D sev_launch_get_measure, }; --=20 2.31.1 From nobody Tue May 21 05:39:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1623876301; cv=none; d=zohomail.com; s=zohoarc; b=jDZZPPCdcA3cC3QIpSppszQNAE1MVua8CttiP56wXGKEftI9wCZRKvONneHOzu9O5yhZf0IJKHUwSs/3Hgtk2K1BkWUD+Xn9sbKhzPpnenXipQvNZOXXsQQGr0jo5uZE9J54unVJuSikZpqLceYs8LHkgWTvQz5Uai40NQsMxlI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623876301; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=Ijj3oNp2VS3kgk+CrwqOtjV8Sk3tYYaTdyhsxAOEaz8=; b=g3x2vMmsH5rRHvdg+UNwIG8xXyn/zc4Boqvy8PH7M/pJHUHKNgJqzhicJ5MQ1nW8wNgAiUb7sQx+k+FjRre8EAH8tjVJTIgWNtObjtvsjNLN79GP3MkCkde72z6CJb+Idx5jQUitPgyaN4UlVBlTLdYNLgaWNQ5j8AMjswgzm+k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 162387630135792.41867407127666; Wed, 16 Jun 2021 13:45:01 -0700 (PDT) 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-401-MrZMRvAyNFqHU1LHLxYVGA-1; Wed, 16 Jun 2021 16:44:59 -0400 Received: by mail-wr1-f71.google.com with SMTP id l2-20020adfe5820000b029011a64161d6aso1877398wrm.6 for ; Wed, 16 Jun 2021 13:44:59 -0700 (PDT) Return-Path: Return-Path: 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623876300; 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=Wg72rmOv9JDtgRX3KONwvT7zOkY55W1v3tBK4R1Ygi1hskQ+Em7D8OJGSFw+nfwDmu/NG3 /a07KKQP9F4ODXnkfui8NjkmGLcZfC0JQdIvSNT4ZXFQioYKw/Dsf6l4XlG5XRCjYSHo2Z bA88bKG2uuTGWDsiHG7mhy+2QADetiQ= X-MC-Unique: MrZMRvAyNFqHU1LHLxYVGA-1 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=FHkgc3n9oi4jS0IBe3uu/uPTsi7jqMKqfHGBIdJQNZHGDIUiS76qyWcrGwga+rR133 NnB34mu/DHmNqSFI84Q+98pZIKbDaUl1tPDCommS03kpAQ94trj3QE2MET9LzXczXysa l/m2L60cXgUcXct5DS1pfqN2G8JbET3vn9E5KCqaMDD9w3AmJ8/x1+wYQJ6SY5MweZdM 6PEQbg3K073eIb0c3chmvfeOxJSjg14EOPteLYG64sRSQznDG6trVhpaOsuhmWlymyAo DIn8Ld33HznmiecmPu6a8Oji2cI6wsxbXI6Nzc+pn+Fc1gs4k/sUWyoxSDJyFwRE86nn e0pg== X-Gm-Message-State: AOAM531LRutLFG14dtGPp5OQ/brU9Bln1bWc5LLKIz7OhWmZevoEsB8U gEhQLlGgzTIRUIA+/cSOrIYr8KsYt2WlzLa/ml1md5vHEfVod1nWMGbjfbiODas4cawZfsspZ82 s4yKFcxuNLgbVoA== X-Received: by 2002:a5d:65cf:: with SMTP id e15mr1204755wrw.310.1623876298121; 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Paolo Bonzini , Connor Kuehl , Gerd Hoffmann , Brijesh Singh , "Dr . David Alan Gilbert" , Eric Blake , Eduardo Habkost , Markus Armbruster , Igor Mammedov , James Bottomley , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Sergio Lopez , Marcel Apfelbaum , "Michael S. Tsirkin" , Laszlo Ersek , Dov Murik 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) 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=C3=A9 Acked-by: Michael S. Tsirkin --- 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 =20 #include "sysemu/sev.h" -#include "qapi/qapi-types-misc-target.h" =20 #define SEV_POLICY_NODBG 0x1 #define SEV_POLICY_NOKS 0x2 @@ -25,7 +24,6 @@ #define SEV_POLICY_SEV 0x20 =20 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); =20 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 =3D 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 =3D 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 @@ */ =20 #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" =20 -SevInfo *sev_get_info(void) +SevInfo *qmp_query_sev(Error **errp) { + error_setg(errp, QERR_UNSUPPORTED); return NULL; } =20 @@ -59,3 +62,8 @@ SevAttestationReport *qmp_query_sev_attestation_report(co= nst 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; } =20 -SevInfo * -sev_get_info(void) +static SevInfo *sev_get_info(void) { SevInfo *info; =20 @@ -395,6 +396,40 @@ sev_get_info(void) return info; } =20 +SevInfo *qmp_query_sev(Error **errp) +{ + SevInfo *info; + + info =3D 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 =3D 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_chai= n, size_t *cert_chain_len, Error **errp) --=20 2.31.1 From nobody Tue May 21 05:39:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1623876311; cv=none; d=zohomail.com; s=zohoarc; b=b6lSTCG3gTBfQ2MgWRK1UIUPnddMDwRYebOA8YIcJrr+3FrzqIWHzdSeoCNETQMGbiDVs+moSTrRcZDFbYIMVd22DQUpHmL85EBiT2ujLGBfE1OLgDQvzdm5Lt80MFQCPx/ggz01xKLin7qDm3VUyowVD5E2Cm9Vp5KVNBEbuLk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623876311; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=3bGf8QhwYTyqtZDoJsvakD6t0hbGYHq/YSQMhMqEONQ=; b=RugFAj2srXUjU6v6ETAE17m5BSD+PrKhgrHxUCgBxnsIBIhBonuTRx2nsWOrcCXDARitBHjL80DR1F+nU9/ELv2ztvRfUs9tIBUwFBrSGcPF+b5C/kSqPeYf0m0FaTgOaqg1PI/Aw0wtDb4jZXPR6NBhMXWicx9S4DWBTD1cWVY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1623876311130418.41562123365; Wed, 16 Jun 2021 13:45:11 -0700 (PDT) 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-453-YUxNI4oUOU-qkoGERjDUsg-1; Wed, 16 Jun 2021 16:45:04 -0400 Received: by mail-wr1-f72.google.com with SMTP id n2-20020adfb7420000b029010e47b59f31so1850432wre.9 for ; Wed, 16 Jun 2021 13:45:04 -0700 (PDT) Return-Path: Return-Path: 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623876310; 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=JAR2Hwz3iqMM4EE9IuXCgifFQy1uj4PEpK4FiWdZvYJf/1l652Kj0qd/vaQXhvqyciIqGD oSFaj5w9ZvwaJ4FInREKJHPu25JsDCEWDBZoYj7KzDvAg/xwoEBxOOmoP8/YZxs/BciX0B hwkPWyx1fQ2uEYlNqWqOLju+vIl8oKc= X-MC-Unique: YUxNI4oUOU-qkoGERjDUsg-1 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=clEcfK3TovtNvnc4N+1N584GcTu9UF2N2L4C2WcjQSe+6hfRNEKqPNLU6jo3bPnHgX /7DJ/lTKJbVzCC4GGbNtL5GLI0629698D8pXrY0/35jN5KH5F8WOXU2aq/NSj9vQkOkl 0cAR0W877pW+nCKIvLcIBZMki1pVW5O3Yrvajlpret8l+ZccJLpSHNVmfHgW6+G/z+x0 0sITd7e60mHY7+IcYfm0M2FwWWz1JX0eoLvvBhRhvJpEEYgryz/TZW3DIfXyCi4UWCR8 4Ai+6GCPKdVb6dFVUsc9pdJ87a1vfk+thTnYvr0tRwwPLNsTQXxCpkn2BD9iwoF/oGtQ VG+Q== X-Gm-Message-State: AOAM531hzPiv6hZUjRMgNBGoHa2KHlvDNoB3SFWwxsvxcnkl1HakRd+m 0jjdtai4g8sqSG7yLQPyq/NrXX6Rc+o4MptIK0prScihvTb4PbGdQROf2rqwtxdKCSfl73IUK5L LmoPGppjMsqc8KQ== X-Received: by 2002:a5d:6409:: with SMTP id z9mr1113385wru.279.1623876303545; 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Paolo Bonzini , Connor Kuehl , Gerd Hoffmann , Brijesh Singh , "Dr . David Alan Gilbert" , Eric Blake , Eduardo Habkost , Markus Armbruster , Igor Mammedov , James Bottomley , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Sergio Lopez , Marcel Apfelbaum , "Michael S. Tsirkin" , Laszlo Ersek , Dov Murik 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Michael S. Tsirkin --- 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); =20 #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 @@ =20 #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" --=20 2.31.1 From nobody Tue May 21 05:39:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1623876317; cv=none; d=zohomail.com; s=zohoarc; b=lHgWwAk2ijsRYLp8G87WTebh371Szg73Wl/JYO2E/6O+cJjeCAsdFLUFRQgBuXt3PrJrrUKN+NnnveS1AM2VGR126Mgyr9yyz3m8nw5Tbj+37Z5dRLAw93BuOvIOiVkFCpDRVf9CaYPaOqS+XnLJTqfc0zKpCiH9dtB5PZk4+ag= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623876317; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=B1OGMC38jawyGu8IsSixsuh7u6q/pZHdAwAhcewq1IY=; b=O9KOsIGDuxYMjbGFxGBv5+EiEgXoFUyX+xhQ8lgk1fdr3etmX3H45/MLKNxJGMzA5KZsIbjSd3oMo4GGjhZ+lbyZ1U8yEUEUH7jy5Hr97zwHs/lkrYBRj2AzzQCwcMaW41JPlKbHmJ30GEsS3gIE0WzSCPBV6TyrzjF9iTcrck4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1623876317182665.0163515360848; Wed, 16 Jun 2021 13:45:17 -0700 (PDT) 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-199-2fzOvW0dOzGDn6NHyfZMJA-1; Wed, 16 Jun 2021 16:45:10 -0400 Received: by mail-wr1-f70.google.com with SMTP id y12-20020adffa4c0000b0290119c11bd29eso1880620wrr.2 for ; Wed, 16 Jun 2021 13:45:10 -0700 (PDT) Return-Path: Return-Path: 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623876316; 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=VFw9vgJJoWSiV7kKdyLbqCikn/UF8LofhlNMqgsl6snLodIzLndOVR8zO2yUqdR+Hxoc8D ngv/nt8W3nz3MLnUC6TRO+/CRcGZuJyynt6EewDD0Vm4I/sl9VeghfKUB+GA8Nb7gTcLzU Fq7/jKG8zEIad2ntJ0uHrd391eudJ8o= X-MC-Unique: 2fzOvW0dOzGDn6NHyfZMJA-1 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=h8qfaFFBJpi8VnJDp0SRB63BIkdp8cxyiYtoBs6eIyHHGjZuPDlm34xz2W8FtIb7WH h0wmPlzJemAGOyH601RBBdJpq8Qc3GLvRRHB913kcQ7mRaMoelqzCefd3Em0l1SW58aE MH/RPTA+1v5z2zAcsptNkIh73I3taSXB1L2Th0xvNfbPvqLlgTHghnM+oZhQ0xSY2zxl LpWFnKc8XE7S95O7XRCAYuWp5+3ikIl9mXaTxfm/UFcWA0rm2srlmw5aDSlSlCXXXUcA ORlD6Oo+nb7jLjjAaZdnWUOoaYLRUk1p0DxH3TiNTXos/LGMDRhJU7xLv7MPcWrQ1mgY i8BA== X-Gm-Message-State: AOAM531UbXY2hrOuub77ZPGuAYGtBd/5t86YYtNY0rG1qXf9AyhBgJlj f4uuQDwMuIXCC8yKiwy3/q4DjPHhU4BGbtyWtSiIsAUd5Ed+BHCy3xHYb94dZ2C/YGJZvjcuDR4 gat8l22tDgyEN4w== X-Received: by 2002:adf:e8cb:: with SMTP id k11mr1125138wrn.127.1623876309328; 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Paolo Bonzini , Connor Kuehl , Gerd Hoffmann , Brijesh Singh , "Dr . David Alan Gilbert" , Eric Blake , Eduardo Habkost , Markus Armbruster , Igor Mammedov , James Bottomley , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Sergio Lopez , Marcel Apfelbaum , "Michael S. Tsirkin" , Laszlo Ersek , Dov Murik 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Michael S. Tsirkin --- 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 @@ */ =20 #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" =20 --=20 2.31.1 From nobody Tue May 21 05:39:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1623876317; cv=none; d=zohomail.com; s=zohoarc; b=e6DE+WqusO3NKvmXxSoh9R5RABgVwMIJO80joHYgOaEvXlzsT2UIMIzr5CVXimCf7zSAOvIbpdcfeM5VpvywJQnK9NObVsD49skoxdcK1d+4s6Xjn1p49ZHvxof6BoSzDMnnlOOHJSzGEYbcHvi6PYNhyVKmL9v1QTiaEDQZU+s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623876317; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=cY8oP9xa0KaEyRIW/MhQjUz22bVRjld90OclKILOu7M=; b=B/7d3SYTq8sHYBGg/eQG8reVsBnvgF3zmQd+ziXFshTt7JdKuAuFRE9UMH2qN4qqLbQqWd152p0R+kkhZgXrzgStgxCRDr4L3FyRow5dlypZrpuWaz+tsmuRguIwoZIo37w5vnoWZcuB0S1pX2dTuveJqFx3fXuUJS1dTai8j+0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1623876317986932.7809496041557; Wed, 16 Jun 2021 13:45:17 -0700 (PDT) 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-34-l-vKJjEnPF2NeHkJC2GeWA-1; Wed, 16 Jun 2021 16:45:15 -0400 Received: by mail-wr1-f72.google.com with SMTP id f22-20020a5d58f60000b029011634e39889so1859026wrd.7 for ; Wed, 16 Jun 2021 13:45:15 -0700 (PDT) Return-Path: Return-Path: 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623876317; 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=MCwKpTOaVSN7Lg3bDtwjtpApKkOdMUtkgk9LmiUeK9SXAtK42jqGnT0BEl+pOJen9Ks5GZ iHJh1MG/HdHw4rZlB+Nvn8mfKo0DVtPQUqTY6jkYRNbGG1/32PVy29bWMtRE4IJuwfM7XL wXEdpx/QBz06KB0FpvzNtlkTbAIbn7Q= X-MC-Unique: l-vKJjEnPF2NeHkJC2GeWA-1 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=SVp0R+MBr+IQvzh3Vj9lLzmyPebSVOS6Zi1GlHO93SwOBIlDoHYhyzkky+zVmJRy5U 9c7D+wSQje9wVo3YZGETFmL8y26ISUmikJ5YjwnQ+oRlBVyKJoDkLNbrNGlV9FYXGSaG bBNXuUZNrwW38kTIE4s2yxBKM8dyCN3iXqmgvt8C6zhXTQLubPsCthhvvn8bfL72nNAe 70DzcKY1Dl6Thrz/e4H76kCm8YmK4D8mPyBbkV0wAtWdLjGb+1jAiGcOKGk6m+VWORl+ 5oehgLU/fHVHqxAuGf9O49bOReIs9E4Oc2LQSBRJsvMgTSLfvVBWq1h4B2V3cR9nSyyp MXKw== X-Gm-Message-State: AOAM531V3VCv9r9oVFKV6XOhZOxn4MYu17aD2A5ZGtlobVf/Psz/j6E0 M3OJB49HSOymuOOakVW3CkUEJIKB0TRz/Pts05CeMEVqOum+xmGj1PvHug6RzfcUHxw0KOfWO+M lCKew41qWzYp+Iw== X-Received: by 2002:a5d:59ae:: with SMTP id p14mr1152651wrr.188.1623876314688; 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Paolo Bonzini , Connor Kuehl , Gerd Hoffmann , Brijesh Singh , "Dr . David Alan Gilbert" , Eric Blake , Eduardo Habkost , Markus Armbruster , Igor Mammedov , James Bottomley , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Sergio Lopez , Marcel Apfelbaum , "Michael S. Tsirkin" , Laszlo Ersek , Dov Murik 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) 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=C3=A9 Acked-by: Michael S. Tsirkin --- hw/i386/{acpi-build.c =3D> acpi-pc.c} | 0 hw/i386/meson.build | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename hw/i386/{acpi-build.c =3D> 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')) =20 subdir('kvm') --=20 2.31.1 From nobody Tue May 21 05:39:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1623876323; cv=none; d=zohomail.com; s=zohoarc; b=WNiBF7ErrZoUss5g9e1kqpGqlNV7RCNxu5uI7weMJDjqSeEO2tEv6l3GvUF0SsHAKuuTmKWdRivwItzYYDvsarm/u2hyC4yLtkKnGEMaFfsPEjm0Yk/4cfNWUKvPiZNySEiwfJkSVOtCujXgdgPcHVtB2SaEPXxt51JjYLnEoSw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623876323; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=4OKxB9aMXMBUxq8Iq2kay9+mSOYnNmtBdcnlzYkDQcU=; b=mCZlRSr1SqaHt42wtbHa+51TZoTNDNi8+RQRymOpL5a2aAWb9Q9Pj9PAjOxfUMAji8GXrsOcIH0ylMFhoUR+pGEy4Rax3mDstJGG99u2ZvZnhUeio/gvjRbu/LeIj79mbW/f1X87RLKVMt1dwKDSJIRfrCqrmY2IuHAFLfJnmxk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1623876323652773.336048809014; Wed, 16 Jun 2021 13:45:23 -0700 (PDT) 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-121-2Q72qusUPVqAT8EqQdojtg-1; Wed, 16 Jun 2021 16:45:21 -0400 Received: by mail-wr1-f72.google.com with SMTP id e9-20020a5d6d090000b0290119e91be97dso1875934wrq.1 for ; Wed, 16 Jun 2021 13:45:21 -0700 (PDT) Return-Path: Return-Path: 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623876322; 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=WMhdWokgRG6OoWhOV/UNu39hUEytIsxa/FXl/tiQSXi3mRgQFsR67yWnJAWbtbxiZcKWes 3xiMkb3HApBJemWmOp/Iy0mUx1hsLYIzLYmEvvORAWdoQ2beh8M5sIoGk2BZQxc0iFL+iN hx3IYmbhaAdjutWtExmLbihPxPQ3Pzo= X-MC-Unique: 2Q72qusUPVqAT8EqQdojtg-1 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=Qrn6LYqkoI+DTVEEMXG4ontsSls26zNwEIA4zbmfmpiXKvxP9FP3JSQRiG2dN7IcBq N2FdHBG8uNA84n2/6plxTcOcrUrgrkYP2nCUiW9DinaDxkktM8VYkIRacis0FzBQhSzE Sa8Dn+4E/PhVG7ajZNoyh++HWhfl8BQ65nZTBG4vQVwOgl49jja/mIrDY7cZc7tzJNRu n9G4PFtwIFROPrcr2qmkH+l4P7AqW3+wSyxu8BkjtrrdgvqL8YHDIIgmrmF5kKDciJDR hd5EzyFoLbhkznCmaLGJO2NXCvweqobbuIa/l26jrDNqLmpTehvvPE0cm/pYQL8aOv4M HlFQ== X-Gm-Message-State: AOAM530tvYFOd3Ws1DCADzZB+D5hdnjj7fQvTBd5etHN/QOKMYOFvomG oYDz6guiJHBwgPokySGNW/boO6DVgygyxkwzYs2V8/+GnK/RrWBriO0k/30S//1jyaN3Do3QKes wGt7kp2xdNIc2PA== X-Received: by 2002:a5d:58cc:: with SMTP id o12mr1166924wrf.384.1623876320398; 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Paolo Bonzini , Connor Kuehl , Gerd Hoffmann , Brijesh Singh , "Dr . David Alan Gilbert" , Eric Blake , Eduardo Habkost , Markus Armbruster , Igor Mammedov , James Bottomley , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Sergio Lopez , Marcel Apfelbaum , "Michael S. Tsirkin" , Laszlo Ersek , Dov Murik 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) pc_madt_cpu_entry() is specific to QEMU 'PC' machines, move it to acpi-pc.c. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Michael S. Tsirkin --- 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" =20 -void pc_madt_cpu_entry(AcpiDeviceIf *adev, int uid, - const CPUArchIdList *apic_ids, GArray *entry) -{ - uint32_t apic_id =3D 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 =3D acpi_data_push(entry, sizeof *apic= ); - - apic->type =3D ACPI_APIC_PROCESSOR; - apic->length =3D sizeof(*apic); - apic->processor_id =3D uid; - apic->local_apic_id =3D apic_id; - if (apic_ids->cpus[uid].cpu !=3D NULL) { - apic->flags =3D cpu_to_le32(1); - } else { - apic->flags =3D cpu_to_le32(0); - } - } else { - AcpiMadtProcessorX2Apic *apic =3D acpi_data_push(entry, sizeof *ap= ic); - - apic->type =3D ACPI_APIC_LOCAL_X2APIC; - apic->length =3D sizeof(*apic); - apic->uid =3D cpu_to_le32(uid); - apic->x2apic_id =3D cpu_to_le32(apic_id); - if (apic_ids->cpus[uid].cpu !=3D NULL) { - apic->flags =3D cpu_to_le32(1); - } else { - apic->flags =3D 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 *li= nker, (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 =3D 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 =3D acpi_data_push(entry, sizeof *apic= ); + + apic->type =3D ACPI_APIC_PROCESSOR; + apic->length =3D sizeof(*apic); + apic->processor_id =3D uid; + apic->local_apic_id =3D apic_id; + if (apic_ids->cpus[uid].cpu !=3D NULL) { + apic->flags =3D cpu_to_le32(1); + } else { + apic->flags =3D cpu_to_le32(0); + } + } else { + AcpiMadtProcessorX2Apic *apic =3D acpi_data_push(entry, sizeof *ap= ic); + + apic->type =3D ACPI_APIC_LOCAL_X2APIC; + apic->length =3D sizeof(*apic); + apic->uid =3D cpu_to_le32(uid); + apic->x2apic_id =3D cpu_to_le32(apic_id); + if (apic_ids->cpus[uid].cpu !=3D NULL) { + apic->flags =3D cpu_to_le32(1); + } else { + apic->flags =3D cpu_to_le32(0); + } + } +} --=20 2.31.1 From nobody Tue May 21 05:39:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1623876329; cv=none; d=zohomail.com; s=zohoarc; b=A7LDQYNm1vf5wvpLbEUrw/7NKOHb6y1jWXjaY6CQcZLF72NVx259mMdRut+Pggdl4GSsdknmynDSkNJqwhzawZFfRqw2VVzi0rsYLQUQM7CSQczkrrBHZVfNpnBpoL7xJaUuXtSnfcH/KlcNK6mQ/70/ivMe0Pr1yKzL44R66EU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623876329; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=kB/lnjMU7yko7yxzqp5L1QJkdTuRfvKiLBaXoDmFI74=; b=RXac3YWc7CRf6yjDryuj3zLhRdFW58J3vxt7pak84WpFK30Wi4kz5Aig/CEY6hTJErK0PvO+8RiJX/iQtfhaRZU3fLW6nR4jOaLtblkolcOqLafkaVvpEREkWZakvJMb//1N7R1SfwIqQOn7sxL3L/KNcfpjoH9IH0N/MzQh5yE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1623876329900714.7737133430622; Wed, 16 Jun 2021 13:45:29 -0700 (PDT) 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-312-r70yHyKWPgyWr8JL_JK1Yg-1; Wed, 16 Jun 2021 16:45:27 -0400 Received: by mail-wr1-f71.google.com with SMTP id z13-20020adfec8d0000b0290114cc6b21c4so1840346wrn.22 for ; Wed, 16 Jun 2021 13:45:27 -0700 (PDT) Return-Path: Return-Path: 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623876328; 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=PcnTK1L1Oe7vHLum/QRnTZo8fMZ8YCnbEwI5xRutFT5hLqumbeJ6WauJtre8QyPuux+Rwj j7j1q0By4Qj6/DM4OoWX6OA/2FTUycCynXY1ymYKwVGyGaBSmWze8cXfIrOvSfPNqlRjV6 9HkpbCpA8PCGP5DO/Ls6rgCuadRy/Fg= X-MC-Unique: r70yHyKWPgyWr8JL_JK1Yg-1 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=aZYQCim3tDi0QUwviDY+WuTk3qPvqYxmvSIfsfWAvumhaQo2cW2iLMsHy6J/4pnDnV coMg2qu7e7jYh/KFndVGs7B1Kkdj778BRHp3tU0N8B7jF//lsGYnFb09kw1Y2hF0itpX /vLiZxpU2KMhuScBE7yHaBuJlejyNkrnYbAy5kzQP1PYAexXt3bthy41gaDxgUsxKfHW Q358GFqxxE+625U0w1pMY+quzM45uRKv94WUvtz6H2dol+dQVUenfjRJdNl2cAbRrUr2 GYvqeeHApFpPEmP9QknIgwNav7WxiZtzR1JtZG6xggGuTbu4/csS8rF0GnsXKuC+IceT BIrg== X-Gm-Message-State: AOAM532lA65g+oiPk/UfFeL+cCuBxUaoQi2vuWKenhR0rBSoN/mqtJ0H t0J7F8Fq0xR941/6i6VHkXJJQCY87/opFiT/nPRhsyimmmHEaIbpuGh6QSSdXMO8lMnWiu6N9dx P5Dy098Y75QRZUA== X-Received: by 2002:adf:cc8d:: with SMTP id p13mr1127397wrj.239.1623876325755; 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Paolo Bonzini , Connor Kuehl , Gerd Hoffmann , Brijesh Singh , "Dr . David Alan Gilbert" , Eric Blake , Eduardo Habkost , Markus Armbruster , Igor Mammedov , James Bottomley , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Sergio Lopez , Marcel Apfelbaum , "Michael S. Tsirkin" , Laszlo Ersek , Dov Murik 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) ACPI core routines (in core.c) are not really x86-specific. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Michael S. Tsirkin --- 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')) --=20 2.31.1 From nobody Tue May 21 05:39:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1623876335; cv=none; d=zohomail.com; s=zohoarc; b=l1RT8V4rYIe1MMcOBf07FyiCBBEP1pF6bHUcDvpYNYe5Z6CeIh2zisWfyWRTzK3ppN4BlzJ0+JBK2s0iz9TM3F2SUpCbyvUNUBdr8nz98MGHbRzHxN5kKeC+8RJrB13HSh2bn/GTjQ+wrbAYJ6cTb2+S/pWwIIHdWKPcYAfVCDs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623876335; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=GCjF8F/1VJOBX/ktZ6oKHcbI63O5csahyL1IvsamaYk=; b=dLC2e+6CV0GhlWIVfurkSxCV5PYhUDMjKTQtU2jUnKmaE+2PW2L1sed0oOxkeeXYNm8sjnqWn5GVjfchh9UVFVRIbzcUFHWQ1608TbZdEbr8pIyKP3uyEKstvYCeMF/zIQANnSh8pwsEr5i032+H1tAujdZq1/TmG1a0vQnzo5o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1623876335193538.4273068765734; Wed, 16 Jun 2021 13:45:35 -0700 (PDT) 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-493-MxSazFKTPF-oLPu2VPUIKQ-1; Wed, 16 Jun 2021 16:45:33 -0400 Received: by mail-wr1-f69.google.com with SMTP id z13-20020adfec8d0000b0290114cc6b21c4so1840457wrn.22 for ; Wed, 16 Jun 2021 13:45:32 -0700 (PDT) Return-Path: Return-Path: 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) 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= X-MC-Unique: MxSazFKTPF-oLPu2VPUIKQ-1 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=rMhrN8sWayqdGd9m+Jk7ttNZeRjnwdbJKz10qQ/wJNPukUIj4FfE9N1/TlP/Jup8mH CG9TRuGqt8SrF5wPjEmDpAxiDvRkDpW09Cp54mu0RRr/w5h2bAWqzxxjE8AXCPlVh/Zi 8uCGbq2oyp6tHFkTHMq4xN+gzt6J6M1BCCw5zMtthd+qJSlfIbWIxgVbqbHCzhQ9mO8t W/6tAzRrFdaPtFGh4Cmn6zYur08qzNDOW/BQysoP50ds2nhJIb7E58/uUMbOsvdpSrk9 ae+s4dWLfy0rXqO3JnTpyCM+G2hTI8K23LnP7H+Ccg5eT48lO2kc1D8+tHkiG4Z1D6nJ VDbg== X-Gm-Message-State: AOAM533uAQkRovWm31RTtewnQCZLs0uVXVC4qDpshlqMeGBLc1PfKGN8 Cd0RxVfNhuq4uYDAI0jGw032xDIe8KxWkPDDqxRPmeyKzOh4CptTQdUkYPMrvP9kXOt4VY50orG FJgNUYqyvY5QImA== X-Received: by 2002:a5d:698a:: with SMTP id g10mr169056wru.129.1623876331756; 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Paolo Bonzini , Connor Kuehl , Gerd Hoffmann , Brijesh Singh , "Dr . David Alan Gilbert" , Eric Blake , Eduardo Habkost , Markus Armbruster , Igor Mammedov , James Bottomley , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Sergio Lopez , Marcel Apfelbaum , "Michael S. Tsirkin" , Laszlo Ersek , Dov Murik 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) 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_f= ind' Fixes: f522cef9b35 ("sev: update sev-inject-launch-secret to make gpa optio= nal") Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Michael S. Tsirkin --- 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 *pcm= s); void pc_system_firmware_init(PCMachineState *pcms, MemoryRegion *rom_memor= y); 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); =20 =20 /* 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 *p= cms) } } =20 -#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_si= ze) -{ - 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 =3D qemu_uuid_bswap(guid); /* guids are LE */ - ptr =3D flash_ptr + flash_size - 48; - if (!qemu_uuid_is_equal((QemuUUID *)ptr, &guid)) { - return; - } - - /* if found, just before is two byte table length */ - ptr -=3D sizeof(uint16_t); - tot_len =3D le16_to_cpu(*(uint16_t *)ptr) - sizeof(guid) - sizeof(uint= 16_t); - - if (tot_len <=3D 0) { - return; - } - - ovmf_table =3D g_malloc(tot_len); - ovmf_table_len =3D 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 +=3D tot_len; -} - -bool pc_system_ovmf_table_find(const char *entry, uint8_t **data, - int *data_len) -{ - uint8_t *ptr =3D ovmf_table; - int tot_len =3D ovmf_table_len; - QemuUUID entry_guid; - - if (qemu_uuid_parse(entry, &entry_guid) < 0) { - return false; - } - - if (!ptr) { - return false; - } - - entry_guid =3D qemu_uuid_bswap(entry_guid); /* guids are LE */ - while (tot_len >=3D 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 =3D (QemuUUID *)(ptr - sizeof(QemuUUID)); - len =3D 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 -=3D len; - tot_len -=3D len; - if (qemu_uuid_is_equal(guid, &entry_guid)) { - if (data) { - *data =3D ptr; - } - if (data_len) { - *data_len =3D 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=C3=A9 + * + * SPDX-License-Identifier: GPL-2.0-or-later + * + * This work is licensed under the terms of the GNU GPL, version 2 or late= r. + * 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 *dat= a_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"), t= o deal + * in the Software without restriction, including without limitation the r= ights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or se= ll + * 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 OT= HER + * 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 =3D qemu_uuid_bswap(guid); /* guids are LE */ + ptr =3D flash_ptr + flash_size - 48; + if (!qemu_uuid_is_equal((QemuUUID *)ptr, &guid)) { + return; + } + + /* if found, just before is two byte table length */ + ptr -=3D sizeof(uint16_t); + tot_len =3D le16_to_cpu(*(uint16_t *)ptr) - sizeof(guid) - sizeof(uint= 16_t); + + if (tot_len <=3D 0) { + return; + } + + ovmf_table =3D g_malloc(tot_len); + ovmf_table_len =3D 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 +=3D tot_len; +} + +bool pc_system_ovmf_table_find(const char *entry, uint8_t **data, + int *data_len) +{ + uint8_t *ptr =3D ovmf_table; + int tot_len =3D ovmf_table_len; + QemuUUID entry_guid; + + if (qemu_uuid_parse(entry, &entry_guid) < 0) { + return false; + } + + if (!ptr) { + return false; + } + + entry_guid =3D qemu_uuid_bswap(entry_guid); /* guids are LE */ + while (tot_len >=3D 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 =3D (QemuUUID *)(ptr - sizeof(QemuUUID)); + len =3D 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 -=3D len; + tot_len -=3D len; + if (qemu_uuid_is_equal(guid, &entry_guid)) { + if (data) { + *data =3D ptr; + } + if (data_len) { + *data_len =3D 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=C3=A9 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 =20 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-stu= bs.c')) =20 subdir('kvm') subdir('xen') --=20 2.31.1 From nobody Tue May 21 05:39:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1623876341; cv=none; d=zohomail.com; s=zohoarc; b=O/wqrbwVn04zwMbEKFzMgsysamGzwmVGm1+BXAwJapFHHDIdaEhoSskx2aYLsVym29paFdlTEHxTXj7B6lEYb4cVqb4G+Np/GUiiZH+fPSbqa0aqhD38oUAEOcSB1zWeXdxGfgMAhDxlJAxNJLb924+yY7ffwtxT7LwGOHMny/k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623876341; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=0afWzhBhI6klZY1Mb1UVWAL8VD89TP6dUzvV5tmy8sQ=; b=n32DrFmbxLKDAIuFBNAhnZBiJxxT8PHMAlKGyKzuBAHLvn2XaxPWPAd12bi5W2Yj8KPmzCiPQLf7jYqbKvxprMtuO/srrdEA5dBfIQixD4Ji13zM4faKFdorc9rAtSKiJXIhwSE7l3CHGGxVo9EY8A2rIWQPCrQFOepbjFHajyE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1623876341783333.6005667439264; Wed, 16 Jun 2021 13:45:41 -0700 (PDT) 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-514-LBJIeK-5M4Wu2bNuOScKtA-1; Wed, 16 Jun 2021 16:45:38 -0400 Received: by mail-wr1-f70.google.com with SMTP id y12-20020adffa4c0000b0290119c11bd29eso1881365wrr.2 for ; Wed, 16 Jun 2021 13:45:37 -0700 (PDT) Return-Path: Return-Path: 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623876340; 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=dsr6Ze7w1w2mNqHcG+0nF5F8qXsoYRGdxnYoqCWzr+oR5RHdbaAokCDLX6nSdcgtAD5N3b GU1RXoom8JMZXj4Md8S5L/Kc0W5MTw7KeULtvpkarJYGifCSDC0osIEdH8H1W79NktwcTG OvXtX1QpdPnb+Q1oedRQPYcJJgCr5QM= X-MC-Unique: LBJIeK-5M4Wu2bNuOScKtA-1 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=BGSC4u5Zs6UUdljOuXmTz0521ETLAJCTVI1oMD4RNThAol+hY2Rebaa2cEuHJxwCq3 6q4CKuEU6JjWvEqkoH3z05IAT3YKmCeMl15EeMmGSB6grhhZ/G9XLn734uZLXHAEbww2 Vq228UNvWy2fWLsH4Qf4ImSviwdJ1pAoqTjWfr898gTNUMdJ6KxLkq54BZw/2viTjqAu 7chVbz3bPOkESootJ8IEwu4JVMuN5XcFdX0HDAFz9e2QqZQcS3skDmEEA0jOadDbmYRX v/b53zk9/A6LYPSUhL6wXD8eHYLedlL2qoO+griYpYWpuKbi2b/7RxvUDb9/hhcyflb8 FiYw== X-Gm-Message-State: AOAM531XEOdHPYBGlgukR1WDsMfurFnHNz4ujcSDzkB8ilM9+RGNwcR3 l7SuPH7SJW4U+XBG6bEUx5Z0wyNybYe87sZGl26U9xwQ1Xrt8N+msc7JjMTdxGOmO8Eg4CZr2wR Y8Z878bpL81SBqg== X-Received: by 2002:a5d:4cd1:: with SMTP id c17mr1155099wrt.295.1623876336805; 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Paolo Bonzini , Connor Kuehl , Gerd Hoffmann , Brijesh Singh , "Dr . David Alan Gilbert" , Eric Blake , Eduardo Habkost , Markus Armbruster , Igor Mammedov , James Bottomley , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Sergio Lopez , Marcel Apfelbaum , "Michael S. Tsirkin" , Laszlo Ersek , Dov Murik 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) The 'microvm' machine misses various dependencies: /usr/bin/ld: libqemu-i386-softmmu.fa.p/hw_i386_acpi-microvm.c.o: in funct= ion `acpi_setup_microvm': hw/i386/acpi-microvm.c:247: undefined reference to `acpi_build_tables_ini= t' /usr/bin/ld: libqemu-i386-softmmu.fa.p/hw_i386_acpi-microvm.c.o: in funct= ion `acpi_build_microvm': hw/i386/acpi-microvm.c:192: undefined reference to `bios_linker_loader_al= loc' /usr/bin/ld: libqemu-i386-softmmu.fa.p/hw_i386_acpi-microvm.c.o: in funct= ion `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_dat= a_push' /usr/bin/ld: hw/i386/acpi-microvm.c:126: undefined reference to `aml_scop= e' /usr/bin/ld: hw/i386/acpi-microvm.c:129: undefined reference to `build_ge= d_aml' /usr/bin/ld: hw/i386/acpi-microvm.c:131: undefined reference to `acpi_dsd= t_add_power_button' /usr/bin/ld: libqemu-i386-softmmu.fa.p/hw_i386_acpi-microvm.c.o: in funct= ion `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 funct= ion `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_he= ader' /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 funct= ion `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_fa= dt' /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_bui= ld_madt' /usr/bin/ld: hw/i386/acpi-microvm.c:212: undefined reference to `build_xs= dt' /usr/bin/ld: hw/i386/acpi-microvm.c:224: undefined reference to `build_rs= dp' /usr/bin/ld: libqemu-i386-softmmu.fa.p/hw_i386_acpi-microvm.c.o: in funct= ion `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_bui= ld_tables_cleanup' /usr/bin/ld: libqemu-i386-softmmu.fa.p/hw_i386_acpi-microvm.c.o: in funct= ion `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=C3=A9 Acked-by: Michael S. Tsirkin 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 =20 config ACPI_HW_REDUCED + bool + select ACPI + select ACPI_MEMORY_HOTPLUG + select ACPI_NVDIMM --=20 2.31.1 From nobody Tue May 21 05:39:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1623876347; cv=none; d=zohomail.com; s=zohoarc; b=RFFQQvI4FmhG3POCTbMgfBSU7HuOT+J1tjxQXa62l7J6fkifqDL17Tt6k1ART5Ti6gVMC4oKpLNlcLgTuvnSEmNvwr8aqKfnSCorMQsxfR3veGWKqjzw9Atpsfal5R+8yIYzWgecslvb6IBLwqG/eJgIIapV0nZsizo4ZG1DT5o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623876347; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=JxnpTnfrSc/SaJ3Gl4Vf5kVk0k2nHRHvjFPx1fnte0M=; b=emFdk39Lu2OmcXgfbQuzTD2FnYShBUtRqJqgUMciwyKSO2GHsgVmd+tfdyVeHcdlfXn7jTu4oOyAOtdn0uqIi+33321ldDpbn2BAVHboPz5cOANDxaWhybeF55h8C2S6YRfUm+AAR6sD9PuZixZpUBRQGh/n11EF7U3euCpxye4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1623876347040609.6366332656909; Wed, 16 Jun 2021 13:45:47 -0700 (PDT) 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-467-AXhxyFRvPpWiUHMFGRk61w-1; Wed, 16 Jun 2021 16:45:43 -0400 Received: by mail-wr1-f70.google.com with SMTP id z4-20020adfe5440000b0290114f89c9931so1843712wrm.17 for ; Wed, 16 Jun 2021 13:45:43 -0700 (PDT) Return-Path: Return-Path: 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) 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=JxnpTnfrSc/SaJ3Gl4Vf5kVk0k2nHRHvjFPx1fnte0M=; b=B6h/KIqVNM1V8QYMLK1L+vLgv5K4ryh2IDby/gtkCt4VN9vGdw83w6XtkFUzD/W/uHJctb 07DGG57CsfRVz2a4fthwwtYV/qSijcFCrdZuzyxtR3xxF83xwOu9TMfp+ICLF8V5n1S69q GizNDmTHHlFSctdK4mSn/zBgaAEg9os= X-MC-Unique: AXhxyFRvPpWiUHMFGRk61w-1 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=MQ+MGjsN+xD9w8lYKRie1LjD3p2cTPLp1Zdr00MPRcBFAzvqCSec0qVJeaGeQXbr0l hteRr5qza3ZEucAYK497r4BiYeAr6ErNJ4Zmfjmt/ROXGj/HVrdBfhhMq/L4ymWbMv8B Cqs3BmkIauYDldBZ7EhWqdwWBVRs1pevQ9oYBsBAMVZBYYsA5Xmxvlou776udBho8j5+ cOozbAgJJnHklA5BXs9JAaRu6zUExJNmhUMeeJ6vOSC4ijLoaEs6gvhRBEOamPcSQ574 rck/qS4ZAZyDSKu36eqKHchsoc9dFQijPbmzMvY5P/A/P6nUmbB1zrLTF6hDiH/9PTzi /vaw== X-Gm-Message-State: AOAM532yD7t1zxjGdsbiIDO9mdWXa0xspTlCFcD0ivjvh9o/IRcnlFp6 anBTg1/ouQxIABlNugw1VgACMRCNj80Z2tmBsjyyxmEkhFCxT1QqQGH5X3CJ/PVWBiWAV1TAUB1 BBXpBSoZoPQf5GA== X-Received: by 2002:a05:6000:50d:: with SMTP id a13mr1163845wrf.130.1623876342565; 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Paolo Bonzini , Connor Kuehl , Gerd Hoffmann , Brijesh Singh , "Dr . David Alan Gilbert" , Eric Blake , Eduardo Habkost , Markus Armbruster , Igor Mammedov , James Bottomley , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Sergio Lopez , Marcel Apfelbaum , "Michael S. Tsirkin" , Laszlo Ersek , Dov Murik 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) 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 !=3D= NULL) Bail out! ERROR:qom/object.c:714:object_new_with_type: assertion failed: = (type !=3D 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=3D) a= t qom/object.c:714 #5 0x000055a878c18399 in object_new (typename=3Dtypename@entry=3D0x55a87= 8dec36a "isa-pit") at qom/object.c:747 #6 0x000055a878cc8146 in qdev_new (name=3Dname@entry=3D0x55a878dec36a "i= sa-pit") at hw/core/qdev.c:153 #7 0x000055a878a8b439 in isa_new (name=3Dname@entry=3D0x55a878dec36a "is= a-pit") at hw/isa/isa-bus.c:160 #8 0x000055a878adb782 in i8254_pit_init (base=3D64, isa_irq=3D0, alt_irq= =3D0x0, bus=3D0x55a87ab38760) at include/hw/timer/i8254.h:54 #9 microvm_devices_init (mms=3D0x55a87ac36800) at hw/i386/microvm.c:263 #10 microvm_machine_state_init (machine=3D) at hw/i386/mic= rovm.c:471 #11 0x000055a878a944ab in machine_run_board_init (machine=3Dmachine@entry= =3D0x55a87ac36800) 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=C3=A9 Acked-by: Michael S. Tsirkin 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 =20 config X86_IOMMU bool --=20 2.31.1