From nobody Thu Apr 25 22:28:17 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1634116301951553.3324900031778; Wed, 13 Oct 2021 02:11:41 -0700 (PDT) Received: from localhost ([::1]:54126 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1maaIW-0005JX-U4 for importer@patchew.org; Wed, 13 Oct 2021 05:11:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54302) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1maaEZ-0002AX-Jv for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:35 -0400 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]:37544) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1maaEW-0005aL-RJ for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:35 -0400 Received: by mail-ed1-x52f.google.com with SMTP id y12so7306675eda.4 for ; Wed, 13 Oct 2021 02:07:31 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id c6sm6177849ejb.41.2021.10.13.02.07.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Oct 2021 02:07:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7plEq4p81FFj38cXa029iyAHNk4D+4Vmgv+BRxxENfI=; b=Ot0uYgLl1pCWlg5xhIvWrPYYw6WqxU8/YanNBAEP0qv/9L2vlRFjr9pHxcstkjWbvw Z5EddnQ7qx6KsqPFZw6I5H7P0LIcNtTwbYcgFmZAF+wZCBZ7fKpgzdq9IjDOYNIeyfh+ 9YcRmKrP2kF+OqbKwHtjD43gJwLDsyA3J/NoIG7SSvaKCgO621rZIutrgdsKs289ZMKY Foul4ZbNXpiXfU17c/9Qaile4ntPDP4ujtN1lKOLtkS1Gg35hnUQYGeuL9OFqI/5QU5T DcKxa3E5JVEjKukzj5DnMQ1G+501AQqagYbzhScJZ7cubVGgB+Rx2CTBsIUz9LTAjG8U ISQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=7plEq4p81FFj38cXa029iyAHNk4D+4Vmgv+BRxxENfI=; b=miSpAKE186IDufBusuG77KB9hRQOvIykzeq0tmusws2P5afhlfKQ8x28Plfk73lk01 cltpu9PUtCiMPedm6NfJ+cZKI4Smxohcb7pPlqtRv2gQLIpeWNIXJ6mFhkQ0KJfSkDgj G8SbrtnbQFenW3U7nTvTHLOO4o6c4ORfVpHFUMAMZkBzXwNSkITJVS0GLd6hftTA7uAU /gUOrXYhoQBdWMtygkOMj366HrqFBxhjukV5x92enm4KPRA4JSUzilN9rYB3OHE1t7lH SFsITQAYAt0MYuomPihqe2xtWRJKLJL0BkZWOdRszrQ29ef4o4FsHUkEN84S4pT1WeDd M59Q== X-Gm-Message-State: AOAM532zvIFz91xwP7eK2gA0T85Zy+w7fPKXK2QohrZGpqwwZtsIf0n0 MUzL2aHe507pUwMMdu/rG9v+XGLa8uA= X-Google-Smtp-Source: ABdhPJyak+opCT8aGv/u8Zu1uGaY4baW+YNqSY8OP93IjIX73srjcDpOt3d4iMuwqCv7qHbD6zAfZQ== X-Received: by 2002:aa7:c2da:: with SMTP id m26mr7732209edp.89.1634116050887; Wed, 13 Oct 2021 02:07:30 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 01/40] MAINTAINERS: Add myself as reviewer of the 'Memory API' Date: Wed, 13 Oct 2021 11:06:49 +0200 Message-Id: <20211013090728.309365-2-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211013090728.309365-1-pbonzini@redhat.com> References: <20211013090728.309365-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::52f; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x52f.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , David Hildenbrand Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1634116302210100006 From: Philippe Mathieu-Daud=C3=A9 Having developed interest with the Memory API, volunteer to review the patches. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: David Hildenbrand Message-Id: <20211007091949.319404-1-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 50435b8d2f..32b668e92f 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2502,6 +2502,7 @@ Memory API M: Paolo Bonzini M: Peter Xu M: David Hildenbrand +R: Philippe Mathieu-Daud=C3=A9 S: Supported F: include/exec/ioport.h F: include/exec/memop.h --=20 2.31.1 From nobody Thu Apr 25 22:28:17 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1634116298053733.5923915308016; Wed, 13 Oct 2021 02:11:38 -0700 (PDT) Received: from localhost ([::1]:53852 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1maaIS-00057f-FM for importer@patchew.org; Wed, 13 Oct 2021 05:11:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54304) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1maaEZ-0002AY-Kr for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:35 -0400 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]:37547) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1maaEX-0005ay-Sz for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:35 -0400 Received: by mail-ed1-x532.google.com with SMTP id y12so7306793eda.4 for ; Wed, 13 Oct 2021 02:07:32 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id c6sm6177849ejb.41.2021.10.13.02.07.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Oct 2021 02:07:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0FDTyDLOhG/Kr2K+3Sxwib8ho+Rf1TxbO6LGzgBxoOk=; b=CYCvhGEUaIIkbmUb06/EAVprKUvlCqmbEe3nZmTugdKyOwU8TybX6irP/YW1lceQD9 GSUofK9i1aRv/mrqkjdmK6in5P4dFneLWnsH2Izx+Wg6iAHiiAnKj9xkLDud35wvp5yg vafqoCmEjzIvgbJJ1X2UPJFbNh7w0XGsCEXifYok30AtWoOIS5lm/DfHJzYud3OCTZzi B9Asf75IBuHlZpfURqWCgtOhKcR8H5DWqbLYCNV6ZGrY/BnEp9OLVLW5A0HYTo6hYj9c ae2Ugw8HMHl71AUfL/8JNqNFFtgatI5pRkiM8rEwjeCIHBNkx9Pc+i/r+uOVLPiw59fa 5D2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=0FDTyDLOhG/Kr2K+3Sxwib8ho+Rf1TxbO6LGzgBxoOk=; b=PixFG909X6mJq+034g7CmWgd32VuzjeXFOEK04VuheyM5fBSo14+ocRbEWp2Ec0NBv IWM68QWh0kqQb9EDdCtmFR/ZMp1eeQpw9iyQhq8HUlQqKvVm4t1/rNDxfBfuPt/Lhmx0 Pd/XXX8dfxNMEBalHR18cQhBBqPiuMI17buEp6C7U1cRfutaLWiKwL3q3ce4KSB1M/lf LPbYHfc/aH5Emf2skEFmys1KiuIZXMxdxCgl8PnWJF2jTqdS26QtzForPLZR1UmeF+1N JT5jhx7d3bpjVkd5Wz/WntjWFeS4si8tho6OuD8wmvDwvlZ+PDp6dFFhMl4pJO6z1Aot Cb8A== X-Gm-Message-State: AOAM530P0ix1nXEal/UybrmMzpaRCmlXUrU4wWu1svOglpAf4OVVD2BI TDmQL5kA/9XWSBG66QqzxpIyT6Ai88I= X-Google-Smtp-Source: ABdhPJybFz06W4WATp6R3z0fJJ/9jqFtV+V43M7wQFxXSZ52Dr/gCXGW/jNzaEwdqKogSC+4JJsWhA== X-Received: by 2002:a05:6402:14cc:: with SMTP id f12mr7953012edx.242.1634116051537; Wed, 13 Oct 2021 02:07:31 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 02/40] tests: add missing dependency for check-block Date: Wed, 13 Oct 2021 11:06:50 +0200 Message-Id: <20211013090728.309365-3-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211013090728.309365-1-pbonzini@redhat.com> References: <20211013090728.309365-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::532; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x532.google.com X-Spam_score_int: 4 X-Spam_score: 0.4 X-Spam_bar: / X-Spam_report: (0.4 / 5.0 requ) DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1634116300138100003 Content-Type: text/plain; charset="utf-8" qemu-iotests run qemu-storage-daemon, make sure it is up to date. Signed-off-by: Paolo Bonzini --- tests/Makefile.include | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/Makefile.include b/tests/Makefile.include index 7bb8961515..cc1e4f2c07 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -151,6 +151,7 @@ ifeq ($(CONFIG_TOOLS)$(CONFIG_POSIX),yy) check: check-block export PYTHON check-block: $(SRC_PATH)/tests/check-block.sh qemu-img$(EXESUF) \ + storage-daemon/qemu-storage-daemon$(EXESUF) \ qemu-io$(EXESUF) qemu-nbd$(EXESUF) $(QEMU_IOTESTS_HELPERS-y) \ $(filter qemu-system-%, $(ninja-targets)) @$< --=20 2.31.1 From nobody Thu Apr 25 22:28:17 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1634116517056507.33075835039176; Wed, 13 Oct 2021 02:15:17 -0700 (PDT) Received: from localhost ([::1]:34276 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1maaLz-0002fn-S7 for importer@patchew.org; Wed, 13 Oct 2021 05:15:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54358) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1maaEc-0002C0-3h for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:38 -0400 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]:44586) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1maaEX-0005bx-Tv for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:36 -0400 Received: by mail-ed1-x52f.google.com with SMTP id w14so7161038edv.11 for ; Wed, 13 Oct 2021 02:07:33 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id c6sm6177849ejb.41.2021.10.13.02.07.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Oct 2021 02:07:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=H0+ITqm7hx9kuwpqKK0wFnUKiCP3pA/P6YqdcV8LmWc=; b=BuVPJ/zKtYPlfT4eqJinhPbuHGAXgCuUtbyRPAHj73XuXM83Yq0917/AS0EPPGG7og wFlrnnQ4B0alstv7KnWemouQwc5WxvDi1Oa2mGGsRMdrljB1WU77DVvRmj+GxgvsTG1c aXPiVHvRCAsNT48q8sGbgLlBiCr/04hdxemZja8zJxam4mrPr+tgwLuATW4yqtxjBGiA eGDPXpZ7Xa8ztmI3MzoSOZghHNGSXgUrR8yeiQpRHQKKiBk5dE4HiTgn6rwNwTCOmfLB 5U4lNOIWUrLmZRl/oAI7XOv1JF9H22ljeCKAAK+wrr3pceCPcev0X8+QsYW+kj8VvKVN vNwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=H0+ITqm7hx9kuwpqKK0wFnUKiCP3pA/P6YqdcV8LmWc=; b=b+4BqwpFkjVP+Bkk3faKA2vKjECHFL1EyBqq5PHGtAL6r693xkbXNPWabcEySpRrS8 Fq52KCCwktjiPnO25q327L2sZwG0+yYo3Obf7NvW81t52PS04ETqQhAUbw0OD3FzUqBs fp5CQ5uSUBdldonbI7eLcu2Ux6moDBxwcpBp0tpBtpxvmq51++KpAMv7tpRfpzOx/a+U nPvxxK6CHy9DxXXNNT0kNuLRyjadTj/sHXTIjjDAkKRL2AKRIpYA1T5NlM9KMFYfQJ8y DtBgMcrQ6gwwqXGQLM5VKFFoFy3mYZqynEJKmBdI2vF6PdW+mm9YnKPk9hXwaTe6eRfJ 54CA== X-Gm-Message-State: AOAM533WBarlWAkOZAicntpqdOf1Mr3qZf0pqJHBt+e7DntCIMLGyeTH WqGoJ+SWi1KFfCmahEbA5uPIWqpBhz8= X-Google-Smtp-Source: ABdhPJwktlg48fyu0xZERwvBquOwL4er0a5/oZN2LRqQ76sOyVxn1aUSOLRs+s24PxCCtWHC5H2ZRg== X-Received: by 2002:a50:fc8e:: with SMTP id f14mr7819248edq.87.1634116052158; Wed, 13 Oct 2021 02:07:32 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 03/40] build: fix "make check" without earlier "make" Date: Wed, 13 Oct 2021 11:06:51 +0200 Message-Id: <20211013090728.309365-4-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211013090728.309365-1-pbonzini@redhat.com> References: <20211013090728.309365-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::52f; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x52f.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1634116518000100001 Content-Type: text/plain; charset="utf-8" "make check", if not preceded by "make", will not build the tools needed by qemu-iotests. This happens because qemu-iotests, aka "make check-block", is not yet part of meson.build. While at it, remove the reference to the now-dead QEMU_IOTESTS_HELPERS-y variable. Signed-off-by: Paolo Bonzini --- tests/Makefile.include | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/tests/Makefile.include b/tests/Makefile.include index cc1e4f2c07..8434a33fe6 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -150,14 +150,21 @@ check: ifeq ($(CONFIG_TOOLS)$(CONFIG_POSIX),yy) check: check-block export PYTHON -check-block: $(SRC_PATH)/tests/check-block.sh qemu-img$(EXESUF) \ - storage-daemon/qemu-storage-daemon$(EXESUF) \ - qemu-io$(EXESUF) qemu-nbd$(EXESUF) $(QEMU_IOTESTS_HELPERS-y) \ - $(filter qemu-system-%, $(ninja-targets)) + +ifneq ($(filter check check-block check-build, $(MAKECMDGOALS)),) +ninja-cmd-goals +=3D \ + qemu-img$(EXESUF) \ + qemu-io$(EXESUF) \ + qemu-nbd$(EXESUF) \ + storage-daemon/qemu-storage-daemon$(EXESUF) \ + $(filter qemu-system-%, $(ninja-targets)) +endif + +check-block: $(SRC_PATH)/tests/check-block.sh run-ninja @$< endif =20 -check-build: $(QEMU_IOTESTS_HELPERS-y) +check-build: run-ninja =20 check-clean: rm -rf $(TESTS_VENV_DIR) $(TESTS_RESULTS_DIR) --=20 2.31.1 From nobody Thu Apr 25 22:28:17 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1634116587642881.9002019597071; Wed, 13 Oct 2021 02:16:27 -0700 (PDT) Received: from localhost ([::1]:36232 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1maaN7-00041R-JX for importer@patchew.org; Wed, 13 Oct 2021 05:16:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54360) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1maaEc-0002C4-4c for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:38 -0400 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]:46986) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1maaEZ-0005cp-8A for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:36 -0400 Received: by mail-ed1-x533.google.com with SMTP id z20so7129351edc.13 for ; Wed, 13 Oct 2021 02:07:33 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id c6sm6177849ejb.41.2021.10.13.02.07.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Oct 2021 02:07:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uNG36sfrGRnhfbW02QCMFzqnCJ3SMLhvJx/HaulJn0Y=; b=ggsKdrCW1FXYuozXn7G7sBXbO4e3YaZS4PPTBYVipC3eSPhrC7ZTzvQMJMqoJkE3L/ h0YQYWht4F1KLX0YXx2fwRCw5TkOgrCvoW6a2Walx+rSTewJnJpRf7ftKpOFXheK2HaB QwVAAVa0wCD4PSA7Co5QYNlDQcbAdZkVlUhUXHc/LwVfmS4J8NQ6+vHr0ocq/uPjvUWg a91ZcrbCHnk78J4vKv4x8EWtmJVXFm4CtFZdD+9cweiD+0g48WjQKy0iUmZM4yFUmmJV FVW0hEGGGiOsMsGUFESkd5b17mVik6dQIfuqiAVZlCvvY8k18YwwTC8acZGymN8REeCI mBcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=uNG36sfrGRnhfbW02QCMFzqnCJ3SMLhvJx/HaulJn0Y=; b=x5Dp5PwbgiMZXFxWdGmxvDzvGZRYBkANm+ZAfYOxPpHhvbVMC/Nw8nnwNAwyjLqSF2 +XBdVUfMo5l8wzep7jllPVz9U98k2ewKsmdqcO99srLwlF3UrXQYWPGLYL4sRa3U/8l6 d+GNxVMCwXf9/ghjECpsPW/F2/UlEowaKQ3KIFcBjnbeRhN20ie9CpT7c1PCEjUvD+Lc 5ziXjJmLC/y3TKprnFUxS9Gymb8gzg9CYPgCKTalVQUNI5MqczWi/cRnldpMqeCm7i+7 3x9W1lCIGP3iOmyd9VeRcGEvaZ9Leei/5+usNnyMtN3YSz++VqNLVi5UoQuHqbQebpvt qQbQ== X-Gm-Message-State: AOAM532G5X3tuODHOleDzr7uIBzmddY1MJyJzNj0JrkEe1B8iYXNJWjR CXCejrLu/PSpxhqYUdCnuu5G6oO2PNg= X-Google-Smtp-Source: ABdhPJz18O6M0Zo8qZnaPQ8267k0zlBzr2eWUDogPap2z/yKmksPX199t/0ssy6PANwZrll0qRB8qg== X-Received: by 2002:a05:6402:1b92:: with SMTP id cc18mr7773797edb.31.1634116052854; Wed, 13 Oct 2021 02:07:32 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 04/40] qemu-iotests: flush after every test Date: Wed, 13 Oct 2021 11:06:52 +0200 Message-Id: <20211013090728.309365-5-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211013090728.309365-1-pbonzini@redhat.com> References: <20211013090728.309365-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::533; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x533.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1634116589370100001 Content-Type: text/plain; charset="utf-8" This makes it possible to see what is happening, even if the output of "make check-block" is not sent to a tty (for example if it is sent to grep or tee). Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- tests/qemu-iotests/testrunner.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qemu-iotests/testrunner.py b/tests/qemu-iotests/testrunn= er.py index a56b6da396..0e29c2fddd 100644 --- a/tests/qemu-iotests/testrunner.py +++ b/tests/qemu-iotests/testrunner.py @@ -341,6 +341,7 @@ def run_tests(self, tests: List[str]) -> bool: elif res.status =3D=3D 'not run': notrun.append(name) =20 + sys.stdout.flush() if res.interrupted: break =20 --=20 2.31.1 From nobody Thu Apr 25 22:28:17 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1634116517223877.2607414907169; Wed, 13 Oct 2021 02:15:17 -0700 (PDT) Received: from localhost ([::1]:34308 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1maaM0-0002gx-8K for importer@patchew.org; Wed, 13 Oct 2021 05:15:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54356) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1maaEc-0002Bw-27 for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:38 -0400 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]:34740) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1maaEZ-0005ct-8M for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:36 -0400 Received: by mail-ed1-x52d.google.com with SMTP id g10so7368041edj.1 for ; Wed, 13 Oct 2021 02:07:34 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id c6sm6177849ejb.41.2021.10.13.02.07.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Oct 2021 02:07:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=AEqa38VkLdIJcTdcKrh0XIzK4SvxOQGWMtjVV5oHctU=; b=pZaUE7sGgdnzlctV2mAKWva5Am5xIl55cxClAGRTP/vaA3GcF//HwAZGplUhnyQCKH Bzd/6SnZqBB5FTyK4+y4qBFOrxxR5AxdKnvbSj29vt4odgLnNBfZeFh3ZAG3/yGIwrMr x7fdefAa8V/+uz8KfDBWLoS/YDLWZGpUAPBgsTknMpKYerZitOebtyf6kRev0QyYVqG2 zCQrFZSg6fPW/lBmQkG294fyWfyodOx7usOs5uTxbQjTaajkrTzIKvXPTyoaU87l8D9S Em3rGuwdPt6NH6O8LcTsFCRPMrYavb8Aibp/MahLJecJEdrA5DyfNAWepzEhp/ecdK8p E/OQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=AEqa38VkLdIJcTdcKrh0XIzK4SvxOQGWMtjVV5oHctU=; b=FtXqzNYG73cZjvG6h5kRNPUiNYwvmFMHWiBrzQpJEL7z2sKpT0Zae9mHldBzgdCBiZ nLpSTNW+CWo1cM2OFqADOFMvP9bS4Z8rMHhE7app43vGSSFkas7z8LXdI5apuOgi2pa3 E0ygY2D/fP6NV7CX/vcXKRZEJRaqgQdFSb8vu49dBBvWSdKU+duDoy19gJvK14Wgs67b R+LMqtAtC86t4rC9qBZH5Y4gV5AopzbyoWa59p0e3TPetCIP0+mKiVW4Ug9w713UUT+r YJqtSDdYSwEe3BkHyBfyv9KEGLRILK5DBkC1uirOxyNc3d9uqyeyPQADLxIE6pqNa/s7 F3BA== X-Gm-Message-State: AOAM530qa7y6abcf+QLkt4ItdaTBQxDXj2Ie6FeZU4kDf+bQlSJxa/By b3GQM9r2AngGVRscwIyzPJ7vNQPB65A= X-Google-Smtp-Source: ABdhPJw8iR1pZHS4U1faeeqhM0VYR9sYwEGZlrjk0vpFhc0B88txUUo3As7by6sUMuZVOScdZK5hdg== X-Received: by 2002:a05:6402:11d4:: with SMTP id j20mr7703153edw.267.1634116053526; Wed, 13 Oct 2021 02:07:33 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 05/40] util/compatfd.c: use libc signalfd wrapper instead of raw syscall Date: Wed, 13 Oct 2021 11:06:53 +0200 Message-Id: <20211013090728.309365-6-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211013090728.309365-1-pbonzini@redhat.com> References: <20211013090728.309365-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::52d; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x52d.google.com X-Spam_score_int: 4 X-Spam_score: 0.4 X-Spam_bar: / X-Spam_report: (0.4 / 5.0 requ) DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Kacper=20S=C5=82omi=C5=84ski?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1634116518002100002 From: Kacper S=C5=82omi=C5=84ski This allows the use of native signalfd instead of the sigtimedwait based emulation on systems other than Linux. Signed-off-by: Kacper S=C5=82omi=C5=84ski Message-Id: <20210905011621.200785-1-kacper.slominski72@gmail.com> Signed-off-by: Paolo Bonzini --- meson.build | 7 +++---- util/compatfd.c | 5 ++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/meson.build b/meson.build index 99a0a3e689..2d373a61a6 100644 --- a/meson.build +++ b/meson.build @@ -1420,10 +1420,9 @@ config_host_data.set('CONFIG_POSIX_MADVISE', cc.link= s(gnu_source_prefix + ''' #include int main(void) { return posix_madvise(NULL, 0, POSIX_MADV_DONTNEED); }''= ')) config_host_data.set('CONFIG_SIGNALFD', cc.links(gnu_source_prefix + ''' - #include - #include - #include - int main(void) { return syscall(SYS_signalfd, -1, NULL, _NSIG / 8); }'''= )) + #include + #include + int main(void) { return signalfd(-1, NULL, SFD_CLOEXEC); }''')) config_host_data.set('CONFIG_SPLICE', cc.links(gnu_source_prefix + ''' #include #include diff --git a/util/compatfd.c b/util/compatfd.c index a8ec525c6c..ab810c42a9 100644 --- a/util/compatfd.c +++ b/util/compatfd.c @@ -17,7 +17,7 @@ #include "qemu/thread.h" =20 #if defined(CONFIG_SIGNALFD) -#include +#include #endif =20 struct sigfd_compat_info { @@ -96,9 +96,8 @@ int qemu_signalfd(const sigset_t *mask) #if defined(CONFIG_SIGNALFD) int ret; =20 - ret =3D syscall(SYS_signalfd, -1, mask, _NSIG / 8); + ret =3D signalfd(-1, mask, SFD_CLOEXEC); if (ret !=3D -1) { - qemu_set_cloexec(ret); return ret; } #endif --=20 2.31.1 From nobody Thu Apr 25 22:28:17 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1634116718567425.29564367603757; Wed, 13 Oct 2021 02:18:38 -0700 (PDT) Received: from localhost ([::1]:42982 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1maaPF-00009U-Dv for importer@patchew.org; Wed, 13 Oct 2021 05:18:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54406) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1maaEh-0002Cu-HK for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:44 -0400 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]:44588) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1maaEb-0005dv-7H for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:39 -0400 Received: by mail-ed1-x530.google.com with SMTP id w14so7161478edv.11 for ; Wed, 13 Oct 2021 02:07:35 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id c6sm6177849ejb.41.2021.10.13.02.07.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Oct 2021 02:07:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SuuikUBHzwC0idz8oNxMZ8qqc26pz27g7jT3Vmh3saI=; b=EalS5XegZiXTSd+IbMVfkkiOhqMlkYaZWB5Uj+4OcU4weFzGozRgA+psBNh3A/paQn K5WuljWiCtUJ5jkhUnlsdjzq9SUKL3CUCoWzBt99wxQmt+Hfciqzoldw44NsYkXeASAH 7HyW1VtGqQG0N91kFH7sXdlGymrfgfx1vZq45TfgwQF8wOFnEIlm0mZXRsBUhWVWqy14 SsdeNR38IlfTRwGGm70PsOfKh1ZcsXP3wFx3z1Rx8tYOsyl+gQJR2urwg8Gi/f1OtGP8 +01GelP+FT8HZ979DN++ARIksJoTdsemZyVLtZeheCoyszjRLwkEqDCU6e5Xdq4XSlSF EHqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=SuuikUBHzwC0idz8oNxMZ8qqc26pz27g7jT3Vmh3saI=; b=5LXvZ3Blcc6cTA1B0p4kLFq68lqOW8JtpZFq0V8VIhypDKU3vUa45v4F2YVJ5P7XYs 6a7OfkHOdMDUfXctLmjTY+GNZ/o2q8pny8Lz+wLKvpkYph5rL+JhFGISv5dUcw6bMc0R CtuLLnGwOHmFyMy8VyN603Ox4EJ+iHhtdsqFuka9B/nEhLqMJlex+/2qlc4vxlWrSvUL eZXNhRoqWIg8zYXRh1nvaOGjRsv8gvYl4JFFzEyrUVilyO8+SZN5E8je4jbpHMakxsUj LKeHr+7sivpUcPE+AbgMnXox3E7GaK3v0FAufbghQ2/hwOf7Ujkgo4/1JXm+vEp01gKO jlUw== X-Gm-Message-State: AOAM533svl2iG+YhynYO/4or6Vp6hRcSSI/+93a4fn0X8ASjtxjhi4gC vyYdycpDDfxRVNZlW+7QbRmEmZCyRGA= X-Google-Smtp-Source: ABdhPJyLxRMWiYfiUMbLQXVGGiBme7Au4psQeeqEyX3U3lv0ESFB+G7UH0I5OycGPYBTbdb9vf2YSA== X-Received: by 2002:aa7:d84a:: with SMTP id f10mr8044451eds.132.1634116054185; Wed, 13 Oct 2021 02:07:34 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 06/40] qapi/misc-target: Wrap long 'SEV Attestation Report' long lines Date: Wed, 13 Oct 2021 11:06:54 +0200 Message-Id: <20211013090728.309365-7-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211013090728.309365-1-pbonzini@redhat.com> References: <20211013090728.309365-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::530; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x530.google.com X-Spam_score_int: 4 X-Spam_score: 0.4 X-Spam_bar: / X-Spam_report: (0.4 / 5.0 requ) DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1634116719892100001 From: Philippe Mathieu-Daud=C3=A9 Wrap long lines before 70 characters for legibility. Suggested-by: Markus Armbruster Reviewed-by: Markus Armbruster Reviewed-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20211007161716.453984-2-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- 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 594fbd1577..ae5577e039 100644 --- a/qapi/misc-target.json +++ b/qapi/misc-target.json @@ -300,8 +300,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) # @@ -315,10 +315,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. # @@ -326,11 +327,13 @@ # # 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': 'TARGET_I386' } =20 --=20 2.31.1 From nobody Thu Apr 25 22:28:17 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1634116916573397.52871611814044; Wed, 13 Oct 2021 02:21:56 -0700 (PDT) Received: from localhost ([::1]:51798 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1maaSR-00067P-C1 for importer@patchew.org; Wed, 13 Oct 2021 05:21:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54426) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1maaEi-0002Cw-4f for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:44 -0400 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]:36389) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1maaEb-0005eM-81 for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:42 -0400 Received: by mail-ed1-x530.google.com with SMTP id d3so7317452edp.3 for ; Wed, 13 Oct 2021 02:07:35 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id c6sm6177849ejb.41.2021.10.13.02.07.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Oct 2021 02:07:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/giZe14TAwXhU0o5Dy2WDHUDipUg4ESGdmNZUsCh8Pg=; b=ZLELFuGwd6ZeUf3//J7KLUuAHcEz6z93e5xLCvQR7Ndyc2nEAH2gCSwAkrqsQs62xV YJxfAz57s+gwDzQySaYChic6DeJaUEx9VzaUq3iWgTxojLaphguh/rYF65HYm1FCMfs3 vdEjQ2sErn0AFuM6VFwpdS0AeLPraah0ddyIDtIchyZQCvyTUJteiUiWGcqZ63H3CI70 iKrJ3rRewJxtVeEzCM/bl7xv9mHmj/de6NRiZ10cpBxAV+VWjh8bg5KrJLbjQF1uxAXC VEllPuOC7bRPrvh4gIEoPWsiL2KRUfSATbsmnwDZeh3c+djIEGUk82N+ik3gEDetlsTo j8nA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=/giZe14TAwXhU0o5Dy2WDHUDipUg4ESGdmNZUsCh8Pg=; b=XOBcU9rzAnDwTs2y2hiaOWGo7dXdlzP86BEi8xOCtSZ4MTsjKwPR9NhxnlxC7JS9oN i+mgTJrY4yxt5ynw2HpkN+teRvn6NhUC/k+lSYWyy+n43EhqBIeBiRw4WKHvj+JqNKrI yL0JKEXlB5gNgZWH7rBvrJWn1K/fIFshfG5ePd+KjF9H49SpTrpLhR0rShsy9U1yRC9f 2EZy/JqA3VH4KitITHchmlWxN/cVd9oCUdOMLW4BTGxe1AkmPS7S3RHHP3xZLHPyKOY8 OCvwECcm9UkQcsofp6mHBW63wTq8wySoYKCKCmoIlhMXFOwcOenuMJls1pZkRSYo6DtB 09YA== X-Gm-Message-State: AOAM531Ms5rm7jtOJSWuO/MR5UpLOMKLk6HcuB1+Pyao7N3I9lCj0Nns p26fRW4INI0QaBu5m9Jua3SBvQsgtuI= X-Google-Smtp-Source: ABdhPJz0UVyKx8/fM2nMhlNmEHdJmSscIOiC1DQInoF/s5Aj+ZK8BqTxs2FtOBzhWZOgFv4OT+2tlQ== X-Received: by 2002:a17:906:52d6:: with SMTP id w22mr37241603ejn.248.1634116054869; Wed, 13 Oct 2021 02:07:34 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 07/40] qapi/misc-target: Group SEV QAPI definitions Date: Wed, 13 Oct 2021 11:06:55 +0200 Message-Id: <20211013090728.309365-8-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211013090728.309365-1-pbonzini@redhat.com> References: <20211013090728.309365-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::530; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x530.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1634116917031100003 From: Philippe Mathieu-Daud=C3=A9 There is already a section with various SEV commands / types, so move the SEV guest attestation together. Reviewed-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20211007161716.453984-3-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- qapi/misc-target.json | 80 +++++++++++++++++++++---------------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/qapi/misc-target.json b/qapi/misc-target.json index ae5577e039..5aa2b95b7d 100644 --- a/qapi/misc-target.json +++ b/qapi/misc-target.json @@ -229,6 +229,46 @@ 'data': { 'packet-header': 'str', 'secret': 'str', '*gpa': 'uint64' }, 'if': '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': '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': 'TARGET_I386' } + ## # @dump-skeys: # @@ -297,46 +337,6 @@ 'if': 'TARGET_ARM' } =20 =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': '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': 'TARGET_I386' } - ## # @SGXInfo: # --=20 2.31.1 From nobody Thu Apr 25 22:28:17 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1634116737845658.1533897150462; Wed, 13 Oct 2021 02:18:57 -0700 (PDT) Received: from localhost ([::1]:44752 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1maaPY-0001Kh-Tv for importer@patchew.org; Wed, 13 Oct 2021 05:18:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54428) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1maaEi-0002Cx-4j for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:44 -0400 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]:37549) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1maaEb-0005f7-Kr for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:40 -0400 Received: by mail-ed1-x532.google.com with SMTP id y12so7307493eda.4 for ; Wed, 13 Oct 2021 02:07:36 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id c6sm6177849ejb.41.2021.10.13.02.07.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Oct 2021 02:07:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XnHUnCLWt30/lAF1VSb0VH9h0dBGTDpJmWynp4ygNJ4=; b=IULQBBvd2GZzMCiUYHfLJrZiiwmvlSPwILMG16yfpUzKeiQas+6tMDGZ/aLkjqciT6 78B76wa4OVAyO7JPZ/rN8+T7k68tifGszd8X0WMBmj8DmTQbJMSQ59IS7fzawoXFbCek XMx5Fd+qpkRoJWiSEvjP6BKpne8zddf9RAMw22Ntif9ch+axgposBlRVyFfErSNzEdR/ Bdacs7HxEgszLLzw/VbaNuEIHZjQ5GV2rsv+GmWPX1BeSAmkf7W9ifoLQps1K/poRATb XBhpIhdZcccbxgdykBY0iTBBG0RB3vF2NAr4KskqzoPWuYEJ1ahrTE4CKY8J4Ta6ORpa jjag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=XnHUnCLWt30/lAF1VSb0VH9h0dBGTDpJmWynp4ygNJ4=; b=OJr/gRSdSkjRNngyP/HmTcFQkL3JDSLkFlQID8P8BvQzXB+nJWkec8vJZNTgkZ4t83 AejSrtsA48LNiinwKivvwJeU3J9YEAkMXCom9AqVVP2l0TMHJSdmNxSZRYYPuhESVSVC SvU5j3wZ5KPiHCa9lhdZFt6XcP5VnePxm1WxAxuQrUAuZZzftspz4U2VkCGUoOsmY+5c 0Rb9X7J8wybsiz/cgGzSsFYNiw/78LXLcs5eGFBDAD+iYUnAsRsnWFfeTMAqzRsnOkXP YhXIYjq5Bf+Ss4NwS6iZdsIWY5FP94IqbTKSs38C/kfjI4DvaPQpF/2eQNZZ4RVaSJY4 7mjQ== X-Gm-Message-State: AOAM532m9KRYR0vj65vFhR7wJkdrGrlXb9IxSN5HIT0URQCytnPEtiq4 ZwWPHMnIMHp7H67CaLvYzkDZ05NhiFE= X-Google-Smtp-Source: ABdhPJzf2G5WvmRAUTHm9F71pA723my9qVe0ar9aIYQp4rwy1hHZvvjz/LBw+0v7qwwDxDLgEFDncg== X-Received: by 2002:a05:6402:274b:: with SMTP id z11mr7747701edd.151.1634116055510; Wed, 13 Oct 2021 02:07:35 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 08/40] target/i386/kvm: Introduce i386_softmmu_kvm Meson source set Date: Wed, 13 Oct 2021 11:06:56 +0200 Message-Id: <20211013090728.309365-9-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211013090728.309365-1-pbonzini@redhat.com> References: <20211013090728.309365-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::532; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x532.google.com X-Spam_score_int: 4 X-Spam_score: 0.4 X-Spam_bar: / X-Spam_report: (0.4 / 5.0 requ) DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1634116739037100001 From: Philippe Mathieu-Daud=C3=A9 Introduce the i386_softmmu_kvm Meson source set to be able to add features dependent on CONFIG_KVM. Reviewed-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20211007161716.453984-4-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- target/i386/kvm/meson.build | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/target/i386/kvm/meson.build b/target/i386/kvm/meson.build index 0a533411ca..b1c76957c7 100644 --- a/target/i386/kvm/meson.build +++ b/target/i386/kvm/meson.build @@ -1,8 +1,12 @@ i386_ss.add(when: 'CONFIG_KVM', if_false: files('kvm-stub.c')) =20 -i386_softmmu_ss.add(when: 'CONFIG_KVM', if_true: files( +i386_softmmu_kvm_ss =3D ss.source_set() + +i386_softmmu_kvm_ss.add(files( 'kvm.c', 'kvm-cpu.c', )) =20 i386_softmmu_ss.add(when: 'CONFIG_HYPERV', if_true: files('hyperv.c'), if_= false: files('hyperv-stub.c')) + +i386_softmmu_ss.add_all(when: 'CONFIG_KVM', if_true: i386_softmmu_kvm_ss) --=20 2.31.1 From nobody Thu Apr 25 22:28:17 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1634116301550481.5365845178817; Wed, 13 Oct 2021 02:11:41 -0700 (PDT) Received: from localhost ([::1]:54058 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1maaIW-0005GN-Ft for importer@patchew.org; Wed, 13 Oct 2021 05:11:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54424) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1maaEi-0002Cv-4O for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:44 -0400 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]:36387) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1maaEb-0005fs-KB for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:41 -0400 Received: by mail-ed1-x52d.google.com with SMTP id d3so7317696edp.3 for ; Wed, 13 Oct 2021 02:07:37 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id c6sm6177849ejb.41.2021.10.13.02.07.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Oct 2021 02:07:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6C7qmO/3CizDFj/nvo16BV7vTh+VUkta9xLU7/ZlGCc=; b=XPve3E2+PEilFaGI0Zc91jzLE34rMimGFM//kySi1b58cbDxhPniQrnXCEaaykzmcp qcr9qa1VFzbhWWH6iyPVryf947YUUboXZng4v9jTPj1Bx5oSVMvVeRgjIQseG/wnqbLo QCnrN0i4v9IQPLyMpoO87egnSBuB9F9bpc2Syfwa8YQnWeBCvJv3/2++mJxE5vxIzqjZ 6MwE/QbmeYWqIMQo9MnRtUbnzsrxILLv4ar3oO60VAS4LOLIzUNhlnIj76iP1bi5bDTB +IakhAfO0NXG+dgs9fGXbH0GvjuoI7SqBmW6sOWFBiaN+0kdPuuyHT2RBcCn+rhN5qk2 xHyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=6C7qmO/3CizDFj/nvo16BV7vTh+VUkta9xLU7/ZlGCc=; b=l6vxThZWbpoMF6VoU7LRmJa+sAiFY0VGdMAX1YE70zzcz8BFa56F0cj4vMk/hFsVUU iMrl+/oJk82eTuAAX9sH2xKSEKozawLOXTi31B4n7i0LrFFrFn2aYcLqBEQbz0ZuCsfN un+3G1KUX1IeOSLGheZ9cFOVTgiarTOZO1I7L6rlJkycJ8EbfrknTVe+1xE4xYTMnp5K qfVU/+ONoUWQ3i+ByTm7xdEfxsdlhSCipALoXAP4yvl8nAdFT4BS1Wg8I4SGtERSk3Zl F2jHjlbwVIc6bD1y2yaj0RgZ8UqdrZX6obhPcVmv25UssjgPPUHQryB+30YTSecmxjQg lRcg== X-Gm-Message-State: AOAM532J+IrwzAs81qEVGsO1+g1DAlUtswnkrbSocI8pGk7pB3Q693tZ Mc5DqlYDeRR+kA0WRLTOWLCgMZ8BZS4= X-Google-Smtp-Source: ABdhPJyC+hlcVRyGLOLsRkNRfqsvDA9eyR3BFmZqPw4Fw0wsHoy/JXOdOldwODb0GxACNeIjFbjPcA== X-Received: by 2002:a17:907:c0c:: with SMTP id ga12mr9246750ejc.111.1634116056179; Wed, 13 Oct 2021 02:07:36 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 09/40] target/i386/kvm: Restrict SEV stubs to x86 architecture Date: Wed, 13 Oct 2021 11:06:57 +0200 Message-Id: <20211013090728.309365-10-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211013090728.309365-1-pbonzini@redhat.com> References: <20211013090728.309365-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::52d; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x52d.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1634116302175100005 From: Philippe Mathieu-Daud=C3=A9 SEV is x86-specific, no need to add its stub to other architectures. Move the stub file to target/i386/kvm/. Reviewed-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20211007161716.453984-5-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- accel/kvm/meson.build | 1 - target/i386/kvm/meson.build | 2 ++ {accel =3D> target/i386}/kvm/sev-stub.c | 0 3 files changed, 2 insertions(+), 1 deletion(-) rename {accel =3D> target/i386}/kvm/sev-stub.c (100%) diff --git a/accel/kvm/meson.build b/accel/kvm/meson.build index 8d219bea50..397a1fe1fd 100644 --- a/accel/kvm/meson.build +++ b/accel/kvm/meson.build @@ -3,6 +3,5 @@ kvm_ss.add(files( 'kvm-all.c', 'kvm-accel-ops.c', )) -kvm_ss.add(when: 'CONFIG_SEV', if_false: files('sev-stub.c')) =20 specific_ss.add_all(when: 'CONFIG_KVM', if_true: kvm_ss) diff --git a/target/i386/kvm/meson.build b/target/i386/kvm/meson.build index b1c76957c7..736df8b72e 100644 --- a/target/i386/kvm/meson.build +++ b/target/i386/kvm/meson.build @@ -7,6 +7,8 @@ i386_softmmu_kvm_ss.add(files( 'kvm-cpu.c', )) =20 +i386_softmmu_kvm_ss.add(when: 'CONFIG_SEV', if_false: files('sev-stub.c')) + i386_softmmu_ss.add(when: 'CONFIG_HYPERV', if_true: files('hyperv.c'), if_= false: files('hyperv-stub.c')) =20 i386_softmmu_ss.add_all(when: 'CONFIG_KVM', if_true: i386_softmmu_kvm_ss) diff --git a/accel/kvm/sev-stub.c b/target/i386/kvm/sev-stub.c similarity index 100% rename from accel/kvm/sev-stub.c rename to target/i386/kvm/sev-stub.c --=20 2.31.1 From nobody Thu Apr 25 22:28:17 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1634116938808534.3045141356905; Wed, 13 Oct 2021 02:22:18 -0700 (PDT) Received: from localhost ([::1]:53442 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1maaSn-0007B7-Jm for importer@patchew.org; Wed, 13 Oct 2021 05:22:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54492) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1maaEk-0002ET-F5 for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:46 -0400 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]:38730) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1maaEd-0005g3-FV for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:45 -0400 Received: by mail-ed1-x533.google.com with SMTP id d9so7272168edh.5 for ; Wed, 13 Oct 2021 02:07:37 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id c6sm6177849ejb.41.2021.10.13.02.07.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Oct 2021 02:07:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5YvbBsVLcxi9ut0yB4oLJ5mEfeOCgloSDAO20Piz2Bo=; b=feTcIDOI+cxoafy3hfR6ic8i1IVLM/BW0c5XbAB1CbZgZHA4RBEbdRYqK3gpx3AWgn jIWv0ZLnoT4gxglD0AZ5SHnsDcCzn6BOA0l4TYtDcv4fZihN6v0Js9Kww/SnOLlI+6tv 4/BgTQNtupV8X3YIH5+rgtXiB9Dv8NtoEnx6998CELyQjsza44vyXgJRAvY/+uuubRwk ZdWCzWusYi1Se6tFtsS8I00j0MB2gSRF5uTab2RlKKILN6Yvtr175cjHK4UEdbPXlIJJ mQe/79WCOgLOfpO+BuPOcvb/xx8XYyrttnLmKiFAh/7TubfPYEpnCeqFaQvNIjJIW97r 9zdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=5YvbBsVLcxi9ut0yB4oLJ5mEfeOCgloSDAO20Piz2Bo=; b=wR5EBPXv2UH8UjZvR9pS6beR897vOv7dgRK7cTq0dmqyEGFvtjwLlNCvXl0Wtp2psn Ek28jTS+Q9/5/VaF8uxjQesLb9LOFd3EB0T/Vxtk5JrI8yRh1qyuYGeHxzF4ED6W6Ibc PAWhh8eJ3CcaHN1MLhhfSSeWPvzLblPBx5rtXOqjHk/XH/78s1WAgQ+GypyTRx6GstHk 7DpuS85AtG6hlI66TPtUAw4PGBmLBsUjs2RXCInszjibN5iYUuCZX4TAa5W8JkzJz4fs Kbi2Vvln4mq+k4tXpAKvx6+U23FQdpqDBXZBpVno4/Ui4Dl0dGVQhlfcktdLtw+aOKQn xR2Q== X-Gm-Message-State: AOAM532aOcLKsn2KNxy0JFOhrXaCeE+cP6Rd9bUuF0LFiMkMecNI56jU n7iZdxu7FW1OxEX3NhCWQng7kr5uaWw= X-Google-Smtp-Source: ABdhPJxKUduj+tTRbUC6CL+s9cJWQO4eCwbyXSA/8Wq+eNPzTQlFqETRQzXazcsC3e+vyAYU9lHGCQ== X-Received: by 2002:a17:906:ce2c:: with SMTP id sd12mr39683803ejb.488.1634116056910; Wed, 13 Oct 2021 02:07:36 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 10/40] target/i386/sev: Prefix QMP errors with 'SEV' Date: Wed, 13 Oct 2021 11:06:58 +0200 Message-Id: <20211013090728.309365-11-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211013090728.309365-1-pbonzini@redhat.com> References: <20211013090728.309365-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::533; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x533.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Dr . David Alan Gilbert" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1634116940275100001 From: Philippe Mathieu-Daud=C3=A9 Multiple errors might be reported to the monitor, better to prefix the SEV ones so we can distinct them. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Dr. David Alan Gilbert Message-Id: <20211007161716.453984-6-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- target/i386/monitor.c | 2 +- target/i386/sev.c | 20 +++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/target/i386/monitor.c b/target/i386/monitor.c index 196c1c9e77..eabbeb9be9 100644 --- a/target/i386/monitor.c +++ b/target/i386/monitor.c @@ -717,7 +717,7 @@ SevLaunchMeasureInfo *qmp_query_sev_launch_measure(Erro= r **errp) =20 data =3D sev_get_launch_measurement(); if (!data) { - error_setg(errp, "Measurement is not available"); + error_setg(errp, "SEV launch measurement is not available"); return NULL; } =20 diff --git a/target/i386/sev.c b/target/i386/sev.c index bcd9260fa4..4f1952cd32 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -440,7 +440,8 @@ sev_get_pdh_info(int fd, guchar **pdh, size_t *pdh_len,= guchar **cert_chain, r =3D sev_platform_ioctl(fd, SEV_PDH_CERT_EXPORT, &export, &err); if (r < 0) { if (err !=3D SEV_RET_INVALID_LEN) { - error_setg(errp, "failed to export PDH cert ret=3D%d fw_err=3D= %d (%s)", + error_setg(errp, "SEV: Failed to export PDH cert" + " ret=3D%d fw_err=3D%d (%s)", r, err, fw_error_to_str(err)); return 1; } @@ -453,7 +454,7 @@ sev_get_pdh_info(int fd, guchar **pdh, size_t *pdh_len,= guchar **cert_chain, =20 r =3D sev_platform_ioctl(fd, SEV_PDH_CERT_EXPORT, &export, &err); if (r < 0) { - error_setg(errp, "failed to export PDH cert ret=3D%d fw_err=3D%d (= %s)", + error_setg(errp, "SEV: Failed to export PDH cert ret=3D%d fw_err= =3D%d (%s)", r, err, fw_error_to_str(err)); goto e_free; } @@ -491,7 +492,7 @@ sev_get_capabilities(Error **errp) =20 fd =3D open(DEFAULT_SEV_DEVICE, O_RDWR); if (fd < 0) { - error_setg_errno(errp, errno, "Failed to open %s", + error_setg_errno(errp, errno, "SEV: Failed to open %s", DEFAULT_SEV_DEVICE); return NULL; } @@ -557,8 +558,9 @@ sev_get_attestation_report(const char *mnonce, Error **= errp) &input, &err); if (ret < 0) { 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)); + error_setg(errp, "SEV: Failed to query the attestation report" + " length ret=3D%d fw_err=3D%d (%s)", + ret, err, fw_error_to_str(err)); g_free(buf); return NULL; } @@ -572,7 +574,7 @@ sev_get_attestation_report(const char *mnonce, Error **= errp) ret =3D sev_ioctl(sev->sev_fd, KVM_SEV_GET_ATTESTATION_REPORT, &input, &err); if (ret) { - error_setg_errno(errp, errno, "Failed to get attestation report" + error_setg_errno(errp, errno, "SEV: Failed to get attestation repo= rt" " ret=3D%d fw_err=3D%d (%s)", ret, err, fw_error_to_str(er= r)); goto e_free_data; } @@ -596,7 +598,7 @@ sev_read_file_base64(const char *filename, guchar **dat= a, gsize *len) GError *error =3D NULL; =20 if (!g_file_get_contents(filename, &base64, &sz, &error)) { - error_report("failed to read '%s' (%s)", filename, error->message); + error_report("SEV: Failed to read '%s' (%s)", filename, error->mes= sage); g_error_free(error); return -1; } @@ -911,7 +913,7 @@ sev_encrypt_flash(uint8_t *ptr, uint64_t len, Error **e= rrp) if (sev_check_state(sev_guest, SEV_STATE_LAUNCH_UPDATE)) { int ret =3D sev_launch_update_data(sev_guest, ptr, len); if (ret < 0) { - error_setg(errp, "failed to encrypt pflash rom"); + error_setg(errp, "SEV: Failed to encrypt pflash rom"); return ret; } } @@ -930,7 +932,7 @@ int sev_inject_launch_secret(const char *packet_hdr, co= nst char *secret, MemoryRegion *mr =3D NULL; =20 if (!sev_guest) { - error_setg(errp, "SEV: SEV not enabled."); + error_setg(errp, "SEV not enabled for guest"); return 1; } =20 --=20 2.31.1 From nobody Thu Apr 25 22:28:17 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 163411652323333.50965041258826; Wed, 13 Oct 2021 02:15:23 -0700 (PDT) Received: from localhost ([::1]:34718 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1maaM6-0002xr-73 for importer@patchew.org; Wed, 13 Oct 2021 05:15:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54520) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1maaEl-0002Fa-E8 for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:48 -0400 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]:35653) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1maaEh-0005hm-9Z for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:47 -0400 Received: by mail-ed1-x531.google.com with SMTP id w19so7362093edd.2 for ; Wed, 13 Oct 2021 02:07:38 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id c6sm6177849ejb.41.2021.10.13.02.07.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Oct 2021 02:07:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=vu1dBQYjlPMeD+bu2re3t6lrd4Enxp4xeWWzptccB38=; b=p01dKUSbEV49MZMNsEcKPIzfqdfmtkwBQu4b9cIhX7TOS7DBY/77eH9x/gJh8XX55n nXEWDo2Xqe1QwEVyLJmtRIOOI8ujn0OEfJzMKWn6k2BrX0MnoRzgMQ2aBNdpTTGOtETd kN4ZJbRpD4kgH8zkrat7wPpgaGSmejG3PH7QaVKikRpIUviO/GLcvWY/x37s13VHxlWF JMdBPB9sQ9FSDgYN/jEA+WEL1U/YWqgQx134KmS1J/wTNXc1pD5XAo6mBb58JFgU1IgI JYChvqHHXQfPJ62aKkEXlluZYv5Bh10rSDk0lwG7lBRcm7+lhwy0poSTKTq2AUmT8+rD ad0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=vu1dBQYjlPMeD+bu2re3t6lrd4Enxp4xeWWzptccB38=; b=22RWF5fHf0eQpIz+wYVH3Z7POUXp9e5t8Ep44BXFaeAiAbfA46rwFTh+HrLJS/gLsE OIfxA4VZmzRavPldAvyBoFOrZREyPyA/5nnVFGmRlsNPVBEWb6pfKg1vk7f6mnAdXqdT c/VZCmShYl/lyPtWEq35BlIx+e0jj8nideox1NW7T0iljyPwOr5RP68xO+Lr1qXBzcaH bBczwC4PhHrxZuPHRSd8LAgjI4Fcna6YbU4WzXA0VmHjNa8KRESPVVvicx9yXobFxoWK BNx/IuKMt2VPpWRpRmDGHdfT2Ct0+ejxo6oQJg+A0BhMK/t4l1M4qNpx/OqdxZF2R2Qk 4aPQ== X-Gm-Message-State: AOAM530bUgQX7O9qoUlwnN9v1UcAWZahinTZ7dq53/n1gv1SnZ4Oa3am 8EUAhNyHBOEF3psCmKpsSykMpyPBG4U= X-Google-Smtp-Source: ABdhPJw9+8z42YwwztR8UCTDcYE97tDFmDTiB/bwO+5zo5V+j5y8/lHbeIKPjsOAx5iCIoZjKnuDBQ== X-Received: by 2002:a17:906:ccde:: with SMTP id ot30mr17457924ejb.121.1634116057603; Wed, 13 Oct 2021 02:07:37 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 11/40] target/i386/monitor: Return QMP error when SEV is not enabled for guest Date: Wed, 13 Oct 2021 11:06:59 +0200 Message-Id: <20211013090728.309365-12-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211013090728.309365-1-pbonzini@redhat.com> References: <20211013090728.309365-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::531; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x531.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Connor Kuehl , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Dr . David Alan Gilbert" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1634116524391100001 From: Philippe Mathieu-Daud=C3=A9 If the management layer tries to inject a secret, it gets an empty response in case the guest doesn't have SEV enabled, or the binary is 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: { "execute": "sev-inject-launch-secret", "arguments": { "packet-header": "mypkt", "secret": "mypass", "gpa": 429= 4959104 } } { "error": { "class": "GenericError", "desc": "SEV not enabled for guest" } } Note: we will remove the sev_inject_launch_secret() stub in few commits, so we don't bother to add error_setg() there. Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Connor Kuehl Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20211007161716.453984-7-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- target/i386/monitor.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/target/i386/monitor.c b/target/i386/monitor.c index eabbeb9be9..ea836678f5 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" @@ -743,6 +744,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, "SEV not enabled for guest"); + return; + } if (!has_gpa) { uint8_t *data; struct sev_secret_area *area; --=20 2.31.1 From nobody Thu Apr 25 22:28:17 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 163411672143859.5360735584934; Wed, 13 Oct 2021 02:18:41 -0700 (PDT) Received: from localhost ([::1]:43064 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1maaPI-0000Ca-7v for importer@patchew.org; Wed, 13 Oct 2021 05:18:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54574) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1maaEn-0002GA-2R for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:49 -0400 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]:34749) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1maaEj-0005hs-41 for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:48 -0400 Received: by mail-ed1-x534.google.com with SMTP id g10so7368841edj.1 for ; Wed, 13 Oct 2021 02:07:39 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id c6sm6177849ejb.41.2021.10.13.02.07.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Oct 2021 02:07:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=i5Q7ravtNv+LMTi+DPhAh6MiXPOowmkPtgZBEGRvYxw=; b=UU7SB4gpAd6W5zpYb2XNv3qd4I0ApCL5ICNX1zbXDhLdH0neOH12371u4bG3lMetXq NqCmSyRTMvoUnI2mLBSqCe2gX9XeRRAbHkjyDlwVQ1Gqs3lhap6G9Jkdb9w7zgNA7w2y tEtTifHHzDtG6CvEF7CAHatJxTeEwr/zn/DTquSlbj6l7lkDBxT1WcBbodBaZNXWUZVW 4JqPIzJQRZQQBtjVJMOcplrP0MbFjtIAQ8In59+nHjACKiTXw7QMcaUi7/jg92QR7KwI lIdiGBFWNhoW6NPyBb8o/3oxoT11VwxnegqCNSjOcKgCIY7xb/ZefNUygBGcqJE1Wd0i 1IXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=i5Q7ravtNv+LMTi+DPhAh6MiXPOowmkPtgZBEGRvYxw=; b=B66VhRgwTUfGJi7SxShT0h4hQIj+Tv5wTulYUNPhqevmnUXEHKdZaDP0uTlREKWM8J FkGnqglngZ4tIiQJwNOXd3/dknUfm6emJHIyuwZ+1U6QobWG7fzNeizpfjAQAm1ujeV/ 5zGByJnFyLGsjrENruZWRAnpxokrveFQlT2pZTnW4/H/CY6+diTuEJOO3C5mma0393Yk TW2VwHpScORS4qGLDRoGas9B35RT3bKojCU2k/3YEc7H0oxbZ+qWG2G7rQXx/GBRvsr4 mvMunhowvq1QpUszguaoV28hdkMu6BTphxylBaeZfMHe3qsmo9ieBg7mL+OOxmmXquVv lt5g== X-Gm-Message-State: AOAM5321MLkv+h4uo2o9UKHKHm3zOCUJrj5IADVCjdYj3unjbxXGBUDD Lf2iEvY7Sj2pduKhf/NYZzPmQEow2lA= X-Google-Smtp-Source: ABdhPJwxzUko1PGQ/mRLHHvFIh05S+ZpMb2kdFvgffXnlG6JD+6mKsfEWosfkWcK15iPXxHOsAn3xw== X-Received: by 2002:a17:907:629b:: with SMTP id nd27mr38773630ejc.24.1634116058275; Wed, 13 Oct 2021 02:07:38 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 12/40] target/i386/cpu: Add missing 'qapi/error.h' header Date: Wed, 13 Oct 2021 11:07:00 +0200 Message-Id: <20211013090728.309365-13-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211013090728.309365-1-pbonzini@redhat.com> References: <20211013090728.309365-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::534; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x534.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Connor Kuehl , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Dr . David Alan Gilbert" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1634116721995100004 From: Philippe Mathieu-Daud=C3=A9 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 Reviewed-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20211007161716.453984-8-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- target/i386/cpu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index a7b1b6aa93..b54b98551e 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 Thu Apr 25 22:28:17 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1634117083061822.8916243962321; Wed, 13 Oct 2021 02:24:43 -0700 (PDT) Received: from localhost ([::1]:60272 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1maaV4-0003HD-SX for importer@patchew.org; Wed, 13 Oct 2021 05:24:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54588) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1maaEn-0002Hr-Et for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:49 -0400 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]:42999) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1maaEh-0005jB-9G for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:49 -0400 Received: by mail-ed1-x529.google.com with SMTP id t16so7201982eds.9 for ; Wed, 13 Oct 2021 02:07:40 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id c6sm6177849ejb.41.2021.10.13.02.07.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Oct 2021 02:07:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6VHmLLmXYeTvvAAKhJOvJbJzG0qMwqzai0Zg9brnVs8=; b=WblQnu2aF0ROY0sLjGQxN+HtaNt2iEZcW6Snv8c4aiZ2cC/s9xyddgnYUEojzllia7 q42Zq80QYBo2PVXp7rvYtUpIVQ3Wk4Gkse8D16kNadUEXLa6m8j2Ruuh7aDhkJSftHuF Hf1Apo2ahdGoFFsYKxMEllSbOO05OX4idJNGQdoPNH7cfrYMUPV/FITLjF/7RqOXE2fs HG2Y1aRiQNZFP746klda5jmUbzY4fbU1pAjGpRvjczapCa8Sr0NUj6aiTLuShst2RLC2 hnJdMyMdQ3gNM0M/jxyFNjapJRtB+H6eDy5AbxaxdDRV6mal9bpKGQp7B1MIGMYk4Yv6 dbqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=6VHmLLmXYeTvvAAKhJOvJbJzG0qMwqzai0Zg9brnVs8=; b=CsKy3wrgwHq40FwBkNllyYc7X7YKPXbWKN4vMQGIkB8c85KZ9k2udW8XF+HVWTzTjB rUfe76I6vtWkHqm657ccthHe4cNglzMGHFGzy5UzYbR16WhAAdhtzUueLVZEZwytChPY sL2LGW5AGLvKqUTWXDIV8USUnFFYGh15KzQHC16Fz2vDZgivRyxWoJn19Pvlasbxpcwd qGExhYihleVjVQ2JVTK71Jygytby4FRPwhlujITvsy7QaflT5nAMlKbXtKwQ1r6LibvE UgdcfG++lARmXrbMY2yTZD/CWxuQGHkM26QUBAl03cq05BCSGzGgo8eP9QlZxmdsdfOI DtrQ== X-Gm-Message-State: AOAM530r4VolJvU32yjfpHZf9qFpBCiyY19XpahI7lgNXvHdNMvzhFLU N6Lo5c1UKDCDFpW5sAUFnkafbL6Xp3g= X-Google-Smtp-Source: ABdhPJxlJV+xMFwALfRb0qjiyrW5mn8ApI5+x3u9A5/gpVx4IwuODVbVW7jM1YOI/dtSGYcG/7Gn6w== X-Received: by 2002:a50:da04:: with SMTP id z4mr7785725edj.52.1634116058977; Wed, 13 Oct 2021 02:07:38 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 13/40] target/i386/sev_i386.h: Remove unused headers Date: Wed, 13 Oct 2021 11:07:01 +0200 Message-Id: <20211013090728.309365-14-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211013090728.309365-1-pbonzini@redhat.com> References: <20211013090728.309365-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::529; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x529.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Connor Kuehl , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1634117085032100001 From: Philippe Mathieu-Daud=C3=A9 Declarations don't require these headers, remove them. Reviewed-by: Connor Kuehl Reviewed-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20211007161716.453984-9-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- target/i386/sev-stub.c | 1 + target/i386/sev_i386.h | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/target/i386/sev-stub.c b/target/i386/sev-stub.c index d8e6583171..408441768d 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) diff --git a/target/i386/sev_i386.h b/target/i386/sev_i386.h index 2afe108069..9bf6cd1878 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 --=20 2.31.1 From nobody Thu Apr 25 22:28:17 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1634117079350273.1400660562209; Wed, 13 Oct 2021 02:24:39 -0700 (PDT) Received: from localhost ([::1]:60132 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1maaV4-0003B0-1s for importer@patchew.org; Wed, 13 Oct 2021 05:24:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54522) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1maaEl-0002Fc-HP for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:48 -0400 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]:33306) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1maaEh-0005jH-SK for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:47 -0400 Received: by mail-ed1-x532.google.com with SMTP id p13so7488978edw.0 for ; Wed, 13 Oct 2021 02:07:40 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id c6sm6177849ejb.41.2021.10.13.02.07.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Oct 2021 02:07:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qG5T9h7NO2czZMv3uDDpamlGY0rnV9Cus9fxgzYsPQs=; b=jCKg/9bJ+gMEyD8h5a6KcJznN+99sPBns1Rbe5OpWipq30atvxgxNiArKkvDsmLout B2kyj5lN9HEmzBUGoGimnYbbgC9L//Rs4uogN77pKSeGLDc5rvYv1RIvtZMaRBhfidVn s/EDvZUVMW06nmjyFxoP9GmEuOBA0vwulkm6vsxmhhVOtCXUQJQp9mE1zTeJiFzsk4Kr 35IDBQvot/6K9fj8bSrvA9CdDEDJes1sZgK6bl3TGPuUYOKacG8gVrQEhKkC7Ojh/VYL jApQpI0DBM/GWxjxvSwXw2vWDKGrJSNIVy0fPvdU67vahUpOfsvSYX+5DP6Pt1spgZPx l6dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=qG5T9h7NO2czZMv3uDDpamlGY0rnV9Cus9fxgzYsPQs=; b=gaIoki2lUgBJA+THDBh+5UwlW9wtYAattdSPgtGx4n1KNoTLPmv2g3w+S3cLaY7X0W B911lm+8Ed9EmlJBuf3d7O8ebWfB4BZOcJ0ypVCWL5k8zZiBnXSBX5g92NbkWULcwAoX 7BDo17IYx+01R3wbE0qKOb4i0HwpHgFKBKFsGiSn5vnwsBKw3PgK1QZcUr359VhMcs3v QbazS1262jIXWtl5CU3OTOAtQ/whjo8KZ2gFw56Oq7jOaRasJOSrJOgMQUw2NuYfAc76 Kf3BS4VucSolWaU1reFsC5o0gKObPM7DgGmH584F0ro/lJIgPIeWcBCUO9YZ+pjrY/Ov /7Dg== X-Gm-Message-State: AOAM532VxlM8zUrqvfxqkE6S+KzTE+FG19jvosrGh86sJESdea5PcNEO FUrrAOh/5bNUYw3Q00lrChHiIeSy+Ok= X-Google-Smtp-Source: ABdhPJwQD41O3BL1ZfZL+R6E9g54fvLxs9W0VSZxpD0zFvaF3woDi98IQrbZsXGfQbW2hEkUGepNMg== X-Received: by 2002:a17:906:2599:: with SMTP id m25mr39540449ejb.302.1634116059691; Wed, 13 Oct 2021 02:07:39 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 14/40] target/i386/sev: Remove sev_get_me_mask() Date: Wed, 13 Oct 2021 11:07:02 +0200 Message-Id: <20211013090728.309365-15-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211013090728.309365-1-pbonzini@redhat.com> References: <20211013090728.309365-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::532; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x532.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Connor Kuehl , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Dr . David Alan Gilbert" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1634117080848100002 From: Philippe Mathieu-Daud=C3=A9 Unused dead code makes review harder, so remove it. Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Connor Kuehl Reviewed-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20211007161716.453984-10-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- target/i386/sev-stub.c | 5 ----- target/i386/sev.c | 9 --------- target/i386/sev_i386.h | 1 - 3 files changed, 15 deletions(-) diff --git a/target/i386/sev-stub.c b/target/i386/sev-stub.c index 408441768d..20b1e18ec1 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 4f1952cd32..9e3f2ec8dd 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -65,7 +65,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; @@ -389,12 +388,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) { @@ -833,8 +826,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) { diff --git a/target/i386/sev_i386.h b/target/i386/sev_i386.h index 9bf6cd1878..d83428fa26 100644 --- a/target/i386/sev_i386.h +++ b/target/i386/sev_i386.h @@ -36,7 +36,6 @@ typedef struct SevKernelLoaderContext { } SevKernelLoaderContext; =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); --=20 2.31.1 From nobody Thu Apr 25 22:28:17 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1634117300099114.86277467141792; Wed, 13 Oct 2021 02:28:20 -0700 (PDT) Received: from localhost ([::1]:42354 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1maaYd-0001o6-3w for importer@patchew.org; Wed, 13 Oct 2021 05:28:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54564) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1maaEm-0002Fz-My for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:48 -0400 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]:37552) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1maaEj-0005ji-4J for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:48 -0400 Received: by mail-ed1-x533.google.com with SMTP id y12so7308498eda.4 for ; Wed, 13 Oct 2021 02:07:41 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id c6sm6177849ejb.41.2021.10.13.02.07.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Oct 2021 02:07:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=vGjhPX2QnJ6WPnhDf7oXeCULa6fTXtYSaHXPX/SXJjk=; b=HxEtpM2mZ/d7QtAw8FOlKlaHmfc7cEHCV33QJR2xGEuyQaOhQ0Ahb/YWnm/VjI/EuP 8X00oy5CvNu5HvYH57A11aLceNdHImcEchVJXeTKwlkJw8c8WNGYPudZ9/2clsQ56jgC LiSudyDz/q+xh+VDIWtRm0dNz/LwH53nDG0hU5YPlaliZ9fritpq5RBCi1jxc2ZjdYAF WbK4pQKSJIjaQPpcUvPk36IfO/2ujSdlrGGfpBnjTymJCexewjKQJUDrbZresYZAj8fk 8ZSXNNw9lOM9tg44m2aZZkfHYVxRIXPcFFE6pV8e6cj/i+ZUM6imsu6TKFTcEdCrqmIg 9BPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=vGjhPX2QnJ6WPnhDf7oXeCULa6fTXtYSaHXPX/SXJjk=; b=sAst0QqdkjMHeIV1opZruNbwCi+d3yS6EzAUfoih/FgsYy47khaeU3YhsZgP7F8Xs4 Du5XPxIjKUo+FUT6kD5g4gSBroO2F3v73ZFKkA+mk8zujXwhkb+X6wpU4X2e8TsMOn72 B55CBdA6n3ayTaZKwe6mLhK/cbfkN6HOJ6qdzJOos8D30mMJEqilik0b0x2/C3Y4YVuD h1svaf2BrrQQHHvVH1yYGHJrEaO71WRXFt2J2dX/Rd7CD85K7mejrF+OS/68EjLpzEPl 8ytQrX/28P6oqcZU7KiCbk2/XrJPOuRz4qOsxAbcgSAgxiNTZd8hch7DCff0Bjg1Mtij tWzw== X-Gm-Message-State: AOAM533EqnM0X/6Wl4bx33CzBldUeznW2xBBMyiqqeCWz3jTvsyvy405 SCYqH11M5btfduOvd5Dv+RjMOHozMfI= X-Google-Smtp-Source: ABdhPJwZgfuIFXvGcD8ZS4n8D6IsNK3DvYOEoBi+Sqd0aqEgfdVJvD7oPbTIzyeNWIo4zMdfxoreNQ== X-Received: by 2002:aa7:c38b:: with SMTP id k11mr7864575edq.79.1634116060400; Wed, 13 Oct 2021 02:07:40 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 15/40] target/i386/sev: Mark unreachable code with g_assert_not_reached() Date: Wed, 13 Oct 2021 11:07:03 +0200 Message-Id: <20211013090728.309365-16-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211013090728.309365-1-pbonzini@redhat.com> References: <20211013090728.309365-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::533; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x533.google.com X-Spam_score_int: 4 X-Spam_score: 0.4 X-Spam_bar: / X-Spam_report: (0.4 / 5.0 requ) DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Connor Kuehl , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1634117301707100001 From: Philippe Mathieu-Daud=C3=A9 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 Reviewed-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20211007161716.453984-11-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- 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 20b1e18ec1..55f1ec7419 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 Thu Apr 25 22:28:17 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1634117281464184.41140489145778; Wed, 13 Oct 2021 02:28:01 -0700 (PDT) Received: from localhost ([::1]:40826 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1maaYK-0000mI-7t for importer@patchew.org; Wed, 13 Oct 2021 05:28:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54608) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1maaEo-0002Kc-6S for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:50 -0400 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]:34746) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1maaEj-0005kk-CZ for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:49 -0400 Received: by mail-ed1-x52f.google.com with SMTP id g10so7369350edj.1 for ; Wed, 13 Oct 2021 02:07:41 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id c6sm6177849ejb.41.2021.10.13.02.07.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Oct 2021 02:07:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=vFqI0VCEVAZ6JnDvTYNxAsSrQc6wGMnCMT9x3PtInzA=; b=HdAMERaY77XXAFoTrMooVARy5nHo346wAxnEx4DhzfFBRUdwU5RA+uD7mekMqpRA9T 7I6OKQ/oZLHCankcP96GezC9n+dv0OVTW7KBXrll7tgqajtkBQCukJb4BrZKsAEcbktF WvreGQNWlY/DuTHK0eEN71FFGO1cOJEve0X9Hi5g8ryBz4g+20s1PL8618QyV5mqaipf pW793xrzAogUf8dHi4p8AXZuKbpF8UBpNmdaW/AVm0Rlo6fMdklyPrd7oqjWa5QelBks 8mn8hX+gvWfwM1e27djm2Gk6Xwfc622Ct5zOoEkrrctQLFenHcnSAsYkvttmahRLSyEZ f9ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=vFqI0VCEVAZ6JnDvTYNxAsSrQc6wGMnCMT9x3PtInzA=; b=lVxiSgnhFbIhGSj2ei6Z17Bi8Xzc6r9D5Wqq93rRvU+Ly2V6GcyW42pq7SexkegUVp o+5gzWrx5CNgX58cj2Dw76A8lXvIHez9ttRGLYA//vhqNty31CDkPTOi+tawBM3NkeK+ Q4lOmePCwMj90JGO3wVs/mIET76GaLePg0siUGTX+4rTJJMVBhEydh65c1Be8Lp5rrMZ dDynq7I070UdNls7TR7nsAicger7hSom6k47BUt9tcxNGMfm2xfSia+F9+EtNMKfb1fk e+fTZLFKYRTHvEdTndzXkMhexejA81KMOrOGJ6NCtlXvJMCGud/ou4Jbpv1HvU4e6ekd 86qA== X-Gm-Message-State: AOAM531S1YMp0bUDVRzANSpxoaRzn9LCvqVruc8Pt8RWWUo14ZZuI56X j2T0vn9fvwJG8XuZ6igwY+GGdOhWdZg= X-Google-Smtp-Source: ABdhPJw3B/Ca0mzMAa0oNuz75ShOd9teUF4VWy+BK2vtw9PF5QGwQqZg61t2eMJXzbivEgiuqS9QdQ== X-Received: by 2002:a05:6402:3186:: with SMTP id di6mr7728194edb.225.1634116061093; Wed, 13 Oct 2021 02:07:41 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 16/40] target/i386/sev: sev_get_attestation_report use g_autofree Date: Wed, 13 Oct 2021 11:07:04 +0200 Message-Id: <20211013090728.309365-17-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211013090728.309365-1-pbonzini@redhat.com> References: <20211013090728.309365-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::52f; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x52f.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Connor Kuehl , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Brijesh Singh , "Dr. David Alan Gilbert" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1634117282060100003 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> Reviewed-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20211007161716.453984-12-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- 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 9e3f2ec8dd..3a30ba6d94 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -521,8 +521,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 @@ -542,7 +542,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 @@ -554,7 +553,6 @@ sev_get_attestation_report(const char *mnonce, Error **= errp) error_setg(errp, "SEV: Failed to query the attestation report" " length ret=3D%d fw_err=3D%d (%s)", ret, err, fw_error_to_str(err)); - g_free(buf); return NULL; } } @@ -569,7 +567,7 @@ sev_get_attestation_report(const char *mnonce, Error **= errp) if (ret) { error_setg_errno(errp, errno, "SEV: Failed to get attestation repo= rt" " 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); @@ -577,9 +575,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 Thu Apr 25 22:28:17 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 163411691614248.04704229855702; Wed, 13 Oct 2021 02:21:56 -0700 (PDT) Received: from localhost ([::1]:51686 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1maaSQ-00062j-Lg for importer@patchew.org; Wed, 13 Oct 2021 05:21:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54502) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1maaEk-0002EX-QD for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:46 -0400 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]:46986) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1maaEh-0005lg-U4 for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:46 -0400 Received: by mail-ed1-x52f.google.com with SMTP id z20so7130836edc.13 for ; Wed, 13 Oct 2021 02:07:42 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id c6sm6177849ejb.41.2021.10.13.02.07.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Oct 2021 02:07:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ClGzHESyUs7PZrcCr5X0pVDGEGbBz0p9ZTrPPNvNO9g=; b=k6xNeBJNbgfbbo77SpM0sgz9Nly30u2QJnSmbowAsJZWojaN3lOjj82EofivdU7JK3 dUW5+vILuR+FrlT04hrky2HLlBBaneQWydSxiufyd+YBMCc5DNtGpIcIUGnWpDQ93hMk BjJhZmdlogpyMLEJ90T7zyZ20/TaEG9McwkDTCmTrOkG2WLz3d8Juy1ofwGwT4IKLehr 9OperkAeLhFZFzGQQun6Tgkfr9Ini8UI+0bUUMqB8rz3XsMd0+9DR1cAkmWHlX3oSFE0 khooxbasB6Uev3wbDziCedMl9oOJ4zXQ9YtYYr7IeOAJFJ0pLDQw5jr6+1OfA15M7VVp 5LdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=ClGzHESyUs7PZrcCr5X0pVDGEGbBz0p9ZTrPPNvNO9g=; b=FHbomiRn4JEixaVPRJDcBJHRteaeTMviAdbysVc+VaaErkOwhqqmqbOjV0eG1EJMrb tLuCbqMLZBR+ZCN21rPyWgAeTJ/Ot81Fmsex/o0D8NRg1c9C9LtzhZlPBAwPqGEwCxxJ qPEzkjIQ8NyUUZYtzZ8Y3FENoLm0692DsS3LsE0aev/dbxu+PcLzHZJNbYBGdhHSk/Jd BzWn0jAtpYGM2xh9GVTGkEZD86gKghBn/+UXtuaV3j2HXVmh46Me8KT5D7kCxuDzCuJW yHFox9bafG3y6A7V9CQKsB0cBts8sHriJnQAesu4R766n56pqPcc1+LM626/Ko1ZN9cf 0VMw== X-Gm-Message-State: AOAM530AUIFCQW8Q2oKc3BIF5lfTh2/nG3oSTOgp9ldEehl5y9Kem9sq gL64VMHtbK/xxGRIhuAuxvlQeKpuKWk= X-Google-Smtp-Source: ABdhPJwQgwitT9JoEZRzQ9HpMlaolMO83bpmKnjJvZGWaabBafX7xdKIPAM2YUgYehFhugDwUBgyQQ== X-Received: by 2002:a17:906:35cc:: with SMTP id p12mr39077781ejb.351.1634116061764; Wed, 13 Oct 2021 02:07:41 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 17/40] target/i386/sev: Use g_autofree in sev_launch_get_measure() Date: Wed, 13 Oct 2021 11:07:05 +0200 Message-Id: <20211013090728.309365-18-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211013090728.309365-1-pbonzini@redhat.com> References: <20211013090728.309365-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::52f; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x52f.google.com X-Spam_score_int: 4 X-Spam_score: 0.4 X-Spam_bar: / X-Spam_report: (0.4 / 5.0 requ) DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1634116917025100002 From: Philippe Mathieu-Daud=C3=A9 Use g_autofree to remove a pair of g_free/goto. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20211007161716.453984-13-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- target/i386/sev.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/target/i386/sev.c b/target/i386/sev.c index 3a30ba6d94..5cbbcf0bb9 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -685,8 +685,8 @@ sev_launch_get_measure(Notifier *notifier, void *unused) { SevGuestState *sev =3D sev_guest; int ret, error; - guchar *data; - struct kvm_sev_launch_measure *measurement; + g_autofree guchar *data =3D NULL; + g_autofree struct kvm_sev_launch_measure *measurement =3D NULL; =20 if (!sev_check_state(sev, SEV_STATE_LAUNCH_UPDATE)) { return; @@ -708,7 +708,7 @@ sev_launch_get_measure(Notifier *notifier, void *unused) if (!measurement->len) { error_report("%s: LAUNCH_MEASURE ret=3D%d fw_error=3D%d '%s'", __func__, ret, error, fw_error_to_str(errno)); - goto free_measurement; + return; } =20 data =3D g_new0(guchar, measurement->len); @@ -720,7 +720,7 @@ sev_launch_get_measure(Notifier *notifier, void *unused) if (ret) { error_report("%s: LAUNCH_MEASURE ret=3D%d fw_error=3D%d '%s'", __func__, ret, error, fw_error_to_str(errno)); - goto free_data; + return; } =20 sev_set_guest_state(sev, SEV_STATE_LAUNCH_SECRET); @@ -728,11 +728,6 @@ sev_launch_get_measure(Notifier *notifier, void *unuse= d) /* encode the measurement value and emit the event */ sev->measurement =3D g_base64_encode(data, measurement->len); trace_kvm_sev_launch_measurement(sev->measurement); - -free_data: - g_free(data); -free_measurement: - g_free(measurement); } =20 char * --=20 2.31.1 From nobody Thu Apr 25 22:28:17 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1634117511394614.6362390638158; Wed, 13 Oct 2021 02:31:51 -0700 (PDT) Received: from localhost ([::1]:50964 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1maac2-0007cR-AH for importer@patchew.org; Wed, 13 Oct 2021 05:31:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54600) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1maaEo-0002Jq-1G for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:50 -0400 Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]:45837) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1maaEj-0005m3-45 for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:49 -0400 Received: by mail-ed1-x536.google.com with SMTP id r18so7149969edv.12 for ; Wed, 13 Oct 2021 02:07:43 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id c6sm6177849ejb.41.2021.10.13.02.07.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Oct 2021 02:07:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5cVoPyB8QPmFDHLHl6dUbs6vG5blXkCtoV/NqW9eQRE=; b=g41k7akcEkcva3nO7ubDZE+LdC9L0m2opj/iJKCgMAhgOgBP/SNj7rfvYXv4leidSh n+dRn5bBkIQ/164LgqkGvt494mR1iziTFJ+lZ8Q4FF/UhjXkzJiNfg+vYKcc+Z0x3X3p gr2g1C1EaLeSbwfIGE1A68dMTD9ZOr8UnRUfYuHMn+PFkERVDalJXZUnGxIwj7RrFyXS kOLtRlj/dZCi5Vc8kXR1zMSAgomzjTNGGld6qifIW+tc4vV/wB5v8UeTu0BonKepsvkw zOQOLQ121v+3dFSlxFDdZz/JmTkBUkwRHD9z9F3HTY/sN15mi0IcRoUJo/ukyNFvGVHo rQhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=5cVoPyB8QPmFDHLHl6dUbs6vG5blXkCtoV/NqW9eQRE=; b=fquruJD7nFQYsCcxTplfeJ0aZS3PytDwkygqX+uy6JOsTbHyEPNnzxABOnpbCMIetg b0ngXh5UUme1f6UFUArvk8jNjNCygy98Wx2urLq4RetNt89ODyjct5FQ7Fo3CGQ5zBSx 3eV2vs1kqkcg1Y4CUQjhNYf2GiuNZOY9ggc6bOOFvLBVuvgJlIKHERtB7ZpgQcfTvJMX VAEFdfyl2HwgXSoZ05SAVQ2cU4t5cIdOXN5A3IKFA7njDKmlWIQjNUBS87EnnXCdd+ux kRfR6vd5e3QD+g8/1LMDzadpfOl4jv423gQJfzNZY//HHlb6AEBR19atJ5jOfXwoCwXV R00w== X-Gm-Message-State: AOAM533I7qjq77FcVxIll4pwJzxcMlI27bKmxgC4y5VwOBokIpVq0ScH XYjMX9Iqfm44qqGujQKGwnhKJuEjflU= X-Google-Smtp-Source: ABdhPJxeuPm2hA9AsAVxJjGvSx43qolXueZmaxiFmWUmcqWoY9/g/ZYs5FJINTjnsflYxPAp4QAkbA== X-Received: by 2002:aa7:ccc1:: with SMTP id y1mr7918890edt.177.1634116062431; Wed, 13 Oct 2021 02:07:42 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 18/40] target/i386/sev: Restrict SEV to system emulation Date: Wed, 13 Oct 2021 11:07:06 +0200 Message-Id: <20211013090728.309365-19-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211013090728.309365-1-pbonzini@redhat.com> References: <20211013090728.309365-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::536; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x536.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1634117512647100001 From: Philippe Mathieu-Daud=C3=A9 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. Reviewed-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20211007161716.453984-14-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- target/i386/meson.build | 4 ++- target/i386/sev-stub.c | 43 ------------------------- target/i386/sev-sysemu-stub.c | 60 +++++++++++++++++++++++++++++++++++ 3 files changed, 63 insertions(+), 44 deletions(-) create mode 100644 target/i386/sev-sysemu-stub.c diff --git a/target/i386/meson.build b/target/i386/meson.build index dac19ec00d..a4f45c3ec1 100644 --- a/target/i386/meson.build +++ b/target/i386/meson.build @@ -6,7 +6,7 @@ i386_ss.add(files( '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 @@ i386_softmmu_ss.add(files( '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') diff --git a/target/i386/sev-stub.c b/target/i386/sev-stub.c index 55f1ec7419..170e9f50fe 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,49 +30,11 @@ 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; } =20 -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; -} - bool sev_add_kernel_loader_hashes(SevKernelLoaderContext *ctx, Error **err= p) { g_assert_not_reached(); diff --git a/target/i386/sev-sysemu-stub.c b/target/i386/sev-sysemu-stub.c new file mode 100644 index 0000000000..d556b4f091 --- /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; +} --=20 2.31.1 From nobody Thu Apr 25 22:28:17 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1634117272817616.7117304177995; Wed, 13 Oct 2021 02:27:52 -0700 (PDT) Received: from localhost ([::1]:40246 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1maaYB-0000IX-Ht for importer@patchew.org; Wed, 13 Oct 2021 05:27:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54666) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1maaEp-0002Mp-P0 for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:54 -0400 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]:36397) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1maaEj-0005ne-Ca for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:51 -0400 Received: by mail-ed1-x534.google.com with SMTP id d3so7318990edp.3 for ; Wed, 13 Oct 2021 02:07:44 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id c6sm6177849ejb.41.2021.10.13.02.07.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Oct 2021 02:07:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0POeyvCNhHyE/TogB33YpCfoQlQfvkymaIGlO6Vha5A=; b=PvcVK9zgGtIyQCUoQMKWEDDmA4CjdY2B5or9/DV2QcmR58xAZ7egACXXKT9ye5uSg4 coXt0LEmx47lRfkrD4oBwtrpHfKxe+cHttR+FmukbS5IfDFQhCatyGWPw8wUUGnuZSz2 WcZ9Xn7P/NhC72Rz72JVUyiTzohoyc3Mr11Ix3Tip5WEpqEotiv+h9m0kbWqBmlwpZL1 3Bns6L4PUpM07HLSYkSHRXL95GUcxI6yBnOcc0orB85H2MS4f6igeEBJB5vLi//RaoQ2 fpLUelvT/bajHBcb82dDSiB2LMKQDc9HevFpdsKuLMC5T0AGhNeRpkLlsB4ySgQnXyda ZdzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=0POeyvCNhHyE/TogB33YpCfoQlQfvkymaIGlO6Vha5A=; b=zwCQMcbSIsNPmzQQb3dVSTPsiRYU8x/mGyEQQQxqqyxMPnfhwwCS74gTEd5pSVgdg0 iL0+p7V0q5qLRTeB9Qv3MRGrOnpnLgWjnSm/jdC+T394yHfergxftOXwbS5YS6acQdGx wo8Eqfi1BJ4W3igZPlHlx71+Gq6nS9B7kSF79Y9YeWxjYifpo3RSlQKpU7p5XNM17ukM +HfFubOi9H5T7b7EKZUMYUYlIsl8Lop8u/yIbR4c2nXOrZbLz391WAZVVWD0CfNhmLRH gqcdz96iPFoRr6FqOHHdStgsw8ocYAioaLRmDv+ESO6UAlSbesDr/xfnthizcGD7jlc9 xdLg== X-Gm-Message-State: AOAM532XZ/ajTXqCUmBS18Gg9pcItS8fcr1nlWi1Ii4tC1RVWYitG1Em lTM8O8kqgHV/uRokEJwpWLWMEykcZl4= X-Google-Smtp-Source: ABdhPJxF0/7DJyP3O9Uy3oSqM4fS5uWcxXOkPR40BSwCrFp3DvZ7Tn2jF+AEyxY3R/abKb7upFOLog== X-Received: by 2002:a05:6402:5252:: with SMTP id t18mr7629475edd.129.1634116063145; Wed, 13 Oct 2021 02:07:43 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 19/40] target/i386/sev: Rename sev_i386.h -> sev.h Date: Wed, 13 Oct 2021 11:07:07 +0200 Message-Id: <20211013090728.309365-20-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211013090728.309365-1-pbonzini@redhat.com> References: <20211013090728.309365-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::534; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x534.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Dr . David Alan Gilbert" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1634117273656100001 From: Philippe Mathieu-Daud=C3=A9 SEV is a x86 specific feature, and the "sev_i386.h" header is already in target/i386/. Rename it as "sev.h" to simplify. Patch created mechanically using: $ git mv target/i386/sev_i386.h target/i386/sev.h $ sed -i s/sev_i386.h/sev.h/ $(git grep -l sev_i386.h) Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Dr. David Alan Gilbert Message-Id: <20211007161716.453984-15-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- hw/i386/x86.c | 2 +- target/i386/cpu.c | 2 +- target/i386/kvm/kvm.c | 2 +- target/i386/monitor.c | 2 +- target/i386/sev-stub.c | 2 +- target/i386/sev-sysemu-stub.c | 2 +- target/i386/sev.c | 2 +- target/i386/{sev_i386.h =3D> sev.h} | 0 8 files changed, 7 insertions(+), 7 deletions(-) rename target/i386/{sev_i386.h =3D> sev.h} (100%) diff --git a/hw/i386/x86.c b/hw/i386/x86.c index 0c7c054e3a..76de7e2265 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -47,7 +47,7 @@ #include "hw/i386/fw_cfg.h" #include "hw/intc/i8259.h" #include "hw/rtc/mc146818rtc.h" -#include "target/i386/sev_i386.h" +#include "target/i386/sev.h" =20 #include "hw/acpi/cpu_hotplug.h" #include "hw/irq.h" diff --git a/target/i386/cpu.c b/target/i386/cpu.c index b54b98551e..8289dc87bd 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -26,7 +26,7 @@ #include "sysemu/reset.h" #include "sysemu/hvf.h" #include "kvm/kvm_i386.h" -#include "sev_i386.h" +#include "sev.h" #include "qapi/error.h" #include "qapi/qapi-visit-machine.h" #include "qapi/qmp/qerror.h" diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index f25837f63f..a5f6ff63c8 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -28,7 +28,7 @@ #include "sysemu/kvm_int.h" #include "sysemu/runstate.h" #include "kvm_i386.h" -#include "sev_i386.h" +#include "sev.h" #include "hyperv.h" #include "hyperv-proto.h" =20 diff --git a/target/i386/monitor.c b/target/i386/monitor.c index ea836678f5..109e4e61c0 100644 --- a/target/i386/monitor.c +++ b/target/i386/monitor.c @@ -32,7 +32,7 @@ #include "sysemu/kvm.h" #include "sysemu/sev.h" #include "qapi/error.h" -#include "sev_i386.h" +#include "sev.h" #include "qapi/qapi-commands-misc-target.h" #include "qapi/qapi-commands-misc.h" #include "hw/i386/pc.h" diff --git a/target/i386/sev-stub.c b/target/i386/sev-stub.c index 170e9f50fe..7e8b6f9a25 100644 --- a/target/i386/sev-stub.c +++ b/target/i386/sev-stub.c @@ -13,7 +13,7 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" -#include "sev_i386.h" +#include "sev.h" =20 bool sev_enabled(void) { diff --git a/target/i386/sev-sysemu-stub.c b/target/i386/sev-sysemu-stub.c index d556b4f091..8082781feb 100644 --- a/target/i386/sev-sysemu-stub.c +++ b/target/i386/sev-sysemu-stub.c @@ -14,7 +14,7 @@ #include "qemu/osdep.h" #include "qapi/qapi-commands-misc-target.h" #include "qapi/error.h" -#include "sev_i386.h" +#include "sev.h" =20 SevInfo *sev_get_info(void) { diff --git a/target/i386/sev.c b/target/i386/sev.c index 5cbbcf0bb9..e43bbf3a17 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -25,7 +25,7 @@ #include "qemu/uuid.h" #include "crypto/hash.h" #include "sysemu/kvm.h" -#include "sev_i386.h" +#include "sev.h" #include "sysemu/sysemu.h" #include "sysemu/runstate.h" #include "trace.h" diff --git a/target/i386/sev_i386.h b/target/i386/sev.h similarity index 100% rename from target/i386/sev_i386.h rename to target/i386/sev.h --=20 2.31.1 From nobody Thu Apr 25 22:28:17 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 163411711500871.8689239672766; Wed, 13 Oct 2021 02:25:15 -0700 (PDT) Received: from localhost ([::1]:33852 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1maaVd-0004VI-UC for importer@patchew.org; Wed, 13 Oct 2021 05:25:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54568) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1maaEm-0002G0-T4 for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:48 -0400 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]:46991) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1maaEj-0005nb-3v for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:48 -0400 Received: by mail-ed1-x533.google.com with SMTP id z20so7131176edc.13 for ; Wed, 13 Oct 2021 02:07:44 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id c6sm6177849ejb.41.2021.10.13.02.07.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Oct 2021 02:07:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rZnb1x20O2Ui1ngIl9Od4LRZGQWROtAMwvlAfS3bJqM=; b=M34FVbeDm7n7U2svl3ZNJ15jLBYDPOLPvvDB9qB1jvfEK146gnY6F3IGN4qgt7Pty7 t34eXl8sVGOIGsdIIp6QhABtr39fyBFukt3YkBnrFHCyDXqKUR4DRRcDzAvJJB+QSi1w fYr6gh9rPnDWF/DCgpHIpHGHxMURO30HGkQwcYowIoAWp1TTbJj012/o7tGR/3WAzi7j rdM7seRU/dgCDyUv+/5JXuDlLA68GMkXWNVxA6+bmiuuj2pDnX3ao8opBjwm7DVIfIkN 6DBHgitFdc1kKeXtMyJyygk4ZkWHyDnkUH9bLHC41Q0HnaIA3twUIQ8dbbHpMVPGodL6 JcuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=rZnb1x20O2Ui1ngIl9Od4LRZGQWROtAMwvlAfS3bJqM=; b=SVM9GJllwV++xUr0aXWmnBWcT6YSzdJsFIU5tKIdIrXhyfh3iSVM9MOhFbKzdKMHvc JrNx9pCWPM4+Esfv61EfKaFeUkTwn7lsqvUSQPEmIr+50TXqK5TOZ+Y+PFANRgqqWDAO 9Gf0AjyW0kyZwqPHoVParZUTfbttmjokgHhDEKICjAjP7GuWSWU4IqR6YorePvkFkKj3 vF87aAtxaju7fXKHX2I3k1IUwKpa2te5bGpr42d1lYHOlTK7g3mjoDOFhx+IX56uCnQ0 A9kTdTgXNXvrvASdWAcxbd9cVrRoLNBMSJhOMkft4thYRyngsRu1Nqj9deWY3krTWb1l TNuw== X-Gm-Message-State: AOAM533ZP5IrRP/U2UEVXJGtlAkw804IUMZgmjFFpOzvMmnS1r9CTkgO r1hPRpndpQj5t97M6eyFECrNicXV5So= X-Google-Smtp-Source: ABdhPJxYXHhWqmlsTkX5Aiu4gHup4vkSni4kh3QCLZMGQQUdKh6U9BGXgmq3vvKKPI5PpHRFEFos5w== X-Received: by 2002:a17:906:4f96:: with SMTP id o22mr39323428eju.169.1634116063831; Wed, 13 Oct 2021 02:07:43 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 20/40] target/i386/sev: Declare system-specific functions in 'sev.h' Date: Wed, 13 Oct 2021 11:07:08 +0200 Message-Id: <20211013090728.309365-21-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211013090728.309365-1-pbonzini@redhat.com> References: <20211013090728.309365-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::533; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x533.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1634117116951100001 From: Philippe Mathieu-Daud=C3=A9 "sysemu/sev.h" is only used from x86-specific files. Let's move it to include/hw/i386, and merge it with target/i386/sev.h. Suggested-by: Paolo Bonzini Reviewed-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20211007161716.453984-16-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- hw/i386/pc_sysfw.c | 2 +- include/sysemu/sev.h | 28 ---------------------------- target/i386/kvm/kvm.c | 1 - target/i386/kvm/sev-stub.c | 2 +- target/i386/monitor.c | 1 - target/i386/sev.h | 12 +++++++++++- 6 files changed, 13 insertions(+), 33 deletions(-) delete mode 100644 include/sysemu/sev.h diff --git a/hw/i386/pc_sysfw.c b/hw/i386/pc_sysfw.c index 68d6b1f783..c8b17af953 100644 --- a/hw/i386/pc_sysfw.c +++ b/hw/i386/pc_sysfw.c @@ -37,7 +37,7 @@ #include "hw/qdev-properties.h" #include "hw/block/flash.h" #include "sysemu/kvm.h" -#include "sysemu/sev.h" +#include "sev.h" =20 #define FLASH_SECTOR_SIZE 4096 =20 diff --git a/include/sysemu/sev.h b/include/sysemu/sev.h deleted file mode 100644 index 94d821d737..0000000000 --- a/include/sysemu/sev.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * QEMU Secure Encrypted Virutualization (SEV) support - * - * Copyright: Advanced Micro Devices, 2016-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. - * - */ - -#ifndef QEMU_SEV_H -#define QEMU_SEV_H - -#include "sysemu/kvm.h" - -bool sev_enabled(void); -int sev_kvm_init(ConfidentialGuestSupport *cgs, Error **errp); -int sev_encrypt_flash(uint8_t *ptr, uint64_t len, Error **errp); -int sev_inject_launch_secret(const char *hdr, const char *secret, - uint64_t gpa, Error **errp); - -int sev_es_save_reset_vector(void *flash_ptr, uint64_t flash_size); -void sev_es_set_reset_vector(CPUState *cpu); - -#endif diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index a5f6ff63c8..0eb7a0340c 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -44,7 +44,6 @@ #include "hw/i386/intel_iommu.h" #include "hw/i386/x86-iommu.h" #include "hw/i386/e820_memory_layout.h" -#include "sysemu/sev.h" =20 #include "hw/pci/pci.h" #include "hw/pci/msi.h" diff --git a/target/i386/kvm/sev-stub.c b/target/i386/kvm/sev-stub.c index 9587d1b2a3..6080c007a2 100644 --- a/target/i386/kvm/sev-stub.c +++ b/target/i386/kvm/sev-stub.c @@ -13,7 +13,7 @@ =20 #include "qemu/osdep.h" #include "qemu-common.h" -#include "sysemu/sev.h" +#include "sev.h" =20 int sev_kvm_init(ConfidentialGuestSupport *cgs, Error **errp) { diff --git a/target/i386/monitor.c b/target/i386/monitor.c index 109e4e61c0..935a8ee8ca 100644 --- a/target/i386/monitor.c +++ b/target/i386/monitor.c @@ -30,7 +30,6 @@ #include "qapi/qmp/qdict.h" #include "qapi/qmp/qerror.h" #include "sysemu/kvm.h" -#include "sysemu/sev.h" #include "qapi/error.h" #include "sev.h" #include "qapi/qapi-commands-misc-target.h" diff --git a/target/i386/sev.h b/target/i386/sev.h index d83428fa26..c96072bf78 100644 --- a/target/i386/sev.h +++ b/target/i386/sev.h @@ -14,7 +14,7 @@ #ifndef QEMU_SEV_I386_H #define QEMU_SEV_I386_H =20 -#include "sysemu/sev.h" +#include "exec/confidential-guest-support.h" #include "qapi/qapi-types-misc-target.h" =20 #define SEV_POLICY_NODBG 0x1 @@ -35,6 +35,7 @@ typedef struct SevKernelLoaderContext { size_t cmdline_size; } SevKernelLoaderContext; =20 +bool sev_enabled(void); extern bool sev_es_enabled(void); extern SevInfo *sev_get_info(void); extern uint32_t sev_get_cbit_position(void); @@ -45,4 +46,13 @@ extern SevAttestationReport * sev_get_attestation_report(const char *mnonce, Error **errp); extern bool sev_add_kernel_loader_hashes(SevKernelLoaderContext *ctx, Erro= r **errp); =20 +int sev_encrypt_flash(uint8_t *ptr, uint64_t len, Error **errp); +int sev_inject_launch_secret(const char *hdr, const char *secret, + uint64_t gpa, Error **errp); + +int sev_es_save_reset_vector(void *flash_ptr, uint64_t flash_size); +void sev_es_set_reset_vector(CPUState *cpu); + +int sev_kvm_init(ConfidentialGuestSupport *cgs, Error **errp); + #endif --=20 2.31.1 From nobody Thu Apr 25 22:28:17 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1634116916394499.0190387052718; Wed, 13 Oct 2021 02:21:56 -0700 (PDT) Received: from localhost ([::1]:51710 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1maaSR-00063t-8V for importer@patchew.org; Wed, 13 Oct 2021 05:21:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54634) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1maaEo-0002Mj-Td for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:54 -0400 Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]:40716) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1maaEk-0005nr-68 for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:50 -0400 Received: by mail-ed1-x52e.google.com with SMTP id g8so7267628edt.7 for ; Wed, 13 Oct 2021 02:07:45 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id c6sm6177849ejb.41.2021.10.13.02.07.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Oct 2021 02:07:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=LmyRMNL1zBGRAH5+b9u5/SShogXqCvazqeHNtByQRzQ=; b=cOHjMHEOhEgkrkFlTRf8EDOOW+LjJh46+FAr0bsyTAiJZTCYP+yGpVB5JC9XPejo7U c2Qm33XtuXk7q1qh3VpGy6gUabvtCx5s+Ni+gIj7sjrqE3Jqg7adEnTxQdLUMbiBvJFv 9M51JiCUemHtCkP/OSV1SlQwat3phJDWxppovqNoI/nPWIEN87TufBHgpDTVE7jfJ6iN QGScZ0pfEFu91R/v9PsqOLCPmFLu632x1yDJLEFAQjvnWZbrx8B/RD6xVrL1T7MDvAhb Tf+RQoDwXRX9O01SovtM4sNUGWCzA7LaVZB+f3Oa9bZxNTADwV1uY5oyKSU6K0O2GCfD P3IA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=LmyRMNL1zBGRAH5+b9u5/SShogXqCvazqeHNtByQRzQ=; b=icKJNsHHtRSW2YzLXAYSUt3SlDBSDcsDnnrZD/MMOzYQPRjL7S/Uw2AM2sjKWMQDx6 XBbd/WDTxioNycT0Pav/9aS/u0uolDrEoqcXLJW1WB+Lr9ffVPX7k2iBKq+oRHGanozZ EFgQplYC7O4A2uVylPC6L2Z2nXIeJ5MhatSdvJJW9Q5zfeBmhFSgJQM8bTW6VKJ6Vnam gwfljknvLQq9b7PpKWJ+mvCzePIdmtMoOkKdTiyCn+G/UwBqfHjFHt4NSdfxupCNaXC9 pao6vhbaw+SDnGcNpClbGHmuC7UrNbK8AYn53oyj2otZpm5FrzKG5DsPgtuZgLsPqVKc a/wg== X-Gm-Message-State: AOAM532W9j1lkeREdNny8OQfBRA05+DCuoXxMFnAKKYnpYrVmTbdn9vZ ZQS7u2vDIl02c+6aurKuJUQOJ6BYwo8= X-Google-Smtp-Source: ABdhPJyoIgAgyzs0ElAry/D617toWBDVYQeb1Nw1G8E0EZGdemOlitoSawV2OHE4HXqtUQBHxqxdEg== X-Received: by 2002:a17:906:7632:: with SMTP id c18mr41599011ejn.317.1634116064531; Wed, 13 Oct 2021 02:07:44 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 21/40] target/i386/sev: Remove stubs by using code elision Date: Wed, 13 Oct 2021 11:07:09 +0200 Message-Id: <20211013090728.309365-22-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211013090728.309365-1-pbonzini@redhat.com> References: <20211013090728.309365-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::52e; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x52e.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eric Blake , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1634116917022100001 From: Philippe Mathieu-Daud=C3=A9 Only declare sev_enabled() and sev_es_enabled() when CONFIG_SEV is set, to allow the compiler to elide unused code. Remove unnecessary stubs. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Eric Blake Message-Id: <20211007161716.453984-17-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- target/i386/cpu.c | 13 +++++++------ target/i386/meson.build | 2 +- target/i386/sev-stub.c | 41 ----------------------------------------- target/i386/sev.h | 12 +++++++++++- 4 files changed, 19 insertions(+), 49 deletions(-) delete mode 100644 target/i386/sev-stub.c diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 8289dc87bd..fc3ed80ef1 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -5764,12 +5764,13 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index= , uint32_t count, *edx =3D 0; break; case 0x8000001F: - *eax =3D sev_enabled() ? 0x2 : 0; - *eax |=3D sev_es_enabled() ? 0x8 : 0; - *ebx =3D sev_get_cbit_position(); - *ebx |=3D sev_get_reduced_phys_bits() << 6; - *ecx =3D 0; - *edx =3D 0; + *eax =3D *ebx =3D *ecx =3D *edx =3D 0; + if (sev_enabled()) { + *eax =3D 0x2; + *eax |=3D sev_es_enabled() ? 0x8 : 0; + *ebx =3D sev_get_cbit_position(); + *ebx |=3D sev_get_reduced_phys_bits() << 6; + } break; default: /* reserved values: zero */ diff --git a/target/i386/meson.build b/target/i386/meson.build index a4f45c3ec1..ae38dc9563 100644 --- a/target/i386/meson.build +++ b/target/i386/meson.build @@ -6,7 +6,7 @@ i386_ss.add(files( 'xsave_helper.c', 'cpu-dump.c', )) -i386_ss.add(when: 'CONFIG_SEV', if_true: files('host-cpu.c'), if_false: fi= les('sev-stub.c')) +i386_ss.add(when: 'CONFIG_SEV', if_true: files('host-cpu.c')) =20 # x86 cpu type i386_ss.add(when: 'CONFIG_KVM', if_true: files('host-cpu.c')) diff --git a/target/i386/sev-stub.c b/target/i386/sev-stub.c deleted file mode 100644 index 7e8b6f9a25..0000000000 --- a/target/i386/sev-stub.c +++ /dev/null @@ -1,41 +0,0 @@ -/* - * QEMU SEV 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/error.h" -#include "sev.h" - -bool sev_enabled(void) -{ - return false; -} - -uint32_t sev_get_cbit_position(void) -{ - return 0; -} - -uint32_t sev_get_reduced_phys_bits(void) -{ - return 0; -} - -bool sev_es_enabled(void) -{ - return false; -} - -bool sev_add_kernel_loader_hashes(SevKernelLoaderContext *ctx, Error **err= p) -{ - g_assert_not_reached(); -} diff --git a/target/i386/sev.h b/target/i386/sev.h index c96072bf78..b6289234b0 100644 --- a/target/i386/sev.h +++ b/target/i386/sev.h @@ -14,6 +14,10 @@ #ifndef QEMU_SEV_I386_H #define QEMU_SEV_I386_H =20 +#ifndef CONFIG_USER_ONLY +#include CONFIG_DEVICES /* CONFIG_SEV */ +#endif + #include "exec/confidential-guest-support.h" #include "qapi/qapi-types-misc-target.h" =20 @@ -35,8 +39,14 @@ typedef struct SevKernelLoaderContext { size_t cmdline_size; } SevKernelLoaderContext; =20 +#ifdef CONFIG_SEV bool sev_enabled(void); -extern bool sev_es_enabled(void); +bool sev_es_enabled(void); +#else +#define sev_enabled() 0 +#define sev_es_enabled() 0 +#endif + extern SevInfo *sev_get_info(void); extern uint32_t sev_get_cbit_position(void); extern uint32_t sev_get_reduced_phys_bits(void); --=20 2.31.1 From nobody Thu Apr 25 22:28:17 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1634117476879377.04801936959836; Wed, 13 Oct 2021 02:31:16 -0700 (PDT) Received: from localhost ([::1]:49326 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1maabS-0006RQ-7O for importer@patchew.org; Wed, 13 Oct 2021 05:31:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54664) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1maaEp-0002Mo-Lk for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:54 -0400 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]:37553) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1maaEk-0005ob-FZ for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:51 -0400 Received: by mail-ed1-x531.google.com with SMTP id y12so7309338eda.4 for ; Wed, 13 Oct 2021 02:07:46 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id c6sm6177849ejb.41.2021.10.13.02.07.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Oct 2021 02:07:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zJL8sLW6AgvhnhUvvGEi4Ld1qkJ3BqygiG806nIB4Oc=; b=Jq3ukb0s8gsGBublsENsjIDHLSbv5hRmzIrPa8EJ5+iiblyX/hLlSRKCB8ZLDw8Edd iIAtcB91NPktPrkxi+eyZL3CUO++qt59vEYG2DOIgmiTviqiZwLAAUd3FYiLgwKCPrqX CFFparY7Nem+eeI80lKNG1nzqo7NCtKQy8zVcNszoQjG8BvkwV3UluXT/vrjEMMcWkoK jesvIC7LAPqZsRTYCfxckzPUGrEdtaiBaj9q8EBlnbrxw3Hro2Ft0JA0Sgae1CsIxIKG eA6GZ/N0WCZU2CJJBECoXH3NO9wJv6gA4E9jUZqOb9TmA1EPH2Pufe6B/l848h/zy+4B TN5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=zJL8sLW6AgvhnhUvvGEi4Ld1qkJ3BqygiG806nIB4Oc=; b=XN24UkuKRZYZHP3qmlTyfFAyfWAGCK+3510WSpQ9J0M4vwzw6Oi1vl1cxS1FRvg3fn h8omVbq4tsNDJyxaHI0gg+ZDvq/UlG6BUu7njGGAQIaVW54BnKqd4ucoki2pscHj73eG wbgvxvXc3Uwz4qQSA+HQRR2LHMQQNeMke7xIu38UP/CSi4H1GN8UGUMff80dL2RmMIKB 2dXCNtPAOnErIaj0vWNTgBkx+ZMrzdLhhLMDlGg05+eKHLliUDa8FRAPFGh3fX/JG0Sh xVpLEqYD4qZkcKbwcSkvEPJRFPJZikgaaFo1J2TZS0XZlWxgYFzLUyWqppXkbdKBlzNi Q3vw== X-Gm-Message-State: AOAM531LKFpcxMlcmpW46zXs7MSTljPu0MPEZ7YaLY9KUPESc/I5H1SC dOvOkCtrTk2FD0VdFLalBMu+2piNaLE= X-Google-Smtp-Source: ABdhPJwIonebvdf3AHGBvV+wpM2JMI9OThv2oOSchlhoMrEqoj80aS6qDDKO5c5J1rOm9YdkK2/Oew== X-Received: by 2002:a17:907:205c:: with SMTP id pg28mr40357182ejb.407.1634116065233; Wed, 13 Oct 2021 02:07:45 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 22/40] target/i386/sev: Move qmp_query_sev_attestation_report() to sev.c Date: Wed, 13 Oct 2021 11:07:10 +0200 Message-Id: <20211013090728.309365-23-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211013090728.309365-1-pbonzini@redhat.com> References: <20211013090728.309365-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::531; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x531.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1634117477834100003 From: Philippe Mathieu-Daud=C3=A9 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. Reviewed-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20211007161716.453984-18-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- target/i386/monitor.c | 6 ------ target/i386/sev-sysemu-stub.c | 5 +++-- target/i386/sev.c | 12 ++++++++++-- target/i386/sev.h | 2 -- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/target/i386/monitor.c b/target/i386/monitor.c index 935a8ee8ca..cf4a8a61a0 100644 --- a/target/i386/monitor.c +++ b/target/i386/monitor.c @@ -763,12 +763,6 @@ void qmp_sev_inject_launch_secret(const char *packet_h= dr, sev_inject_launch_secret(packet_hdr, secret, gpa, errp); } =20 -SevAttestationReport * -qmp_query_sev_attestation_report(const char *mnonce, Error **errp) -{ - return sev_get_attestation_report(mnonce, errp); -} - SGXInfo *qmp_query_sgx(Error **errp) { return sgx_get_info(errp); diff --git a/target/i386/sev-sysemu-stub.c b/target/i386/sev-sysemu-stub.c index 8082781feb..d5ec6b32e0 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.h" =20 @@ -52,8 +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"); return NULL; diff --git a/target/i386/sev.c b/target/i386/sev.c index e43bbf3a17..038fa56058 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -32,6 +32,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 @@ -515,8 +517,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; @@ -578,6 +580,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) { diff --git a/target/i386/sev.h b/target/i386/sev.h index b6289234b0..529a54acb8 100644 --- a/target/i386/sev.h +++ b/target/i386/sev.h @@ -52,8 +52,6 @@ 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); extern bool sev_add_kernel_loader_hashes(SevKernelLoaderContext *ctx, Erro= r **errp); =20 int sev_encrypt_flash(uint8_t *ptr, uint64_t len, Error **errp); --=20 2.31.1 From nobody Thu Apr 25 22:28:17 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1634117840076768.8439467921505; Wed, 13 Oct 2021 02:37:20 -0700 (PDT) Received: from localhost ([::1]:39976 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1maahK-0002MX-TE for importer@patchew.org; Wed, 13 Oct 2021 05:37:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54778) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1maaEt-0002UP-Np for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:55 -0400 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]:33302) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1maaEl-0005on-8I for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:55 -0400 Received: by mail-ed1-x52b.google.com with SMTP id p13so7490082edw.0 for ; Wed, 13 Oct 2021 02:07:46 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id c6sm6177849ejb.41.2021.10.13.02.07.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Oct 2021 02:07:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YY9bEngcjRBkEwp4l9kuLkL7/5wHfYYc6U7fQJYjvcU=; b=UbGZjIMIc2C4Un1LJDGDB78blunrq718EZKPs9rNvifWv7X7uTDILAj0BEHNuUoc3b l77wesSpIweZ3+fB6ag9fcFpdV7R9LB6oTKg+e6tZW1vL4TRtreq5uEbaJPUT4HzQVN9 GHW4Z2nv9wzH/4Tn1wQYTKFHA78xlkp/nKz7/g6JwStwunlJekVEKYkaJFV8MjHl3Su+ TiutjPwUC/bjXhKw6d0G7WDALiv0EUtxoav8K5Bh26c5BXV5bmGnC7XvVmmFzyuNP4aD JDCuVlLn2FfX8ZKh+Ob8g8z9s61RY36Jz2Fe0HvEEY9n10tlrxxxWQdgfHHkEpPuPhd2 9zaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=YY9bEngcjRBkEwp4l9kuLkL7/5wHfYYc6U7fQJYjvcU=; b=rpQ+Sa6thOkfbPznld53BieCEPGo7tq+6IhYr988R3roOaLvCv15tHPwKTvlanU9wX BQHlng5VKS7CIYDyzLhSm2i6rwSjW8mfbGI9KwwaD8aqLV+YRTRYZDoEgUy8geKEz5Q8 YXGO2iQTgDKEv+9APsvhyJYOVaJl4+clLN7Cnf24GuFGqHLiug+3c8wr2kn9cm/RfZ8P Q/14uXOXgtk7B+T+RegD/hiRBIQpRim6F1WgpzGC/9J+1meXaRv1YVZjSV69HbirWvCT lOsxwsf6KNGBTFrDF3P6ffi8R1eHwO26LRCciG+W7uLE/eFnNKYgx9ek2l3f0O8tqQxz Lv2Q== X-Gm-Message-State: AOAM533DnrfPjNMbINNF6RKPBHrfi0A1R1ypyczNcCqjUVIiuMjobqTs BVjFYly0J8nhaRlzucaie5RtQiXUOVk= X-Google-Smtp-Source: ABdhPJzlKJMS+5ci5g8gXVcTb245F5bgek2Ff+ixS5EjGPNaYOPS38fKgD2PJ7hkQAKOb8AxlC0/IA== X-Received: by 2002:a17:906:998d:: with SMTP id af13mr36071996ejc.568.1634116065889; Wed, 13 Oct 2021 02:07:45 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 23/40] target/i386/sev: Move qmp_sev_inject_launch_secret() to sev.c Date: Wed, 13 Oct 2021 11:07:11 +0200 Message-Id: <20211013090728.309365-24-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211013090728.309365-1-pbonzini@redhat.com> References: <20211013090728.309365-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::52b; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x52b.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1634117841551100001 From: Philippe Mathieu-Daud=C3=A9 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. Previously with binaries built without SEV, management layer was getting an empty response: { "execute": "sev-inject-launch-secret", "arguments": { "packet-header": "mypkt", "secret": "mypass", "gpa": 429= 4959104 } } { "return": { } } Now the response is explicit, mentioning the feature is disabled: { "execute": "sev-inject-launch-secret", "arguments": { "packet-header": "mypkt", "secret": "mypass", "gpa= ": 4294959104 } } { "error": { "class": "GenericError", "desc": "this feature or command is not currently supported" } } Reviewed-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20211007161716.453984-19-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- 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 cf4a8a61a0..22883ef2eb 100644 --- a/target/i386/monitor.c +++ b/target/i386/monitor.c @@ -732,37 +732,6 @@ SevCapability *qmp_query_sev_capabilities(Error **errp) return sev_get_capabilities(errp); } =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, "SEV not enabled for guest"); - 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); -} - SGXInfo *qmp_query_sgx(Error **errp) { return sgx_get_info(errp); diff --git a/target/i386/sev-sysemu-stub.c b/target/i386/sev-sysemu-stub.c index d5ec6b32e0..82c5ebb92f 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, "SEV is not available in this QEMU"); } =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 038fa56058..072bb6f0fd 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -973,6 +973,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, "SEV not enabled for guest"); + 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 Thu Apr 25 22:28:17 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1634117279098112.89905213274415; Wed, 13 Oct 2021 02:27:59 -0700 (PDT) Received: from localhost ([::1]:40626 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1maaYH-0000cE-UI for importer@patchew.org; Wed, 13 Oct 2021 05:27:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54712) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1maaEr-0002OA-6b for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:54 -0400 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]:33307) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1maaEl-0005pV-Ok for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:52 -0400 Received: by mail-ed1-x530.google.com with SMTP id p13so7490160edw.0 for ; Wed, 13 Oct 2021 02:07:47 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id c6sm6177849ejb.41.2021.10.13.02.07.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Oct 2021 02:07:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KUxbOVVYQMI1tYDBR9aoEQ+5fJqal+gmG6XqDBCXmTg=; b=cNLseVSwZUP3NQypSJ0gDDt20RjFW/FO0l5vsaMWQQwXUvag5kuqbKeEjo5cs436DE gOpJJ+5vWzt2GUl1E9R6hKPPawKBKCxcwQkeMcGUeOL+7jsacFZFnuHv7UZTMCz139nh nDMumZCHkHqrdDduLy5N2tJVHcFSHjXf8tB/JFuRn+cwg3cRFKOImtCZG/Dq//2lzAwE l1eDK/UIDxd/92HQyrLP6SmGv0karTrIs1znhY05v0hEfQSEeLnlVzi1TklGLIyeAh37 6WlIpgygpuCaNJWSWpqWm6l0QuX3+dIQeLWWc/hfto9/9IQLG2MBb11RnbpDs9oC4hUf 9dGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=KUxbOVVYQMI1tYDBR9aoEQ+5fJqal+gmG6XqDBCXmTg=; b=wP+urLw1SuQt+P+cPYaVmYbBYbQ1NEGBko6BhwG4Q7Ug8qq7HR2qYtl5JdS6xUVnvi 7XVJet/r0Nw2wQzGFbNfr3YD7831kHicRBf3go/zZRohZ9XJO/eMeGlL8SzzJ4E8iXkn M9SzwzOuEeFkox6J6HEUD+BfdYE47ZPSiPtwdn/t36XfwIMMvtY4utLZRVobdhfWJM5+ 52l+wLZxry8WKUT7fvtauDeHGfCRdHfhfrltkxkiotPdccABnELrs4ebk6XitrNj/b8A FjV3/SD/QOhoeiqnwlLPFaDA3sI1E//1fcGPKimNIY2ZTHaYgaTCwbYxIK42mePr5mty 7PNg== X-Gm-Message-State: AOAM532tAASLg3WnckmM3SnOCTV6F/JgBshRzhDbZIN0fps0ouQ7ZkR6 uZgYA+IFf6+LKw7u0v+a2muNtNGDID0= X-Google-Smtp-Source: ABdhPJyS3k+736woks4OQA0L0+QRwPLXNtKZ6d/NoFt0b8sM1exQV/YIqA97bNeXZOfneN8OBN7HQg== X-Received: by 2002:a05:6402:1910:: with SMTP id e16mr8032460edz.176.1634116066532; Wed, 13 Oct 2021 02:07:46 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 24/40] target/i386/sev: Move qmp_query_sev_capabilities() to sev.c Date: Wed, 13 Oct 2021 11:07:12 +0200 Message-Id: <20211013090728.309365-25-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211013090728.309365-1-pbonzini@redhat.com> References: <20211013090728.309365-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::530; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x530.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1634117280147100001 From: Philippe Mathieu-Daud=C3=A9 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. Reviewed-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20211007161716.453984-20-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- target/i386/monitor.c | 5 ----- target/i386/sev-sysemu-stub.c | 2 +- target/i386/sev.c | 8 ++++++-- target/i386/sev.h | 1 - 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/target/i386/monitor.c b/target/i386/monitor.c index 22883ef2eb..4c017b59b3 100644 --- a/target/i386/monitor.c +++ b/target/i386/monitor.c @@ -727,11 +727,6 @@ SevLaunchMeasureInfo *qmp_query_sev_launch_measure(Err= or **errp) return info; } =20 -SevCapability *qmp_query_sev_capabilities(Error **errp) -{ - return sev_get_capabilities(errp); -} - SGXInfo *qmp_query_sgx(Error **errp) { return sgx_get_info(errp); diff --git a/target/i386/sev-sysemu-stub.c b/target/i386/sev-sysemu-stub.c index 82c5ebb92f..3e8cab4c14 100644 --- a/target/i386/sev-sysemu-stub.c +++ b/target/i386/sev-sysemu-stub.c @@ -27,7 +27,7 @@ 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"); return NULL; diff --git a/target/i386/sev.c b/target/i386/sev.c index 072bb6f0fd..56e9e03acc 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -466,8 +466,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; @@ -517,6 +516,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) { diff --git a/target/i386/sev.h b/target/i386/sev.h index 529a54acb8..35e702e57b 100644 --- a/target/i386/sev.h +++ b/target/i386/sev.h @@ -51,7 +51,6 @@ 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); extern bool sev_add_kernel_loader_hashes(SevKernelLoaderContext *ctx, Erro= r **errp); =20 int sev_encrypt_flash(uint8_t *ptr, uint64_t len, Error **errp); --=20 2.31.1 From nobody Thu Apr 25 22:28:17 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1634117079897527.1087905486227; Wed, 13 Oct 2021 02:24:39 -0700 (PDT) Received: from localhost ([::1]:60216 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1maaV4-0003F6-RM for importer@patchew.org; Wed, 13 Oct 2021 05:24:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54726) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1maaEr-0002OB-IG for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:54 -0400 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]:44590) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1maaEn-0005qU-5q for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:53 -0400 Received: by mail-ed1-x52a.google.com with SMTP id w14so7163704edv.11 for ; Wed, 13 Oct 2021 02:07:48 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id c6sm6177849ejb.41.2021.10.13.02.07.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Oct 2021 02:07:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1UVpIl3wisL15Hw6RRnp1TioghQoJ5kaNvVSiU34d+8=; b=D5/jgpFsGM3FsoMLegbB2ktkTS7CDcEOYaGLJaBdG3DaIHm9QAtRRQoINTE/oNuntu vNzcyEvDgOBWmZQ9ULwoScsBj+acyZwSdD5J9PO5BeTvRhbQcHl+RDgBSMudmlnb553J 3BZH4p492YzFAiGkeBrLAG9avbP107Du+vmcVCtVyLaUaC6dnBcdTHcYRHllQy+fQTNu BCu4hFeSSiQgRVolW0odpPd6n4HlqGN8xI9ehQkCHcu6b7tbcGYhHSHK+xkNkDiifIHK 0jmh+tDKDje49O+5PWm8HgSaLw64jU8QEgpxQNj8LX3rFNSXt4fRvLSwvwNlv4v5vRab obUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=1UVpIl3wisL15Hw6RRnp1TioghQoJ5kaNvVSiU34d+8=; b=jlv1AFBZNe+rE1qgc+cIgaJ0eBzTiSsxbCSs0PxlnkeL1ocVIeQndAYP6Rfhg1oZAi aQ51PqeK4OWnGakO2gcAqty3OjQkVrRWz6GR4Fwkxx2uUeR34v7ejiU/wiCBbADuwcsa ZpQTd8IhY9OEix3yRTBBzbiFd6/qdmSnD4ddJZT+9ph2cw8eNkvPGS5rgAXCwamOJhHm XXHstmtrDSU0Y5eu8t086uyF4PyJaael+LOM9EYOhdGozUs1PKQfDRzdjOWDAcYAcsAO ujvNUux88AgjoXN4lv3hq6YWF+n8NoJABpK0Wk2Pslxth6YgP51Qp2/k0hPzKcDqEw89 MGVA== X-Gm-Message-State: AOAM531M5CmsehzRc+J6LJo17Sgsw/AMvxUmicxtW/E0YxJvpoxRpkWY 2E/g9TZlIXjn0Warw+npAK05oqgG5uc= X-Google-Smtp-Source: ABdhPJyLExi+ipzxj2P0wFuSxeFdAd4B1+FWGQ3/Gg6TBVqBJ8SDVZAY6xqQ6aok6ycPuAZLmNtTtg== X-Received: by 2002:a17:906:c302:: with SMTP id s2mr37828439ejz.499.1634116067181; Wed, 13 Oct 2021 02:07:47 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 25/40] target/i386/sev: Move qmp_query_sev_launch_measure() to sev.c Date: Wed, 13 Oct 2021 11:07:13 +0200 Message-Id: <20211013090728.309365-26-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211013090728.309365-1-pbonzini@redhat.com> References: <20211013090728.309365-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::52a; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x52a.google.com X-Spam_score_int: 4 X-Spam_score: 0.4 X-Spam_bar: / X-Spam_report: (0.4 / 5.0 requ) DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1634117080847100001 From: Philippe Mathieu-Daud=C3=A9 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. Reviewed-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20211007161716.453984-21-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- target/i386/monitor.c | 17 ----------------- target/i386/sev-sysemu-stub.c | 3 ++- target/i386/sev.c | 20 ++++++++++++++++++-- target/i386/sev.h | 1 - 4 files changed, 20 insertions(+), 21 deletions(-) diff --git a/target/i386/monitor.c b/target/i386/monitor.c index 4c017b59b3..bd24d0d473 100644 --- a/target/i386/monitor.c +++ b/target/i386/monitor.c @@ -710,23 +710,6 @@ void hmp_info_sev(Monitor *mon, const QDict *qdict) qapi_free_SevInfo(info); } =20 -SevLaunchMeasureInfo *qmp_query_sev_launch_measure(Error **errp) -{ - char *data; - SevLaunchMeasureInfo *info; - - data =3D sev_get_launch_measurement(); - if (!data) { - error_setg(errp, "SEV launch measurement is not available"); - return NULL; - } - - info =3D g_malloc0(sizeof(*info)); - info->data =3D data; - - return info; -} - SGXInfo *qmp_query_sgx(Error **errp) { return sgx_get_info(errp); diff --git a/target/i386/sev-sysemu-stub.c b/target/i386/sev-sysemu-stub.c index 3e8cab4c14..8d97d7c7e1 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, "SEV is not available in this QEMU"); return NULL; } =20 diff --git a/target/i386/sev.c b/target/i386/sev.c index 56e9e03acc..ec874b3df8 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -742,8 +742,7 @@ sev_launch_get_measure(Notifier *notifier, void *unused) trace_kvm_sev_launch_measurement(sev->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) { @@ -753,6 +752,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, "SEV launch 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, }; diff --git a/target/i386/sev.h b/target/i386/sev.h index 35e702e57b..9ee1429395 100644 --- a/target/i386/sev.h +++ b/target/i386/sev.h @@ -50,7 +50,6 @@ 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); extern bool sev_add_kernel_loader_hashes(SevKernelLoaderContext *ctx, Erro= r **errp); =20 int sev_encrypt_flash(uint8_t *ptr, uint64_t len, Error **errp); --=20 2.31.1 From nobody Thu Apr 25 22:28:17 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 163411747507514.745410447583481; Wed, 13 Oct 2021 02:31:15 -0700 (PDT) Received: from localhost ([::1]:49302 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1maabR-0006QN-S7 for importer@patchew.org; Wed, 13 Oct 2021 05:31:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54758) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1maaEs-0002Pp-MF for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:54 -0400 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]:41954) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1maaEn-0005qt-CN for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:54 -0400 Received: by mail-ed1-x52a.google.com with SMTP id a25so7235736edx.8 for ; Wed, 13 Oct 2021 02:07:48 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id c6sm6177849ejb.41.2021.10.13.02.07.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Oct 2021 02:07:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TjeSfvmFO8v2dqdmZaziYRhTFXrTQLh+6339eRCAhmY=; b=ZtOdIBzjzq4CuEXiLqJ/9ikytv19HNGYld5Zei1Sk1ut9n2xa1nAw87rBJhaCL+XVZ 5gQCylGgPvxNknzzTkPTPwWicnSlcS/Ome91T24sUlPUyQoQghHZOonL0fom0ANkHcNU OdHHrjUrmXMVQidV830Fn2OkNqPWICtNYXR2++WSsoTCrYI1S0W9zgYV8lgRuXeWSiUC Y4TBWA5kIcRnJoYKywQ+ZQNE8o0D4wifvm/n6LFPyoNqsQtFK2ZOnvUkmIMoiFsEA5fK UCod2vCCy1MCkwpYqp1es7ypuUTn6ENHt24VMIYJNpj7XENTcO2q4cBLGO8Cw+gnvrli /hgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=TjeSfvmFO8v2dqdmZaziYRhTFXrTQLh+6339eRCAhmY=; b=JkCqwPEfZ2J/NT8MsMMbQ1KpdDlvFHhhLg2aKrD+p42SxrKgXl0UHG4Ba3BRAdV6IL YEh6aTy6wCPX66SE94+M0yuH3kmtN81lv+3ogqy2wo2QWcr7IaLdL1CBdV5yFSDMqdDA tlL6rnFEaSupNo9H8MyXtfAqhLb8N/On8yJ0QWtK/nJG0T79gBJ74givV5cvveeMyG1r spL5l7FonRfq14F/i8CTTzvY88wcT5UTalhzM+OWJYH70fPWYjGHzMUZ0igmWEpKgQVx qNWvUQRQbNHl7E7V+mUT62dZo+PlyHJ+/IkJH6mm1+U4T8QzMtMb0O7FMnh29GTLCECb 8Hgg== X-Gm-Message-State: AOAM531GqGA/WQpyRTAXMgHZ1xwKby4vpprd6dKr0AjpkHsQF7p5y7FB /xwTVzyzu3qHSZ00Sc7/Rw3DGTuLfvs= X-Google-Smtp-Source: ABdhPJxJh5yQOvYXyqdmAvysI6Cr84GpnXYaMVOcPp9VlWInVP15908Hwu16k2UFmrXlHvLN8ujefA== X-Received: by 2002:a17:906:646:: with SMTP id t6mr16356265ejb.197.1634116067846; Wed, 13 Oct 2021 02:07:47 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 26/40] target/i386/sev: Move qmp_query_sev() & hmp_info_sev() to sev.c Date: Wed, 13 Oct 2021 11:07:14 +0200 Message-Id: <20211013090728.309365-27-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211013090728.309365-1-pbonzini@redhat.com> References: <20211013090728.309365-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::52a; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x52a.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1634117476048100001 From: Philippe Mathieu-Daud=C3=A9 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(). Reviewed-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20211007161716.453984-22-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- target/i386/monitor.c | 35 -------------------------------- target/i386/sev-sysemu-stub.c | 10 ++++++++- target/i386/sev.c | 38 +++++++++++++++++++++++++++++++++-- target/i386/sev.h | 2 -- 4 files changed, 45 insertions(+), 40 deletions(-) diff --git a/target/i386/monitor.c b/target/i386/monitor.c index bd24d0d473..680d282591 100644 --- a/target/i386/monitor.c +++ b/target/i386/monitor.c @@ -31,7 +31,6 @@ #include "qapi/qmp/qerror.h" #include "sysemu/kvm.h" #include "qapi/error.h" -#include "sev.h" #include "qapi/qapi-commands-misc-target.h" #include "qapi/qapi-commands-misc.h" #include "hw/i386/pc.h" @@ -676,40 +675,6 @@ void hmp_info_io_apic(Monitor *mon, const QDict *qdict) "removed soon. Please use 'info pic' instead.\n"); } =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); -} - SGXInfo *qmp_query_sgx(Error **errp) { return sgx_get_info(errp); diff --git a/target/i386/sev-sysemu-stub.c b/target/i386/sev-sysemu-stub.c index 8d97d7c7e1..68518fd3f9 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.h" =20 -SevInfo *sev_get_info(void) +SevInfo *qmp_query_sev(Error **errp) { + error_setg(errp, "SEV is not available in this QEMU"); return NULL; } =20 @@ -60,3 +63,8 @@ SevAttestationReport *qmp_query_sev_attestation_report(co= nst char *mnonce, error_setg(errp, "SEV is not available in this QEMU"); 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 ec874b3df8..19504796fb 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -32,6 +32,7 @@ #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" @@ -402,8 +403,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 @@ -422,6 +422,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) diff --git a/target/i386/sev.h b/target/i386/sev.h index 9ee1429395..83e82aa42c 100644 --- a/target/i386/sev.h +++ b/target/i386/sev.h @@ -19,7 +19,6 @@ #endif =20 #include "exec/confidential-guest-support.h" -#include "qapi/qapi-types-misc-target.h" =20 #define SEV_POLICY_NODBG 0x1 #define SEV_POLICY_NOKS 0x2 @@ -47,7 +46,6 @@ bool sev_es_enabled(void); #define sev_es_enabled() 0 #endif =20 -extern SevInfo *sev_get_info(void); extern uint32_t sev_get_cbit_position(void); extern uint32_t sev_get_reduced_phys_bits(void); extern bool sev_add_kernel_loader_hashes(SevKernelLoaderContext *ctx, Erro= r **errp); --=20 2.31.1 From nobody Thu Apr 25 22:28:17 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1634117632816456.57491933598385; Wed, 13 Oct 2021 02:33:52 -0700 (PDT) Received: from localhost ([::1]:57840 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1maadz-0003le-Oi for importer@patchew.org; Wed, 13 Oct 2021 05:33:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54766) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1maaEt-0002RQ-0D for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:55 -0400 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]:39564) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1maaEn-0005s3-Ud for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:54 -0400 Received: by mail-ed1-x534.google.com with SMTP id ec8so7259323edb.6 for ; Wed, 13 Oct 2021 02:07:49 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id c6sm6177849ejb.41.2021.10.13.02.07.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Oct 2021 02:07:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uRLBkBTO2vHgRUnd0ocK68bxa5JKjoSqkWbJMyecl8U=; b=EDE5P8Tw1ButNzLc/B29bAglgTF2XoNa34gXzwJ7eobOhUpubepWrJ6BN/cdkYSpGM l/FOQKmhUlFAdSSvdLChNkqEvomE2BQwkh4DUakOP/smlxa+y5DcgGcB+tS76JQRLjyN 79V19FjNhpT0Fmm7ho6bMLRiTej7zTBPYdrbl5n4QUONaWds/PJspleBLNtGD9BqCJWk NHmxDVWOABfIxsDUETlbl8+yxwTj3dnHo1EXVEYZjWeOdMVJf9BK66IFPL6RrwXK91Aa 9W8WMQ+RNcqpqFInb3gA2qgR+MMmbQ3djNofi8w/bK20GIMuYbE6fMBQjB5m8yKI1UMw CYaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=uRLBkBTO2vHgRUnd0ocK68bxa5JKjoSqkWbJMyecl8U=; b=QqHpq+KlHpcfq9KFdARa9tF5A33bKuJxIVVbSozJZzfoliImXW08kEFpE7yKShOfXV +r2hIwX2MOx0SC6rue8SYVrWxP/RCp6eS1ModGPQOvGsNFX2P2LTRfffsQVvIKTikbml u2/kl7i3OyozVIiMqxa3NSeMqvfSbw3I6jPPCbfC15+tIP3X4AFLEOKgnojotJafiohL BpSX15a120dOUtCx9aXi9fzEjNwf8w3N1Z1sPDtok7K4yCtIQ17qawHe+g9AC2SZlMox UFUyzPYF2PDH2xjeKfBMCkGpuauc5ppJ4mCZyCCXreTwhBqUaWubcRvQpKs4pq+YiTr7 zDFg== X-Gm-Message-State: AOAM530RZBp6+XudQ/TKb2rF6pwKF3Jp8ulk5UBy+1DEGnnWPfQUqBKd APRyQ+b9nqYKzLmu13CiZMD9QKNvuXw= X-Google-Smtp-Source: ABdhPJzQl9oyrJzwItBimjJwuj0lMntHqyEvjOggFpqNXEZ89i58XF7VMtuDJvUmqAsdW2Gg9pqhSw== X-Received: by 2002:a17:906:3715:: with SMTP id d21mr40132972ejc.74.1634116068525; Wed, 13 Oct 2021 02:07:48 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 27/40] monitor: Reduce hmp_info_sev() declaration Date: Wed, 13 Oct 2021 11:07:15 +0200 Message-Id: <20211013090728.309365-28-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211013090728.309365-1-pbonzini@redhat.com> References: <20211013090728.309365-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::534; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x534.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1634117634883100001 From: Philippe Mathieu-Daud=C3=A9 While being conditionally used for TARGET_I386 in hmp-commands-info.hx, hmp_info_sev() is declared for all targets. Reduce its declaration to target including "monitor/hmp-target.h". This is a minor cleanup. Reviewed-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20211007161716.453984-23-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- 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 dc53add7ee..96956d0fc4 100644 --- a/include/monitor/hmp-target.h +++ b/include/monitor/hmp-target.h @@ -49,6 +49,7 @@ 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); void hmp_info_sgx(Monitor *mon, const QDict *qdict); =20 #endif /* MONITOR_HMP_TARGET_H */ diff --git a/include/monitor/hmp.h b/include/monitor/hmp.h index 3baa1058e2..6bc27639e0 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 68518fd3f9..7a29295d1e 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 19504796fb..4c64c68244 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 Thu Apr 25 22:28:17 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1634117649252790.8882139220569; Wed, 13 Oct 2021 02:34:09 -0700 (PDT) Received: from localhost ([::1]:59482 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1maaeG-0004qz-7Q for importer@patchew.org; Wed, 13 Oct 2021 05:34:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54780) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1maaEt-0002UQ-Nl for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:55 -0400 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]:40724) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1maaEo-0005sM-F8 for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:55 -0400 Received: by mail-ed1-x534.google.com with SMTP id g8so7268409edt.7 for ; Wed, 13 Oct 2021 02:07:49 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id c6sm6177849ejb.41.2021.10.13.02.07.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Oct 2021 02:07:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Ep7UvjMq3uUV10FUcwpkD1q3h/E0ThEAGvGre/JUM6Q=; b=k/wXIa/XZJB3fFds1H8UAiS5/ngl2UkR06El6TIS1EpYwZ189EwXvsEC8eYCDV22tb qHBDFB8Xu+KzKn/bOd/w3m0R4X3w7CtafHwfXxZi7FAHwQzg7DHTx02svqJNDsbj9TDZ XwXxYvk6QWmKQU2t+NnYHuv5ESS5DKwZqcXitt51Gnj7qqVwOhDNEUV9LHgtAnFmhiiE YqriwGm7Nvm03k3r0NRAn4uHKkojob/F71Pt8a85meoOCf0L/MVj5MRpdtmA5fHSFlc1 Wn/AhqhJ3lg1BBxdLnukNZqzTBRkGrw2ZpwOCb8AzRBFkvPMCSemJ2nCzLITGYKU3RoL 8sxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=Ep7UvjMq3uUV10FUcwpkD1q3h/E0ThEAGvGre/JUM6Q=; b=Xf4vNoyuZLlerkXHQNqH9nj0A4Nu+1BEIwnFMBgjhlLFE6e97YuUJQgDKEM9sPsBrl /kgIARg+fpTSMMHV2+3RekrQPeJEAq1oy7BdHCzhcmh3rosDSkQP4DcGg1xj4Fupw7GJ R8Uxo5EegxaWu+VLbnToYlyigl9RGcl6B3l+S+g+OM0AN7ZdMJ1++iIiE3IeT2GIkU83 T0UkMiC9AqKbAViObNMXOxUzdc5X+dMdy4y8coJXr9TBbRQQhhB2kBsVJTRf6E8XeGeC PhPkeRcKT176vKpeiXXXpIpVcykiDa2jq2r4mT76QcX7BHa0/tmwOdqWcYqAgaqRoyGU llOw== X-Gm-Message-State: AOAM530ZZz6NqhrGN8se5cZQcQS0+cEfLFN4eqCZ7/531Ufs8IOKBCSA alycYJos1R5+nZATbihzDQbT7SXyomk= X-Google-Smtp-Source: ABdhPJyEwnok4rzEJD/Qf53VwFZ7md8isjjzHSCClGghEk8Fj+38Ls/vQVWnNnig5O1HdXbXUv+uXw== X-Received: by 2002:a17:907:f83:: with SMTP id kb3mr41144206ejc.453.1634116069150; Wed, 13 Oct 2021 02:07:49 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 28/40] MAINTAINERS: Cover SEV-related files with X86/KVM section Date: Wed, 13 Oct 2021 11:07:16 +0200 Message-Id: <20211013090728.309365-29-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211013090728.309365-1-pbonzini@redhat.com> References: <20211013090728.309365-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::534; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x534.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1634117649889100001 From: Philippe Mathieu-Daud=C3=A9 Complete the x86/KVM section with SEV-related files. Suggested-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20211007161716.453984-24-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 32b668e92f..e31c190b47 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -417,7 +417,9 @@ M: Paolo Bonzini M: Marcelo Tosatti L: kvm@vger.kernel.org S: Supported +F: docs/amd-memory-encryption.txt F: target/i386/kvm/ +F: target/i386/sev* F: scripts/kvm/vmxcap =20 Guest CPU Cores (other accelerators) --=20 2.31.1 From nobody Thu Apr 25 22:28:17 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1634117983206181.39315540881603; Wed, 13 Oct 2021 02:39:43 -0700 (PDT) Received: from localhost ([::1]:48542 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1maaje-00083K-7D for importer@patchew.org; Wed, 13 Oct 2021 05:39:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54810) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1maaEu-0002Wr-OW for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:57 -0400 Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]:44603) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1maaEp-0005tN-EX for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:56 -0400 Received: by mail-ed1-x536.google.com with SMTP id w14so7164137edv.11 for ; Wed, 13 Oct 2021 02:07:51 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id c6sm6177849ejb.41.2021.10.13.02.07.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Oct 2021 02:07:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gCPOO8vd2h8GUe9dv0h6T1ONRg1lbq1vkzQBXhJZDy8=; b=kFMAINvAPKh5ykTLYXB1OvDaCRFr3e4AqZS7qbCL5W8B0uATfC1/KqDfTDHhdQBCxl b1QxAlHdHAaOZCktlx7dsYQ+C9nZxxP76ByICwaNdp2gY4vrdjp/U+zeVPGuoC1VsAsc W3b8HS1bwkorPJGZKil76mS8Fz2RVj5nAMUdFSq46iyNqWPUmwQck8IC1pk9p8V3o28m 5DLvhG9LsOlWJ+SyOgBtRCnzt604cw7Q6SMa+X7N4gAg/eSBcKTjMWk4E10S10FCYkZG KT19AIBsNl6GvOtt/I4SMdMYUYFjcAkudlvNtZfUzSFfCUTk3mParCFW8ZrOz6R1O1XR VMEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=gCPOO8vd2h8GUe9dv0h6T1ONRg1lbq1vkzQBXhJZDy8=; b=Du9inYEUDIU3Qr1Dhc7rNb9Ua8kiVx4KmIW33oBMpMrjgZxNkvL1313MNGwAQgFYu8 W3IQ2lOoonZ5HXBq3Ml4OT6RLfrUxSR3r0lfjK+caFV7cfeJopde+eAZNbyPbqftR249 +2s1c66Oq2c9eSzkSJr0zg+x7NMNJlPBc4bheCSZ2UAozTaTd7MDFMFkoaOwXalILPZH fY+qmlIyhWbOe7Col6BPsF2LiGqpBl/Bt6/s12XPu0g/mtYAmFGogbDysgimoJYRTfIn zYxn/U6iGFv7i7w6qq2K5hyNnSVLurIdQQPGbayPWw9LEpE3k91Xw/50axl2t4F/mtZU Az8Q== X-Gm-Message-State: AOAM532q9EY5dwiTE8bomsR3p0+IQ6H9DJT35BstRnaH6XPKPiO9kOEl fszabRauubG6qJB7sSD+aXiBsAFUsXA= X-Google-Smtp-Source: ABdhPJxHZVJALtqZndRXcxHEEOMRBgD2de2bfMRTyD9Vx8S5OhxJ82+xuy9alTRWzilnK/JsYGeFBA== X-Received: by 2002:a17:906:5590:: with SMTP id y16mr38999070ejp.286.1634116069805; Wed, 13 Oct 2021 02:07:49 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 29/40] qapi: Make some ObjectTypes depend on the build settings Date: Wed, 13 Oct 2021 11:07:17 +0200 Message-Id: <20211013090728.309365-30-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211013090728.309365-1-pbonzini@redhat.com> References: <20211013090728.309365-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::536; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x536.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1634117984547100001 Content-Type: text/plain; charset="utf-8" From: Thomas Huth Some of the ObjectType entries already depend on CONFIG_* switches. Some others also only make sense with certain configurations, but are currently always listed in the ObjectType enum. Let's make them depend on the correpsonding CONFIG_* switches, too, so that upper layers (like libvirt) have a better way to determine which features are available in QEMU. Signed-off-by: Thomas Huth Reviewed-by: Markus Armbruster Message-Id: <20210928160232.432980-1-thuth@redhat.com> [Do the same for MemoryBackendEpcProperties. - Paolo] Signed-off-by: Paolo Bonzini --- qapi/qom.json | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/qapi/qom.json b/qapi/qom.json index 0222bb4506..7231ac3f34 100644 --- a/qapi/qom.json +++ b/qapi/qom.json @@ -794,7 +794,8 @@ 'authz-pam', 'authz-simple', 'can-bus', - 'can-host-socketcan', + { 'name': 'can-host-socketcan', + 'if': 'CONFIG_LINUX' }, 'colo-compare', 'cryptodev-backend', 'cryptodev-backend-builtin', @@ -808,21 +809,26 @@ 'filter-replay', 'filter-rewriter', 'input-barrier', - 'input-linux', + { 'name': 'input-linux', + 'if': 'CONFIG_LINUX' }, 'iothread', + { 'name': 'memory-backend-epc', + 'if': 'CONFIG_LINUX' }, 'memory-backend-file', { 'name': 'memory-backend-memfd', 'if': 'CONFIG_LINUX' }, 'memory-backend-ram', - 'memory-backend-epc', 'pef-guest', - 'pr-manager-helper', + { 'name': 'pr-manager-helper', + 'if': 'CONFIG_LINUX' }, 'qtest', 'rng-builtin', 'rng-egd', - 'rng-random', + { 'name': 'rng-random', + 'if': 'CONFIG_POSIX' }, 'secret', - 'secret_keyring', + { 'name': 'secret_keyring', + 'if': 'CONFIG_SECRET_KEYRING' }, 'sev-guest', 's390-pv-guest', 'throttle-group', @@ -853,7 +859,8 @@ 'authz-listfile': 'AuthZListFileProperties', 'authz-pam': 'AuthZPAMProperties', 'authz-simple': 'AuthZSimpleProperties', - 'can-host-socketcan': 'CanHostSocketcanProperties', + 'can-host-socketcan': { 'type': 'CanHostSocketcanProperties', + 'if': 'CONFIG_LINUX' }, 'colo-compare': 'ColoCompareProperties', 'cryptodev-backend': 'CryptodevBackendProperties', 'cryptodev-backend-builtin': 'CryptodevBackendProperties', @@ -867,20 +874,25 @@ 'filter-replay': 'NetfilterProperties', 'filter-rewriter': 'FilterRewriterProperties', 'input-barrier': 'InputBarrierProperties', - 'input-linux': 'InputLinuxProperties', + 'input-linux': { 'type': 'InputLinuxProperties', + 'if': 'CONFIG_LINUX' }, 'iothread': 'IothreadProperties', + 'memory-backend-epc': { 'type': 'MemoryBackendEpcProperties', + 'if': 'CONFIG_LINUX' }, 'memory-backend-file': 'MemoryBackendFileProperties', 'memory-backend-memfd': { 'type': 'MemoryBackendMemfdPropertie= s', 'if': 'CONFIG_LINUX' }, 'memory-backend-ram': 'MemoryBackendProperties', - 'memory-backend-epc': 'MemoryBackendEpcProperties', - 'pr-manager-helper': 'PrManagerHelperProperties', + 'pr-manager-helper': { 'type': 'PrManagerHelperProperties', + 'if': 'CONFIG_LINUX' }, 'qtest': 'QtestProperties', 'rng-builtin': 'RngProperties', 'rng-egd': 'RngEgdProperties', - 'rng-random': 'RngRandomProperties', + 'rng-random': { 'type': 'RngRandomProperties', + 'if': 'CONFIG_POSIX' }, 'secret': 'SecretProperties', - 'secret_keyring': 'SecretKeyringProperties', + 'secret_keyring': { 'type': 'SecretKeyringProperties', + 'if': 'CONFIG_SECRET_KEYRING' }, 'sev-guest': 'SevGuestProperties', 'throttle-group': 'ThrottleGroupProperties', 'tls-creds-anon': 'TlsCredsAnonProperties', --=20 2.31.1 From nobody Thu Apr 25 22:28:17 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1634118193718156.21463282140826; Wed, 13 Oct 2021 02:43:13 -0700 (PDT) Received: from localhost ([::1]:57106 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1maan2-0005V4-IH for importer@patchew.org; Wed, 13 Oct 2021 05:43:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54808) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1maaEu-0002Wo-O7 for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:57 -0400 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]:45835) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1maaEp-0005tb-MQ for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:56 -0400 Received: by mail-ed1-x52f.google.com with SMTP id r18so7151514edv.12 for ; Wed, 13 Oct 2021 02:07:51 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id c6sm6177849ejb.41.2021.10.13.02.07.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Oct 2021 02:07:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jnuICvUChwckoi0bOEdRybFsN3xmu9Vkq/jJXFkB2Uk=; b=JmIk7WFdtZ6d8HqJxpXJwoBWXExoFes2w8Fqz6/qkC9StS+CZwjEHnauVl24ozn7MC mUGqrbr7ghpvix0zR4sRAN41ZsqSVwAb5Y/yan71t52oEkI9YhT9BoI/EtdLuYumueKQ +X4oXda4477FmtcQvAMADpL2bQl8nd1pg4piPUPAM61bk3Ofjr+aFMIbKEj5nx6GujKF FEiHvRp4T/RjmhkBojGREQl+pSGmid/sYc2hrWaC5n5WOyEuZpJEoXJJg9Ip19dvhYG7 kA8m/wlcYWk5uZU2XW17CMxw1DE0AT6f/jZEZNLAg/G+wdBKNd8UEeAtpL0QGrly8L2+ Vzaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=jnuICvUChwckoi0bOEdRybFsN3xmu9Vkq/jJXFkB2Uk=; b=x5CJT+ifUl+PCk1vIKgs4PJL2m4CjfV8i9HXwb+jXhvRqSWDw8zT9Toe7UFBTTdcDG V+NUENBQzSswyF8plojjMxzrBcojI6mtFiPuW7X/ebvuEtJy0XFNIJX9JfR1yN1zJReH W7M7td6YZ2Mgj+y+TK+t0WRLIQLkHDi+hARClmf9MfKoARcD/PA4A8vmBSyXkICi254w q1fquBbXUAuSUpkIf3cPbYnsqKKu1IXKgQWWH28hlalff/c6txl+2YcJId+0nkKqCZz8 LrUlcDxFnBAZiTaTxgK+S7nOWOkP8OQMu8V/QGAHDZNLehdap+9j5SEQE9kQJdvmSoyq rl9g== X-Gm-Message-State: AOAM5330s136QX+ls+Yrg7rYhJ0wnI5sbcXO/yNNn9lo3PZcRw365/tG X0xqy6dN7ATcQa2Wb8OdeulOMG2Cuko= X-Google-Smtp-Source: ABdhPJxtLW0eh9e0IhcbF48eAvKUx3eS4KHrAGPnx8LFSKQzniUlj/6VQyP3gM/h7snRFHJKUcq+wQ== X-Received: by 2002:a17:907:7790:: with SMTP id ky16mr40592988ejc.490.1634116070421; Wed, 13 Oct 2021 02:07:50 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 30/40] tests: tcg: Fix PVH test with binutils 2.36+ Date: Wed, 13 Oct 2021 11:07:18 +0200 Message-Id: <20211013090728.309365-31-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211013090728.309365-1-pbonzini@redhat.com> References: <20211013090728.309365-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::52f; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x52f.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Cole Robinson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1634118195779100001 Content-Type: text/plain; charset="utf-8" From: Cole Robinson binutils started adding a .note.gnu.property ELF section which makes the PVH test fail: TEST hello on x86_64 qemu-system-x86_64: Error loading uncompressed kernel without PVH ELF Note Discard .note.gnu* while keeping the PVH .note bits intact. This also strips the build-id note, so drop the related comment. Signed-off-by: Cole Robinson Message-Id: <5ab2a54c262c61f64c22dbb49ade3e2db8a740bb.1633708346.git.crobin= so@redhat.com> Signed-off-by: Paolo Bonzini --- tests/tcg/x86_64/system/kernel.ld | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/tcg/x86_64/system/kernel.ld b/tests/tcg/x86_64/system/ke= rnel.ld index 49c12b04ae..ca5d6bd850 100644 --- a/tests/tcg/x86_64/system/kernel.ld +++ b/tests/tcg/x86_64/system/kernel.ld @@ -16,7 +16,10 @@ SECTIONS { *(.rodata) } :text =20 - /* Keep build ID and PVH notes in same section */ + /DISCARD/ : { + *(.note.gnu*) + } + .notes : { *(.note.*) } :note --=20 2.31.1 From nobody Thu Apr 25 22:28:17 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1634117626177792.350867315974; Wed, 13 Oct 2021 02:33:46 -0700 (PDT) Received: from localhost ([::1]:57166 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1maads-0003LC-SN for importer@patchew.org; Wed, 13 Oct 2021 05:33:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54906) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1maaEy-0002c1-JI for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:08:05 -0400 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]:39565) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1maaEq-0005uY-Bm for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:59 -0400 Received: by mail-ed1-x534.google.com with SMTP id ec8so7259778edb.6 for ; Wed, 13 Oct 2021 02:07:51 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id c6sm6177849ejb.41.2021.10.13.02.07.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Oct 2021 02:07:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tDROQXrBHjp89GUquZYhrHR11bo1zH9TlZJcG4AO4d8=; b=ef0wDXiuFMlJwMMXOPqFXHL4IMIeUm3k1bmqOjG2aNTLJuDCtmut85VTNelthW5EqJ unRwIvC01gnD1ZU+k+kAtlJ2vJZibKcX+sv2V+DUGjEmFIyHnBS+uEKbVYztGqJqtt1x IpAqFCD9R38NlRj8K752wDGzTsnyJEmlwlcf2DSHabMlWaiQfSa9jWSCDZi8eY22pe7f i0YtDOxNRJfqnlUF397QgzkfZS+YL4A5Fp59XziF6aX1wwx4OGoZmq6irE77KcVZcu9C 1+UsgBmBw451o7ZSyN9wugLCLFZRRqITGFoVEvuZl/K44no1UvgQcQZfJN4/TxrLEOfN 48AQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=tDROQXrBHjp89GUquZYhrHR11bo1zH9TlZJcG4AO4d8=; b=nlgknnbDJaeofcc4/K2wR3CB337yM4EKQ8D36KAFG6oG7vVecH6xEb9+Lq4ya9KmAW lfpHlPMPIfy7WbmGgkEr17mgz9iow3ks3O4oTkQnyqwG5KDwErn5bHkOhjhqwRKIB+9V xG1Q+kgodOf5DC2E8U0Xi+JmucfNepRo670ZccCzTzh8OPSDXPbHelO9XcZAyYPL+13D N6yU1VSyV78nKaFckf27+4dAFEblpK+dbz94n+vVad14E1uFhYHfEWvsQ2PwGKlqNlxE RNULzjtX4wKqxTF1CzlWKML+R/Q0qOT+MBNERcEIQY+M/OAdytxyg0REF7ZsfsLUv/l/ uy8A== X-Gm-Message-State: AOAM532m5yFFrr1s6RIT53KcGGuCqD/Jq8Y2ueo0gEmSLoPBICo4Qvx2 TN8oU3UMZvw4gU7MjIF4r/hbNXURoxU= X-Google-Smtp-Source: ABdhPJxZnZUDBYyc4h5cHS5hxj6hYFxo3AFg5WRgull/5qMNFp0cVbst8BvoqGQ0WLnuQNr/fNdTrA== X-Received: by 2002:a50:e043:: with SMTP id g3mr8015354edl.196.1634116071084; Wed, 13 Oct 2021 02:07:51 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 31/40] hvf: Determine slot count from struct layout Date: Wed, 13 Oct 2021 11:07:19 +0200 Message-Id: <20211013090728.309365-32-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211013090728.309365-1-pbonzini@redhat.com> References: <20211013090728.309365-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::534; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x534.google.com X-Spam_score_int: -11 X-Spam_score: -1.2 X-Spam_bar: - X-Spam_report: (-1.2 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexander Graf , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1634117626917100001 Content-Type: text/plain; charset="utf-8" From: Alexander Graf We can handle up to a static amount of memory slots, capped by the size of an internal array. Let's make sure that array size is the only source of truth for the number of elements in that array. Signed-off-by: Alexander Graf Reviewed-by: Richard Henderson Message-Id: <20211008054616.43828-1-agraf@csgraf.de> Signed-off-by: Paolo Bonzini --- accel/hvf/hvf-accel-ops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/accel/hvf/hvf-accel-ops.c b/accel/hvf/hvf-accel-ops.c index 6cbd2c3f97..2b2c411076 100644 --- a/accel/hvf/hvf-accel-ops.c +++ b/accel/hvf/hvf-accel-ops.c @@ -321,7 +321,7 @@ static int hvf_accel_init(MachineState *ms) =20 s =3D g_new0(HVFState, 1); =20 - s->num_slots =3D 32; + s->num_slots =3D ARRAY_SIZE(s->slots); for (x =3D 0; x < s->num_slots; ++x) { s->slots[x].size =3D 0; s->slots[x].slot_id =3D x; --=20 2.31.1 From nobody Thu Apr 25 22:28:17 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1634117812239540.0636151548441; Wed, 13 Oct 2021 02:36:52 -0700 (PDT) Received: from localhost ([::1]:37418 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1maagt-0000eB-1J for importer@patchew.org; Wed, 13 Oct 2021 05:36:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54962) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1maaF3-0002cd-5x for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:08:06 -0400 Received: from mail-ed1-x52c.google.com ([2a00:1450:4864:20::52c]:35656) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1maaEr-0005w3-Bm for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:08:03 -0400 Received: by mail-ed1-x52c.google.com with SMTP id w19so7364720edd.2 for ; Wed, 13 Oct 2021 02:07:52 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id c6sm6177849ejb.41.2021.10.13.02.07.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Oct 2021 02:07:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9e6ErNC+odqDQ74nox/v6mwbruJMWqSgjCx7Fe58coQ=; b=AZMHfswDMV0q/BG9ZMXwyo8hPw4WQpMF/BPvDCUJwqrj7uhHI6L+u34wt3zrVfaSIE 9kD038+6p5XP05MYQFgLzW70mb7PJk5W+ygiqvLGqsDFkSbMEs9JJtOvakRaJxoyCIzm ws8lUvU/6QZfTFbzGWP7knjxFB6hf5yqyJlQKCykmU9oa1lPqWz7fEqDsBT49Q9tEXOr DDlh5Z909bg7crcxLkccrHlPHa8AfwsOFgblj+BWDjoM8wIOGydyeWdv7seza6WaUjZu +xASIo71R8iTn4ZB1fNEfnqlwmaJa8s1RYtogyFkke3wEfy52Dc3sxZHiKzelat1T3Ln mhCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=9e6ErNC+odqDQ74nox/v6mwbruJMWqSgjCx7Fe58coQ=; b=iQtE7niDxUHUzfyq4IwDmuflXJ4m1riWU0bt1ITdq5wpABIRxCVVI4y/THRKP0yvgG /9ypNHr6qClD6HVuzJ+leMNWLQbBYxSeSaL9f9STEIe11/MldCHFkUGUsnAhJM+bCjvi QrKrTFglTzZ0RGmH/vXifEMq2kpnxbPMNAaoawtbl8UALMpshlxj77g4TnR91NQF5+NV B+F8Fn9138OOa4ZblBvI05Pfc8RBpmOMxllriwF1P2jKC6D2apih6nZKIDBb8O+uDVeN UkzKsLL1yECpJHcyySlPQWtrlxgbh/KipCCm4TOW2MNTV3Gf/nZCrrRIKauLQAMaLrsN puIA== X-Gm-Message-State: AOAM531NJHH0GDFJzqqjJYMCjyHLAkKlX6MfeR9dvlYfUIQV6/HYratB K43HkdvfpNnET6vg48LDlg9hl7NbIqo= X-Google-Smtp-Source: ABdhPJyKQDXlTvc/V8TbMIP6+hd8TnFOlzQM7tXxphMWtRiVfq2Aswrwz60udR3PQ81eNi5niN8yiw== X-Received: by 2002:a17:906:1c03:: with SMTP id k3mr31277746ejg.562.1634116071969; Wed, 13 Oct 2021 02:07:51 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 32/40] MAINTAINERS: Cover SGX documentation file with X86/KVM section Date: Wed, 13 Oct 2021 11:07:20 +0200 Message-Id: <20211013090728.309365-33-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211013090728.309365-1-pbonzini@redhat.com> References: <20211013090728.309365-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::52c; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x52c.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Yang Zhong , Marcelo Tosatti , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1634117812781100001 From: Philippe Mathieu-Daud=C3=A9 Cc: Yang Zhong Cc: Paolo Bonzini Cc: Marcelo Tosatti Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20211007175612.496366-2-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index e31c190b47..cfefe386ea 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -418,6 +418,7 @@ M: Marcelo Tosatti L: kvm@vger.kernel.org S: Supported F: docs/amd-memory-encryption.txt +F: docs/system/i386/sgx.rst F: target/i386/kvm/ F: target/i386/sev* F: scripts/kvm/vmxcap --=20 2.31.1 From nobody Thu Apr 25 22:28:17 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1634117633762393.9484406632632; Wed, 13 Oct 2021 02:33:53 -0700 (PDT) Received: from localhost ([::1]:57860 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1maae0-0003mg-Pi for importer@patchew.org; Wed, 13 Oct 2021 05:33:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54838) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1maaEw-0002Zp-46 for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:58 -0400 Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]:42505) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1maaEs-0005wx-9m for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:57 -0400 Received: by mail-ed1-x536.google.com with SMTP id t16so7204489eds.9 for ; Wed, 13 Oct 2021 02:07:53 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id c6sm6177849ejb.41.2021.10.13.02.07.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Oct 2021 02:07:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=C9y5huMw4LwH2pJnuKk7cxJUHcEjm1Oaww7ZVrlgFH8=; b=FfwLyCRTagya72JwQwm71kgyFWcPQVlZkVY+kPpbbXn1GZtUKSqTG2RDRrI8z6nbKN FeMEbVbLcpnHgZVRwNe5FX71kaKToJ5wBGIQ5pilAewZK6n1/lM78NldpCKwuo4bEQoX 3hzQS2hxqK+tRLOmpwwjuJtq7AQ9UT/gjg5V7n70DEbg3UflKpH9iRVykXDwHOcVzVXJ RZ9M262L7xPXIYLJkWyLZFeeKEYtWZl1NXPETreR+HmPwXr0vUWbop7RYJJEWropln2Z 8tGfRX+bdkitRr9LT+xb36mIEa5edQEWce6XpnwvzeqUD6eTG/fgUo7q0wV3rcO3/kNB mr7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=C9y5huMw4LwH2pJnuKk7cxJUHcEjm1Oaww7ZVrlgFH8=; b=3dD40CbLC9NsCs35pC7b1YQ9flC1z1KnzXEj54DNgwkcrJpON+gDtJ61PclrDDUx3y 3SyColDS3eNF0pz9FmPIfFyz6DF7en3h+xGoq5bqitnpI06NJ8b4dRkXNc6VpscW9UmN HnMYSvy99gBivKyK5selsx814jJFeY/IJbzjFtCSBNmLQpHaxX0IzeZ4I1MZZwWxOTFP sjWW8fErwkefjaCmjrTLI/8oezjyG6+D4eiFVT2lvwxRauBkkZzOr6bLZ5R/SSFPCuZQ Mn717BzdRetxhm6vcRLRql0ESODUWMO+pfp37H2cCuZa1j0wh0fKr9r1Mgck4hlHyvit gOxg== X-Gm-Message-State: AOAM533sWGdjplSHlpnj7rC0DEPOa0MbdR4o61G8iXXgLwNt29kNLvTA 0UHlsUel7YjRkziEN81LWJuC+mszFTg= X-Google-Smtp-Source: ABdhPJwoPmax0I7ER/5XArGq+xeYfx6QfmKMoBbLsUIVxtFHbLics27oGZEGLTWPx4ZDPZC13p7kwQ== X-Received: by 2002:a17:907:c0c:: with SMTP id ga12mr9248080ejc.111.1634116072671; Wed, 13 Oct 2021 02:07:52 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 33/40] hw/i386/sgx: Have sgx_epc_get_section() return a boolean Date: Wed, 13 Oct 2021 11:07:21 +0200 Message-Id: <20211013090728.309365-34-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211013090728.309365-1-pbonzini@redhat.com> References: <20211013090728.309365-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::536; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x536.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1634117635016100003 From: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20211007175612.496366-3-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- hw/i386/sgx-stub.c | 2 +- hw/i386/sgx.c | 6 +++--- include/hw/i386/sgx-epc.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/i386/sgx-stub.c b/hw/i386/sgx-stub.c index 3be9f5ca32..45c473119e 100644 --- a/hw/i386/sgx-stub.c +++ b/hw/i386/sgx-stub.c @@ -20,7 +20,7 @@ void pc_machine_init_sgx_epc(PCMachineState *pcms) memset(&pcms->sgx_epc, 0, sizeof(SGXEPCState)); } =20 -int sgx_epc_get_section(int section_nr, uint64_t *addr, uint64_t *size) +bool sgx_epc_get_section(int section_nr, uint64_t *addr, uint64_t *size) { g_assert_not_reached(); } diff --git a/hw/i386/sgx.c b/hw/i386/sgx.c index e481e9358f..29724ff8f0 100644 --- a/hw/i386/sgx.c +++ b/hw/i386/sgx.c @@ -115,13 +115,13 @@ SGXInfo *sgx_get_info(Error **errp) return info; } =20 -int sgx_epc_get_section(int section_nr, uint64_t *addr, uint64_t *size) +bool sgx_epc_get_section(int section_nr, uint64_t *addr, uint64_t *size) { PCMachineState *pcms =3D PC_MACHINE(qdev_get_machine()); SGXEPCDevice *epc; =20 if (pcms->sgx_epc.size =3D=3D 0 || pcms->sgx_epc.nr_sections <=3D sect= ion_nr) { - return 1; + return true; } =20 epc =3D pcms->sgx_epc.sections[section_nr]; @@ -129,7 +129,7 @@ int sgx_epc_get_section(int section_nr, uint64_t *addr,= uint64_t *size) *addr =3D epc->addr; *size =3D memory_device_get_region_size(MEMORY_DEVICE(epc), &error_fat= al); =20 - return 0; + return false; } =20 void pc_machine_init_sgx_epc(PCMachineState *pcms) diff --git a/include/hw/i386/sgx-epc.h b/include/hw/i386/sgx-epc.h index 65a68ca753..a6a65be854 100644 --- a/include/hw/i386/sgx-epc.h +++ b/include/hw/i386/sgx-epc.h @@ -55,7 +55,7 @@ typedef struct SGXEPCState { int nr_sections; } SGXEPCState; =20 -int sgx_epc_get_section(int section_nr, uint64_t *addr, uint64_t *size); +bool sgx_epc_get_section(int section_nr, uint64_t *addr, uint64_t *size); =20 static inline uint64_t sgx_epc_above_4g_end(SGXEPCState *sgx_epc) { --=20 2.31.1 From nobody Thu Apr 25 22:28:17 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1634117452713527.0855638512002; Wed, 13 Oct 2021 02:30:52 -0700 (PDT) Received: from localhost ([::1]:48620 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1maab4-0005xf-BF for importer@patchew.org; Wed, 13 Oct 2021 05:30:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54860) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1maaEw-0002bj-S7 for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:08:00 -0400 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]:41961) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1maaEs-0005xA-Nx for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:58 -0400 Received: by mail-ed1-x52f.google.com with SMTP id a25so7236798edx.8 for ; Wed, 13 Oct 2021 02:07:54 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id c6sm6177849ejb.41.2021.10.13.02.07.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Oct 2021 02:07:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yk4kcyQ2A5Yj4updooA55fCsiBi5b3aUbtCd8WI+3P0=; b=d2iQkwsjOxRVOvwfFPqCtYXwEtaLru1lW2i3p04fHOPnLy+M22hTQLbDIj7bnaQC+7 go/c6OywzFA7mDGeQvtIWtvKOiSeKsMSVc2/z7YVGXeHrh+PMT4+8PDtV1i6S6cNzjGd c1IHJpkSq8dBvNcyCcBdL8Q89wYaXddZYER+bJF5bVtjDUYIH+276OWUZRcVMGrrqHh+ KlTaUMZyV9rxnjydR1mLKqRSa5MG1MlbfRjToeQ9WKbMxUsYbNawqMSeLbc2TMelme+v 5Rb4ZUwZ51CC03ncSLWXMy0uBs4wioDzJFAZbD5yDnY3TmrF9K8gPl0RaWXiYu5JiXho sQlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=yk4kcyQ2A5Yj4updooA55fCsiBi5b3aUbtCd8WI+3P0=; b=pP87Hb4aPtHLiZg28UxCg6giEj/IH9sRfOKP8QCFgd4z0SyxryPHQRbqNsEiLP8yov 9AW9bjtNXEv3xnJyOEipM8aAfX430QGofbhHT5xFiHfwobGuII04XSeB6wqmZjC7aZxs /g4hk3/S5Q8Gz0rQRLDx/JdAC6ERUOX6hVpAPIMwZk9Dosvr19snzMFH+QCnMN/DxhH8 khb6669o99UgfxLDint6Igp8tONIebeM56bx7JWaKIKNya6ltuodrX7WerRL8xiI2ikk JwmfyKVTJunpHYrg44U3qW4HiQ/0Com7uC7gRpGOsR8DqPynB0tqskftm7KiG1vgkNTm Fjlw== X-Gm-Message-State: AOAM531KALBPKG0HPKLihYQ8MKJbHFyV9jzEG8czR3tMbOXfOZobkgUJ Wumfk4vwL79XbzkWdERnsq3HfQUJsec= X-Google-Smtp-Source: ABdhPJyEwch15Yd2dB1DL8CyDPZs7QTZxvgbyEGHW3vw2VB+uUeKH81R1rAyR8ajtGzzUL5pYWWWtg== X-Received: by 2002:a50:fc8e:: with SMTP id f14mr7821561edq.87.1634116073366; Wed, 13 Oct 2021 02:07:53 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 34/40] hw/i386/sgx: Move qmp_query_sgx_capabilities() to hw/i386/sgx.c Date: Wed, 13 Oct 2021 11:07:22 +0200 Message-Id: <20211013090728.309365-35-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211013090728.309365-1-pbonzini@redhat.com> References: <20211013090728.309365-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::52f; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x52f.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1634117453983100001 From: Philippe Mathieu-Daud=C3=A9 Move qmp_query_sgx_capabilities() from target/i386/monitor.c to hw/i386/sgx.c, removing the sgx_get_capabilities() indirection. Suggested-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20211007175612.496366-4-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- hw/i386/sgx-stub.c | 4 +++- hw/i386/sgx.c | 3 ++- include/hw/i386/sgx.h | 1 - target/i386/monitor.c | 5 ----- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/hw/i386/sgx-stub.c b/hw/i386/sgx-stub.c index 45c473119e..3749656db1 100644 --- a/hw/i386/sgx-stub.c +++ b/hw/i386/sgx-stub.c @@ -2,6 +2,8 @@ #include "hw/i386/pc.h" #include "hw/i386/sgx-epc.h" #include "hw/i386/sgx.h" +#include "qapi/error.h" +#include "qapi/qapi-commands-misc-target.h" =20 SGXInfo *sgx_get_info(Error **errp) { @@ -9,7 +11,7 @@ SGXInfo *sgx_get_info(Error **errp) return NULL; } =20 -SGXInfo *sgx_get_capabilities(Error **errp) +SGXInfo *qmp_query_sgx_capabilities(Error **errp) { error_setg(errp, "SGX support is not compiled in"); return NULL; diff --git a/hw/i386/sgx.c b/hw/i386/sgx.c index 29724ff8f0..713f136343 100644 --- a/hw/i386/sgx.c +++ b/hw/i386/sgx.c @@ -16,6 +16,7 @@ #include "hw/mem/memory-device.h" #include "monitor/qdev.h" #include "qapi/error.h" +#include "qapi/qapi-commands-misc-target.h" #include "exec/address-spaces.h" #include "hw/i386/sgx.h" #include "sysemu/hw_accel.h" @@ -57,7 +58,7 @@ static uint64_t sgx_calc_host_epc_section_size(void) return size; } =20 -SGXInfo *sgx_get_capabilities(Error **errp) +SGXInfo *qmp_query_sgx_capabilities(Error **errp) { SGXInfo *info =3D NULL; uint32_t eax, ebx, ecx, edx; diff --git a/include/hw/i386/sgx.h b/include/hw/i386/sgx.h index 16fc25725c..2bf90b3f4f 100644 --- a/include/hw/i386/sgx.h +++ b/include/hw/i386/sgx.h @@ -7,6 +7,5 @@ #include "qapi/qapi-types-misc-target.h" =20 SGXInfo *sgx_get_info(Error **errp); -SGXInfo *sgx_get_capabilities(Error **errp); =20 #endif diff --git a/target/i386/monitor.c b/target/i386/monitor.c index 680d282591..84fba47f19 100644 --- a/target/i386/monitor.c +++ b/target/i386/monitor.c @@ -700,8 +700,3 @@ void hmp_info_sgx(Monitor *mon, const QDict *qdict) monitor_printf(mon, "size: %" PRIu64 "\n", info->section_size); } - -SGXInfo *qmp_query_sgx_capabilities(Error **errp) -{ - return sgx_get_capabilities(errp); -} --=20 2.31.1 From nobody Thu Apr 25 22:28:17 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1634117821168153.0602441877537; Wed, 13 Oct 2021 02:37:01 -0700 (PDT) Received: from localhost ([::1]:38224 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1maah1-0001CT-Uv for importer@patchew.org; Wed, 13 Oct 2021 05:37:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54904) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1maaEy-0002c0-HM for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:08:00 -0400 Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]:38741) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1maaEt-0005xt-Jv for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:07:59 -0400 Received: by mail-ed1-x536.google.com with SMTP id d9so7275232edh.5 for ; Wed, 13 Oct 2021 02:07:54 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id c6sm6177849ejb.41.2021.10.13.02.07.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Oct 2021 02:07:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=AYqBjtwIP/Y4XBbfbDoadmxylhZu0QmchPu8vr13YfM=; b=aP9c0RYgzBacII6ZVP1c2gxi/9YCHWCIkUQaiUhC9grvkNFK9g5c1TRhpFbA25xehl QdSeGjlLRMiu/tpjlqKBu8qV8RVdOEvIVp9jQi2jWjD6dalFvkQhLmSA9W7Bz9wthNI6 jW5H//7Jr16AbaFbgpykh/GZ81ALDKF/L4Mtf1F5ZbLSYo68xNAYObegsnQTXlCtk66Y N7pk6+c25RgmjWwtNVeyHS/UA2VswYAjXKN2N2zjeZN2oWW5A686NSkb+HDg85fAfE9B VSU/4xwfZcLB/M6nBBLcRAzR5QCHixKaooQM1fzOdkBRjyprt/2O//NS7CUrP0kbtyvu ftJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=AYqBjtwIP/Y4XBbfbDoadmxylhZu0QmchPu8vr13YfM=; b=U7iSnHK78WaJOOj6vA9C7iOeY1PDRjsPuxn6Q+rzjoIVkukfmE1P//u1Oyd7S4zhso v3g+tepTU6AchfiiMAF0z6Q959ZaQFfEgcjOa5EgsmcmzXSaxfWtZ1nMn82PfJx1gohK P5SK/TTOPLz3Gi0pZhQ/gGzkrHWybC8U2nFZotAH6ON+oFUm7yDlXwcg72qRM/RtJfAw WbJcfwwxv94vxOy+pbP8Womwn0+vYMP7ikqbir4878fv5u7fwa2gqoeaiV6G0ba6wFp7 JV1iCXW5OSBVR3WOllUSobsUUBhN4UD+hpURI7heE8wQLMpKiSkBQiA+jC3etFMcqOAC UVCw== X-Gm-Message-State: AOAM530Jzdf5G+aMolVKnSQZmXOCGJHvSRE24pqv8Ex4nO1OujDVSgMv azB9tG4YjEiBap/n85h4Msyz0V1ZyRY= X-Google-Smtp-Source: ABdhPJyT2I/IFMQkL9lXTp1OeyIj+yL8ySzf9aBGOBL+qrDgo03bXiBO5+SVImLbaW9KcBo53TDqdg== X-Received: by 2002:a17:906:ce2c:: with SMTP id sd12mr39685266ejb.488.1634116074059; Wed, 13 Oct 2021 02:07:54 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 35/40] hw/i386/sgx: Move qmp_query_sgx() and hmp_info_sgx() to hw/i386/sgx.c Date: Wed, 13 Oct 2021 11:07:23 +0200 Message-Id: <20211013090728.309365-36-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211013090728.309365-1-pbonzini@redhat.com> References: <20211013090728.309365-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::536; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x536.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1634117821572100001 From: Philippe Mathieu-Daud=C3=A9 Move qmp_query_sgx() and hmp_info_sgx() from target/i386/monitor.c to hw/i386/sgx.c, removing the sgx_get_info() indirection and the "hw/i386/sgx.h" header. Suggested-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20211007175612.496366-5-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- hw/i386/sgx-stub.c | 10 ++++++++-- hw/i386/sgx.c | 26 ++++++++++++++++++++++++-- include/hw/i386/sgx.h | 11 ----------- target/i386/monitor.c | 27 --------------------------- 4 files changed, 32 insertions(+), 42 deletions(-) delete mode 100644 include/hw/i386/sgx.h diff --git a/hw/i386/sgx-stub.c b/hw/i386/sgx-stub.c index 3749656db1..c9b379e665 100644 --- a/hw/i386/sgx-stub.c +++ b/hw/i386/sgx-stub.c @@ -1,11 +1,12 @@ #include "qemu/osdep.h" +#include "monitor/monitor.h" +#include "monitor/hmp-target.h" #include "hw/i386/pc.h" #include "hw/i386/sgx-epc.h" -#include "hw/i386/sgx.h" #include "qapi/error.h" #include "qapi/qapi-commands-misc-target.h" =20 -SGXInfo *sgx_get_info(Error **errp) +SGXInfo *qmp_query_sgx(Error **errp) { error_setg(errp, "SGX support is not compiled in"); return NULL; @@ -17,6 +18,11 @@ SGXInfo *qmp_query_sgx_capabilities(Error **errp) return NULL; } =20 +void hmp_info_sgx(Monitor *mon, const QDict *qdict) +{ + monitor_printf(mon, "SGX is not available in this QEMU\n"); +} + void pc_machine_init_sgx_epc(PCMachineState *pcms) { memset(&pcms->sgx_epc, 0, sizeof(SGXEPCState)); diff --git a/hw/i386/sgx.c b/hw/i386/sgx.c index 713f136343..11607568b6 100644 --- a/hw/i386/sgx.c +++ b/hw/i386/sgx.c @@ -15,10 +15,11 @@ #include "hw/i386/sgx-epc.h" #include "hw/mem/memory-device.h" #include "monitor/qdev.h" +#include "monitor/monitor.h" +#include "monitor/hmp-target.h" #include "qapi/error.h" #include "qapi/qapi-commands-misc-target.h" #include "exec/address-spaces.h" -#include "hw/i386/sgx.h" #include "sysemu/hw_accel.h" =20 #define SGX_MAX_EPC_SECTIONS 8 @@ -86,7 +87,7 @@ SGXInfo *qmp_query_sgx_capabilities(Error **errp) return info; } =20 -SGXInfo *sgx_get_info(Error **errp) +SGXInfo *qmp_query_sgx(Error **errp) { SGXInfo *info =3D NULL; X86MachineState *x86ms; @@ -116,6 +117,27 @@ SGXInfo *sgx_get_info(Error **errp) return info; } =20 +void hmp_info_sgx(Monitor *mon, const QDict *qdict) +{ + Error *err =3D NULL; + g_autoptr(SGXInfo) info =3D qmp_query_sgx(&err); + + if (err) { + error_report_err(err); + return; + } + monitor_printf(mon, "SGX support: %s\n", + info->sgx ? "enabled" : "disabled"); + monitor_printf(mon, "SGX1 support: %s\n", + info->sgx1 ? "enabled" : "disabled"); + monitor_printf(mon, "SGX2 support: %s\n", + info->sgx2 ? "enabled" : "disabled"); + monitor_printf(mon, "FLC support: %s\n", + info->flc ? "enabled" : "disabled"); + monitor_printf(mon, "size: %" PRIu64 "\n", + info->section_size); +} + bool sgx_epc_get_section(int section_nr, uint64_t *addr, uint64_t *size) { PCMachineState *pcms =3D PC_MACHINE(qdev_get_machine()); diff --git a/include/hw/i386/sgx.h b/include/hw/i386/sgx.h deleted file mode 100644 index 2bf90b3f4f..0000000000 --- a/include/hw/i386/sgx.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef QEMU_SGX_H -#define QEMU_SGX_H - -#include "qom/object.h" -#include "qapi/error.h" -#include "qemu/error-report.h" -#include "qapi/qapi-types-misc-target.h" - -SGXInfo *sgx_get_info(Error **errp); - -#endif diff --git a/target/i386/monitor.c b/target/i386/monitor.c index 84fba47f19..8166e17693 100644 --- a/target/i386/monitor.c +++ b/target/i386/monitor.c @@ -34,7 +34,6 @@ #include "qapi/qapi-commands-misc-target.h" #include "qapi/qapi-commands-misc.h" #include "hw/i386/pc.h" -#include "hw/i386/sgx.h" =20 /* Perform linear address sign extension */ static hwaddr addr_canonical(CPUArchState *env, hwaddr addr) @@ -674,29 +673,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"); } - -SGXInfo *qmp_query_sgx(Error **errp) -{ - return sgx_get_info(errp); -} - -void hmp_info_sgx(Monitor *mon, const QDict *qdict) -{ - Error *err =3D NULL; - g_autoptr(SGXInfo) info =3D qmp_query_sgx(&err); - - if (err) { - error_report_err(err); - return; - } - monitor_printf(mon, "SGX support: %s\n", - info->sgx ? "enabled" : "disabled"); - monitor_printf(mon, "SGX1 support: %s\n", - info->sgx1 ? "enabled" : "disabled"); - monitor_printf(mon, "SGX2 support: %s\n", - info->sgx2 ? "enabled" : "disabled"); - monitor_printf(mon, "FLC support: %s\n", - info->flc ? "enabled" : "disabled"); - monitor_printf(mon, "size: %" PRIu64 "\n", - info->section_size); -} --=20 2.31.1 From nobody Thu Apr 25 22:28:17 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1634118161277641.7277424603418; Wed, 13 Oct 2021 02:42:41 -0700 (PDT) Received: from localhost ([::1]:55430 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1maamW-0004Ot-3U for importer@patchew.org; Wed, 13 Oct 2021 05:42:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54914) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1maaEy-0002cV-TI for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:08:06 -0400 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]:42503) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1maaEu-0005z9-S3 for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:08:00 -0400 Received: by mail-ed1-x533.google.com with SMTP id t16so7204876eds.9 for ; Wed, 13 Oct 2021 02:07:55 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id c6sm6177849ejb.41.2021.10.13.02.07.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Oct 2021 02:07:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NeO3EvyOv7NFzaEw8iL4zutsirDjVhen3zbJex2mzhU=; b=FAS2kViGBbTAbjU+oLc5TtpvVQ0oFjPhKmFexZXhdhZjvwCWYtIrENkTQfyWiu5RnA YyF9k7NuoO3WpyPGlM8JuQ4oXrxparplxn+IGEjrBt4aN8qO33GZtD+ugD1sRqf+TKxm zfYIp3PnUl38IJLNr9B4+HfGycOkn45Ug0miSzaZ7ppRWu2aRpkOCmc8DeV52EIBtOIO L7hx92IuFywZhxvVDf7EccpR9++2T/faiy8zrPr1ha3KXVQ4KD5ACsNqZpEclBbFJE7a ybqFMq9JABIR3rLINhDfhlhJhK8mGvyeVQsI7nnDtOUGvMGZJ4TRNhL6iu4AdB362IvU AeIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=NeO3EvyOv7NFzaEw8iL4zutsirDjVhen3zbJex2mzhU=; b=Gy8AoU+RorpRQ78pJ32Oo64AgjFXK1Y23Z7xKUZZ69n6PpG4CKMvcIDkr99+Aej3hK r6HJcZI20d5I+JB4YdmZIBF/L2feF8xjfaBcF0rlKHajCZ0t1eiulfkqhAMI34uqvc+T SzBGnGLZTK8xiuVDDNz0m+ENe/0XzisTlsJ50bHOWNP+esGOMqg8W/xWJ0esoPvJUJAz g+xFs4PUASanDpCebq4mD52NqHhByGvmlElmmsf23mBabVhWdKvG9whVplBdd5swHo7P uohZPokFFO3yJeos3AaivQxr7+nrnGt9YzxDDoDZhC7q2N6FD2XrixL77eho1uB1nPUY yuAA== X-Gm-Message-State: AOAM533k3jna9Juyxdjt8gvALeYvsfDy6P5eZb7+oELU/0PLfXdhYCes k/qUGavqWuUqCD7qZ7e7cpUYhMA1R04= X-Google-Smtp-Source: ABdhPJzJfek99zSOChCQxTrWss3oHl+elKG8D62Yd1gJ+e3lq5qr9gJCTJjVJjcmDJzOq5on1lKSsQ== X-Received: by 2002:a50:d802:: with SMTP id o2mr7432152edj.331.1634116074659; Wed, 13 Oct 2021 02:07:54 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 36/40] Revert "hw/misc: applesmc: use host osk as default on macs" Date: Wed, 13 Oct 2021 11:07:24 +0200 Message-Id: <20211013090728.309365-37-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211013090728.309365-1-pbonzini@redhat.com> References: <20211013090728.309365-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::533; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x533.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1634118162101100001 Content-Type: text/plain; charset="utf-8" This reverts commit 93ddefbc3c909bb6c3b76086f1dfc8ad98dd3725. The commit included code under the APSL 2.0, which is incompatible with the GPL v2. Signed-off-by: Paolo Bonzini --- hw/misc/applesmc.c | 192 +-------------------------------------------- 1 file changed, 1 insertion(+), 191 deletions(-) diff --git a/hw/misc/applesmc.c b/hw/misc/applesmc.c index cec247b5ee..1b9acaf1d3 100644 --- a/hw/misc/applesmc.c +++ b/hw/misc/applesmc.c @@ -38,171 +38,6 @@ #include "qemu/timer.h" #include "qom/object.h" =20 -#if defined(__APPLE__) && defined(__MACH__) -#include - -enum { - kSMCSuccess =3D 0x00, - kSMCKeyNotFound =3D 0x84 -}; - -enum { - kSMCUserClientOpen =3D 0x00, - kSMCUserClientClose =3D 0x01, - kSMCHandleYPCEvent =3D 0x02, - kSMCReadKey =3D 0x05, - kSMCGetKeyInfo =3D 0x09 -}; - -typedef struct SMCVersion { - uint8_t major; - uint8_t minor; - uint8_t build; - uint8_t reserved; - uint16_t release; -} SMCVersion; - -typedef struct SMCPLimitData { - uint16_t version; - uint16_t length; - uint32_t cpuPLimit; - uint32_t gpuPLimit; - uint32_t memPLimit; -} SMCPLimitData; - -typedef struct SMCKeyInfoData { - IOByteCount dataSize; - uint32_t dataType; - uint8_t dataAttributes; -} SMCKeyInfoData; - -typedef struct { - uint32_t key; - SMCVersion vers; - SMCPLimitData pLimitData; - SMCKeyInfoData keyInfo; - uint8_t result; - uint8_t status; - uint8_t data8; - uint32_t data32; - uint8_t bytes[32]; -} SMCParamStruct; - -static IOReturn smc_call_struct_method(uint32_t selector, - SMCParamStruct *inputStruct, - SMCParamStruct *outputStruct) -{ - IOReturn ret; - - size_t inputStructCnt =3D sizeof(SMCParamStruct); - size_t outputStructCnt =3D sizeof(SMCParamStruct); - - io_service_t smcService =3D IO_OBJECT_NULL; - io_connect_t smcConnect =3D IO_OBJECT_NULL; - - smcService =3D IOServiceGetMatchingService(kIOMasterPortDefault, - IOServiceMatching("AppleSMC")= ); - if (smcService =3D=3D IO_OBJECT_NULL) { - ret =3D kIOReturnNotFound; - goto exit; - } - - ret =3D IOServiceOpen(smcService, mach_task_self(), 1, &smcConnect); - if (ret !=3D kIOReturnSuccess) { - smcConnect =3D IO_OBJECT_NULL; - goto exit; - } - if (smcConnect =3D=3D IO_OBJECT_NULL) { - ret =3D kIOReturnError; - goto exit; - } - - ret =3D IOConnectCallMethod(smcConnect, kSMCUserClientOpen, - NULL, 0, NULL, 0, - NULL, NULL, NULL, NULL); - if (ret !=3D kIOReturnSuccess) { - goto exit; - } - - ret =3D IOConnectCallStructMethod(smcConnect, selector, - inputStruct, inputStructCnt, - outputStruct, &outputStructCnt); - -exit: - if (smcConnect !=3D IO_OBJECT_NULL) { - IOConnectCallMethod(smcConnect, kSMCUserClientClose, - NULL, 0, NULL, 0, NULL, - NULL, NULL, NULL); - IOServiceClose(smcConnect); - } - - return ret; -} - -static IOReturn smc_read_key(uint32_t key, - uint8_t *bytes, - IOByteCount *dataSize) -{ - IOReturn ret; - - SMCParamStruct inputStruct; - SMCParamStruct outputStruct; - - if (key =3D=3D 0 || bytes =3D=3D NULL) { - ret =3D kIOReturnCannotWire; - goto exit; - } - - /* determine key's data size */ - memset(&inputStruct, 0, sizeof(SMCParamStruct)); - inputStruct.data8 =3D kSMCGetKeyInfo; - inputStruct.key =3D key; - - memset(&outputStruct, 0, sizeof(SMCParamStruct)); - ret =3D smc_call_struct_method(kSMCHandleYPCEvent, &inputStruct, &outp= utStruct); - if (ret !=3D kIOReturnSuccess) { - goto exit; - } - if (outputStruct.result =3D=3D kSMCKeyNotFound) { - ret =3D kIOReturnNotFound; - goto exit; - } - if (outputStruct.result !=3D kSMCSuccess) { - ret =3D kIOReturnInternalError; - goto exit; - } - - /* get key value */ - memset(&inputStruct, 0, sizeof(SMCParamStruct)); - inputStruct.data8 =3D kSMCReadKey; - inputStruct.key =3D key; - inputStruct.keyInfo.dataSize =3D outputStruct.keyInfo.dataSize; - - memset(&outputStruct, 0, sizeof(SMCParamStruct)); - ret =3D smc_call_struct_method(kSMCHandleYPCEvent, &inputStruct, &outp= utStruct); - if (ret !=3D kIOReturnSuccess) { - goto exit; - } - if (outputStruct.result =3D=3D kSMCKeyNotFound) { - ret =3D kIOReturnNotFound; - goto exit; - } - if (outputStruct.result !=3D kSMCSuccess) { - ret =3D kIOReturnInternalError; - goto exit; - } - - memset(bytes, 0, *dataSize); - if (*dataSize > inputStruct.keyInfo.dataSize) { - *dataSize =3D inputStruct.keyInfo.dataSize; - } - memcpy(bytes, outputStruct.bytes, *dataSize); - -exit: - return ret; -} -#endif - /* #define DEBUG_SMC */ =20 #define APPLESMC_DEFAULT_IOBASE 0x300 @@ -480,7 +315,6 @@ static const MemoryRegionOps applesmc_err_io_ops =3D { static void applesmc_isa_realize(DeviceState *dev, Error **errp) { AppleSMCState *s =3D APPLE_SMC(dev); - bool valid_key =3D false; =20 memory_region_init_io(&s->io_data, OBJECT(s), &applesmc_data_io_ops, s, "applesmc-data", 1); @@ -497,31 +331,7 @@ static void applesmc_isa_realize(DeviceState *dev, Err= or **errp) isa_register_ioport(&s->parent_obj, &s->io_err, s->iobase + APPLESMC_ERR_PORT); =20 - if (s->osk) { - valid_key =3D strlen(s->osk) =3D=3D 64; - } else { -#if defined(__APPLE__) && defined(__MACH__) - IOReturn ret; - IOByteCount size =3D 32; - - ret =3D smc_read_key('OSK0', (uint8_t *) default_osk, &size); - if (ret !=3D kIOReturnSuccess) { - goto failure; - } - - ret =3D smc_read_key('OSK1', (uint8_t *) default_osk + size, &size= ); - if (ret !=3D kIOReturnSuccess) { - goto failure; - } - - warn_report("Using AppleSMC with host key"); - valid_key =3D true; - s->osk =3D default_osk; -failure:; -#endif - } - - if (!valid_key) { + if (!s->osk || (strlen(s->osk) !=3D 64)) { warn_report("Using AppleSMC with invalid key"); s->osk =3D default_osk; } --=20 2.31.1 From nobody Thu Apr 25 22:28:17 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1634118483959937.9963810084697; Wed, 13 Oct 2021 02:48:03 -0700 (PDT) Received: from localhost ([::1]:40242 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1maari-0004im-T0 for importer@patchew.org; Wed, 13 Oct 2021 05:48:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54920) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1maaEz-0002cW-BE for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:08:06 -0400 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]:46993) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1maaEu-0005zc-Vf for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:08:01 -0400 Received: by mail-ed1-x531.google.com with SMTP id z20so7133128edc.13 for ; Wed, 13 Oct 2021 02:07:56 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id c6sm6177849ejb.41.2021.10.13.02.07.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Oct 2021 02:07:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0p6Xy3m/q/Jw9/CEOKm+gyba6CHxYqCDNm/LIuD+WsE=; b=U9UH7fWTuqWmMC/IGtuL9mPzj0m7lqwYGhLmk/hQjyni+2ucKQ6cfPiJurjtaa23yD xh0mcQ23iHiQBNKl3UjSz9nbkyJpkjJPWdhZG/QEhTFV5p54fMHRNWugrsTLzG8WfkBq 9ngsxEuQxO8xkMzh2slE9BYeSuzx2JIf+/P5JRTdizuVbSOnfDOcwat5/3M/0X5aVKMS i1BzL6mFQwWXQVKjlSZz4lqbXpUljd/inlHYbDcUoqgYCg1UF8+mH6v482dFVnVJwBXc RRb7JiPN51fyERUfRzDLhfiAM/gVZwf4fU8P5BuOu1DZb5+mnyQQUP5iO2rR27wgQ7td QmZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=0p6Xy3m/q/Jw9/CEOKm+gyba6CHxYqCDNm/LIuD+WsE=; b=3iF91EEf2GNS060q5BdK8sabfPsHfOPsMa/IE02DIp+UTYnai0QcftDKPAjWxfKp2v +WpoZgjgmgIakI70i9g+guoNE5giTfT18vPnFl/YSR8GRJBae+yiazVlt8k5+6CI3zQD ZDkpIgmpKPWqVHFq+tC3Xaijax5LzTNr6kp3d37eU7IlxACTN0LTAWSJPMivHEXqbdtN Atd21EqeULDuxQuxKe3H1CHFscxvBTC7UKp0F5zJsBSxolTIMz5PXz/B3dhnldmwVpE8 X2AIR0DsZJH/9OjQ6R8JJhqY6ENsz9SOtdBO9qSGE2nlCfw3qBui2c6wk20Org4f8Wew UgNw== X-Gm-Message-State: AOAM530vPj4EimdPXTaPSQzlW+gEHEZHGBc6OTK1hI8OUfF12L0wOzbx qSbT67lC9lrZg8A+NfbdobEmnDixWkE= X-Google-Smtp-Source: ABdhPJwf+gQbmOMwDdKFNuXodTbtxF2CngOME6P9thpG9OECIQUlu+tec4IL+chk3rxE9rn6v9rqAw== X-Received: by 2002:a17:906:ccde:: with SMTP id ot30mr17459446ejb.121.1634116075336; Wed, 13 Oct 2021 02:07:55 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 37/40] monitor: Tidy up find_device_state() Date: Wed, 13 Oct 2021 11:07:25 +0200 Message-Id: <20211013090728.309365-38-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211013090728.309365-1-pbonzini@redhat.com> References: <20211013090728.309365-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::531; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x531.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Damien Hedde , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1634118485920100001 From: Markus Armbruster Commit 6287d827d4 "monitor: allow device_del to accept QOM paths" extended find_device_state() to accept QOM paths in addition to qdev IDs. This added a checked conversion to TYPE_DEVICE at the end, which duplicates the check done for the qdev ID case earlier, except it sets a *different* error: GenericError "ID is not a hotpluggable device" when passed a QOM path, and DeviceNotFound "Device 'ID' not found" when passed a qdev ID. Fortunately, the latter won't happen as long as we add only devices to /machine/peripheral/. Earlier, commit b6cc36abb2 "qdev: device_del: Search for to be unplugged device in 'peripheral' container" rewrote the lookup by qdev ID to use QOM instead of qdev_find_recursive(), so it can handle buss-less devices. It does so by constructing an absolute QOM path. Works, but object_resolve_path_component() is easier. Switching to it also gets rid of the unclean duplication described above. While there, avoid converting to TYPE_DEVICE twice, first to check whether it's possible, and then for real. Signed-off-by: Markus Armbruster Reviewed-by: Damien Hedde Reviewed-by: Daniel P. Berrang=C3=A9 Message-Id: <20210916111707.84999-1-armbru@redhat.com> Signed-off-by: Paolo Bonzini --- softmmu/qdev-monitor.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/softmmu/qdev-monitor.c b/softmmu/qdev-monitor.c index 0705f00846..3df99ce9fc 100644 --- a/softmmu/qdev-monitor.c +++ b/softmmu/qdev-monitor.c @@ -836,16 +836,12 @@ void qmp_device_add(QDict *qdict, QObject **ret_data,= Error **errp) static DeviceState *find_device_state(const char *id, Error **errp) { Object *obj; + DeviceState *dev; =20 if (id[0] =3D=3D '/') { obj =3D object_resolve_path(id, NULL); } else { - char *root_path =3D object_get_canonical_path(qdev_get_peripheral(= )); - char *path =3D g_strdup_printf("%s/%s", root_path, id); - - g_free(root_path); - obj =3D object_resolve_path_type(path, TYPE_DEVICE, NULL); - g_free(path); + obj =3D object_resolve_path_component(qdev_get_peripheral(), id); } =20 if (!obj) { @@ -854,12 +850,13 @@ static DeviceState *find_device_state(const char *id,= Error **errp) return NULL; } =20 - if (!object_dynamic_cast(obj, TYPE_DEVICE)) { + dev =3D (DeviceState *)object_dynamic_cast(obj, TYPE_DEVICE); + if (!dev) { error_setg(errp, "%s is not a hotpluggable device", id); return NULL; } =20 - return DEVICE(obj); + return dev; } =20 void qdev_unplug(DeviceState *dev, Error **errp) --=20 2.31.1 From nobody Thu Apr 25 22:28:17 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1634117949472577.5759584645747; Wed, 13 Oct 2021 02:39:09 -0700 (PDT) Received: from localhost ([::1]:46882 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1maaj6-0006wY-9v for importer@patchew.org; Wed, 13 Oct 2021 05:39:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54934) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1maaF0-0002cZ-9l for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:08:06 -0400 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]:43718) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1maaEv-0005zp-ID for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:08:01 -0400 Received: by mail-ed1-x532.google.com with SMTP id i20so7138765edj.10 for ; Wed, 13 Oct 2021 02:07:56 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id c6sm6177849ejb.41.2021.10.13.02.07.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Oct 2021 02:07:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=armVoq3TN3IYSGrDgw8VqfJc8agou8DDdYHEuf07qwY=; b=GqZmrBLCTj55qaFEA+p1fP2RBWsvyUApTzoHb95M2oCuTaCnp/huHdud2Wj3UFW8Jb a70z168ALbdS1xCIeGu1Vcmd7pGblANZiYc4kZRRGzaQKRgwpOabkK9H3rO5XKtMzQ4x WXJ1IzBXi72enXAUas36mI6Iy8NkayX57r6t+2or3lVv5S/ggyOEV2UyClRLYf1Mbzgd WxMT/7Z6J9DbWJ+V+P8gqy8rNVPiyRixWhxEW4vZdmortWbaHhthuiOGUzhxFgvAbNQG LImfdmyvx9DrwQOEOh2kcudGbMqABm2tHiLR9gAsAb1jf7Rto5b16jzOj6MerVzFk6Ys 0juA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=armVoq3TN3IYSGrDgw8VqfJc8agou8DDdYHEuf07qwY=; b=koMH2OURFN64DxRyCkagMDUAa+MKw2r9a+Ln96ID3mKoLY07Rko2B77dZ6FI3JJztW H4mitKJMc0OkKovcmbGs5Ktm+Dr0//J1DYOC8e7sFdNdGrtsJMvS3e+VH4Y8cVxotIn2 VGWKgsPgbUMxlp+YxT1s1cAr5jxXxsZLAiXyYeBAYJb7buKCxDZKEHvsw6IBB5gWa27x +lsUCCrJGimw6lKgGE4FsuzxUHQrcUUqVytu9dOO9vxyz18SWWKtT2Wu2xARBT7xasT/ VCubhvrVyCVNleSniHmIAYroGxUH+EWfT33zTrG2HgwE3YAw/kT4sguzZNPs4xmKK8GK i9oA== X-Gm-Message-State: AOAM5316IESDRhu1w0LOQ3C3GqNUJKVi+Ub/CH+xyTJMuU9SrE5gw1pl 7thLpkLsnJ6V5+Wt2/tRzFFmODaJGsE= X-Google-Smtp-Source: ABdhPJyMdpUwoJ7/ueDferHasYEX0qA96qizybafZLGWLwZ6G9orc+fb1UNp6HkMSxonPAlE2f8sjg== X-Received: by 2002:a17:907:629b:: with SMTP id nd27mr38775100ejc.24.1634116076010; Wed, 13 Oct 2021 02:07:56 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 38/40] target/i386/sev: Use local variable for kvm_sev_launch_start Date: Wed, 13 Oct 2021 11:07:26 +0200 Message-Id: <20211013090728.309365-39-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211013090728.309365-1-pbonzini@redhat.com> References: <20211013090728.309365-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::532; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x532.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dov Murik , "Dr . David Alan Gilbert" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1634117951454100003 Content-Type: text/plain; charset="utf-8" From: Dov Murik The struct kvm_sev_launch_start has a constant and small size, and therefore we can use a regular local variable for it instead of allocating and freeing heap memory for it. Signed-off-by: Dov Murik Reviewed-by: Dr. David Alan Gilbert Message-Id: <20211011173026.2454294-2-dovmurik@linux.ibm.com> Signed-off-by: Paolo Bonzini --- target/i386/sev.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/target/i386/sev.c b/target/i386/sev.c index 4c64c68244..0062566c71 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -647,31 +647,29 @@ sev_launch_start(SevGuestState *sev) gsize sz; int ret =3D 1; int fw_error, rc; - struct kvm_sev_launch_start *start; + struct kvm_sev_launch_start start =3D { + .handle =3D sev->handle, .policy =3D sev->policy + }; guchar *session =3D NULL, *dh_cert =3D NULL; =20 - start =3D g_new0(struct kvm_sev_launch_start, 1); - - start->handle =3D sev->handle; - start->policy =3D sev->policy; if (sev->session_file) { if (sev_read_file_base64(sev->session_file, &session, &sz) < 0) { goto out; } - start->session_uaddr =3D (unsigned long)session; - start->session_len =3D sz; + start.session_uaddr =3D (unsigned long)session; + start.session_len =3D sz; } =20 if (sev->dh_cert_file) { if (sev_read_file_base64(sev->dh_cert_file, &dh_cert, &sz) < 0) { goto out; } - start->dh_uaddr =3D (unsigned long)dh_cert; - start->dh_len =3D sz; + start.dh_uaddr =3D (unsigned long)dh_cert; + start.dh_len =3D sz; } =20 - trace_kvm_sev_launch_start(start->policy, session, dh_cert); - rc =3D sev_ioctl(sev->sev_fd, KVM_SEV_LAUNCH_START, start, &fw_error); + trace_kvm_sev_launch_start(start.policy, session, dh_cert); + rc =3D sev_ioctl(sev->sev_fd, KVM_SEV_LAUNCH_START, &start, &fw_error); if (rc < 0) { error_report("%s: LAUNCH_START ret=3D%d fw_error=3D%d '%s'", __func__, ret, fw_error, fw_error_to_str(fw_error)); @@ -679,11 +677,10 @@ sev_launch_start(SevGuestState *sev) } =20 sev_set_guest_state(sev, SEV_STATE_LAUNCH_UPDATE); - sev->handle =3D start->handle; + sev->handle =3D start.handle; ret =3D 0; =20 out: - g_free(start); g_free(session); g_free(dh_cert); return ret; --=20 2.31.1 From nobody Thu Apr 25 22:28:17 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1634117821268736.1390349882781; Wed, 13 Oct 2021 02:37:01 -0700 (PDT) Received: from localhost ([::1]:38260 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1maah2-0001Dl-4H for importer@patchew.org; Wed, 13 Oct 2021 05:37:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54958) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1maaF3-0002cc-5G for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:08:06 -0400 Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]:37555) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1maaEw-00060h-54 for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:08:02 -0400 Received: by mail-ed1-x52e.google.com with SMTP id y12so7311333eda.4 for ; Wed, 13 Oct 2021 02:07:57 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id c6sm6177849ejb.41.2021.10.13.02.07.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Oct 2021 02:07:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=vKFmsuwtEO4oTw2mau37Wrts+wYFtIMjBXD7rlwLojc=; b=pP8CTXibWoir+5FrMD4m8pZVrRwrIEEoAnKXk83I4Zd5kn4KEwCX05Isv6wvFQ9xsc EebyRKop+9wT3Rbth1PK2jz5daE0FcYB+FZTtSpamiTpiJLILxwbk+tR+UQ1QHwc77ed 2XpKnHRUAstZ2PMtclg0J35g7yVQhtzixjHD9TGTRiKUw9XCZ1bNVqRTqNporgnHXt/8 atryd2AzDfcPATtGx9Af8OZfnP7F/UXWppEnIpxmJmADWBBjgNc5ZJvS/wNStr2S346Q OsIXhakPfMTLV8aiHnQruNQLL1nk4pdg3hN3juf1wKmkUOd4rekHkSO9Syz+BGUNGEc/ GbnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=vKFmsuwtEO4oTw2mau37Wrts+wYFtIMjBXD7rlwLojc=; b=7H7unQBtc0P3ZFPKNqUVxk/VZVEv/K1pqfPcNyHgktAXvX3Gp5U0iZlpoY4oX+LLw2 ozpXQuYfODIWYGY8xBG3gFoEqagSqJUPF9LZ6oix9nbMRmYAH4uNWFH3aS/V2eeLjSm1 EVPs6hAIkSIeQWAxxah5dd8Ki4iuEUaH13YjdKwsjDntEYwDXE81S3LL2rLFa5NMMEcX URXLaWhkVfFVeIzCmzEDX5G3Dwg1FJ+VZbFdYVdWk22eXRkyPIgHba/aF4ANYTcUAM1p gQ1sOekOTtMGPKFl/IEUWTm3hCnal1aWnEZL8Rje4dQX2N6d8fM/MC1WXjp+r1NNeTpx I98w== X-Gm-Message-State: AOAM533HOncw6twNk+yfu4+ipNBlMDw/jhgcHmbYhUpOYq1240JZ0dF0 HWdVO04MvbtXpDnYRZBNZ9CtWI1pz0g= X-Google-Smtp-Source: ABdhPJy7ncYHvSpS+DcCdLCSO/FoWp8krjaTOL4Qc299hLkXD4hRujZzEXOehA+Qa7DFrQErbBV3TA== X-Received: by 2002:a17:906:2757:: with SMTP id a23mr24505819ejd.230.1634116076724; Wed, 13 Oct 2021 02:07:56 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 39/40] target/i386/sev: Use local variable for kvm_sev_launch_measure Date: Wed, 13 Oct 2021 11:07:27 +0200 Message-Id: <20211013090728.309365-40-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211013090728.309365-1-pbonzini@redhat.com> References: <20211013090728.309365-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::52e; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x52e.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dov Murik , "Dr . David Alan Gilbert" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1634117823479100003 Content-Type: text/plain; charset="utf-8" From: Dov Murik The struct kvm_sev_launch_measure has a constant and small size, and therefore we can use a regular local variable for it instead of allocating and freeing heap memory for it. Signed-off-by: Dov Murik Reviewed-by: Dr. David Alan Gilbert Message-Id: <20211011173026.2454294-3-dovmurik@linux.ibm.com> Signed-off-by: Paolo Bonzini --- target/i386/sev.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/target/i386/sev.c b/target/i386/sev.c index 0062566c71..eede07f11d 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -729,7 +729,7 @@ sev_launch_get_measure(Notifier *notifier, void *unused) SevGuestState *sev =3D sev_guest; int ret, error; g_autofree guchar *data =3D NULL; - g_autofree struct kvm_sev_launch_measure *measurement =3D NULL; + struct kvm_sev_launch_measure measurement =3D {}; =20 if (!sev_check_state(sev, SEV_STATE_LAUNCH_UPDATE)) { return; @@ -743,23 +743,21 @@ sev_launch_get_measure(Notifier *notifier, void *unus= ed) } } =20 - measurement =3D g_new0(struct kvm_sev_launch_measure, 1); - /* query the measurement blob length */ ret =3D sev_ioctl(sev->sev_fd, KVM_SEV_LAUNCH_MEASURE, - measurement, &error); - if (!measurement->len) { + &measurement, &error); + if (!measurement.len) { error_report("%s: LAUNCH_MEASURE ret=3D%d fw_error=3D%d '%s'", __func__, ret, error, fw_error_to_str(errno)); return; } =20 - data =3D g_new0(guchar, measurement->len); - measurement->uaddr =3D (unsigned long)data; + data =3D g_new0(guchar, measurement.len); + measurement.uaddr =3D (unsigned long)data; =20 /* get the measurement blob */ ret =3D sev_ioctl(sev->sev_fd, KVM_SEV_LAUNCH_MEASURE, - measurement, &error); + &measurement, &error); if (ret) { error_report("%s: LAUNCH_MEASURE ret=3D%d fw_error=3D%d '%s'", __func__, ret, error, fw_error_to_str(errno)); @@ -769,7 +767,7 @@ sev_launch_get_measure(Notifier *notifier, void *unused) sev_set_guest_state(sev, SEV_STATE_LAUNCH_SECRET); =20 /* encode the measurement value and emit the event */ - sev->measurement =3D g_base64_encode(data, measurement->len); + sev->measurement =3D g_base64_encode(data, measurement.len); trace_kvm_sev_launch_measurement(sev->measurement); } =20 --=20 2.31.1 From nobody Thu Apr 25 22:28:17 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1634117948814459.82087602044453; Wed, 13 Oct 2021 02:39:08 -0700 (PDT) Received: from localhost ([::1]:46852 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1maaj5-0006ux-ET for importer@patchew.org; Wed, 13 Oct 2021 05:39:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54956) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1maaF3-0002cb-5n for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:08:06 -0400 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]:37558) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1maaEw-00061T-Jx for qemu-devel@nongnu.org; Wed, 13 Oct 2021 05:08:03 -0400 Received: by mail-ed1-x531.google.com with SMTP id y12so7311428eda.4 for ; Wed, 13 Oct 2021 02:07:58 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id c6sm6177849ejb.41.2021.10.13.02.07.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Oct 2021 02:07:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MJWSAS/jciDvzJRMQ0t1rHf+V8crwNUmrK8Gn4OaQNM=; b=JsMq/xb9KtoFerauoxOUnrskHcjqWbifKI/WZK2MKp8yCA7Yy6KfRbgm/aEeE/F5Oq r2SkqCqOdgkesHq2wCYElevBHwl7JVG7s4tRqPXL2W/mAiNZvOlTlv2y6l1dduFQYEsX 7pa1m1loxmE3xP1KZPgBvaJ0H9pGgsN/v9zNlI+BQx2nz5I7vHWRn4u49um6uiRmCdEV lIldqSpsoFiTxA6KnXdvIA93bjxUPxT0LJOzDVHpjIz0MQinZN/V+zPDa74ec7KhOrPS iElx2g+KaHHO2t+xBFYeFZdZUcpx4bWguXT84Mc+J9AJKtfh7+6w5VMtBGnmyqB/xqeZ L1QQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=MJWSAS/jciDvzJRMQ0t1rHf+V8crwNUmrK8Gn4OaQNM=; b=eTEkZ0Os1k8U7/nkwuJauP9eKXUET6jca/+GvrC7SkqGM7RMMWXvo+E8d+/Xhvz1rG 8LZQkrQol9KtS4cTZdtw056eH7d8pa6NknTFRp8q/YzTb8rGTlqNY3ZAbVpLi9j7zjg8 3lySnA17AFm60/M525Zg9DZ+uXpSuM/vb6VY2xJBOc7rS5V3wxvdN6gLf6Qpx+QGkXjM U4GGpFLvbi2m4W5eHFafcXLAJW9kIm5IZ9Px7c5RtQThpBw1zqyK+Qsmf87DCp4sH7cJ SbA4wfJrMh8+Z5LYgJDp2hH4QJX5Crqw9k5cMi5w5LggXqGXVJy9og7I3UZ6hNTie4ts dw7w== X-Gm-Message-State: AOAM530YIeD0ecjx5jYTvdhiF+3xh+AgVZkQVb/stWnzTt8Pj1VcGjl9 MnMkyaT3v8u2lo5ijT/tvJrd/mnnx44= X-Google-Smtp-Source: ABdhPJxk00ryMgVUL6KChEKLa/ADQ35AGblJyk3CxUc0Jv8L3b6NZUlEdimpr8qpQ145kYVLQ247eg== X-Received: by 2002:a05:6402:11d4:: with SMTP id j20mr7705701edw.267.1634116077326; Wed, 13 Oct 2021 02:07:57 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 40/40] ebpf: really include it only in system emulators Date: Wed, 13 Oct 2021 11:07:28 +0200 Message-Id: <20211013090728.309365-41-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211013090728.309365-1-pbonzini@redhat.com> References: <20211013090728.309365-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::531; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x531.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1634117949505100001 eBPF libraries are being included in user emulators, which is useless and also breaks --static compilation if a shared library for libbpf is present in the system. Reported-by: Alex Benn=C3=A9e Signed-off-by: Paolo Bonzini --- meson.build | 2 -- 1 file changed, 2 deletions(-) diff --git a/meson.build b/meson.build index 2d373a61a6..c1314baace 100644 --- a/meson.build +++ b/meson.build @@ -2300,8 +2300,6 @@ subdir('bsd-user') subdir('linux-user') subdir('ebpf') =20 -common_ss.add(libbpf) - bsd_user_ss.add(files('gdbstub.c')) specific_ss.add_all(when: 'CONFIG_BSD_USER', if_true: bsd_user_ss) =20 --=20 2.31.1