From nobody Thu May 9 05:51:05 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 1633456167525159.15315081820097; Tue, 5 Oct 2021 10:49:27 -0700 (PDT) Received: from localhost ([::1]:59840 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mXoZC-0006Xb-Fz for importer@patchew.org; Tue, 05 Oct 2021 13:49:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45014) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mXnYA-0007oF-4e for qemu-devel@nongnu.org; Tue, 05 Oct 2021 12:44:18 -0400 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]:43743) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mXnY5-0003sj-Nz for qemu-devel@nongnu.org; Tue, 05 Oct 2021 12:44:17 -0400 Received: by mail-ed1-x52d.google.com with SMTP id p11so1202723edy.10 for ; Tue, 05 Oct 2021 09:44:13 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id x14sm6101392edd.25.2021.10.05.09.44.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Oct 2021 09:44:11 -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=6TvpJNG/slIkrin+hkmKbZdjUk1wAScZU5uZgiSk3LM=; b=OY1UkgI1s5xhY025AvIlekdoZMVej7SY/E96hmzpCHROBJGfujvWMIVkQWfMfcOkts q99ITR1WLDzIbj77LCmAomgcCqym379slZmll/w4Aot7Uhdwh5B46KFB2HP+LmSrqLUR skG/+hPfk7EF9FNx2+SRPIbhETbIdqJrR1xRKQNvSTPwYg9BHxYz1r9HSHC49JmjtFaT u2VUvlzIUZiW5/w0R1POp0Kx9VCXoBwnYpWOyYfu9PhFi4X1HPUunJZiDtlMn5cdiuVx kGjfnbRW1xD9YDKuNWPTnQZ/tf81FKBXBPBaCAqFYPY3HqH6PPGUXakWdJgPLN8lWvvR Hapw== 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=6TvpJNG/slIkrin+hkmKbZdjUk1wAScZU5uZgiSk3LM=; b=Te+8M0R658vcPohG6FfT2CwpSA+zsgTUbuvKWALZfo2jskJGy5JcoLto8g51KK1RIa c+YADmYFXUIY3Wv36xldeZTNW3i0qZlktesnLQob7L96Qyl30+Xc/c2KuzGZ7pCFkJkJ ey7jnLGDWZGg+bUsWtkRmdqpUHmncobg/6A2hvInfpSwtESYs41c8zfoHetvZxGAgdM3 glFnzCg190jgbejF9uE+XBCdx/8M6i8HuqqqWHj9SJKyrsmQbZH0IqO6jkKcVZt6s2m+ xRzv+vtZrg9O0DCPz0vz4u+hklPxw4zc8Qqd2f3gUkC05oRXbLuvVDv/OtO5pdnaiGeB qsbg== X-Gm-Message-State: AOAM530fJ6Gh+LGYkG85rdrDKGyMm2MamCvIw5g3XBm0GDwM4r6e7Knn cd3dWY9U/DAOHPSaOrQcHuk+MSaX5rQ= X-Google-Smtp-Source: ABdhPJyKUTiej7y/KMy++BFFEV8jzjVHqDl8RDIk0mLgk2WylrVPLzaidoqQaF5AQuQQuUxtB3XLew== X-Received: by 2002:aa7:d7d2:: with SMTP id e18mr5880900eds.126.1633452252172; Tue, 05 Oct 2021 09:44:12 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 01/12] i386: docs: Briefly describe KVM PV features Date: Tue, 5 Oct 2021 18:43:57 +0200 Message-Id: <20211005164408.288128-2-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211005164408.288128-1-pbonzini@redhat.com> References: <20211005164408.288128-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::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.249, 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: Vitaly Kuznetsov 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: 1633456169507100001 Content-Type: text/plain; charset="utf-8" From: Vitaly Kuznetsov KVM PV features don't seem to be documented anywhere, in particular, the fact that some of the features are enabled by default and some are not can only be figured out from the code. Signed-off-by: Vitaly Kuznetsov Message-Id: <20211004140445.624875-1-vkuznets@redhat.com> Signed-off-by: Paolo Bonzini --- docs/system/i386/kvm-pv.rst | 100 ++++++++++++++++++++++++++++++++++++ docs/system/target-i386.rst | 1 + 2 files changed, 101 insertions(+) create mode 100644 docs/system/i386/kvm-pv.rst diff --git a/docs/system/i386/kvm-pv.rst b/docs/system/i386/kvm-pv.rst new file mode 100644 index 0000000000..1e5a9923ef --- /dev/null +++ b/docs/system/i386/kvm-pv.rst @@ -0,0 +1,100 @@ +Paravirtualized KVM features +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D + +Description +----------- + +In some cases when implementing hardware interfaces in software is slow, `= `KVM`` +implements its own paravirtualized interfaces. + +Setup +----- + +Paravirtualized ``KVM`` features are represented as CPU flags. The followi= ng +features are enabled by default for any CPU model when ``KVM`` acceleratio= n is +enabled: + +- ``kvmclock`` +- ``kvm-nopiodelay`` +- ``kvm-asyncpf`` +- ``kvm-steal-time`` +- ``kvm-pv-eoi`` +- ``kvmclock-stable-bit`` + +``kvm-msi-ext-dest-id`` feature is enabled by default in x2apic mode with = split +irqchip (e.g. "-machine ...,kernel-irqchip=3Dsplit -cpu ...,x2apic"). + +Note: when CPU model ``host`` is used, QEMU passes through all supported +paravirtualized ``KVM`` features to the guest. + +Existing features +----------------- + +``kvmclock`` + Expose a ``KVM`` specific paravirtualized clocksource to the guest. Supp= orted + since Linux v2.6.26. + +``kvm-nopiodelay`` + The guest doesn't need to perform delays on PIO operations. Supported si= nce + Linux v2.6.26. + +``kvm-mmu`` + This feature is deprecated. + +``kvm-asyncpf`` + Enable asynchronous page fault mechanism. Supported since Linux v2.6.38. + Note: since Linux v5.10 the feature is deprecated and not enabled by ``K= VM``. + Use ``kvm-asyncpf-int`` instead. + +``kvm-steal-time`` + Enable stolen (when guest vCPU is not running) time accounting. Supported + since Linux v3.1. + +``kvm-pv-eoi`` + Enable paravirtualized end-of-interrupt signaling. Supported since Linux + v3.10. + +``kvm-pv-unhalt`` + Enable paravirtualized spinlocks support. Supported since Linux v3.12. + +``kvm-pv-tlb-flush`` + Enable paravirtualized TLB flush mechanism. Supported since Linux v4.16. + +``kvm-pv-ipi`` + Enable paravirtualized IPI mechanism. Supported since Linux v4.19. + +``kvm-poll-control`` + Enable host-side polling on HLT control from the guest. Supported since = Linux + v5.10. + +``kvm-pv-sched-yield`` + Enable paravirtualized sched yield feature. Supported since Linux v5.10. + +``kvm-asyncpf-int`` + Enable interrupt based asynchronous page fault mechanism. Supported sinc= e Linux + v5.10. + +``kvm-msi-ext-dest-id`` + Support 'Extended Destination ID' for external interrupts. The feature a= llows + to use up to 32768 CPUs without IRQ remapping (but other limits may appl= y making + the number of supported vCPUs for a given configuration lower). Supporte= d since + Linux v5.10. + +``kvmclock-stable-bit`` + Tell the guest that guest visible TSC value can be fully trusted for kvm= clock + computations and no warps are expected. Supported since Linux v2.6.35. + +Supplementary features +---------------------- + +``kvm-pv-enforce-cpuid`` + Limit the supported paravirtualized feature set to the exposed features = only. + Note, by default, ``KVM`` allows the guest to use all currently supported + paravirtualized features even when they were not announced in guest visi= ble + CPUIDs. Supported since Linux v5.10. + + +Useful links +------------ + +Please refer to Documentation/virt/kvm in Linux for additional details. diff --git a/docs/system/target-i386.rst b/docs/system/target-i386.rst index 6a86d63863..4daa53c35d 100644 --- a/docs/system/target-i386.rst +++ b/docs/system/target-i386.rst @@ -26,6 +26,7 @@ Architectural features :maxdepth: 1 =20 i386/cpu + i386/kvm-pv i386/sgx =20 .. _pcsys_005freq: --=20 2.31.1 From nobody Thu May 9 05:51:05 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 1633456400179658.2166149563828; Tue, 5 Oct 2021 10:53:20 -0700 (PDT) Received: from localhost ([::1]:39996 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mXocx-0004Dk-36 for importer@patchew.org; Tue, 05 Oct 2021 13:53:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45012) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mXnYA-0007oB-4a for qemu-devel@nongnu.org; Tue, 05 Oct 2021 12:44:18 -0400 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]:34437) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mXnY7-0003u8-TZ for qemu-devel@nongnu.org; Tue, 05 Oct 2021 12:44:17 -0400 Received: by mail-ed1-x52f.google.com with SMTP id g10so1119377edj.1 for ; Tue, 05 Oct 2021 09:44:15 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id x14sm6101392edd.25.2021.10.05.09.44.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Oct 2021 09:44:12 -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=mDdKhyGtGxh7guoKQYRKq/mY/zRbnYfe1vCaNSp/edY=; b=B9kzW9H1zdyg/BemUo+kjmjWRvio7Nq5WyKTPnfiebEb/zcC32GkoNFCmmfJO6BUvF uGErd5+PdB5olQ7T4X52hzWIVmsZZGrPwEKozAkJq8JNvdNrpDB0jDJ5/Sr02cXaieIL AvjrHhfPmamNsTD0VXWPinxCj7ZEBjRwDurOHlBb7o/eS9L6JWobGuhF2uBN6x794bJ9 tBueiAUBPeqns4sbhCjYct4ZvHWRF27pMR/62WwEsMIl+7bsjx7syk9WMlFFKaGjm3UM Z50/HSf6ss6eerlACkJetAOUsMVBzDVaQ7wNHDnxmu2lRwWkOJtuQ4jKG0uT/7Q5mUrf A3+g== 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=mDdKhyGtGxh7guoKQYRKq/mY/zRbnYfe1vCaNSp/edY=; b=kETwyVBlbxa2UFAcFlB9xiT7qrumCC+N+vSrKrXVbyRxnZXJvm5JtN3JViIp/WwfEL JbesKFiudk9X6AiPi2X4kwbUNUpjQStQzAHYEJI5BzWahhBNOzovUIaAg0cg4CJYZmBs BpBh3UKUsOPIB7Gr/1li4/P/3RgPrGvz1JETBIKwz/Pll++VQnpxPSlGj1uReW8iDjGQ lshWUfWbp9JatonGtsl5cwMv4YfrxvlZcG20uZEdA0jtNFwxpNY3L1ZU3HB+tFMprFqE vWaLTFqfszUvvtpK8G8ZbbPYOsp+fCy8HcpE6k+i79G9uaLJ7VKg7fQZwVjHe3nv7v0H tHDw== X-Gm-Message-State: AOAM532mW0qN4Qz9zTaJSZ+kqNIiYAi63ZX9ej3/hST2aeoFpO43Pi1S 02bWUKvknNsrSSdxeWoHo70ySEK/mRU= X-Google-Smtp-Source: ABdhPJzX3dDDsV0bJCWwDMaMQPLe4+v2ElYHnXauSuWNFSojp8f6kuqlke/NB3osaadZhG4T/g5vfQ== X-Received: by 2002:a17:906:640f:: with SMTP id d15mr26853303ejm.419.1633452253232; Tue, 05 Oct 2021 09:44:13 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 02/12] sev/i386: Introduce sev_add_kernel_loader_hashes for measured linux boot Date: Tue, 5 Oct 2021 18:43:58 +0200 Message-Id: <20211005164408.288128-3-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211005164408.288128-1-pbonzini@redhat.com> References: <20211005164408.288128-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.249, 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 , James Bottomley , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=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: 1633456401699100001 From: Dov Murik Add the sev_add_kernel_loader_hashes function to calculate the hashes of the kernel/initrd/cmdline and fill a designated OVMF encrypted hash table area. For this to work, OVMF must support an encrypted area to place the data which is advertised via a special GUID in the OVMF reset table. The hashes of each of the files is calculated (or the string in the case of the cmdline with trailing '\0' included). Each entry in the hashes table is GUID identified and since they're passed through the sev_encrypt_flash interface, the hashes will be accumulated by the AMD PSP measurement (SEV_LAUNCH_MEASURE). Co-developed-by: James Bottomley Signed-off-by: James Bottomley Signed-off-by: Dov Murik Reviewed-by: Daniel P. Berrang=C3=A9 Message-Id: <20210930054915.13252-2-dovmurik@linux.ibm.com> Signed-off-by: Paolo Bonzini --- target/i386/sev-stub.c | 5 ++ target/i386/sev.c | 137 +++++++++++++++++++++++++++++++++++++++++ target/i386/sev_i386.h | 12 ++++ 3 files changed, 154 insertions(+) diff --git a/target/i386/sev-stub.c b/target/i386/sev-stub.c index 0227cb5177..d8e6583171 100644 --- a/target/i386/sev-stub.c +++ b/target/i386/sev-stub.c @@ -81,3 +81,8 @@ sev_get_attestation_report(const char *mnonce, Error **er= rp) 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.c b/target/i386/sev.c index fa7210473a..bcd9260fa4 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -23,6 +23,7 @@ #include "qemu/base64.h" #include "qemu/module.h" #include "qemu/uuid.h" +#include "crypto/hash.h" #include "sysemu/kvm.h" #include "sev_i386.h" #include "sysemu/sysemu.h" @@ -83,6 +84,32 @@ typedef struct __attribute__((__packed__)) SevInfoBlock { uint32_t reset_addr; } SevInfoBlock; =20 +#define SEV_HASH_TABLE_RV_GUID "7255371f-3a3b-4b04-927b-1da6efa8d454" +typedef struct QEMU_PACKED SevHashTableDescriptor { + /* SEV hash table area guest address */ + uint32_t base; + /* SEV hash table area size (in bytes) */ + uint32_t size; +} SevHashTableDescriptor; + +/* hard code sha256 digest size */ +#define HASH_SIZE 32 + +typedef struct QEMU_PACKED SevHashTableEntry { + QemuUUID guid; + uint16_t len; + uint8_t hash[HASH_SIZE]; +} SevHashTableEntry; + +typedef struct QEMU_PACKED SevHashTable { + QemuUUID guid; + uint16_t len; + SevHashTableEntry cmdline; + SevHashTableEntry initrd; + SevHashTableEntry kernel; + uint8_t padding[]; +} SevHashTable; + static SevGuestState *sev_guest; static Error *sev_mig_blocker; =20 @@ -1071,6 +1098,116 @@ int sev_es_save_reset_vector(void *flash_ptr, uint6= 4_t flash_size) return 0; } =20 +static const QemuUUID sev_hash_table_header_guid =3D { + .data =3D UUID_LE(0x9438d606, 0x4f22, 0x4cc9, 0xb4, 0x79, 0xa7, 0x93, + 0xd4, 0x11, 0xfd, 0x21) +}; + +static const QemuUUID sev_kernel_entry_guid =3D { + .data =3D UUID_LE(0x4de79437, 0xabd2, 0x427f, 0xb8, 0x35, 0xd5, 0xb1, + 0x72, 0xd2, 0x04, 0x5b) +}; +static const QemuUUID sev_initrd_entry_guid =3D { + .data =3D UUID_LE(0x44baf731, 0x3a2f, 0x4bd7, 0x9a, 0xf1, 0x41, 0xe2, + 0x91, 0x69, 0x78, 0x1d) +}; +static const QemuUUID sev_cmdline_entry_guid =3D { + .data =3D UUID_LE(0x97d02dd8, 0xbd20, 0x4c94, 0xaa, 0x78, 0xe7, 0x71, + 0x4d, 0x36, 0xab, 0x2a) +}; + +/* + * Add the hashes of the linux kernel/initrd/cmdline to an encrypted guest= page + * which is included in SEV's initial memory measurement. + */ +bool sev_add_kernel_loader_hashes(SevKernelLoaderContext *ctx, Error **err= p) +{ + uint8_t *data; + SevHashTableDescriptor *area; + SevHashTable *ht; + uint8_t cmdline_hash[HASH_SIZE]; + uint8_t initrd_hash[HASH_SIZE]; + uint8_t kernel_hash[HASH_SIZE]; + uint8_t *hashp; + size_t hash_len =3D HASH_SIZE; + int aligned_len; + + if (!pc_system_ovmf_table_find(SEV_HASH_TABLE_RV_GUID, &data, NULL)) { + error_setg(errp, "SEV: kernel specified but OVMF has no hash table= guid"); + return false; + } + area =3D (SevHashTableDescriptor *)data; + + /* + * Calculate hash of kernel command-line with the terminating null byt= e. If + * the user doesn't supply a command-line via -append, the 1-byte "\0"= will + * be used. + */ + hashp =3D cmdline_hash; + if (qcrypto_hash_bytes(QCRYPTO_HASH_ALG_SHA256, ctx->cmdline_data, + ctx->cmdline_size, &hashp, &hash_len, errp) < 0= ) { + return false; + } + assert(hash_len =3D=3D HASH_SIZE); + + /* + * Calculate hash of initrd. If the user doesn't supply an initrd via + * -initrd, an empty buffer will be used (ctx->initrd_size =3D=3D 0). + */ + hashp =3D initrd_hash; + if (qcrypto_hash_bytes(QCRYPTO_HASH_ALG_SHA256, ctx->initrd_data, + ctx->initrd_size, &hashp, &hash_len, errp) < 0)= { + return false; + } + assert(hash_len =3D=3D HASH_SIZE); + + /* Calculate hash of the kernel */ + hashp =3D kernel_hash; + struct iovec iov[2] =3D { + { .iov_base =3D ctx->setup_data, .iov_len =3D ctx->setup_size }, + { .iov_base =3D ctx->kernel_data, .iov_len =3D ctx->kernel_size } + }; + if (qcrypto_hash_bytesv(QCRYPTO_HASH_ALG_SHA256, iov, ARRAY_SIZE(iov), + &hashp, &hash_len, errp) < 0) { + return false; + } + assert(hash_len =3D=3D HASH_SIZE); + + /* + * Populate the hashes table in the guest's memory at the OVMF-designa= ted + * area for the SEV hashes table + */ + ht =3D qemu_map_ram_ptr(NULL, area->base); + + ht->guid =3D sev_hash_table_header_guid; + ht->len =3D sizeof(*ht); + + ht->cmdline.guid =3D sev_cmdline_entry_guid; + ht->cmdline.len =3D sizeof(ht->cmdline); + memcpy(ht->cmdline.hash, cmdline_hash, sizeof(ht->cmdline.hash)); + + ht->initrd.guid =3D sev_initrd_entry_guid; + ht->initrd.len =3D sizeof(ht->initrd); + memcpy(ht->initrd.hash, initrd_hash, sizeof(ht->initrd.hash)); + + ht->kernel.guid =3D sev_kernel_entry_guid; + ht->kernel.len =3D sizeof(ht->kernel); + memcpy(ht->kernel.hash, kernel_hash, sizeof(ht->kernel.hash)); + + /* When calling sev_encrypt_flash, the length has to be 16 byte aligne= d */ + aligned_len =3D ROUND_UP(ht->len, 16); + if (aligned_len !=3D ht->len) { + /* zero the excess data so the measurement can be reliably calcula= ted */ + memset(ht->padding, 0, aligned_len - ht->len); + } + + if (sev_encrypt_flash((uint8_t *)ht, aligned_len, errp) < 0) { + return false; + } + + return true; +} + static void sev_register_types(void) { diff --git a/target/i386/sev_i386.h b/target/i386/sev_i386.h index ae6d840478..2afe108069 100644 --- a/target/i386/sev_i386.h +++ b/target/i386/sev_i386.h @@ -28,6 +28,17 @@ #define SEV_POLICY_DOMAIN 0x10 #define SEV_POLICY_SEV 0x20 =20 +typedef struct SevKernelLoaderContext { + char *setup_data; + size_t setup_size; + char *kernel_data; + size_t kernel_size; + char *initrd_data; + size_t initrd_size; + char *cmdline_data; + size_t cmdline_size; +} SevKernelLoaderContext; + extern bool sev_es_enabled(void); extern uint64_t sev_get_me_mask(void); extern SevInfo *sev_get_info(void); @@ -37,5 +48,6 @@ 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 #endif --=20 2.31.1 From nobody Thu May 9 05:51:05 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 1633455834510327.4978479723468; Tue, 5 Oct 2021 10:43:54 -0700 (PDT) Received: from localhost ([::1]:51226 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mXoTp-0000Eg-I0 for importer@patchew.org; Tue, 05 Oct 2021 13:43:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44990) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mXnY9-0007n4-Bs for qemu-devel@nongnu.org; Tue, 05 Oct 2021 12:44:17 -0400 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]:41497) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mXnY7-0003u6-LX for qemu-devel@nongnu.org; Tue, 05 Oct 2021 12:44:17 -0400 Received: by mail-ed1-x529.google.com with SMTP id z1so1175702edb.8 for ; Tue, 05 Oct 2021 09:44:15 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id x14sm6101392edd.25.2021.10.05.09.44.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Oct 2021 09:44:13 -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=9OmOYSIjg+vLx6xnsv1dbs85bhSDfzlPZkemprRQdZ0=; b=NHT04y5vL4hcFRK2c21am6kiOuMAUVnYbHjDjxpwH0XBKLhwhRo4vZA6doc7stA2dJ l1eBlUxv76CD4VQLjnqOPKAtfVc5Y36RjZW/M0UKe9Yw2eIPzBjAiashYuat45Wj99qi p/k0gr8L5I/8Wz8g8ZSNZfMwI/2WMWXVzScpiCE2wuTCV117FWJZNJBiJEF+eNvFhSbP XLT8aNfq8GwFykbvd/VZxMGD14oJ+aI/J+w1oyFpsJGrp9X3t63Eh/R9GRmc8Him5Hjg bsAjYJCostRGdAO98REmfyxTfWSGL6Movjm0dWc1vvUQQLqCT/pXxxopRroJSaMa0dDF Rz7w== 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=9OmOYSIjg+vLx6xnsv1dbs85bhSDfzlPZkemprRQdZ0=; b=ApauSnOVGZ+3y9AWzXjLtpK0oMTU+4ZHDQzfhOjpbn6+J1cD0MvbSx2VH2dmM8VBMn g8d1IaOq4v0s1HYcUQao8MhneSXZ1NIdl6OBSjG06JgUkGwN//D4c5PzYYnPEw9DGr09 bWGEiLxATwZfW5cf0QAL60v1cny793UGXv0IAEZ9elT6FhPYYTd4YBEPc6Bm8AwZFsxX wTs+IhdPMYOadt3b1NLfrHRIfhTGVFU3f4reMT4Wv6Ko+87u2KXVUe6Ak69kWBbSR6o7 CRkFsnl+8cNBOrroOGKjeJL11ewGW9+PtXMclBLPguUmQu5pfEpYUZFBH6uQYuGrk7UL izRA== X-Gm-Message-State: AOAM530w8dq+uQwsvvmDcIls0x0yiZSmPHtC8suFS+o3pzth69WGqnFY zmLIJLCtryEoICQKTYoGcd5XyASixcI= X-Google-Smtp-Source: ABdhPJxlm2CLp3xDkAs8b26KIyYvaqeuKOpsPaGpCl775zHy3n5r+OAkqXKqXiM7btHfQ8C0EuhMrw== X-Received: by 2002:a50:9347:: with SMTP id n7mr26611059eda.249.1633452254267; Tue, 05 Oct 2021 09:44:14 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 03/12] x86/sev: generate SEV kernel loader hashes in x86_load_linux Date: Tue, 5 Oct 2021 18:43:59 +0200 Message-Id: <20211005164408.288128-4-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211005164408.288128-1-pbonzini@redhat.com> References: <20211005164408.288128-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.249, 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 , James Bottomley , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=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: 1633455836346100001 From: Dov Murik If SEV is enabled and a kernel is passed via -kernel, pass the hashes of kernel/initrd/cmdline in an encrypted guest page to OVMF for SEV measured boot. Co-developed-by: James Bottomley Signed-off-by: James Bottomley Signed-off-by: Dov Murik Reviewed-by: Daniel P. Berrang=C3=A9 Message-Id: <20210930054915.13252-3-dovmurik@linux.ibm.com> Signed-off-by: Paolo Bonzini --- hw/i386/x86.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/hw/i386/x86.c b/hw/i386/x86.c index 41ef9a84a9..0c7c054e3a 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -47,6 +47,7 @@ #include "hw/i386/fw_cfg.h" #include "hw/intc/i8259.h" #include "hw/rtc/mc146818rtc.h" +#include "target/i386/sev_i386.h" =20 #include "hw/acpi/cpu_hotplug.h" #include "hw/irq.h" @@ -780,6 +781,7 @@ void x86_load_linux(X86MachineState *x86ms, const char *initrd_filename =3D machine->initrd_filename; const char *dtb_filename =3D machine->dtb; const char *kernel_cmdline =3D machine->kernel_cmdline; + SevKernelLoaderContext sev_load_ctx =3D {}; =20 /* Align to 16 bytes as a paranoia measure */ cmdline_size =3D (strlen(kernel_cmdline) + 16) & ~15; @@ -926,6 +928,8 @@ void x86_load_linux(X86MachineState *x86ms, fw_cfg_add_i32(fw_cfg, FW_CFG_CMDLINE_ADDR, cmdline_addr); fw_cfg_add_i32(fw_cfg, FW_CFG_CMDLINE_SIZE, strlen(kernel_cmdline) + 1= ); fw_cfg_add_string(fw_cfg, FW_CFG_CMDLINE_DATA, kernel_cmdline); + sev_load_ctx.cmdline_data =3D (char *)kernel_cmdline; + sev_load_ctx.cmdline_size =3D strlen(kernel_cmdline) + 1; =20 if (protocol >=3D 0x202) { stl_p(header + 0x228, cmdline_addr); @@ -1007,6 +1011,8 @@ void x86_load_linux(X86MachineState *x86ms, fw_cfg_add_i32(fw_cfg, FW_CFG_INITRD_ADDR, initrd_addr); fw_cfg_add_i32(fw_cfg, FW_CFG_INITRD_SIZE, initrd_size); fw_cfg_add_bytes(fw_cfg, FW_CFG_INITRD_DATA, initrd_data, initrd_s= ize); + sev_load_ctx.initrd_data =3D initrd_data; + sev_load_ctx.initrd_size =3D initrd_size; =20 stl_p(header + 0x218, initrd_addr); stl_p(header + 0x21c, initrd_size); @@ -1065,15 +1071,32 @@ void x86_load_linux(X86MachineState *x86ms, load_image_size(dtb_filename, setup_data->data, dtb_size); } =20 - memcpy(setup, header, MIN(sizeof(header), setup_size)); + /* + * If we're starting an encrypted VM, it will be OVMF based, which use= s the + * efi stub for booting and doesn't require any values to be placed in= the + * kernel header. We therefore don't update the header so the hash of= the + * kernel on the other side of the fw_cfg interface matches the hash o= f the + * file the user passed in. + */ + if (!sev_enabled()) { + memcpy(setup, header, MIN(sizeof(header), setup_size)); + } =20 fw_cfg_add_i32(fw_cfg, FW_CFG_KERNEL_ADDR, prot_addr); fw_cfg_add_i32(fw_cfg, FW_CFG_KERNEL_SIZE, kernel_size); fw_cfg_add_bytes(fw_cfg, FW_CFG_KERNEL_DATA, kernel, kernel_size); + sev_load_ctx.kernel_data =3D (char *)kernel; + sev_load_ctx.kernel_size =3D kernel_size; =20 fw_cfg_add_i32(fw_cfg, FW_CFG_SETUP_ADDR, real_addr); fw_cfg_add_i32(fw_cfg, FW_CFG_SETUP_SIZE, setup_size); fw_cfg_add_bytes(fw_cfg, FW_CFG_SETUP_DATA, setup, setup_size); + sev_load_ctx.setup_data =3D (char *)setup; + sev_load_ctx.setup_size =3D setup_size; + + if (sev_enabled()) { + sev_add_kernel_loader_hashes(&sev_load_ctx, &error_fatal); + } =20 option_rom[nb_option_roms].bootindex =3D 0; option_rom[nb_option_roms].name =3D "linuxboot.bin"; --=20 2.31.1 From nobody Thu May 9 05:51:05 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 163345472651191.06276880478401; Tue, 5 Oct 2021 10:25:26 -0700 (PDT) Received: from localhost ([::1]:35546 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mXoBr-0003ZM-HT for importer@patchew.org; Tue, 05 Oct 2021 13:25:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45022) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mXnYA-0007p2-QU for qemu-devel@nongnu.org; Tue, 05 Oct 2021 12:44:18 -0400 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]:38490) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mXnY8-0003ut-Kp for qemu-devel@nongnu.org; Tue, 05 Oct 2021 12:44:18 -0400 Received: by mail-ed1-x534.google.com with SMTP id dj4so1217049edb.5 for ; Tue, 05 Oct 2021 09:44:16 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id x14sm6101392edd.25.2021.10.05.09.44.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Oct 2021 09:44:14 -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=o/9VsRJ4FP/YaqS/ATZW3afXJPLasRAhTWZ76zdiiLo=; b=fofZzQ1IYyTbRMqrhQ3eYGismbAqgyCJNcSlwZ2Cwzdx59QuzDglMLg4ZVXEq10k7P T0VWdYmtb0fqIlyjgSnZgZvom8tZKh79WZ+V/nIGQj0NXEF7DeYE6T+9Imbg2fw9Yq+T rAsiocnQmipQ29WEm+euonq3HGRpJbwjnx0z/caGA82CPa8eZ9TAP7tmEyDoQqk4P61b VbSrNspsP/PGkND/+gajdsTqfhr9e/5vMxncSonKWcdKKArc76STx+zO2zo0mBZSvZDa zuomXWRi/n8brWnFay35TwJszQc+ju4WS1s3VLeoKiGXR6HnxOEDYHk3FN/O9Zk8UCI8 RJDA== 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=o/9VsRJ4FP/YaqS/ATZW3afXJPLasRAhTWZ76zdiiLo=; b=FvxGv23LU41lQ8NSQ1WFOFmxYtyqAPTcA8vTKvYsNncNzV5GCgprYY9ieM3TR+lU/n STTl1hv0ZpbVeNuNllkUGI8BNnSuBMpw1kpVkIL3SmQ+5X7XHl/sXTuwghLqPvOBZbXD glcGLrfvjhOWxW5uPDxSu8/Qya9qeKCiII4L3Ypod6iBfjr183pX/jDZNyzGVqYX+ay5 idSipTJmKRzQ/ErV6n8ffBVXg7JGpypH1abtpWu+qZC5I6xEf2dLZv1kvImzJtWqtyO3 Say5l7aCjYX7MpPrrLlm2M3Emz27tDL3jJaAU7nG4ErAkI9NOu0DdPP/HBctC5BcAF51 UaMw== X-Gm-Message-State: AOAM532xLrN7sNnAAlmtuAEMEjwiBUH0HVEs1taoBVtUmnQwcHiV8N55 QBjXo3YBq0Co0k9LIqjFpGAMshLJXV0= X-Google-Smtp-Source: ABdhPJzVBYM8HEy/cYEW5Nn3CW/JGe5g0tGZvSx06y389bu3Odnt9NbU05IEGjRUbP2IBrR0WzNxYg== X-Received: by 2002:a50:d903:: with SMTP id t3mr27231550edj.70.1633452255323; Tue, 05 Oct 2021 09:44:15 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 04/12] hw/misc: applesmc: use host osk as default on macs Date: Tue, 5 Oct 2021 18:44:00 +0200 Message-Id: <20211005164408.288128-5-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211005164408.288128-1-pbonzini@redhat.com> References: <20211005164408.288128-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.249, 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?Pedro=20To=CC=82rres?= 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: 1633454727788100001 From: Pedro To=CC=82rres When running on a Mac, QEMU is able to get the host OSK and use it as the default value for the AppleSMC device. The OSK query operation doesn't require administrator privileges and can be executed by any user on the system. This patch is based on open-source code from Apple, just like the implementation from VirtualBox. Apple: https://opensource.apple.com/source/IOKitUser/IOKitUser-647.6.13/pwr_mgt.su= bproj/IOPMLibPrivate.c https://opensource.apple.com/source/PowerManagement/PowerManagement-637.60.= 1/pmconfigd/PrivateLib.c VirtualBox: https://www.virtualbox.org/browser/vbox/trunk/src/VBox/Devices/EFI/DevSmc.c= pp#L516 Signed-off-by: Pedro To=CC=82rres --- hw/misc/applesmc.c | 192 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 191 insertions(+), 1 deletion(-) diff --git a/hw/misc/applesmc.c b/hw/misc/applesmc.c index 1b9acaf1d3..cec247b5ee 100644 --- a/hw/misc/applesmc.c +++ b/hw/misc/applesmc.c @@ -38,6 +38,171 @@ #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 @@ -315,6 +480,7 @@ 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); @@ -331,7 +497,31 @@ 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 || (strlen(s->osk) !=3D 64)) { + 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) { warn_report("Using AppleSMC with invalid key"); s->osk =3D default_osk; } --=20 2.31.1 From nobody Thu May 9 05:51:05 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 1633454906057128.30693600612005; Tue, 5 Oct 2021 10:28:26 -0700 (PDT) Received: from localhost ([::1]:44192 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mXoEq-0000z8-9g for importer@patchew.org; Tue, 05 Oct 2021 13:28:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45028) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mXnYC-0007pg-CN for qemu-devel@nongnu.org; Tue, 05 Oct 2021 12:44:20 -0400 Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]:35471) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mXnY9-0003vo-So for qemu-devel@nongnu.org; Tue, 05 Oct 2021 12:44:20 -0400 Received: by mail-ed1-x535.google.com with SMTP id b8so1222815edk.2 for ; Tue, 05 Oct 2021 09:44:17 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id x14sm6101392edd.25.2021.10.05.09.44.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Oct 2021 09:44:15 -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=DY6lnefGoP73LgVopoja66JUkhUBsN2m6jSvYb4UO64=; b=NQId0Vf6AgdLopvTphB2lgER6kJbdn2DyaHJ01TLBtwf/ZPbUJJAhnfjowgYyBNgKA HMKj5QImPGlGsw+nUcZWfW0+hllSs9yCZhwQkGkR3XUs63HeSp5dmNZofZ2w2W/w+jhU 7OuLlGiFshHAY+D/xypr1ds5DyybDQYAWCZm9P1oT20f2f7qzIE1VcTOwO9J+0R7ZyQ1 ESRJ3Ej3yYmAIKl6sZkADu6ERWLWE77g51CVuNhhLGz9yUEzyZeQGJhyoEYf6McfDAzq L8gst/QcROXQAFkTovSjP2AxFujExrb/rHlgpuWIQn4dSHbHhcu67D7BHsRuCWOMiqEt +4Fg== 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=DY6lnefGoP73LgVopoja66JUkhUBsN2m6jSvYb4UO64=; b=zSc82p47gLKxVvwOPq6MP1vsI8Ea1NfjPL0JDSn4NqqKELCGrEU5NwY6B/qwfjUBuY psOB4AYeBI9Nq30oQTf/KDZ81bMriUM429V1Le1ZiKCiS3lU/TkK/xgLzP5/9CPDVeoI I+40s7hpziBimyvBXqvV0nIoMMFTH4IkwF/ElOUGyTf2lsI8EfviAChxFm/UF64V+vGH ufZYKog63k47QuT1MSjaBlQzd/S+MXeOLyS/KHjPI3rIx6P64K3Kn+NYs6TrS5CT+qE/ 3voPq2WuwH8XAS4ZtDaI5iK2+EW+BeYgHPnpa4qS3E1bK78iLvnHXBz6K88sZf9ccoFw d08w== X-Gm-Message-State: AOAM533g8JmExYtRvOoD5kOumHnlXPUDm3kxQzoHgqBJ/1IqshEwzA8e 0r0sRlC7pLjwZ9gaH89imovLKNqj7ZQ= X-Google-Smtp-Source: ABdhPJwcm2eq1WkFJcXWJsuFsd8g7Xd/PVxRbRknGAtumZAx9fB4SapzB90AD3pmSw22wNxELUFqMg== X-Received: by 2002:a17:906:36d6:: with SMTP id b22mr25371924ejc.387.1633452256344; Tue, 05 Oct 2021 09:44:16 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 05/12] configure, meson: move CPU_CFLAGS out of QEMU_CFLAGS Date: Tue, 5 Oct 2021 18:44:01 +0200 Message-Id: <20211005164408.288128-6-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211005164408.288128-1-pbonzini@redhat.com> References: <20211005164408.288128-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::535; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x535.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.249, 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: 1633454907888100001 Content-Type: text/plain; charset="utf-8" Flags that choose the target architecture, such as -m32 on x86, affect all invocations of the compiler driver, for example including options such as --print-search-dirs. To ensure that they are treated as such, place them in the cross file in the [binaries] section instead of including them in QEMU_CFLAGS. Signed-off-by: Paolo Bonzini --- configure | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/configure b/configure index b0b1a1cc25..1d3f099498 100755 --- a/configure +++ b/configure @@ -142,11 +142,11 @@ lines: ${BASH_LINENO[*]}" } =20 do_cc() { - do_compiler "$cc" "$@" + do_compiler "$cc" $CPU_CFLAGS "$@" } =20 do_cxx() { - do_compiler "$cxx" "$@" + do_compiler "$cxx" $CPU_CFLAGS "$@" } =20 # Append $2 to the variable named $1, with space separation @@ -1688,7 +1688,6 @@ esac =20 eval "cross_cc_${cpu}=3D\$cc" cross_cc_vars=3D"$cross_cc_vars cross_cc_${cpu}" -QEMU_CFLAGS=3D"$CPU_CFLAGS $QEMU_CFLAGS" =20 # For user-mode emulation the host arch has to be one we explicitly # support, even if we're using TCI. @@ -5114,9 +5113,9 @@ if test "$skip_meson" =3D no; then echo "c_link_args =3D [${LDFLAGS:+$(meson_quote $LDFLAGS)}]" >> $cross echo "cpp_link_args =3D [${LDFLAGS:+$(meson_quote $LDFLAGS)}]" >> $cross echo "[binaries]" >> $cross - echo "c =3D [$(meson_quote $cc)]" >> $cross - test -n "$cxx" && echo "cpp =3D [$(meson_quote $cxx)]" >> $cross - test -n "$objcc" && echo "objc =3D [$(meson_quote $objcc)]" >> $cross + echo "c =3D [$(meson_quote $cc $CPU_CFLAGS)]" >> $cross + test -n "$cxx" && echo "cpp =3D [$(meson_quote $cxx $CPU_CFLAGS)]" >> $c= ross + test -n "$objcc" && echo "objc =3D [$(meson_quote $objcc $CPU_CFLAGS)]" = >> $cross echo "ar =3D [$(meson_quote $ar)]" >> $cross echo "nm =3D [$(meson_quote $nm)]" >> $cross echo "pkgconfig =3D [$(meson_quote $pkg_config_exe)]" >> $cross --=20 2.31.1 From nobody Thu May 9 05:51:05 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 1633457163503974.1324899064214; Tue, 5 Oct 2021 11:06:03 -0700 (PDT) Received: from localhost ([::1]:47758 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mXopG-00031H-D1 for importer@patchew.org; Tue, 05 Oct 2021 14:06:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45208) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mXnYQ-00081Q-6K for qemu-devel@nongnu.org; Tue, 05 Oct 2021 12:44:34 -0400 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]:40813) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mXnYA-0003wX-Ob for qemu-devel@nongnu.org; Tue, 05 Oct 2021 12:44:33 -0400 Received: by mail-ed1-x52b.google.com with SMTP id g8so1226552edt.7 for ; Tue, 05 Oct 2021 09:44:18 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id x14sm6101392edd.25.2021.10.05.09.44.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Oct 2021 09:44:16 -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=55CXRtQhweAX0BfwwY0fYtxLpWQtmPQ9uVNse1thpew=; b=TOqG/LLWUAGNL24NnNHlr8Vxp4JWmzFjEH00di5VJXvg23ZqtlXudQEeivN+sewf6F wpLyloBJCiOPc/GjcAu+uYFyEQGRfu2J8hhKxLXqOR0m/WcRgtEPc3VyDFoATnw8xOx6 hkBFfuXUR8psy/ODEeaM4mRuZXJf1inVRWjfQtgIiM478IszYHe6r7D/n3+MfDum4ZvJ 3FUX4pedgfh3B3vnbSd1FRwh43nBaqNdqC6EXc5GZSDchcf6wx1CTRnAeg6n1KwC1HMI 8m6jdB5vIdAT/HKaNulKZNRar+0O+HRuWw0ScSUqb3o29/Q3LQLZ7aqrEDm7+gZwMj7H gbgQ== 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=55CXRtQhweAX0BfwwY0fYtxLpWQtmPQ9uVNse1thpew=; b=3H48J4W45fhCDuZW+0NZrWzA/mK9cCP5TZo3ujTDRo3aYUOFHeL51cadNGjAmOINJp N9jpzp6QkbW2zcoQv65zrlQFIrFwBBBwYTQOrsROK7lwqhK0vii1rpudcdkzK2kI0JIB JIvnLA4CSGDnKoZMAVFPotMqzV11kGolK9AXpq61WnsVB81N5DByv9qeNpPDxzlxWdgX TxtugI1n2g9ZSEB4kXzLgJv+ulZ5q8m/aEAQ1mZmpegdOFn8M/eI0I8ZHHqT2H5JIcbN R3w3mWFxFY/cqP38d5DumAlJve2KSEhBacXzp5etRjWhpen7GSzIZ7NfNZmDZjdIoSC0 h8SQ== X-Gm-Message-State: AOAM532gzkwQEVMO5rY3djzaBrxJOZbc1sM5G5ElvyUKWE7Zy7YGFZ43 Ye0Ytt5lHbO1am/7WRWZAoVR5CDIkSQ= X-Google-Smtp-Source: ABdhPJzZVIwuqufXRNkDndMUaKsUTi9N9M7O8Gi9ywIO+M5upw01rEXsMzsmHKkmTIxRWHRAiiXpoQ== X-Received: by 2002:a17:906:f208:: with SMTP id gt8mr16061985ejb.522.1633452257281; Tue, 05 Oct 2021 09:44:17 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 06/12] migration: block-dirty-bitmap: add missing qemu_mutex_lock_iothread Date: Tue, 5 Oct 2021 18:44:02 +0200 Message-Id: <20211005164408.288128-7-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211005164408.288128-1-pbonzini@redhat.com> References: <20211005164408.288128-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::52b; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x52b.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.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, 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: Emanuele Giuseppe Esposito , Stefan Hajnoczi 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: 1633457164212100001 Content-Type: text/plain; charset="utf-8" From: Emanuele Giuseppe Esposito init_dirty_bitmap_migration assumes the iothread lock (BQL) to be held, but instead it isn't. Instead of adding the lock to qemu_savevm_state_setup(), follow the same pattern as the other ->save_setup callbacks and lock+unlock inside dirty_bitmap_save_setup(). Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Stefan Hajnoczi Message-Id: <20211005080751.3797161-2-eesposit@redhat.com> Signed-off-by: Paolo Bonzini --- migration/block-dirty-bitmap.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c index 35f5ef688d..9aba7d9c22 100644 --- a/migration/block-dirty-bitmap.c +++ b/migration/block-dirty-bitmap.c @@ -1215,7 +1215,10 @@ static int dirty_bitmap_save_setup(QEMUFile *f, void= *opaque) { DBMSaveState *s =3D &((DBMState *)opaque)->save; SaveBitmapState *dbms =3D NULL; + + qemu_mutex_lock_iothread(); if (init_dirty_bitmap_migration(s) < 0) { + qemu_mutex_unlock_iothread(); return -1; } =20 @@ -1223,7 +1226,7 @@ static int dirty_bitmap_save_setup(QEMUFile *f, void = *opaque) send_bitmap_start(f, s, dbms); } qemu_put_bitmap_flags(f, DIRTY_BITMAP_MIG_FLAG_EOS); - + qemu_mutex_unlock_iothread(); return 0; } =20 --=20 2.31.1 From nobody Thu May 9 05:51:05 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 1633455273113744.1337085585365; Tue, 5 Oct 2021 10:34:33 -0700 (PDT) Received: from localhost ([::1]:32922 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mXoKl-0003xG-S2 for importer@patchew.org; Tue, 05 Oct 2021 13:34:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45054) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mXnYE-0007qk-RC for qemu-devel@nongnu.org; Tue, 05 Oct 2021 12:44:23 -0400 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]:38490) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mXnYC-0003xz-FS for qemu-devel@nongnu.org; Tue, 05 Oct 2021 12:44:21 -0400 Received: by mail-ed1-x533.google.com with SMTP id dj4so1217488edb.5 for ; Tue, 05 Oct 2021 09:44:19 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id x14sm6101392edd.25.2021.10.05.09.44.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Oct 2021 09:44:17 -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=Un1yFg3Apodja50rdrPE+6MDcr8WTBDb0TUSxvICIbI=; b=RFYMLBr5o29OTr/R0bNe26Ua+Y9Ori8HRUSdY9d9jBi0l+pphBXiID0gyX4XzJ42H3 CiDvrhDar+5XXrIKp11z5j06oha5PJMCzvzsVA5mxosLErQ8YZS2hcl/gEFB2R19osjC pWsN2jJmQIkJUvBaV5OzMhzDo+bHI/Hvr4JxfLP8hLr6577OxnqbjdOFTBNhesg8qvOe f2yVv6mafdGnqRVPkPCS99VS/Xqw+zLnSN8zteBnLhHr6xhoNGvNXa/YnsnvfAVyk3iC CoYAmplP7U3M1CSdy3iQJYH8/f9FF78roUiHkMGHNnSjSjsxUv0dxwdyvWGyh+MM5R5X 4x0w== 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=Un1yFg3Apodja50rdrPE+6MDcr8WTBDb0TUSxvICIbI=; b=iD99pKFnNwiZdcPZFXT36vfv0zRDs6NBnW1ysRh5QoOeVQjrLvyVCZXUuFruj24tHC AP2VLIF8TpHf3m7qWcFE6of+6BU9QPCxaAho3f8cchLTIUsC/pG6ff6NFHmGKLdblFYb zq6CiyHWn6jmoRNpV+cbwIzHfArK7qPw8b0lsbtB2afLG2KRRS8yeheuHHfpljRMoyEg A7sx6zieuN9awKtkL/1Hwv3k1RKcMuUfMlphYkoFPHyw77kxZsy1LrWEaGJs9UaCNxph vpvdQYZyQ3ntCv7Kftdb1yMQs5GdIFRfrbAYD+M0mgahtSezlSNshOIzrclfjaOVvhgZ O+ZA== X-Gm-Message-State: AOAM5322ncVEJ3FHCsICfKu1uB7PPalxVFW9oM8kTSlpJP8fwoK5XEiO B8m4EPBvMkRST1cNhpBevLlY7cHTEU4= X-Google-Smtp-Source: ABdhPJyxfmjojn3A05gaqCa8yq8XUYlV+t5QCopl+/iUnqZX0DC7KwFsdrIL5j6QFV5Vn0mgq6dAug== X-Received: by 2002:a05:6402:35c8:: with SMTP id z8mr9783367edc.129.1633452258148; Tue, 05 Oct 2021 09:44:18 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 07/12] migration: add missing qemu_mutex_lock_iothread in migration_completion Date: Tue, 5 Oct 2021 18:44:03 +0200 Message-Id: <20211005164408.288128-8-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211005164408.288128-1-pbonzini@redhat.com> References: <20211005164408.288128-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.249, 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: Emanuele Giuseppe Esposito , "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: 1633455274076100001 Content-Type: text/plain; charset="utf-8" From: Emanuele Giuseppe Esposito qemu_savevm_state_complete_postcopy assumes the iothread lock (BQL) to be held, but instead it isn't. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Dr. David Alan Gilbert Message-Id: <20211005080751.3797161-3-eesposit@redhat.com> Signed-off-by: Paolo Bonzini --- migration/migration.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/migration/migration.c b/migration/migration.c index bb909781b7..6ac807ef3d 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -3168,7 +3168,10 @@ static void migration_completion(MigrationState *s) } else if (s->state =3D=3D MIGRATION_STATUS_POSTCOPY_ACTIVE) { trace_migration_completion_postcopy_end(); =20 + qemu_mutex_lock_iothread(); qemu_savevm_state_complete_postcopy(s->to_dst_file); + qemu_mutex_unlock_iothread(); + trace_migration_completion_postcopy_end_after_complete(); } else if (s->state =3D=3D MIGRATION_STATUS_CANCELLING) { goto fail; --=20 2.31.1 From nobody Thu May 9 05:51:05 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 1633455104891414.4750150413271; Tue, 5 Oct 2021 10:31:44 -0700 (PDT) Received: from localhost ([::1]:52672 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mXoI3-0006eU-PE for importer@patchew.org; Tue, 05 Oct 2021 13:31:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45056) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mXnYE-0007r1-T8 for qemu-devel@nongnu.org; Tue, 05 Oct 2021 12:44:23 -0400 Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]:33778) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mXnYC-0003yr-AQ for qemu-devel@nongnu.org; Tue, 05 Oct 2021 12:44:21 -0400 Received: by mail-ed1-x52e.google.com with SMTP id p13so1229958edw.0 for ; Tue, 05 Oct 2021 09:44:19 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id x14sm6101392edd.25.2021.10.05.09.44.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Oct 2021 09:44:18 -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=/Pxn4hLvHFl7SP+PJwZ9WLDfJ3iclWlvQDwWKU4dNjY=; b=WSgLPw6hw4NDLkZ74/NwCsJGpCrfsXRqtRXnj7nzil/7Nv4fbZ8lg0evoQ8wNTpE+j fpX4QCMNawsgFQOu2rgpFxOth6CdhhxTalMjRWLiivve1kgFzRgn37y+Xo/JsWySvuC1 nujl6DG4puOg38QjXC+tU/ZXVlge2ZEUWt8Nn8GxNI6u68sGgSaZRWbz3xrxFQnmDHeS 9Hf9j+r7Coxi0AB4Qyz9Vwj+BeLKanMOI0Lur/RMsjG4Gb2e7/IDqNnzMSJxpU+FjauO 3KRQov8DM8ZnC4736xFaz+fEKhaI5FLRJqGMXE9chygHA+vX5jZL+AD2ee6jun7YBNPe 9ZfQ== 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=/Pxn4hLvHFl7SP+PJwZ9WLDfJ3iclWlvQDwWKU4dNjY=; b=FBjPIkMNlPQ6UISxI7Xz38PI39eQrj60LYvFqMCCXf3femu9aRq6QTwOnbmgXXTA7G 8pr3gVFTjhuuOerTD9YCeXByuC0VfWlj33l6lrVDJXqEzVY2eAbd6nrmH/qfZz0Y/A3C 7HuKmCAK0dMFt0H1uVkVz2nfOn82jE/5mSUThvxwuyJSURWAcdanLfxdP3D70GZ1f/d7 tPzjr/nGK7IfzaFKsp8PvxRczljwTnHLuPAFM2GB6HNWDYjwWveq98qtNIYpLIndupYN KppZtEiPf+7yUrHV74ug77RNy8u7E9ydVFTSlsNld/+DIycxiNIWcyhAJ796PJmwv9xd UPpw== X-Gm-Message-State: AOAM533BWiz9XF/Njkv/1pqRCSaud5srX+47YYeMQmFdPYDWiIN8OLFK ANhsWzqNl9yFsaw/XGbAQGK/hfopCT4= X-Google-Smtp-Source: ABdhPJyqkC7N4pNVEM4BOVnXTVD0eCADTAFo9ShdTLCKMUecuMcl+Lb5SS4VF6+ikdgjDsPtRk2rdw== X-Received: by 2002:a17:906:3ce2:: with SMTP id d2mr26528131ejh.410.1633452259015; Tue, 05 Oct 2021 09:44:19 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 08/12] meson: bump submodule to 0.59.2 Date: Tue, 5 Oct 2021 18:44:04 +0200 Message-Id: <20211005164408.288128-9-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211005164408.288128-1-pbonzini@redhat.com> References: <20211005164408.288128-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.249, 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: 1633455106755100001 Content-Type: text/plain; charset="utf-8" The update to 0.57 has been delayed due to it causing warnings for some actual issues, but it brings in important bugfixes and new features. 0.58 also brings in a bugfix that is useful for modinfo. Important bugfixes: - 0.57: https://github.com/mesonbuild/meson/pull/7760, build: use PIE objects for non-PIC static libraries if b_pie=3Dtrue - 0.57: https://github.com/mesonbuild/meson/pull/7900, thus avoiding unnecessary rebuilds after running meson. - 0.58.2: https://github.com/mesonbuild/meson/pull/8900, fixes for passing extract_objects() to custom_target (useful for modinfo) Features: - 0.57: the keyval module has now been stabilized - 0.57: env argument to custom_target (useful for hexagon) - 0.57: Feature parity between "meson test" and QEMU's TAP driver - 0.57: https://github.com/mesonbuild/meson/pull/8231, allows bringing back version numbers in the configuration summary - 0.59: Utility methods for feature objects Signed-off-by: Paolo Bonzini --- meson | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson b/meson index 776acd2a80..b25d94e7c7 160000 --- a/meson +++ b/meson @@ -1 +1 @@ -Subproject commit 776acd2a805c9b42b4f0375150977df42130317f +Subproject commit b25d94e7c77fda05a7fdfe8afe562cf9760d69da --=20 2.31.1 From nobody Thu May 9 05:51:05 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 1633456545293239.84834123149517; Tue, 5 Oct 2021 10:55:45 -0700 (PDT) Received: from localhost ([::1]:48354 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mXofH-0001O8-6Y for importer@patchew.org; Tue, 05 Oct 2021 13:55:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45140) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mXnYJ-0007vx-0q for qemu-devel@nongnu.org; Tue, 05 Oct 2021 12:44:27 -0400 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]:39692) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mXnYD-0003zs-D0 for qemu-devel@nongnu.org; Tue, 05 Oct 2021 12:44:26 -0400 Received: by mail-ed1-x52a.google.com with SMTP id x7so1172692edd.6 for ; Tue, 05 Oct 2021 09:44:21 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id x14sm6101392edd.25.2021.10.05.09.44.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Oct 2021 09:44:19 -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=L7aq730I1ONq17GlXDCr+P8AQuo8sCuixTJDUPu3mOI=; b=nvbmlhUv9FU96q6qegcsFKE89wXMZTO65fxmU/XpMntzCOXnwdOhgeZId/UKoaLNVO PJCjHyhGNNhp1WDkB6+ewPS7UQ35vUdwqfYPSfVn9lhEF13IhbEkOGngvbZmNb2e4AsO rOl/0NvxN1QVjoRKfCbR5oBtwE4PG6+Se0uSoh702X9d49UTWckY0V68IZwCLx8pzglo 4CaXrCEgJ+USYvWUz1BdF5nUXQNJsazuHFtDc7BmTWe0RVBbnRkV2m4lujmlqoUxBQKk /eLS8XGsVyOnVm2DqE7QczHmvCOGT68yrzd07mWAGlLVyzAVx540ZWJR4dI4FWLu7S5q Dbog== 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=L7aq730I1ONq17GlXDCr+P8AQuo8sCuixTJDUPu3mOI=; b=BKKzVJCE0g905HqrqW4Aksq/bvHrjseaXeMH3y6IIg2+jEX+N8zkSbUQW57IsW4SYG E23d0iryRYtCa7rTeoL+LFaJiyEM1dne2omeOy6ZhqTWGIHrqugPJgBqQBweAGswad7d yQO59qqaJBc4zMGFoCxoQ83Reiqig32tOY7w1ncec7jXQAXtGr1y4CHJCaiIXQKJMP5/ HrgOaRYzEsK22ofYlCmolCfhGnPh9N0jyDzuvQ1HTmA++DgDu+MFg0i/CvMUEGjUI4j/ lX18MU8ohCEmjRzI2oWaau3eZJVwbQ5Bt/p79Ys1qRRS+94KSVfKG9G8OhUqHRf38Imf oEog== X-Gm-Message-State: AOAM533TzsPbnUIUbyj4+rAcuLjDSu3APas9AbQH/ruclERO24njFqki y5jancUZUKhacsdgwhlgZ92UL6kWS8s= X-Google-Smtp-Source: ABdhPJzo8Diweh7VvuE1Ddz0BwLPap5kr9CFuVkfT6UIUPe5rNKxtFlO0ConfhcKnyMKFM6tS+UXfg== X-Received: by 2002:aa7:c2cd:: with SMTP id m13mr6211620edp.365.1633452259972; Tue, 05 Oct 2021 09:44:19 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 09/12] meson: switch minimum meson version to 0.58.2, minimum recommended to 0.59.2 Date: Tue, 5 Oct 2021 18:44:05 +0200 Message-Id: <20211005164408.288128-10-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211005164408.288128-1-pbonzini@redhat.com> References: <20211005164408.288128-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: -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.249, 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?Marc-Andr=C3=A9=20Lureau?= 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: 1633456547016100001 Meson 0.58.2 does not need b_staticpic=3D$pie anymore, and has stabilized the keyval module. Remove the workaround and use a few replacements for features deprecated in the 0.57.0 release cycle. One feature that we would like to use is passing dependencies to summary. However, that was broken in 0.59.0 and 0.59.1. Therefore, use the embedded Meson if the host has anything older than 0.59.2, but allow --meson=3D to use 0.58.2. Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Paolo Bonzini --- configure | 8 ++---- docs/meson.build | 14 ++++----- meson.build | 54 ++++++++++++++++------------------- plugins/meson.build | 4 +-- scripts/mtest2make.py | 7 ++--- tests/qapi-schema/meson.build | 4 +-- tests/qtest/meson.build | 2 +- tests/unit/meson.build | 2 +- trace/meson.build | 4 +-- 9 files changed, 44 insertions(+), 55 deletions(-) diff --git a/configure b/configure index 1d3f099498..877bf3d76a 100755 --- a/configure +++ b/configure @@ -1994,7 +1994,7 @@ python_version=3D$($python -c 'import sys; print("%d.= %d.%d" % (sys.version_info[0] python=3D"$python -B" =20 if test -z "$meson"; then - if test "$explicit_python" =3D no && has meson && version_ge "$(meson = --version)" 0.55.3; then + if test "$explicit_python" =3D no && has meson && version_ge "$(meson = --version)" 0.59.2; then meson=3Dmeson elif test $git_submodules_action !=3D 'ignore' ; then meson=3Dgit @@ -5163,10 +5163,6 @@ if test "$skip_meson" =3D no; then mv $cross config-meson.cross =20 rm -rf meson-private meson-info meson-logs - unset staticpic - if ! version_ge "$($meson --version)" 0.56.0; then - staticpic=3D$(if test "$pie" =3D yes; then echo true; else echo false;= fi) - fi NINJA=3D$ninja $meson setup \ --prefix "$prefix" \ --libdir "$libdir" \ @@ -5186,7 +5182,6 @@ if test "$skip_meson" =3D no; then -Dwerror=3D$(if test "$werror" =3D yes; then echo true; else echo = false; fi) \ -Dstrip=3D$(if test "$strip_opt" =3D yes; then echo true; else ech= o false; fi) \ -Db_pie=3D$(if test "$pie" =3D yes; then echo true; else echo fals= e; fi) \ - ${staticpic:+-Db_staticpic=3D$staticpic} \ -Db_coverage=3D$(if test "$gcov" =3D yes; then echo true; else ech= o false; fi) \ -Db_lto=3D$lto -Dcfi=3D$cfi -Dcfi_debug=3D$cfi_debug \ -Dmalloc=3D$malloc -Dmalloc_trim=3D$malloc_trim -Dsparse=3D$sparse= \ @@ -5222,6 +5217,7 @@ else perl -i -ne ' s/^gettext =3D true$/gettext =3D auto/; s/^gettext =3D false$/gettext =3D disabled/; + /^b_staticpic/ && next; print;' meson-private/cmd_line.txt fi fi diff --git a/docs/meson.build b/docs/meson.build index cffe1ecf1d..be4dc30f39 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -37,14 +37,14 @@ endif if build_docs SPHINX_ARGS +=3D ['-Dversion=3D' + meson.project_version(), '-Drelease= =3D' + config_host['PKGVERSION']] =20 - sphinx_extn_depends =3D [ meson.source_root() / 'docs/sphinx/depfile.py', - meson.source_root() / 'docs/sphinx/hxtool.py', - meson.source_root() / 'docs/sphinx/kerneldoc.py', - meson.source_root() / 'docs/sphinx/kernellog.py', - meson.source_root() / 'docs/sphinx/qapidoc.py', - meson.source_root() / 'docs/sphinx/qmp_lexer.py', + sphinx_extn_depends =3D [ meson.current_source_dir() / 'sphinx/depfile.p= y', + meson.current_source_dir() / 'sphinx/hxtool.py', + meson.current_source_dir() / 'sphinx/kerneldoc.p= y', + meson.current_source_dir() / 'sphinx/kernellog.p= y', + meson.current_source_dir() / 'sphinx/qapidoc.py', + meson.current_source_dir() / 'sphinx/qmp_lexer.p= y', qapi_gen_depends ] - sphinx_template_files =3D [ meson.source_root() / 'docs/_templates/foote= r.html' ] + sphinx_template_files =3D [ meson.project_source_root() / 'docs/_templat= es/footer.html' ] =20 have_ga =3D have_tools and config_host.has_key('CONFIG_GUEST_AGENT') =20 diff --git a/meson.build b/meson.build index 60f4f45165..17e77fe4ef 100644 --- a/meson.build +++ b/meson.build @@ -1,14 +1,10 @@ -project('qemu', ['c'], meson_version: '>=3D0.55.0', - default_options: ['warning_level=3D1', 'c_std=3Dgnu11', 'cpp_std= =3Dgnu++11', 'b_colorout=3Dauto'] + - (meson.version().version_compare('>=3D0.56.0') ? = [ 'b_staticpic=3Dfalse' ] : []), - version: run_command('head', meson.source_root() / 'VERSION').stdo= ut().strip()) +project('qemu', ['c'], meson_version: '>=3D0.58.2', + default_options: ['warning_level=3D1', 'c_std=3Dgnu11', 'cpp_std= =3Dgnu++11', 'b_colorout=3Dauto', + 'b_staticpic=3Dfalse'], + version: files('VERSION')) =20 not_found =3D dependency('', required: false) -if meson.version().version_compare('>=3D0.56.0') - keyval =3D import('keyval') -else - keyval =3D import('unstable-keyval') -endif +keyval =3D import('keyval') ss =3D import('sourceset') fs =3D import('fs') =20 @@ -1972,21 +1968,21 @@ genh +=3D configure_file(output: 'config-host.h', c= onfiguration: config_host_data) hxtool =3D find_program('scripts/hxtool') shaderinclude =3D find_program('scripts/shaderinclude.pl') qapi_gen =3D find_program('scripts/qapi-gen.py') -qapi_gen_depends =3D [ meson.source_root() / 'scripts/qapi/__init__.py', - meson.source_root() / 'scripts/qapi/commands.py', - meson.source_root() / 'scripts/qapi/common.py', - meson.source_root() / 'scripts/qapi/error.py', - meson.source_root() / 'scripts/qapi/events.py', - meson.source_root() / 'scripts/qapi/expr.py', - meson.source_root() / 'scripts/qapi/gen.py', - meson.source_root() / 'scripts/qapi/introspect.py', - meson.source_root() / 'scripts/qapi/parser.py', - meson.source_root() / 'scripts/qapi/schema.py', - meson.source_root() / 'scripts/qapi/source.py', - meson.source_root() / 'scripts/qapi/types.py', - meson.source_root() / 'scripts/qapi/visit.py', - meson.source_root() / 'scripts/qapi/common.py', - meson.source_root() / 'scripts/qapi-gen.py' +qapi_gen_depends =3D [ meson.current_source_dir() / 'scripts/qapi/__init__= .py', + meson.current_source_dir() / 'scripts/qapi/commands.p= y', + meson.current_source_dir() / 'scripts/qapi/common.py', + meson.current_source_dir() / 'scripts/qapi/error.py', + meson.current_source_dir() / 'scripts/qapi/events.py', + meson.current_source_dir() / 'scripts/qapi/expr.py', + meson.current_source_dir() / 'scripts/qapi/gen.py', + meson.current_source_dir() / 'scripts/qapi/introspect= .py', + meson.current_source_dir() / 'scripts/qapi/parser.py', + meson.current_source_dir() / 'scripts/qapi/schema.py', + meson.current_source_dir() / 'scripts/qapi/source.py', + meson.current_source_dir() / 'scripts/qapi/types.py', + meson.current_source_dir() / 'scripts/qapi/visit.py', + meson.current_source_dir() / 'scripts/qapi/common.py', + meson.current_source_dir() / 'scripts/qapi-gen.py' ] =20 tracetool =3D [ @@ -2635,14 +2631,14 @@ foreach target : target_dirs if target.endswith('-softmmu') execs =3D [{ 'name': 'qemu-system-' + target_name, - 'gui': false, + 'win_subsystem': 'console', 'sources': files('softmmu/main.c'), 'dependencies': [] }] if targetos =3D=3D 'windows' and (sdl.found() or gtk.found()) execs +=3D [{ 'name': 'qemu-system-' + target_name + 'w', - 'gui': true, + 'win_subsystem': 'windows', 'sources': files('softmmu/main.c'), 'dependencies': [] }] @@ -2651,7 +2647,7 @@ foreach target : target_dirs specific_fuzz =3D specific_fuzz_ss.apply(config_target, strict: fals= e) execs +=3D [{ 'name': 'qemu-fuzz-' + target_name, - 'gui': false, + 'win_subsystem': 'console', 'sources': specific_fuzz.sources(), 'dependencies': specific_fuzz.dependencies(), }] @@ -2659,7 +2655,7 @@ foreach target : target_dirs else execs =3D [{ 'name': 'qemu-' + target_name, - 'gui': false, + 'win_subsystem': 'console', 'sources': [], 'dependencies': [] }] @@ -2678,7 +2674,7 @@ foreach target : target_dirs link_language: link_language, link_depends: [block_syms, qemu_syms] + exe.get('link_depen= ds', []), link_args: link_args, - gui_app: exe['gui']) + win_subsystem: exe['win_subsystem']) =20 if targetos =3D=3D 'darwin' icon =3D 'pc-bios/qemu.rsrc' diff --git a/plugins/meson.build b/plugins/meson.build index bfd5c9822a..aeb386ebae 100644 --- a/plugins/meson.build +++ b/plugins/meson.build @@ -2,9 +2,9 @@ plugin_ldflags =3D [] # Modules need more symbols than just those in plugins/qemu-plugins.symbols if not enable_modules if 'CONFIG_HAS_LD_DYNAMIC_LIST' in config_host - plugin_ldflags =3D ['-Wl,--dynamic-list=3D' + (meson.build_root() / 'q= emu-plugins-ld.symbols')] + plugin_ldflags =3D ['-Wl,--dynamic-list=3D' + (meson.project_build_roo= t() / 'qemu-plugins-ld.symbols')] elif 'CONFIG_HAS_LD_EXPORTED_SYMBOLS_LIST' in config_host - plugin_ldflags =3D ['-Wl,-exported_symbols_list,' + (meson.build_root(= ) / 'qemu-plugins-ld64.symbols')] + plugin_ldflags =3D ['-Wl,-exported_symbols_list,' + (meson.project_bui= ld_root() / 'qemu-plugins-ld64.symbols')] endif endif =20 diff --git a/scripts/mtest2make.py b/scripts/mtest2make.py index ee072c0502..02c0453e67 100644 --- a/scripts/mtest2make.py +++ b/scripts/mtest2make.py @@ -60,11 +60,8 @@ def process_tests(test, targets, suites): if test['workdir'] is not None: print('.test.dir.%d :=3D %s' % (i, shlex.quote(test['workdir']))) =20 - if 'depends' in test: - deps =3D (targets.get(x, []) for x in test['depends']) - deps =3D itertools.chain.from_iterable(deps) - else: - deps =3D ['all'] + deps =3D (targets.get(x, []) for x in test['depends']) + deps =3D itertools.chain.from_iterable(deps) =20 print('.test.name.%d :=3D %s' % (i, test['name'])) print('.test.driver.%d :=3D %s' % (i, driver)) diff --git a/tests/qapi-schema/meson.build b/tests/qapi-schema/meson.build index 6187efbd58..df5acfd08b 100644 --- a/tests/qapi-schema/meson.build +++ b/tests/qapi-schema/meson.build @@ -1,5 +1,5 @@ test_env =3D environment() -test_env.set('PYTHONPATH', meson.source_root() / 'scripts') +test_env.set('PYTHONPATH', meson.project_source_root() / 'scripts') test_env.set('PYTHONIOENCODING', 'utf-8') =20 schemas =3D [ @@ -248,7 +248,7 @@ if build_docs # clutter up the build dir with the cache. command: [SPHINX_ARGS, '-b', 'text', '-E', - '-c', meson.source_root() / 'docs= ', + '-c', meson.project_source_root()= / 'docs', '-D', 'master_doc=3Ddoc-good', meson.current_source_dir(), meson.current_build_dir()]) diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index 19444d4752..c9d8458062 100644 --- a/tests/qtest/meson.build +++ b/tests/qtest/meson.build @@ -275,7 +275,7 @@ foreach dir : target_dirs qtest_env.set('QTEST_QEMU_IMG', './qemu-img') test_deps +=3D [qemu_img] endif - qtest_env.set('G_TEST_DBUS_DAEMON', meson.source_root() / 'tests/dbus-vm= state-daemon.sh') + qtest_env.set('G_TEST_DBUS_DAEMON', meson.project_source_root() / 'tests= /dbus-vmstate-daemon.sh') qtest_env.set('QTEST_QEMU_BINARY', './qemu-system-' + target_base) if have_tools and have_vhost_user_blk_server qtest_env.set('QTEST_QEMU_STORAGE_DAEMON_BINARY', './storage-daemon/qe= mu-storage-daemon') diff --git a/tests/unit/meson.build b/tests/unit/meson.build index 5736d285b2..7c297d7e5c 100644 --- a/tests/unit/meson.build +++ b/tests/unit/meson.build @@ -43,7 +43,7 @@ tests =3D { 'test-keyval': [testqapi], 'test-logging': [], 'test-uuid': [], - 'ptimer-test': ['ptimer-test-stubs.c', meson.source_root() / 'hw/core/pt= imer.c'], + 'ptimer-test': ['ptimer-test-stubs.c', meson.project_source_root() / 'hw= /core/ptimer.c'], 'test-qapi-util': [], } =20 diff --git a/trace/meson.build b/trace/meson.build index e401e7c415..b8f95de200 100644 --- a/trace/meson.build +++ b/trace/meson.build @@ -4,7 +4,7 @@ specific_ss.add(files('control-target.c')) trace_events_files =3D [] dtrace =3D find_program('dtrace', required: 'CONFIG_TRACE_DTRACE' in confi= g_host) foreach dir : [ '.' ] + trace_events_subdirs - trace_events_file =3D meson.source_root() / dir / 'trace-events' + trace_events_file =3D meson.project_source_root() / dir / 'trace-events' trace_events_files +=3D [ trace_events_file ] group_name =3D dir =3D=3D '.' ? 'root' : dir.underscorify() group =3D '--group=3D' + group_name @@ -70,7 +70,7 @@ foreach d : [ ] gen =3D custom_target(d[0], output: d[0], - input: meson.source_root() / 'trace-events', + input: meson.project_source_root() / 'trace-events', command: [ tracetool, '--group=3Droot', '--format=3D@0@'.f= ormat(d[1]), '@INPUT@', '@OUTPUT@' ], depend_files: tracetool_depends) specific_ss.add(when: 'CONFIG_TCG', if_true: gen) --=20 2.31.1 From nobody Thu May 9 05:51:05 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 1633455439027683.4816678977053; Tue, 5 Oct 2021 10:37:19 -0700 (PDT) Received: from localhost ([::1]:41394 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mXoNR-0001RX-Ql for importer@patchew.org; Tue, 05 Oct 2021 13:37:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45088) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mXnYF-0007sd-GV for qemu-devel@nongnu.org; Tue, 05 Oct 2021 12:44:23 -0400 Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]:40823) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mXnYD-0003zw-WF for qemu-devel@nongnu.org; Tue, 05 Oct 2021 12:44:23 -0400 Received: by mail-ed1-x535.google.com with SMTP id g8so1227035edt.7 for ; Tue, 05 Oct 2021 09:44:21 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id x14sm6101392edd.25.2021.10.05.09.44.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Oct 2021 09:44:20 -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=VMxPJY6t4uoMf/I961hE4R2GzgtcCFDrssDoN4r5NzQ=; b=A1sZe2WpmWg13qvHB8ePsix5r/JJPfIazuU9qFj19Thb8YSqzVhn+MyDKlYsjWTSkC cUpICsVKwcm0o8HHSMJjNuwn97/hM0XgpJGHykCw/ZMf5uDfWKSF4VV43EiHVCfOhAVn xHIRm5nkCnkYgybRkE+Zau9ylwUAIs0gV5BFVcbzin0Ma8FkrDXPp4DtOb2u1vEiPmyB xJrktKpKk8ZpuXJ9wPV7hzvqE9bWB12rkxTK/SzsYV3yZsEcuWwQnufg9YQnJn7j68Xa MSFdxRh8sydD71GVF9e4sdZStl2S+t6DUd3kOEQGzhQuL68QAW1RxHOpPnQbb3NgDM5i ls0g== 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=VMxPJY6t4uoMf/I961hE4R2GzgtcCFDrssDoN4r5NzQ=; b=Aykq08XcT0wjHnU/XXc760bslD7kNJJor0iPcGqcKM2WS0ui7fUqD4XLQZFbZB/2EQ b/QhCVXKkGtQRB69kRMEYq2dLck3TBNZVrOYqNCtNRgRfhg/UcxgfAzR0bzSludR2geF x+jbEE6/sOFgbItfwlH8bVvdBkZSHMM/3W+E6CbcpVwn/c2MmWkrB0i/fcBphPuTXdRJ w6t9DMsbwK1mgpW577GjY4LDOy9vRHAi5N4tiP6bfImAKOdVQ0qSvVh0B03624J8ExP8 QeTncsOeWhJR/OtfpTWaEMlnXdwKKZ+ymWhusHgcqFBEWaxrdeHJ9GfF1jDIR4Cg3IbK bLsw== X-Gm-Message-State: AOAM5332TdCCLaJgfmJWI9iJRjT+Z2Kh/kJn1E9PD24EDtqZKpGBHaBz 4v15FHyPxTElBaZ83CVZxpCH+3Rvd5A= X-Google-Smtp-Source: ABdhPJx44QLNIO6lvI4d+ME3eMjdXAs/WnSh4l3VP8M8IswX7pPA+TrGfjSjjJ1hiuXUNak26Y1e+g== X-Received: by 2002:a17:906:3402:: with SMTP id c2mr25929857ejb.271.1633452260688; Tue, 05 Oct 2021 09:44:20 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 10/12] hexagon: use env keyword argument to pass PYTHONPATH Date: Tue, 5 Oct 2021 18:44:06 +0200 Message-Id: <20211005164408.288128-11-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211005164408.288128-1-pbonzini@redhat.com> References: <20211005164408.288128-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::535; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x535.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.249, 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: 1633455440542100001 Content-Type: text/plain; charset="utf-8" This feature is new in meson 0.57 and allows getting rid of the "env" wrapp= er. Signed-off-by: Paolo Bonzini --- target/hexagon/meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/hexagon/meson.build b/target/hexagon/meson.build index 6fd9360b74..c6d858ffb2 100644 --- a/target/hexagon/meson.build +++ b/target/hexagon/meson.build @@ -156,7 +156,8 @@ dectree_generated =3D custom_target( 'dectree_generated.h.inc', output: 'dectree_generated.h.inc', depends: [iset_py], - command: ['env', 'PYTHONPATH=3D' + meson.current_build_dir(), files('d= ectree.py'), '@OUTPUT@'], + env: {'PYTHONPATH': meson.current_build_dir()}, + command: [python, files('dectree.py'), '@OUTPUT@'], ) hexagon_ss.add(dectree_generated) =20 --=20 2.31.1 From nobody Thu May 9 05:51:05 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 163345485552233.65057266330098; Tue, 5 Oct 2021 10:27:35 -0700 (PDT) Received: from localhost ([::1]:40704 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mXoE2-00077B-Ge for importer@patchew.org; Tue, 05 Oct 2021 13:27:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45122) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mXnYI-0007v3-42 for qemu-devel@nongnu.org; Tue, 05 Oct 2021 12:44:26 -0400 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]:38489) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mXnYE-00040m-RR for qemu-devel@nongnu.org; Tue, 05 Oct 2021 12:44:24 -0400 Received: by mail-ed1-x531.google.com with SMTP id dj4so1218083edb.5 for ; Tue, 05 Oct 2021 09:44:22 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id x14sm6101392edd.25.2021.10.05.09.44.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Oct 2021 09:44:20 -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=UArhIR2Xzaj04yqObEvMGnbWPul/JgDRnUvix747Vb0=; b=BKU0auOVLE0NpSmkrnWKWuBZEH9q6y8rzxcEyd1Z3zQwlw7gMim4lEE6PIT1jvUMKP bmqdYyWHkwaSTBMo3NdnQ/aN7EpXawwRDozpDE9zRUQufvgY6o8Loo2bAqNPPG9Pmw51 uDuGzXWXb833A4ooBmG4oE2I4IRVnr130r/s1luJkV1J2vYAyOYpCb72XbRHvaGYGWZk pUMAIQIeou8PUjdm0a4JZFqeg2LfHS/9esg3O3bELSpVKs9jA74YKDJOjxNxEmSneArU aZ25Tmf0S032r1GSLb+v+WD821iha4jSQm/lHvRciaKE4s4wbcp/xVnbESHDe78NxDgP i6pA== 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=UArhIR2Xzaj04yqObEvMGnbWPul/JgDRnUvix747Vb0=; b=c5dcy1jMwTgwWxE5VR3PzNWRiy5eBFV42cveBAPQzNNU8gKZeIXKhoEk4by3BNSZRS tFNCebH8oGpduBu9AdbP+FHX7Dcr/OiC5Dbk6oQejifBZWeZVDkM7iydvHMjuM3aaUei iNs/By/ftPibkM/b7fEzi9ZBurhGst6W0RlF4Yvbfpi1DG1emtF2hObB5bllb0HH2Lgj x3VWMC3CoUG1Gz8MkJ81A9+WjsvIZR+N3bZNOFtufj77X++UXHH7ic0iYDnfYhk13I+I 5CIGtVPcb2dD2bokbJlCRkPC0R4t/dw2PWC1VWRz4ddRbDTvn0Rg0WAfxKWe4GBM7VJN NVZA== X-Gm-Message-State: AOAM533a4W/l5L65ROob1KmcfjKwGlmV2BXokc9wjZ0wJLJjab5c3JbI EOtqzjFdqlL9MYhg9axk7fZoRq8DA9I= X-Google-Smtp-Source: ABdhPJzIATpR1/g4TSec7YkGqqIut3iW/QgTQXiG2nj9OCQmaLf4CN/LYiLffvac4iArmdvxxGcMAw== X-Received: by 2002:a17:906:6dc1:: with SMTP id j1mr26195100ejt.324.1633452261521; Tue, 05 Oct 2021 09:44:21 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 11/12] target/xtensa: list cores in a text file Date: Tue, 5 Oct 2021 18:44:07 +0200 Message-Id: <20211005164408.288128-12-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211005164408.288128-1-pbonzini@redhat.com> References: <20211005164408.288128-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::531; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x531.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.249, 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: 1633454856189100001 Content-Type: text/plain; charset="utf-8" Avoid that leftover files affect the build; instead, use the same mechanism that was in place before the Meson transition of updating a file from import_core.sh. Starting with Meson 0.57, the file can be easily read from the filesystem module, so do that instead of using run_command. Signed-off-by: Paolo Bonzini --- target/xtensa/cores.list | 9 +++++++++ target/xtensa/import_core.sh | 3 +++ target/xtensa/meson.build | 4 ++-- 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 target/xtensa/cores.list diff --git a/target/xtensa/cores.list b/target/xtensa/cores.list new file mode 100644 index 0000000000..5772a00ab2 --- /dev/null +++ b/target/xtensa/cores.list @@ -0,0 +1,9 @@ +core-dc232b.c +core-dc233c.c +core-de212.c +core-de233_fpu.c +core-dsp3400.c +core-fsf.c +core-sample_controller.c +core-test_kc705_be.c +core-test_mmuhifi_c3.c diff --git a/target/xtensa/import_core.sh b/target/xtensa/import_core.sh index 396b264be9..df66d09393 100755 --- a/target/xtensa/import_core.sh +++ b/target/xtensa/import_core.sh @@ -66,3 +66,6 @@ static XtensaConfig $NAME __attribute__((unused)) =3D { =20 REGISTER_CORE($NAME) EOF + +grep -qxf core-${NAME}.c "$BASE"/cores.list || \ + echo core-${NAME}.c >> "$BASE"/cores.list diff --git a/target/xtensa/meson.build b/target/xtensa/meson.build index 7c4efa6c62..20bbf9b335 100644 --- a/target/xtensa/meson.build +++ b/target/xtensa/meson.build @@ -1,7 +1,7 @@ xtensa_ss =3D ss.source_set() =20 -xtensa_cores =3D run_command('sh', '-c', 'cd $MESON_SOURCE_ROOT/$MESON_SUB= DIR ; ls -1 core-*.c') -xtensa_ss.add(files(xtensa_cores.stdout().strip().split('\n'))) +xtensa_cores =3D fs.read('cores.list') +xtensa_ss.add(files(xtensa_cores.strip().split('\n'))) =20 xtensa_ss.add(files( 'cpu.c', --=20 2.31.1 From nobody Thu May 9 05:51:05 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 1633455787063547.2069547109874; Tue, 5 Oct 2021 10:43:07 -0700 (PDT) Received: from localhost ([::1]:49950 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mXoT3-0007nQ-V9 for importer@patchew.org; Tue, 05 Oct 2021 13:43:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45160) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mXnYJ-0007xp-Pa for qemu-devel@nongnu.org; Tue, 05 Oct 2021 12:44:28 -0400 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]:40818) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mXnYH-00041Q-TN for qemu-devel@nongnu.org; Tue, 05 Oct 2021 12:44:27 -0400 Received: by mail-ed1-x52f.google.com with SMTP id g8so1227400edt.7 for ; Tue, 05 Oct 2021 09:44:23 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id x14sm6101392edd.25.2021.10.05.09.44.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Oct 2021 09:44:21 -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=Wx/PjAyfkj4ohI4PJ7Vi/Y2903RdRJzTnW/zD2NVT8Q=; b=AAgDjahgCIywPBbFp+xdzrX1dkQRn15MaAtj6cZ4IGmMYNWBuV6LtA/5mCP+EP3wea oM0MTWFqMBP82KOHQzmABuKi5D1TCw09nOMtmTaoB7sAA8T/0Q0C1ZSNb1tg7VkgEICz SWCUBHfzicUMR5nm3nL+IfvyTIBYNoyTSTaqZRcXZeyr1daWEsgj0oWEXFUNyyNW/hxT PhRVj85iM2DcUepU65f8AZZDB95CaO2HL3f8moN7/lSmPsvd8U7s7jgmA20I43dg/qG+ 0mQM2Xdvo7Zmgrff3fxjBE6YGNA0oYyLqf9dHjLtxvCFbrGxz1uZV8rOFBow6+kgbyOR pVLA== 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=Wx/PjAyfkj4ohI4PJ7Vi/Y2903RdRJzTnW/zD2NVT8Q=; b=tCg5LnEVaGdlwlsBN6SNuJjhb9Sn+RFXj2LQWH1eeGJv13xzakhkW9ydQf2f0YG630 Ge1wCKexA7QNSumdW/g0BWtqtYooK4fljKV+0I5X3eD9c0V03oXNLWQkAnd49h0fMk9r qO2cFdhpbzhUodmd7kTtS98d4H04Y5dofyP1kcdbU8/CKMk32K8trWdqqqCGyF9njo6J 91m12lnJ8WubJ58nfXpF0iRcQ4ojuLTXpdF6LYU44Vru0pKzURSZki3nSjsBYfSXxoGy +RtooyIkTuxVTwv25E1u2kr7pHJi+BcSdKPzGRZlnNEiK2RsAJFjlySXqwB7wDsjdPqx 14MQ== X-Gm-Message-State: AOAM530yeYx0w90lMpT7lh+XEamgvcJCkOuUX3XL2T9wicwP8zMSn0Vf xHxjyG46/jczOnbw1PgLOBu32E/nxIo= X-Google-Smtp-Source: ABdhPJwf5WbQ74r734IxCZDnsDFaurMtdWqDCWr6EFvV5hcZNWQRABb6zsXy/HxVDmzW7ViFqZt26Q== X-Received: by 2002:a17:906:1707:: with SMTP id c7mr24323937eje.377.1633452262374; Tue, 05 Oct 2021 09:44:22 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 12/12] meson: show library versions in the summary Date: Tue, 5 Oct 2021 18:44:08 +0200 Message-Id: <20211005164408.288128-13-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211005164408.288128-1-pbonzini@redhat.com> References: <20211005164408.288128-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.249, 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: 1633455789479100001 Content-Type: text/plain; charset="utf-8" Meson 0.57 allows passing external programs and dependency objects to summary(). Use this to show library versions and paths in the summary. Signed-off-by: Paolo Bonzini --- meson.build | 112 +++++++++++++++++++++++++--------------------------- 1 file changed, 54 insertions(+), 58 deletions(-) diff --git a/meson.build b/meson.build index 17e77fe4ef..7b596fdcd9 100644 --- a/meson.build +++ b/meson.build @@ -2859,13 +2859,13 @@ summary_info =3D {} summary_info +=3D {'git': config_host['GIT']} summary_info +=3D {'make': config_host['MAKE']} summary_info +=3D {'python': '@0@ (version: @1@)'.format(python= .full_path(), python.language_version())} -summary_info +=3D {'sphinx-build': sphinx_build.found()} +summary_info +=3D {'sphinx-build': sphinx_build} if config_host.has_key('HAVE_GDB_BIN') summary_info +=3D {'gdb': config_host['HAVE_GDB_BIN']} endif summary_info +=3D {'genisoimage': config_host['GENISOIMAGE']} if targetos =3D=3D 'windows' and config_host.has_key('CONFIG_GUEST_AGENT') - summary_info +=3D {'wixl': wixl.found() ? wixl.full_path() : = false} + summary_info +=3D {'wixl': wixl} endif if slirp_opt !=3D 'disabled' and 'CONFIG_SLIRP_SMBD' in config_host summary_info +=3D {'smbd': config_host['CONFIG_SMBD_COMMAND']} @@ -2956,7 +2956,7 @@ if get_option('cfi') summary_info +=3D {'CFI debug support': get_option('cfi_debug')} endif summary_info +=3D {'strip binaries': get_option('strip')} -summary_info +=3D {'sparse': sparse.found() ? sparse.full_path(= ) : false} +summary_info +=3D {'sparse': sparse} summary_info +=3D {'mingw32 support': targetos =3D=3D 'windows'} =20 # snarf the cross-compilation information for tests @@ -3028,19 +3028,19 @@ if have_block summary_info +=3D {'vvfat support': config_host.has_key('CONFIG_VVFA= T')} summary_info +=3D {'qed support': config_host.has_key('CONFIG_QED'= )} summary_info +=3D {'parallels support': config_host.has_key('CONFIG_PARA= LLELS')} - summary_info +=3D {'FUSE exports': fuse.found()} + summary_info +=3D {'FUSE exports': fuse} endif summary(summary_info, bool_yn: true, section: 'Block layer support') =20 # Crypto summary_info =3D {} summary_info +=3D {'TLS priority': config_host['CONFIG_TLS_PRIORITY']} -summary_info +=3D {'GNUTLS support': gnutls.found()} -summary_info +=3D {'GNUTLS crypto': gnutls_crypto.found()} -# TODO: add back version -summary_info +=3D {'libgcrypt': gcrypt.found()} -# TODO: add back version -summary_info +=3D {'nettle': nettle.found()} +summary_info +=3D {'GNUTLS support': gnutls} +if gnutls.found() + summary_info +=3D {' GNUTLS crypto': gnutls_crypto.found()} +endif +summary_info +=3D {'libgcrypt': gcrypt} +summary_info +=3D {'nettle': nettle} if nettle.found() summary_info +=3D {' XTS': xts !=3D 'private'} endif @@ -3052,76 +3052,72 @@ summary(summary_info, bool_yn: true, section: 'Cryp= to') # Libraries summary_info =3D {} if targetos =3D=3D 'darwin' - summary_info +=3D {'Cocoa support': cocoa.found()} + summary_info +=3D {'Cocoa support': cocoa} endif -# TODO: add back version -summary_info +=3D {'SDL support': sdl.found()} -summary_info +=3D {'SDL image support': sdl_image.found()} -# TODO: add back version -summary_info +=3D {'GTK support': gtk.found()} -summary_info +=3D {'pixman': pixman.found()} -# TODO: add back version -summary_info +=3D {'VTE support': vte.found()} -# TODO: add back version -summary_info +=3D {'slirp support': slirp_opt =3D=3D 'disabled' ? fals= e : slirp_opt} -summary_info +=3D {'libtasn1': tasn1.found()} -summary_info +=3D {'PAM': pam.found()} -summary_info +=3D {'iconv support': iconv.found()} -summary_info +=3D {'curses support': curses.found()} -# TODO: add back version -summary_info +=3D {'virgl support': virgl.found()} -summary_info +=3D {'curl support': curl.found()} -summary_info +=3D {'Multipath support': mpathpersist.found()} -summary_info +=3D {'VNC support': vnc.found()} +summary_info +=3D {'SDL support': sdl} +summary_info +=3D {'SDL image support': sdl_image} +summary_info +=3D {'GTK support': gtk} +summary_info +=3D {'pixman': pixman} +summary_info +=3D {'VTE support': vte} +summary_info +=3D {'slirp support': slirp_opt =3D=3D 'internal' ? slir= p_opt : slirp} +summary_info +=3D {'libtasn1': tasn1} +summary_info +=3D {'PAM': pam} +summary_info +=3D {'iconv support': iconv} +summary_info +=3D {'curses support': curses} +summary_info +=3D {'virgl support': virgl} +summary_info +=3D {'curl support': curl} +summary_info +=3D {'Multipath support': mpathpersist} +summary_info +=3D {'VNC support': vnc} if vnc.found() - summary_info +=3D {'VNC SASL support': sasl.found()} - summary_info +=3D {'VNC JPEG support': jpeg.found()} - summary_info +=3D {'VNC PNG support': png.found()} + summary_info +=3D {'VNC SASL support': sasl} + summary_info +=3D {'VNC JPEG support': jpeg} + summary_info +=3D {'VNC PNG support': png} endif -summary_info +=3D {'brlapi support': brlapi.found()} +summary_info +=3D {'brlapi support': brlapi} summary_info +=3D {'vde support': config_host.has_key('CONFIG_VDE')} summary_info +=3D {'netmap support': config_host.has_key('CONFIG_NETMAP= ')} summary_info +=3D {'Linux AIO support': config_host.has_key('CONFIG_LINUX_= AIO')} -summary_info +=3D {'Linux io_uring support': linux_io_uring.found()} -summary_info +=3D {'ATTR/XATTR support': libattr.found()} +summary_info +=3D {'Linux io_uring support': linux_io_uring} +summary_info +=3D {'ATTR/XATTR support': libattr} summary_info +=3D {'RDMA support': config_host.has_key('CONFIG_RDMA')} summary_info +=3D {'PVRDMA support': config_host.has_key('CONFIG_PVRDMA= ')} summary_info +=3D {'fdt support': fdt_opt =3D=3D 'disabled' ? false = : fdt_opt} -summary_info +=3D {'libcap-ng support': libcap_ng.found()} -summary_info +=3D {'bpf support': libbpf.found()} +summary_info +=3D {'libcap-ng support': libcap_ng} +summary_info +=3D {'bpf support': libbpf} # TODO: add back protocol and server version summary_info +=3D {'spice support': config_host.has_key('CONFIG_SPICE'= )} -summary_info +=3D {'rbd support': rbd.found()} +summary_info +=3D {'rbd support': rbd} summary_info +=3D {'xfsctl support': config_host.has_key('CONFIG_XFS')} -summary_info +=3D {'smartcard support': cacard.found()} -summary_info +=3D {'U2F support': u2f.found()} -summary_info +=3D {'libusb': libusb.found()} -summary_info +=3D {'usb net redir': usbredir.found()} +summary_info +=3D {'smartcard support': cacard} +summary_info +=3D {'U2F support': u2f} +summary_info +=3D {'libusb': libusb} +summary_info +=3D {'usb net redir': usbredir} summary_info +=3D {'OpenGL support': config_host.has_key('CONFIG_OPENGL= ')} -summary_info +=3D {'GBM': gbm.found()} -summary_info +=3D {'libiscsi support': libiscsi.found()} -summary_info +=3D {'libnfs support': libnfs.found()} +summary_info +=3D {'GBM': gbm} +summary_info +=3D {'libiscsi support': libiscsi} +summary_info +=3D {'libnfs support': libnfs} if targetos =3D=3D 'windows' if config_host.has_key('CONFIG_GUEST_AGENT') summary_info +=3D {'QGA VSS support': config_host.has_key('CONFIG_QG= A_VSS')} summary_info +=3D {'QGA w32 disk info': config_host.has_key('CONFIG_QG= A_NTDDSCSI')} endif endif -summary_info +=3D {'seccomp support': seccomp.found()} -summary_info +=3D {'GlusterFS support': glusterfs.found()} +summary_info +=3D {'seccomp support': seccomp} +summary_info +=3D {'GlusterFS support': glusterfs} summary_info +=3D {'TPM support': config_host.has_key('CONFIG_TPM')} summary_info +=3D {'libssh support': config_host.has_key('CONFIG_LIBSSH= ')} -summary_info +=3D {'lzo support': lzo.found()} -summary_info +=3D {'snappy support': snappy.found()} -summary_info +=3D {'bzip2 support': libbzip2.found()} -summary_info +=3D {'lzfse support': liblzfse.found()} -summary_info +=3D {'zstd support': zstd.found()} +summary_info +=3D {'lzo support': lzo} +summary_info +=3D {'snappy support': snappy} +summary_info +=3D {'bzip2 support': libbzip2} +summary_info +=3D {'lzfse support': liblzfse} +summary_info +=3D {'zstd support': zstd} summary_info +=3D {'NUMA host support': config_host.has_key('CONFIG_NUMA')} -summary_info +=3D {'libxml2': libxml2.found()} -summary_info +=3D {'capstone': capstone_opt =3D=3D 'disabled' ? f= alse : capstone_opt} -summary_info +=3D {'libpmem support': libpmem.found()} -summary_info +=3D {'libdaxctl support': libdaxctl.found()} -summary_info +=3D {'libudev': libudev.found()} +summary_info +=3D {'libxml2': libxml2} +summary_info +=3D {'capstone': capstone_opt =3D=3D 'internal' ? c= apstone_opt : capstone} +summary_info +=3D {'libpmem support': libpmem} +summary_info +=3D {'libdaxctl support': libdaxctl} +summary_info +=3D {'libudev': libudev} +# Dummy dependency, keep .found() summary_info +=3D {'FUSE lseek': fuse_lseek.found()} summary(summary_info, bool_yn: true, section: 'Dependencies') =20 --=20 2.31.1