From nobody Sat May 18 21:00:24 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 1646677734073571.181620630512; Mon, 7 Mar 2022 10:28:54 -0800 (PST) Received: from localhost ([::1]:50226 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nRI6H-000221-Ob for importer@patchew.org; Mon, 07 Mar 2022 13:28:53 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55406) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRHuj-000197-1d for qemu-devel@nongnu.org; Mon, 07 Mar 2022 13:16:57 -0500 Received: from [2a00:1450:4864:20::529] (port=41659 helo=mail-ed1-x529.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nRHud-0005Mb-7w for qemu-devel@nongnu.org; Mon, 07 Mar 2022 13:16:56 -0500 Received: by mail-ed1-x529.google.com with SMTP id c20so2720047edr.8 for ; Mon, 07 Mar 2022 10:16:37 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id d8-20020a170906304800b006cdf8a1e146sm4983382ejd.217.2022.03.07.10.16.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 10:16:35 -0800 (PST) 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=Y9cqJILoV0+xn8mWQ2aytUPnC+SpQT6vl7Ugzs0thRM=; b=juzHXceilW31CyV5E9mPgkehz6KhjV5CzDz4/s11KlLT32CvnWRlPm1iIZW6yyfI9B aqWF99/ZaigyH29JGSO6653W6Cd9NxaY6V6E852OVg94CFyS5lLw9r5YsycEh3cZhxTx /pGkNb+G7PSTqjUfhaAjuwAEbAAgO04LV0VKP1M0s27adZSWVquXG5rThsIU+GEXMItB zuUcmO+iHCZDn3C4BDvcHt6AyIkvjYCcyWo5RzHZYsKx3lArCe1D8G9w+6GCzflurP17 vyGKZZtkuxSeConWrmWoar0NPYax4xAKUm2nK4/TbQj2eHrqnZA8vMB621EBwCB/AXbZ yrrQ== 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=Y9cqJILoV0+xn8mWQ2aytUPnC+SpQT6vl7Ugzs0thRM=; b=1xtzK8ShftPeYwtwiN/jbgKKuD+MDjHElcehkB0WwW14uvJI+0ng+G3tkRfp8BnwaL nXfuPoTQvLvARvRpXtEzbGrInVo7GieL+Myow/FEnmGicDoI+6DWqltlONYRk73Px3do tLsRB79+8uO/bwLVgHzr8J7YKal9Fnbjk9juwH0/OdZwYm/5+XQEVBz3/QdmC1V8ksGy I8+rNCTjMzk7Mn2RPYIz2lpwWaTPJajSTX28pT9iAhJuWytsR9M3bicrtTqsHwEoV/jt 0arThk/wtgBR2mDICYLGjgWg8srAixkxfz5l6LBcrAlySRZikQpwwzuve7FSsP/BkSwd ELTw== X-Gm-Message-State: AOAM530Yk7VEX0mBqxr8iOHYOhjlgnoklVphiFnaTVCz2baz1/zy/8+Z dosc1XiDlOLBt/tKzvyyvOixwMk9lEU= X-Google-Smtp-Source: ABdhPJzuJ2CcNqMr+9oavKZ0y+YANajD5E7gZXeNgEeGLvlFvKpe16WW9EPSJ/TqXFTO/s4hxzrzVw== X-Received: by 2002:a50:d498:0:b0:416:2b00:532 with SMTP id s24-20020a50d498000000b004162b000532mr10545738edi.396.1646676996341; Mon, 07 Mar 2022 10:16:36 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 01/23] whpx: Fixed reporting of the CPU context to GDB for 64-bit Date: Mon, 7 Mar 2022 19:16:11 +0100 Message-Id: <20220307181633.596898-2-pbonzini@redhat.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220307181633.596898-1-pbonzini@redhat.com> References: <20220307181633.596898-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::529 (failed) 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: 0 X-Spam_score: -0.1 X-Spam_bar: / X-Spam_report: (-0.1 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ivan Shcherbakov 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: 1646677736327100001 Content-Type: text/plain; charset="utf-8" From: Ivan Shcherbakov Make sure that pausing the VM while in 64-bit mode will set the HF_CS64_MASK flag in env->hflags (see x86_update_hflags() in target/i386/cpu.c). Without it, the code in gdbstub.c would only use the 32-bit register values when debugging 64-bit targets, making debugging effectively impossible. Signed-off-by: Ivan Shcherbakov Message-Id: <00f701d82874$68b02000$3a106000$@sysprogs.com> Signed-off-by: Paolo Bonzini --- target/i386/whpx/whpx-all.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/i386/whpx/whpx-all.c b/target/i386/whpx/whpx-all.c index ef896da0a2..edd4fafbdf 100644 --- a/target/i386/whpx/whpx-all.c +++ b/target/i386/whpx/whpx-all.c @@ -604,6 +604,8 @@ static void whpx_get_registers(CPUState *cpu) whpx_apic_get(x86_cpu->apic_state); } =20 + x86_update_hflags(env); + return; } =20 --=20 2.34.1 From nobody Sat May 18 21:00:24 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 1646677452767563.194759223614; Mon, 7 Mar 2022 10:24:12 -0800 (PST) Received: from localhost ([::1]:34904 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nRI1j-0008Sa-Pl for importer@patchew.org; Mon, 07 Mar 2022 13:24:11 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55346) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRHuh-00013S-N2 for qemu-devel@nongnu.org; Mon, 07 Mar 2022 13:16:55 -0500 Received: from [2a00:1450:4864:20::529] (port=43874 helo=mail-ed1-x529.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nRHud-0005Mg-4v for qemu-devel@nongnu.org; Mon, 07 Mar 2022 13:16:55 -0500 Received: by mail-ed1-x529.google.com with SMTP id f8so21137164edf.10 for ; Mon, 07 Mar 2022 10:16:38 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id d8-20020a170906304800b006cdf8a1e146sm4983382ejd.217.2022.03.07.10.16.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 10:16:36 -0800 (PST) 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=M5dbaBdYAMjhrYbiwidflPhtFdmpOVM1ditmWCxx0uo=; b=SiSxul6XasWX2ziARjKwzxPd0DsfCqMhPX935iuIMhFWnu9WUkkpxySr41w4nkzZIp 0Os9UISV/nGe6Jqx5zPujm8Xo9qkrfmsAjVUd//kQWCUT2RYvDr44L7LnjKffXp8L5fy FWCi6cfO3NnGY0qzdWC35xSIaSYTED2xIMMQiQ0OnPBEnqeEzqFVSgnP0YMRgfj7hQkK SAxkKawVF7bSd2f5Hfamhqn+HkldilDTuv29/eStPO0ylgsfizcp9OjgaLvneWbhTjsb Woxxsgf7nN/5rXTy8m6DHRpAI+QgWuDeOxrcMZkhbW85JmpzzdTGSEELAfZlfVRQsCHO cJWQ== 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=M5dbaBdYAMjhrYbiwidflPhtFdmpOVM1ditmWCxx0uo=; b=Ca/Anrsfr6H/s0YKtqg1vLqcmGtFxtD0dNcWvh1IL39ePE1eSIh99ra+cWIgQGwNss l/0IpN59Mg5GBaDm/hdigIfBK4Sy7nqZBYYRzlJ/MJCkK2ZEsQfMeEFRMxFeUOkgr6nc ROgVu6zXnIf/YKfSKIGQoykKQ7s8+VRlLmqVi5ty8agqhQAbW5V06A5AM1LnOGbD+NYs ekhi+2qw2wnB1zRxIgR8/y0Co63zIKetPZBN9RkbPdeIpZO8lcvinFGzroy++3qefBFm vWe2MC1fNk6Is5iNDalUcuK5RVQuzFZwFglFVyeKWL7U+Ywd0hmlPeZ7rBlbmTLCxrum Qwuw== X-Gm-Message-State: AOAM530wwbAG2lYxUHK5GpY+StrEQthxOMkYVMR4Q08GEQjUObtrQeoH BefK4HzHli4HOgVN0FNBSeDb53KcsPM= X-Google-Smtp-Source: ABdhPJzYo2PvMFqn9Il0OdymtvoBnmvN4ErK12UiQope5a7PArsLCEtWr5gg0iLp+k0S2b1t0hovfA== X-Received: by 2002:a05:6402:1941:b0:413:2b5f:9074 with SMTP id f1-20020a056402194100b004132b5f9074mr12253622edz.414.1646676997137; Mon, 07 Mar 2022 10:16:37 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 02/23] whpx: Fixed incorrect CR8/TPR synchronization Date: Mon, 7 Mar 2022 19:16:12 +0100 Message-Id: <20220307181633.596898-3-pbonzini@redhat.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220307181633.596898-1-pbonzini@redhat.com> References: <20220307181633.596898-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::529 (failed) 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: 0 X-Spam_score: -0.1 X-Spam_bar: / X-Spam_report: (-0.1 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ivan Shcherbakov 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: 1646677454179100001 Content-Type: text/plain; charset="utf-8" From: Ivan Shcherbakov This fixes the following error triggered when stopping and resuming a 64-bit Linux kernel via gdb: qemu-system-x86_64.exe: WHPX: Failed to set virtual processor context, hr= =3Dc0350005 The previous logic for synchronizing the values did not take into account that the lower 4 bits of the CR8 register, containing the priority level, mapped to bits 7:4 of the APIC.TPR register (see section 10.8.6.1 of Volume 3 of Intel 64 and IA-32 Architectures Software Developer's Manual). The caused WHvSetVirtualProcessorRegisters() to fail with an error, effectively preventing GDB from changing the guest context. Signed-off-by: Ivan Shcherbakov Message-Id: <010b01d82874$bb4ef160$31ecd420$@sysprogs.com> Signed-off-by: Paolo Bonzini --- target/i386/whpx/whpx-all.c | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/target/i386/whpx/whpx-all.c b/target/i386/whpx/whpx-all.c index edd4fafbdf..63203730bc 100644 --- a/target/i386/whpx/whpx-all.c +++ b/target/i386/whpx/whpx-all.c @@ -256,6 +256,21 @@ static int whpx_set_tsc(CPUState *cpu) return 0; } =20 +/* + * The CR8 register in the CPU is mapped to the TPR register of the APIC, + * however, they use a slightly different encoding. Specifically: + * + * APIC.TPR[bits 7:4] =3D CR8[bits 3:0] + * + * This mechanism is described in section 10.8.6.1 of Volume 3 of Intel 64 + * and IA-32 Architectures Software Developer's Manual. + */ + +static uint64_t whpx_apic_tpr_to_cr8(uint64_t tpr) +{ + return tpr >> 4; +} + static void whpx_set_registers(CPUState *cpu, int level) { struct whpx_state *whpx =3D &whpx_global; @@ -284,7 +299,7 @@ static void whpx_set_registers(CPUState *cpu, int level) v86 =3D (env->eflags & VM_MASK); r86 =3D !(env->cr[0] & CR0_PE_MASK); =20 - vcpu->tpr =3D cpu_get_apic_tpr(x86_cpu->apic_state); + vcpu->tpr =3D whpx_apic_tpr_to_cr8(cpu_get_apic_tpr(x86_cpu->apic_stat= e)); vcpu->apic_base =3D cpu_get_apic_base(x86_cpu->apic_state); =20 idx =3D 0; @@ -475,6 +490,17 @@ static void whpx_get_registers(CPUState *cpu) hr); } =20 + if (whpx_apic_in_platform()) { + /* + * Fetch the TPR value from the emulated APIC. It may get overwrit= ten + * below with the value from CR8 returned by + * WHvGetVirtualProcessorRegisters(). + */ + whpx_apic_get(x86_cpu->apic_state); + vcpu->tpr =3D whpx_apic_tpr_to_cr8( + cpu_get_apic_tpr(x86_cpu->apic_state)); + } + idx =3D 0; =20 /* Indexes for first 16 registers match between HV and QEMU definition= s */ --=20 2.34.1 From nobody Sat May 18 21:00:24 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 1646677265626509.4604847360546; Mon, 7 Mar 2022 10:21:05 -0800 (PST) Received: from localhost ([::1]:52198 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nRHyi-0001BP-Lr for importer@patchew.org; Mon, 07 Mar 2022 13:21:04 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55330) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRHuh-00012v-Ib for qemu-devel@nongnu.org; Mon, 07 Mar 2022 13:16:55 -0500 Received: from [2a00:1450:4864:20::634] (port=41785 helo=mail-ej1-x634.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nRHud-0005Ml-6S for qemu-devel@nongnu.org; Mon, 07 Mar 2022 13:16:55 -0500 Received: by mail-ej1-x634.google.com with SMTP id a8so33810838ejc.8 for ; Mon, 07 Mar 2022 10:16:39 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id d8-20020a170906304800b006cdf8a1e146sm4983382ejd.217.2022.03.07.10.16.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 10:16:37 -0800 (PST) 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=sppHUFpHoe2Mf0jRs80IVLnkBEj/9LXlh2U2u72ah2M=; b=DvBOADNAYlm3K12CkaxsKM0hatFkFignAn9shnY8z3bgbqtOYflI6RdZ3OFa80frQ5 GwcMrrSsUHjZbz1LIHE7vwgK4Q2H1OSI1FNg2wMJuBNpm0qaodS/s1jLSYUOjTJdpjYl tNhyLzDiXamyh+DHYL9L5BXZgZEpnC0LXhsJrhksqbbtI4jxy9YmTgZRZTIAYG3FWJSj DIiZn/ESC/3wP/mYc88JgEvqqzt/XI+Q1kSJo54l2kpnnNgtH4iEcEfgOlgcNGbs4ynj QJ0cfGS9Mw8PP8YS7HwGhECm2FchBakTxzs6SoVnP2f+/TEJybGwcJVHfMRcsJhYzasf +AoA== 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=sppHUFpHoe2Mf0jRs80IVLnkBEj/9LXlh2U2u72ah2M=; b=rj6xOxuKNFXFkMBvDEL5UEgbmX2KyNXsoVXQC4rc/YU/nSKXr47dn3SH2T16BVTsIe C4bp9bK1yNFHRbKa7XNIsqBxiON6eh8N9TTuGpeAWjSOnskAUIj32m8ge26i2Py9pf3p ZNL9sYlGBjv4KXImiErnvMg/iOl1gvVm+CvVtyTzBYcCjb6P/IaP2OnIrfqp++rklfpu RBCrDeKwP7LX4k2sk9LBho60RyDMC5pt869bpdWHLKZqSuXZKhzbxTX51rzD2knrCCXi QTJEcO+v+ClxxvBvpHqK5y5CHKe3TOYA9M6G8l3H7xD0hjE+Kkx9k9LHyntJgFePw5mW UHGg== X-Gm-Message-State: AOAM532IM7UdkqaSL7NxoXq02ANltSUWe5cFueymBNdf3TTfYy4hCkga LAjDkqUUnLc6VePvzIR4zBd1Osa3VO4= X-Google-Smtp-Source: ABdhPJyN3cm5Jma8GfN6a/uz3W4Or63jupoYwSjr7JC1slc/3NQwY0EEw5zDoJDEB9ui4jRerKtgvA== X-Received: by 2002:a17:906:b102:b0:6db:1487:e73 with SMTP id u2-20020a170906b10200b006db14870e73mr6255476ejy.474.1646676998079; Mon, 07 Mar 2022 10:16:38 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 03/23] vmxcap: Add 5-level EPT bit Date: Mon, 7 Mar 2022 19:16:13 +0100 Message-Id: <20220307181633.596898-4-pbonzini@redhat.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220307181633.596898-1-pbonzini@redhat.com> References: <20220307181633.596898-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::634 (failed) 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::634; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x634.google.com X-Spam_score_int: 0 X-Spam_score: -0.1 X-Spam_bar: / X-Spam_report: (-0.1 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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: 1646677267848100001 Content-Type: text/plain; charset="utf-8" From: Vitaly Kuznetsov 5-level EPT is present in Icelake Server CPUs and is supported by QEMU ('vmx-page-walk-5'). Signed-off-by: Vitaly Kuznetsov Message-Id: <20220221145316.576138-2-vkuznets@redhat.com> Signed-off-by: Paolo Bonzini --- scripts/kvm/vmxcap | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/kvm/vmxcap b/scripts/kvm/vmxcap index 6fe66d5f57..f140040104 100755 --- a/scripts/kvm/vmxcap +++ b/scripts/kvm/vmxcap @@ -249,6 +249,7 @@ controls =3D [ bits =3D { 0: 'Execute-only EPT translations', 6: 'Page-walk length 4', + 7: 'Page-walk length 5', 8: 'Paging-structure memory type UC', 14: 'Paging-structure memory type WB', 16: '2MB EPT pages', --=20 2.34.1 From nobody Sat May 18 21:00:24 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 164667728500243.27920468451077; Mon, 7 Mar 2022 10:21:25 -0800 (PST) Received: from localhost ([::1]:52832 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nRHz1-0001dg-QZ for importer@patchew.org; Mon, 07 Mar 2022 13:21:23 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55280) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRHug-0000yz-A6 for qemu-devel@nongnu.org; Mon, 07 Mar 2022 13:16:54 -0500 Received: from [2a00:1450:4864:20::533] (port=41669 helo=mail-ed1-x533.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nRHud-0005Mo-34 for qemu-devel@nongnu.org; Mon, 07 Mar 2022 13:16:53 -0500 Received: by mail-ed1-x533.google.com with SMTP id c20so2720192edr.8 for ; Mon, 07 Mar 2022 10:16:39 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id d8-20020a170906304800b006cdf8a1e146sm4983382ejd.217.2022.03.07.10.16.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 10:16:38 -0800 (PST) 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=4VLoIpmcWh/bwRoXTyuG+imMilJf3xfJ/t7uUrTUILo=; b=AS8U6PKQQy515cGKMPgByuGO6At0c+h5fcFl4BrYLVRiuX8lD58Bbm71ecU+aizNv2 X6aZFGv36crYGQBXbp2BKrU+BDNsnVnlYgs5mWo2QB5kKE+ptf2r8j661xk1BTa2Osn3 uZHPZ3vHHZAv/uRO2uRoN4KBNZo7RiPhPuQkOhnmVcYZWFguTKZbUXKsG/nPBG36pnMP +sfPAxSmi2DY4oUv0gzrsr/4Vf92aiprp/l9j2jOX09nvc0naY2fBeDpgyXoRK9FllTW QMAzggtELGtv4MRkRI7qTWHX2MJ7eEu47KL76yqa/EPgIMtVvaxxCA6b7UfybZdrBBgm Y4PA== 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=4VLoIpmcWh/bwRoXTyuG+imMilJf3xfJ/t7uUrTUILo=; b=4nkJY21l7jkMZrqVtEithFVNxNA0IiC7ukGEk88UOTinF1sdHtQejTYIr8qrYECJTu lm1Ww5RjEDGoYjGDhuDHGiSAugeWC12gBSJme1uwFTqRcQYna5hZL4O36hJL2ie4q47L jJr+v+o+3x/dz5HKiTsQ8vRC+2iFBF1L+rMl+bgiupgIb767RHViSdW4yf8YLCbyxGUj xzsFY07KDHmGGsRj8LwRs9f56UxfB7nX1CM8VRcsUAiodQxk2n88Chuiwb7YEhH2sgMu XB2ed4jxsW42NTtjA7T+m/FVHCu9tnw/3dAV6zj1y6HSvzEg8V18TMdAwoy6uHMpvOY6 o5+w== X-Gm-Message-State: AOAM531sbyrout8oJkgisN+qEtlsuy4Y5uWJu0x7ytkLZHT3mdoVVpOH zP37A8EZBBR/hxfWkH2OdGzS3cELVhw= X-Google-Smtp-Source: ABdhPJw/I/ID12EcoaaQIik9AMuEfWz8hut/y6CBYZzBfW+2P+mI/VHdINeW37NTFgkjfFQKzu7UkA== X-Received: by 2002:a50:baaa:0:b0:410:a098:2a7f with SMTP id x39-20020a50baaa000000b00410a0982a7fmr12584760ede.53.1646676998825; Mon, 07 Mar 2022 10:16:38 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 04/23] meson: fix generic location of vss headers Date: Mon, 7 Mar 2022 19:16:14 +0100 Message-Id: <20220307181633.596898-5-pbonzini@redhat.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220307181633.596898-1-pbonzini@redhat.com> References: <20220307181633.596898-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::533 (failed) 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: 0 X-Spam_score: -0.1 X-Spam_bar: / X-Spam_report: (-0.1 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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: 1646677286041100001 From: Marc-Andr=C3=A9 Lureau This is a left-over, despite requesting the change before the merge. Fixes: commit 8821a389 ("configure, meson: replace VSS SDK checks and optio= ns with --enable-vss-sdk") Signed-off-by: Marc-Andr=C3=A9 Lureau Message-Id: <20220222194008.610377-2-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 8df40bfac4..b871098dbb 100644 --- a/meson.build +++ b/meson.build @@ -1936,7 +1936,7 @@ have_vss =3D false if targetos =3D=3D 'windows' and link_language =3D=3D 'cpp' have_vss =3D cxx.compiles(''' #define __MIDL_user_allocate_free_DEFINED__ - #include + #include int main(void) { return VSS_CTX_BACKUP; }''') endif =20 --=20 2.34.1 From nobody Sat May 18 21:00:24 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 1646677154773273.75999187617276; Mon, 7 Mar 2022 10:19:14 -0800 (PST) Received: from localhost ([::1]:46028 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nRHwv-0005SN-MU for importer@patchew.org; Mon, 07 Mar 2022 13:19:13 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55222) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRHue-0000um-Tx for qemu-devel@nongnu.org; Mon, 07 Mar 2022 13:16:52 -0500 Received: from [2a00:1450:4864:20::62f] (port=37536 helo=mail-ej1-x62f.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nRHud-0005Mv-26 for qemu-devel@nongnu.org; Mon, 07 Mar 2022 13:16:52 -0500 Received: by mail-ej1-x62f.google.com with SMTP id bg10so33860475ejb.4 for ; Mon, 07 Mar 2022 10:16:40 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id d8-20020a170906304800b006cdf8a1e146sm4983382ejd.217.2022.03.07.10.16.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 10:16:39 -0800 (PST) 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=x3Wm5zyvRpbzPis/TBvRWMn+RknvyzFIxPlVh7GOxBE=; b=YGCBJlp3CPJbSztuaVbzR1r3QSBKb3zoYkm2sqLDgZPlUso5o8LuO7qeJj3BbU22cs 4cPQBEyKE8q55uI7Ge0MyMq7pEXSHcAXBMP3hxbk6f/zKqJiMc6Zj0ZjPMZhuTM3L9yY uGodp8W5zwNMMES5j91rycIyYD+iOS35dRNO2ZSHj2lCeSFlwz66su0DfLb6P8wW9csx DMqZER+JsG2VXO4SSxmUo/wwYrTq1gqptcEWJc/SabMmMVfx8pcTQxdsTz8ceq54nHZA essMfzh2673YAarX+rfsfvXPrdBysAm2RQAU8UuZay5uN6jjtuOvmI+VJbxs5n6+pSBJ flQQ== 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=x3Wm5zyvRpbzPis/TBvRWMn+RknvyzFIxPlVh7GOxBE=; b=V4ts9ABR879CtA6sg9FAgWDk6wWPePhsLf7uspsvxj0B4lxOVUMzqw3/mz+ZBNYJoL vCElhtW5wO/xmF/OTwiJyccGT0LzB8PUTorYI8dviewflASp1TXfoe1TTsU6QZw+FMEm q/1V0IbSthMsZaav3bltgxyldU0cMhiko/bAZ7NBiqqLlCkL2jDOxSo6gc7YoSQYwdkK yT8jtsD2c/9b+E5JQ+AqY8S5iZ/Uw4jI/iMv1+BntQfqGeCxn8cWWP8POwsGtCFJy/cW //bcyfdAWD0UiBmLDokpV24unpL4yzPIDxWGZmN4BAam1z3jmvVraFA220XMMiMooKWZ Cg6g== X-Gm-Message-State: AOAM533oRU1v0sB+LY9lPja2ArEANg/Z/pyR/J0fRdJy/DaTffCT/kNS q/kF6TqTn8S4mUnNzXCDzw1eO6244Jg= X-Google-Smtp-Source: ABdhPJzwdJgGDZCQ1KAUj0hi9rvX46lPgcW477Wfq9vZoGJQzoo80/FLt5/Yv1YYdUsY3h+A15orew== X-Received: by 2002:a17:906:2991:b0:6cf:6b24:e92f with SMTP id x17-20020a170906299100b006cf6b24e92fmr9936737eje.748.1646676999636; Mon, 07 Mar 2022 10:16:39 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 05/23] qga/vss-win32: check old VSS SDK headers Date: Mon, 7 Mar 2022 19:16:15 +0100 Message-Id: <20220307181633.596898-6-pbonzini@redhat.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220307181633.596898-1-pbonzini@redhat.com> References: <20220307181633.596898-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::62f (failed) 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::62f; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x62f.google.com X-Spam_score_int: 0 X-Spam_score: -0.1 X-Spam_bar: / X-Spam_report: (-0.1 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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: 1646677157004100001 From: Marc-Andr=C3=A9 Lureau The VssCoordinator & VssAdmin interfaces have been moved to vsadmin.h in the Windows SDK. Signed-off-by: Marc-Andr=C3=A9 Lureau Message-Id: <20220222194008.610377-3-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- meson.build | 3 +++ qga/vss-win32/install.cpp | 4 ++++ qga/vss-win32/provider.cpp | 4 ++++ qga/vss-win32/vss-common.h | 3 ++- 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index b871098dbb..101a3f2d31 100644 --- a/meson.build +++ b/meson.build @@ -1933,12 +1933,15 @@ config_host_data.set('CONFIG_AF_VSOCK', cc.compiles= (gnu_source_prefix + ''' }''')) =20 have_vss =3D false +have_vss_sdk =3D false # old xp/2003 SDK if targetos =3D=3D 'windows' and link_language =3D=3D 'cpp' have_vss =3D cxx.compiles(''' #define __MIDL_user_allocate_free_DEFINED__ #include int main(void) { return VSS_CTX_BACKUP; }''') + have_vss_sdk =3D cxx.has_header('vscoordint.h') endif +config_host_data.set('HAVE_VSS_SDK', have_vss_sdk) =20 have_ntddscsi =3D false if targetos =3D=3D 'windows' diff --git a/qga/vss-win32/install.cpp b/qga/vss-win32/install.cpp index efc5bb9909..8076efe3cb 100644 --- a/qga/vss-win32/install.cpp +++ b/qga/vss-win32/install.cpp @@ -13,7 +13,11 @@ #include "qemu/osdep.h" =20 #include "vss-common.h" +#ifdef HAVE_VSS_SDK #include +#else +#include +#endif #include "install.h" #include #include diff --git a/qga/vss-win32/provider.cpp b/qga/vss-win32/provider.cpp index fd187fb66f..1b885e24ee 100644 --- a/qga/vss-win32/provider.cpp +++ b/qga/vss-win32/provider.cpp @@ -12,7 +12,11 @@ =20 #include "qemu/osdep.h" #include "vss-common.h" +#ifdef HAVE_VSS_SDK #include +#else +#include +#endif #include =20 #define VSS_TIMEOUT_MSEC (60*1000) diff --git a/qga/vss-win32/vss-common.h b/qga/vss-win32/vss-common.h index 54f8de8c88..0e67e7822c 100644 --- a/qga/vss-win32/vss-common.h +++ b/qga/vss-win32/vss-common.h @@ -64,12 +64,13 @@ const CLSID CLSID_QGAVSSProvider =3D { 0x6e6a3492, 0x8d= 4d, 0x440c, const TCHAR g_szClsid[] =3D TEXT("{6E6A3492-8D4D-440C-9619-5E5D0CC31CA8}"); const TCHAR g_szProgid[] =3D TEXT("QGAVSSProvider"); =20 +#ifdef HAVE_VSS_SDK /* Enums undefined in VSS SDK 7.2 but defined in newer Windows SDK */ enum __VSS_VOLUME_SNAPSHOT_ATTRIBUTES { VSS_VOLSNAP_ATTR_NO_AUTORECOVERY =3D 0x00000002, VSS_VOLSNAP_ATTR_TXF_RECOVERY =3D 0x02000000 }; - +#endif =20 /* COM pointer utility; call ->Release() when it goes out of scope */ template --=20 2.34.1 From nobody Sat May 18 21:00:24 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 16466773037941013.7750260844032; Mon, 7 Mar 2022 10:21:43 -0800 (PST) Received: from localhost ([::1]:54554 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nRHzK-0002lm-K4 for importer@patchew.org; Mon, 07 Mar 2022 13:21:42 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55286) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRHug-0000zA-FN for qemu-devel@nongnu.org; Mon, 07 Mar 2022 13:16:54 -0500 Received: from [2a00:1450:4864:20::52c] (port=33287 helo=mail-ed1-x52c.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nRHud-0005N2-2e for qemu-devel@nongnu.org; Mon, 07 Mar 2022 13:16:54 -0500 Received: by mail-ed1-x52c.google.com with SMTP id m21so15656535edc.0 for ; Mon, 07 Mar 2022 10:16:41 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id d8-20020a170906304800b006cdf8a1e146sm4983382ejd.217.2022.03.07.10.16.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 10:16:40 -0800 (PST) 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=5jubMeLfMS6DO/0PCPGI57Go6LtnBr0CArY5PUrgsRY=; b=V1o+of6JosL1iyVdmwLrRXN3uymfNudvXEQ5h/HOt2JETYUx6lUcNsnwFiPGanuBbd 3VZozjrMWisU96KKgQLQiGJaKlUz1Gw5LIT4fmt3RN4OR9+fbYFqQ8ia4MdF+hqzU5Tf P1TR709oFzg6aLqyR4+iYccxApSHqjeQVx1wTVjjy4BR/MfCHeoaEuqPJHiD/nXWtw0S q7Nvy5tlr+EgNaLA1BYs7XmB0/zIMWCSdfga+xm5od4DxLRRh+fy+yHRTkUe5zC+FErs /TSOkq5O/0kelessGZf0RmDJfCjSvNhCqLb7wdv0O36myLso8knb4bCVGxDD3Grl3qrL pF7g== 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=5jubMeLfMS6DO/0PCPGI57Go6LtnBr0CArY5PUrgsRY=; b=W4z5mGpPMAzO0asRmiYOncQ7+NDHX25v5C0gqvlPmnEXcDayhIy2lF1MRi/Tk4G5ks qiPQe6qTbXYDqavNYgd2Kw4Ea2nn1hDN/5apFxnX+Q0lnvMTHvCqB2jLTkLwkYEujxew XVmipHYyGb8IXlnGFZAtbEPIs/Ro01I1nutnD8eAIPXm7hAUZB2J8xD1AhW/YClNn309 o8yR4WLrpWIw3QiaJ4eaA6aF+5fJIvUJV+SGcdMf3VZf3lHczH2LDVHwK2533oWY0Gzi xsbEhBXEP3p9eZ+S8qgh2ljXp99hmQ2/RlHLvqZBK+sJ8gL5Lhr+w2Tk9iUmdevmDehp WnjA== X-Gm-Message-State: AOAM533oxhegWH3GnNxXkTqT5DqI7INYfa03FdYa/F0R5bapY9KnrOqj VtgdcCBNUgfM/dqILcX9sXpxyHm3OzE= X-Google-Smtp-Source: ABdhPJy15tTVn4a58v03Vm1NzbeGN+rVqqhkNN8zFe1+tLJeGBLL2+aTJjrnGJWbTE2zp7OMJ+tZuw== X-Received: by 2002:a05:6402:1385:b0:413:2bc6:4400 with SMTP id b5-20020a056402138500b004132bc64400mr12504809edv.94.1646677000427; Mon, 07 Mar 2022 10:16:40 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 06/23] qga/vss: update informative message about MinGW Date: Mon, 7 Mar 2022 19:16:16 +0100 Message-Id: <20220307181633.596898-7-pbonzini@redhat.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220307181633.596898-1-pbonzini@redhat.com> References: <20220307181633.596898-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::52c (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::52c; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x52c.google.com X-Spam_score_int: 0 X-Spam_score: -0.1 X-Spam_bar: / X-Spam_report: (-0.1 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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: 1646677304167100001 From: Marc-Andr=C3=A9 Lureau The headers are now all available in MinGW master branch. (commit 13390dbbf885f and earlier) aiming for 10.0. Signed-off-by: Marc-Andr=C3=A9 Lureau Message-Id: <20220222194008.610377-4-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- qga/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qga/meson.build b/qga/meson.build index 54f2da5b07..62472747f1 100644 --- a/qga/meson.build +++ b/qga/meson.build @@ -15,7 +15,7 @@ have_qga_vss =3D get_option('qga_vss') \ If your Visual Studio installation doesn't have the VSS headers, Please download and install Microsoft VSS SDK: http://www.microsoft.com/en-us/download/details.aspx?id=3D23490 - On POSIX-systems, MinGW doesn't yet provide working headers. + On POSIX-systems, MinGW should provide headers in >=3D10.0 releases. you can extract the SDK headers by: $ scripts/extract-vsssdk-headers setup.exe The headers are extracted in the directory 'inc/win2003'. --=20 2.34.1 From nobody Sat May 18 21:00:24 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 1646677907220807.2212105471908; Mon, 7 Mar 2022 10:31:47 -0800 (PST) Received: from localhost ([::1]:59298 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nRI94-0008G3-28 for importer@patchew.org; Mon, 07 Mar 2022 13:31:46 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55436) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRHuj-0001Bh-P1 for qemu-devel@nongnu.org; Mon, 07 Mar 2022 13:16:57 -0500 Received: from [2a00:1450:4864:20::529] (port=41660 helo=mail-ed1-x529.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nRHud-0005N8-9D for qemu-devel@nongnu.org; Mon, 07 Mar 2022 13:16:57 -0500 Received: by mail-ed1-x529.google.com with SMTP id c20so2720327edr.8 for ; Mon, 07 Mar 2022 10:16:42 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id d8-20020a170906304800b006cdf8a1e146sm4983382ejd.217.2022.03.07.10.16.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 10:16:40 -0800 (PST) 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=gc1VZ48NcTl2YvmBVaW5SzwnjSSDE+xasrOWm+E//I4=; b=FcEXouVF1sIDo5HQHEsAMpY17nsD+CTlpx4uT9OK4w2kwYJ1cRNqe+U3p7hhprNw2R DTIUy4Emq8jYAtZxmYcn74Mjup12iG4+yT/l+pisHDuKgc+Mb6bOA1NR8UP/vkPHDY7w 7JwYWC56gf7D8RdSQ+zFUwwm0JgpiR18w3Sr0PdPevgYoSoBKOIuk9nWSz9lAQcAv1yS pJRMYqq8DndeXuzvkrols3hQUdP7aiEY36sAf9NsGnGO56jQpeOxq0qVfuMC/SdbWKXy 8bNhUvd1/c6hxwx/62hbT7QQqrRC0K9mSL0XnN2a2Iomu9mcTLDt7iMRw5vb5Uo+bDxS ZDqw== 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=gc1VZ48NcTl2YvmBVaW5SzwnjSSDE+xasrOWm+E//I4=; b=XlRZjyL2Lzia9LOnmM5B/fVKFM8R7b/1MC/6c+AaNH+RtoYyKJUwXDFAbtPnEIbe/u pufkPXcphRMwCI7XgWp3ivMClGlESwed2v+SHURqEYGHM4nj1xSwHVx/bn3qbtZ8PfQ9 ViNnR13uUN1aQaikj3IKFA/7ExTgsZNj7f1WVAJBUNSTns9KY9fz4VaeJ+iB516mHfvk C/wCsfmCV+JwOyNyo1g/K0X1kpKxOawSLIeu13pFavNqiPIRM648UimKKppitMIO4m6a Vr4CKk09gXfosC1S7eBka9LzJi7hKHW8oYl8k2KZ5I95rtlK2VzmcKvJ6WVvcb/H16c4 ZLiw== X-Gm-Message-State: AOAM531p8AKMT8CSnu0GIUhtfdFofCSB0UmcDZwYa4P9k+/COj1jaqgj tcz93mE7NpgGtoBb8Tx3YWi0SLvqteE= X-Google-Smtp-Source: ABdhPJz/7YoEKPRxHAQwHco7I57l9zBrYD94VnH+YnCr3ckVWDgS08vnLEAtyBadXT93IpZX80kKLQ== X-Received: by 2002:a05:6402:238b:b0:415:ce67:49ee with SMTP id j11-20020a056402238b00b00415ce6749eemr12274135eda.199.1646677001227; Mon, 07 Mar 2022 10:16:41 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 07/23] update meson-buildoptions.sh Date: Mon, 7 Mar 2022 19:16:17 +0100 Message-Id: <20220307181633.596898-8-pbonzini@redhat.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220307181633.596898-1-pbonzini@redhat.com> References: <20220307181633.596898-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::529 (failed) 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: 0 X-Spam_score: -0.1 X-Spam_bar: / X-Spam_report: (-0.1 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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: 1646677908190100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Paolo Bonzini --- scripts/meson-buildoptions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh index 9ee684ef03..1e26f4571e 100644 --- a/scripts/meson-buildoptions.sh +++ b/scripts/meson-buildoptions.sh @@ -20,7 +20,6 @@ meson_options_help() { printf "%s\n" ' --enable-malloc=3DCHOICE choose memory allocator to u= se [system] (choices:' printf "%s\n" ' jemalloc/system/tcmalloc)' printf "%s\n" ' --enable-profiler profiler support' - printf "%s\n" ' --enable-qga-vss build QGA VSS support' printf "%s\n" ' --enable-qom-cast-debug cast debugging support' printf "%s\n" ' --enable-rng-none dummy RNG, avoid using /dev/(u= )random and' printf "%s\n" ' getrandom()' @@ -97,6 +96,7 @@ meson_options_help() { printf "%s\n" ' parallels parallels image format support' printf "%s\n" ' qcow1 qcow1 image format support' printf "%s\n" ' qed qed image format support' + printf "%s\n" ' qga-vss build QGA VSS support (broken with MinG= W)' printf "%s\n" ' rbd Ceph block device driver' printf "%s\n" ' replication replication support' printf "%s\n" ' sdl SDL user interface' --=20 2.34.1 From nobody Sat May 18 21:00:24 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 1646677426710315.52611237410304; Mon, 7 Mar 2022 10:23:46 -0800 (PST) Received: from localhost ([::1]:33196 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nRI1J-0007IF-HW for importer@patchew.org; Mon, 07 Mar 2022 13:23:45 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55348) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRHuh-00013b-PN for qemu-devel@nongnu.org; Mon, 07 Mar 2022 13:16:55 -0500 Received: from [2a00:1450:4864:20::62e] (port=33716 helo=mail-ej1-x62e.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nRHud-0005ND-6e for qemu-devel@nongnu.org; Mon, 07 Mar 2022 13:16:55 -0500 Received: by mail-ej1-x62e.google.com with SMTP id kt27so33956347ejb.0 for ; Mon, 07 Mar 2022 10:16:42 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id d8-20020a170906304800b006cdf8a1e146sm4983382ejd.217.2022.03.07.10.16.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 10:16:41 -0800 (PST) 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=fjXszMyPdCO8TmuZAfVhiRygjcmH9t+A5T8HqlfmFlU=; b=mXzeOz7VKLbeTtsKp/CvhgLNwQ9+KyPOhKPI1jyiaF+Kar5iQ7Bdsqu8jCKbkaX7bx RL4QV62bQOMXXcd54AukDCCyhfZcJJYn0JjCIWLzdVOLZI2dW+wZg572t3+F/RIvbKIA 0si/5kXI95ZLSR8lZSMN/Iu3MVD7WW88Qy381HLVbbpGBGnQHVXj3zk9rYtQnUo2+Ha/ 3YvXd4CrAjlR491swq2l0kJ0nOXoPK8B9F//jjWUnI7ucPmAFGx99kDlriiZ6rZ4ShgN KdaDBSa2GnhoJnZuYFPH+YRgwHJbgsf5cXAh1quNbztokhwXVnV76G4sIbQGWEnegMv1 gduw== 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=fjXszMyPdCO8TmuZAfVhiRygjcmH9t+A5T8HqlfmFlU=; b=y5Xy9sNpN5jUDC4y0Tr5b1WzprSzR5D2l850Q59q1nEcHsrAUU/jntUaJRVaomVMP5 eybuGPc5/o4eLpVNVg9oTPzIRO4AQThqk0Pc1iFoCSUMBtXyWtJw5fsMIqci4N1ZptVK ra8mlHenX+yJVXUvrBE0Ahs6QJqRr7YAnSxeE3j9SdTTXbnIfeyJKsSe7UZHOOJ8m69p ZAqvEjvKUmVLrvfHYHY9D+VQlITg09sHO1jIwIuGqhJcAo+U3VM3G8y2b6Hh0LMksc/h 0oFNzowKzxeBfbSgIlSwY+g3NPcUyGbrXOsg9ZAOvVjwiD4DZoTFQjlfkztz/niBPscI DHzA== X-Gm-Message-State: AOAM533UrFNuvEUea5CfZuDcHxIzHnwBqAOfEdocVaDgVzmE8mLvfA0A zcoFZOcQl3ONcEgSWM/63Jkx2ymOKIo= X-Google-Smtp-Source: ABdhPJzf6OKk/sLArOktyh8JvmFEwW6uGpbeKRjdbjQ923+jUy0fL7B3fETP2NyQMh1iC++8MLyPsw== X-Received: by 2002:a17:907:2d11:b0:6da:924b:748f with SMTP id gs17-20020a1709072d1100b006da924b748fmr9797925ejc.584.1646677001966; Mon, 07 Mar 2022 10:16:41 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 08/23] kvm-irqchip: introduce new API to support route change Date: Mon, 7 Mar 2022 19:16:18 +0100 Message-Id: <20220307181633.596898-9-pbonzini@redhat.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220307181633.596898-1-pbonzini@redhat.com> References: <20220307181633.596898-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::62e (failed) 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::62e; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x62e.google.com X-Spam_score_int: 0 X-Spam_score: -0.1 X-Spam_bar: / X-Spam_report: (-0.1 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Longpeng\(Mike\)" 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: 1646677427900100001 Content-Type: text/plain; charset="utf-8" From: "Longpeng(Mike)" Paolo suggested adding the new API to support route changes [1]. We should = invoke kvm_irqchip_begin_route_changes() before changing the routes, increasing the KVMRouteChange.changes if the routes are changed, and commit the changes at= last. [1] https://lists.gnu.org/archive/html/qemu-devel/2021-11/msg02898.html Signed-off-by: Longpeng Message-Id: <20220222141116.2091-2-longpeng2@huawei.com> Signed-off-by: Paolo Bonzini --- include/sysemu/kvm.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h index 6eb39a088b..36e6d40191 100644 --- a/include/sysemu/kvm.h +++ b/include/sysemu/kvm.h @@ -224,6 +224,11 @@ DECLARE_INSTANCE_CHECKER(KVMState, KVM_STATE, extern KVMState *kvm_state; typedef struct Notifier Notifier; =20 +typedef struct KVMRouteChange { + KVMState *s; + int changes; +} KVMRouteChange; + /* external API */ =20 bool kvm_has_free_slot(MachineState *ms); @@ -494,6 +499,20 @@ int kvm_irqchip_add_msi_route(KVMState *s, int vector,= PCIDevice *dev); int kvm_irqchip_update_msi_route(KVMState *s, int virq, MSIMessage msg, PCIDevice *dev); void kvm_irqchip_commit_routes(KVMState *s); + +static inline KVMRouteChange kvm_irqchip_begin_route_changes(KVMState *s) +{ + return (KVMRouteChange) { .s =3D s, .changes =3D 0 }; +} + +static inline void kvm_irqchip_commit_route_changes(KVMRouteChange *c) +{ + if (c->changes) { + kvm_irqchip_commit_routes(c->s); + c->changes =3D 0; + } +} + void kvm_irqchip_release_virq(KVMState *s, int virq); =20 int kvm_irqchip_add_adapter_route(KVMState *s, AdapterInfo *adapter); --=20 2.34.1 From nobody Sat May 18 21:00:24 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 1646677587836458.00161358519915; Mon, 7 Mar 2022 10:26:27 -0800 (PST) Received: from localhost ([::1]:41822 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nRI3u-0004ci-Je for importer@patchew.org; Mon, 07 Mar 2022 13:26:26 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55386) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRHui-000175-Jv for qemu-devel@nongnu.org; Mon, 07 Mar 2022 13:16:56 -0500 Received: from [2a00:1450:4864:20::631] (port=34809 helo=mail-ej1-x631.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nRHud-0005NL-6s for qemu-devel@nongnu.org; Mon, 07 Mar 2022 13:16:56 -0500 Received: by mail-ej1-x631.google.com with SMTP id gb39so33780063ejc.1 for ; Mon, 07 Mar 2022 10:16:43 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id d8-20020a170906304800b006cdf8a1e146sm4983382ejd.217.2022.03.07.10.16.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 10:16:42 -0800 (PST) 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=KylYBeizrlE5Gp5mZ41VKSCYaKhs9BRVgkz2yfqUuz4=; b=fdxRacVqy7M+AC/6hdS8wOYCDOO/XUDFS7SZ18cP5vmihp4alprCNTp4ui5cSsa+gA vcbqOCfMXREIPEwcskfeSqMU7Z8psl2vtBpRClulOdOXKSdbb3EQTuKZxuMTnrlz8q4U UX+gCX/71fCx1nRZ00LUtOaVKgXOW3XYRKlsaJxsvUyltkbpMbD7i9xdo4QpQ1fk75YD JT0EB/NN3/pwOQQzvsYvSxQ9cfXLWqQ0K/n9mBy4+4ahk5VVUYNsTacqnXzKHSmu+cC1 GWkQXxpxkwrLHa8+PF48GoBI4/1POixgPHh1bkCcelzgkCSqjNOZR8WUvKq4h2atfWz1 RkqQ== 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=KylYBeizrlE5Gp5mZ41VKSCYaKhs9BRVgkz2yfqUuz4=; b=UmgAH15/Mh56P7MU4dzZfIahj7YIHfhLkTCegzR2SAvxg0UU2IVr7UiM+gkmY5KxxJ ONcmI5pcfUgCzjhhnfyBdDgHPApB25qVRC8weYn8LNiwKJkA/syS3Hrlj+IyBQQE8b4L RRCPI0gShymmln17tJPS579XLblnZtqR+U4iDVKuCpQ5ft8rrgynBdBzYmWmolveunad 28MHC94wzKHiZVDZHV/ihiwIfS1/1pAJQbkRAqi5EOQ/LSm+pzw8UmtdhrqXuga9z07L Qnbc3HHqdsffAmrciZKNsKtDL8cPQqOzKLoTeV7+cj/jX5bqj/tC3AtEJTDzGbyN6+he 8FPQ== X-Gm-Message-State: AOAM531GdD5bLn0RHjSpAQ1S9gVt6+26LMSHp6oGyI91HP+vSJHZWgyz HgrOv8luWNkW6Ye6/wHcOf10MCoVq2c= X-Google-Smtp-Source: ABdhPJyl84n2ulSgsKcIsh0mZvI9YyJl3s5tQQqMUXMLx5h7esLZNxRQQ4rQ6hfF9N3dA0gktHAlrQ== X-Received: by 2002:a17:907:6d86:b0:6da:86b9:ac3 with SMTP id sb6-20020a1709076d8600b006da86b90ac3mr10293717ejc.532.1646677002728; Mon, 07 Mar 2022 10:16:42 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 09/23] kvm/msi: do explicit commit when adding msi routes Date: Mon, 7 Mar 2022 19:16:19 +0100 Message-Id: <20220307181633.596898-10-pbonzini@redhat.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220307181633.596898-1-pbonzini@redhat.com> References: <20220307181633.596898-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::631 (failed) 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::631; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x631.google.com X-Spam_score_int: 0 X-Spam_score: -0.1 X-Spam_bar: / X-Spam_report: (-0.1 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Longpeng\(Mike\)" 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: 1646677589128100001 Content-Type: text/plain; charset="utf-8" From: "Longpeng(Mike)" We invoke the kvm_irqchip_commit_routes() for each addition to MSI route table, which is not efficient if we are adding lots of routes in some cases. This patch lets callers invoke the kvm_irqchip_commit_routes(), so the callers can decide how to optimize. [1] https://lists.gnu.org/archive/html/qemu-devel/2021-11/msg00967.html Signed-off-by: Longpeng Message-Id: <20220222141116.2091-3-longpeng2@huawei.com> Signed-off-by: Paolo Bonzini --- accel/kvm/kvm-all.c | 7 ++++--- accel/stubs/kvm-stub.c | 2 +- hw/misc/ivshmem.c | 5 ++++- hw/vfio/pci.c | 5 ++++- hw/virtio/virtio-pci.c | 4 +++- include/sysemu/kvm.h | 4 ++-- target/i386/kvm/kvm.c | 4 +++- 7 files changed, 21 insertions(+), 10 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 0e66ebb497..27864dfaea 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -1961,10 +1961,11 @@ int kvm_irqchip_send_msi(KVMState *s, MSIMessage ms= g) return kvm_set_irq(s, route->kroute.gsi, 1); } =20 -int kvm_irqchip_add_msi_route(KVMState *s, int vector, PCIDevice *dev) +int kvm_irqchip_add_msi_route(KVMRouteChange *c, int vector, PCIDevice *de= v) { struct kvm_irq_routing_entry kroute =3D {}; int virq; + KVMState *s =3D c->s; MSIMessage msg =3D {0, 0}; =20 if (pci_available && dev) { @@ -2004,7 +2005,7 @@ int kvm_irqchip_add_msi_route(KVMState *s, int vector= , PCIDevice *dev) =20 kvm_add_routing_entry(s, &kroute); kvm_arch_add_msi_route_post(&kroute, vector, dev); - kvm_irqchip_commit_routes(s); + c->changes++; =20 return virq; } @@ -2162,7 +2163,7 @@ int kvm_irqchip_send_msi(KVMState *s, MSIMessage msg) abort(); } =20 -int kvm_irqchip_add_msi_route(KVMState *s, int vector, PCIDevice *dev) +int kvm_irqchip_add_msi_route(KVMRouteChange *c, int vector, PCIDevice *de= v) { return -ENOSYS; } diff --git a/accel/stubs/kvm-stub.c b/accel/stubs/kvm-stub.c index 5319573e00..ae6e8e9aa7 100644 --- a/accel/stubs/kvm-stub.c +++ b/accel/stubs/kvm-stub.c @@ -81,7 +81,7 @@ int kvm_on_sigbus(int code, void *addr) } =20 #ifndef CONFIG_USER_ONLY -int kvm_irqchip_add_msi_route(KVMState *s, int vector, PCIDevice *dev) +int kvm_irqchip_add_msi_route(KVMRouteChange *c, int vector, PCIDevice *de= v) { return -ENOSYS; } diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index 299837e5c1..2307f4a513 100644 --- a/hw/misc/ivshmem.c +++ b/hw/misc/ivshmem.c @@ -424,16 +424,19 @@ static void ivshmem_add_kvm_msi_virq(IVShmemState *s,= int vector, Error **errp) { PCIDevice *pdev =3D PCI_DEVICE(s); + KVMRouteChange c; int ret; =20 IVSHMEM_DPRINTF("ivshmem_add_kvm_msi_virq vector:%d\n", vector); assert(!s->msi_vectors[vector].pdev); =20 - ret =3D kvm_irqchip_add_msi_route(kvm_state, vector, pdev); + c =3D kvm_irqchip_begin_route_changes(kvm_state); + ret =3D kvm_irqchip_add_msi_route(&c, vector, pdev); if (ret < 0) { error_setg(errp, "kvm_irqchip_add_msi_route failed"); return; } + kvm_irqchip_commit_route_changes(&c); =20 s->msi_vectors[vector].virq =3D ret; s->msi_vectors[vector].pdev =3D pdev; diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 7b45353ce2..d07a4e99b1 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -412,6 +412,7 @@ static int vfio_enable_vectors(VFIOPCIDevice *vdev, boo= l msix) static void vfio_add_kvm_msi_virq(VFIOPCIDevice *vdev, VFIOMSIVector *vect= or, int vector_n, bool msix) { + KVMRouteChange c; int virq; =20 if ((msix && vdev->no_kvm_msix) || (!msix && vdev->no_kvm_msi)) { @@ -422,11 +423,13 @@ static void vfio_add_kvm_msi_virq(VFIOPCIDevice *vdev= , VFIOMSIVector *vector, return; } =20 - virq =3D kvm_irqchip_add_msi_route(kvm_state, vector_n, &vdev->pdev); + c =3D kvm_irqchip_begin_route_changes(kvm_state); + virq =3D kvm_irqchip_add_msi_route(&c, vector_n, &vdev->pdev); if (virq < 0) { event_notifier_cleanup(&vector->kvm_interrupt); return; } + kvm_irqchip_commit_route_changes(&c); =20 if (kvm_irqchip_add_irqfd_notifier_gsi(kvm_state, &vector->kvm_interru= pt, NULL, virq) < 0) { diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index f9cf9592fd..7cf1231c1c 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -683,10 +683,12 @@ static int kvm_virtio_pci_vq_vector_use(VirtIOPCIProx= y *proxy, int ret; =20 if (irqfd->users =3D=3D 0) { - ret =3D kvm_irqchip_add_msi_route(kvm_state, vector, &proxy->pci_d= ev); + KVMRouteChange c =3D kvm_irqchip_begin_route_changes(kvm_state); + ret =3D kvm_irqchip_add_msi_route(&c, vector, &proxy->pci_dev); if (ret < 0) { return ret; } + kvm_irqchip_commit_route_changes(&c); irqfd->virq =3D ret; } irqfd->users++; diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h index 36e6d40191..e83280521a 100644 --- a/include/sysemu/kvm.h +++ b/include/sysemu/kvm.h @@ -486,7 +486,7 @@ void kvm_init_cpu_signals(CPUState *cpu); =20 /** * kvm_irqchip_add_msi_route - Add MSI route for specific vector - * @s: KVM state + * @c: KVMRouteChange instance. * @vector: which vector to add. This can be either MSI/MSIX * vector. The function will automatically detect whether * MSI/MSIX is enabled, and fetch corresponding MSI @@ -495,7 +495,7 @@ void kvm_init_cpu_signals(CPUState *cpu); * as @NULL, an empty MSI message will be inited. * @return: virq (>=3D0) when success, errno (<0) when failed. */ -int kvm_irqchip_add_msi_route(KVMState *s, int vector, PCIDevice *dev); +int kvm_irqchip_add_msi_route(KVMRouteChange *c, int vector, PCIDevice *de= v); int kvm_irqchip_update_msi_route(KVMState *s, int virq, MSIMessage msg, PCIDevice *dev); void kvm_irqchip_commit_routes(KVMState *s); diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index 2c8feb4a6f..cfef36a14e 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -4939,16 +4939,18 @@ void kvm_arch_init_irq_routing(KVMState *s) kvm_gsi_routing_allowed =3D true; =20 if (kvm_irqchip_is_split()) { + KVMRouteChange c =3D kvm_irqchip_begin_route_changes(s); int i; =20 /* If the ioapic is in QEMU and the lapics are in KVM, reserve MSI routes for signaling interrupts to the local apics. */ for (i =3D 0; i < IOAPIC_NUM_PINS; i++) { - if (kvm_irqchip_add_msi_route(s, 0, NULL) < 0) { + if (kvm_irqchip_add_msi_route(&c, 0, NULL) < 0) { error_report("Could not enable split IRQ mode."); exit(1); } } + kvm_irqchip_commit_route_changes(&c); } } =20 --=20 2.34.1 From nobody Sat May 18 21:00:24 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 1646677624169298.5984562007984; Mon, 7 Mar 2022 10:27:04 -0800 (PST) Received: from localhost ([::1]:43436 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nRI4V-0005lb-2V for importer@patchew.org; Mon, 07 Mar 2022 13:27:03 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55352) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRHuh-00013q-QC for qemu-devel@nongnu.org; Mon, 07 Mar 2022 13:16:55 -0500 Received: from [2a00:1450:4864:20::62a] (port=38540 helo=mail-ej1-x62a.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nRHud-0005NN-5v for qemu-devel@nongnu.org; Mon, 07 Mar 2022 13:16:55 -0500 Received: by mail-ej1-x62a.google.com with SMTP id r13so33858686ejd.5 for ; Mon, 07 Mar 2022 10:16:44 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id d8-20020a170906304800b006cdf8a1e146sm4983382ejd.217.2022.03.07.10.16.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 10:16:43 -0800 (PST) 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=eRmkLnG1rWBHKyLOfVkycC10zsqH/5UMDEaprFf5ja0=; b=EK1n1z6e8MlHEd9m0yk7mY+z2rCvZ88k3GuPSW/2h9MjBVClamCdXVRWKnK2xtK7uG 6UXzgNfAjVzE1X4ASF7pKjfLtmqsGeo/GN6qTJTRvOipz+kYV32u8LYYTDL4lW1L2uW7 riCkeXRblKOTXWqIxZmy1rKAOnLpKmGofJprnkbSRGGppYbX7ADwXG11bhFXit8zkBX9 vcCYsuhOvjelJYKvzE67psi4ctOSOBRLNnzqLb4zMd+jojOeOEfrt137Qsx6h6ceiMtp fuJbmxsdfDxa0+7RDiuyyOn8GLO0K/gOjt6BVVj1MQ3tydxj44fSGOifvSBgSHgK544g aX1A== 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=eRmkLnG1rWBHKyLOfVkycC10zsqH/5UMDEaprFf5ja0=; b=G6VVqlw7UJKMJ/U5n81WC8e7nSnjBRE+2Zofsy5RPvDHzEig6BkZ2Bj9USqTWtjujV Q7Ok7fLiCMsLRb8/89ZAI4cq6J+VObRh9/s12iQlnc1AWid04amI08eoQnPzUnljC9QA P8G5kQESVYu8cBpi30Jmc4SlQzcyrdGf1muj43l+yV7YiUYIWpm3NZkH+W1mkb8vLVaW qIc+cXzq/kOszFFuveVmWdbQ4nW61Xi19PosGIUYRd9YH4T4Ir6v2V0YeqVN1LHOXV8G tcrOPtny0/gMp0dm80twoRTC8dwuKJWaMUYXhAg7ocpcSJxmzxDd6f5Ok4P9JT4IgQ0e pZaw== X-Gm-Message-State: AOAM5335fjxcsF1ZVpnvsryNy//HWinnjtlfXnSDEW9xKT/fJdnZsuh0 JNYNJ+DV4Q1NylcBeE5ZKrCxSKPQUU8= X-Google-Smtp-Source: ABdhPJyQOHP4R9N26/VYX+0PwA1pG5Hb1HBqEJsm0PVjHwKXG1R67Om9d5OvqBOPxECx5BR1t3ZZig== X-Received: by 2002:a17:907:97d5:b0:6da:5b9f:6133 with SMTP id js21-20020a17090797d500b006da5b9f6133mr9952201ejc.343.1646677003478; Mon, 07 Mar 2022 10:16:43 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 10/23] target/i386: only include bits in pg_mode if they are not ignored Date: Mon, 7 Mar 2022 19:16:20 +0100 Message-Id: <20220307181633.596898-11-pbonzini@redhat.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220307181633.596898-1-pbonzini@redhat.com> References: <20220307181633.596898-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::62a (failed) 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::62a; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x62a.google.com X-Spam_score_int: 0 X-Spam_score: -0.1 X-Spam_bar: / X-Spam_report: (-0.1 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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: 1646677625384100001 Content-Type: text/plain; charset="utf-8" LA57/PKE/PKS is only relevant in 64-bit mode, and NXE is only relevant if PAE is in use. Since there is code that checks PG_MODE_LA57 to determine the canonicality of addresses, make sure that the bit is not set by mistake in 32-bit mode. While it would not be a problem because 32-bit addresses by definition fit in both 48-bit and 57-bit address spaces, it is nicer if get_pg_mode() actually returns whether a feature is enabled, and it allows a few simplifications in the page table walker. Signed-off-by: Paolo Bonzini --- target/i386/tcg/sysemu/excp_helper.c | 34 ++++++++++++++-------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/target/i386/tcg/sysemu/excp_helper.c b/target/i386/tcg/sysemu/= excp_helper.c index 5ba739fbed..0410170d64 100644 --- a/target/i386/tcg/sysemu/excp_helper.c +++ b/target/i386/tcg/sysemu/excp_helper.c @@ -24,32 +24,35 @@ int get_pg_mode(CPUX86State *env) { int pg_mode =3D 0; + if (!(env->cr[0] & CR0_PG_MASK)) { + return 0; + } if (env->cr[0] & CR0_WP_MASK) { pg_mode |=3D PG_MODE_WP; } if (env->cr[4] & CR4_PAE_MASK) { pg_mode |=3D PG_MODE_PAE; + if (env->efer & MSR_EFER_NXE) { + pg_mode |=3D PG_MODE_NXE; + } } if (env->cr[4] & CR4_PSE_MASK) { pg_mode |=3D PG_MODE_PSE; } - if (env->cr[4] & CR4_PKE_MASK) { - pg_mode |=3D PG_MODE_PKE; - } - if (env->cr[4] & CR4_PKS_MASK) { - pg_mode |=3D PG_MODE_PKS; - } if (env->cr[4] & CR4_SMEP_MASK) { pg_mode |=3D PG_MODE_SMEP; } - if (env->cr[4] & CR4_LA57_MASK) { - pg_mode |=3D PG_MODE_LA57; - } if (env->hflags & HF_LMA_MASK) { pg_mode |=3D PG_MODE_LMA; - } - if (env->efer & MSR_EFER_NXE) { - pg_mode |=3D PG_MODE_NXE; + if (env->cr[4] & CR4_PKE_MASK) { + pg_mode |=3D PG_MODE_PKE; + } + if (env->cr[4] & CR4_PKS_MASK) { + pg_mode |=3D PG_MODE_PKS; + } + if (env->cr[4] & CR4_LA57_MASK) { + pg_mode |=3D PG_MODE_LA57; + } } return pg_mode; } @@ -278,9 +281,7 @@ do_check_protect_pse36: *prot |=3D PAGE_EXEC; } =20 - if (!(pg_mode & PG_MODE_LMA)) { - pkr =3D 0; - } else if (ptep & PG_USER_MASK) { + if (ptep & PG_USER_MASK) { pkr =3D pg_mode & PG_MODE_PKE ? env->pkru : 0; } else { pkr =3D pg_mode & PG_MODE_PKS ? env->pkrs : 0; @@ -343,8 +344,7 @@ do_check_protect_pse36: if (is_user) error_code |=3D PG_ERROR_U_MASK; if (is_write1 =3D=3D 2 && - (((pg_mode & PG_MODE_NXE) && (pg_mode & PG_MODE_PAE)) || - (pg_mode & PG_MODE_SMEP))) + ((pg_mode & PG_MODE_NXE) || (pg_mode & PG_MODE_SMEP))) error_code |=3D PG_ERROR_I_D_MASK; return error_code; } --=20 2.34.1 From nobody Sat May 18 21:00:24 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 1646677776187469.87122555939675; Mon, 7 Mar 2022 10:29:36 -0800 (PST) Received: from localhost ([::1]:51942 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nRI6x-0003CY-4i for importer@patchew.org; Mon, 07 Mar 2022 13:29:35 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55420) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRHuj-0001AB-Cx for qemu-devel@nongnu.org; Mon, 07 Mar 2022 13:16:57 -0500 Received: from [2a00:1450:4864:20::62a] (port=33713 helo=mail-ej1-x62a.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nRHud-0005NV-99 for qemu-devel@nongnu.org; Mon, 07 Mar 2022 13:16:57 -0500 Received: by mail-ej1-x62a.google.com with SMTP id kt27so33956554ejb.0 for ; Mon, 07 Mar 2022 10:16:45 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id d8-20020a170906304800b006cdf8a1e146sm4983382ejd.217.2022.03.07.10.16.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 10:16:43 -0800 (PST) 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=sUSJfkexg7KkY2CuTVEeR2bYeZuOFKrm5GHwZ7Vta6I=; b=FUDWAhLhf+opo/MiYM1FjXNwgxOPIiar99xq+5C903fR5rqNSCVOszMH9hhpuTsSiQ G+gmDYujJjzBWDQQYgi1DApjssqbkuSMWzWrc6G0rzdUtLkDDdFsjTC7Bi6BV5WNAQmP 5QbHHSkJZeNqV2NH6tcQPV2YR6CFN+K98xqEmm7KrhlQRIYn4loM52G/W2lNtzYXGyxr fNv78b1c0O2sVR8sq81UVMSeGA8XeAkmKXyhEOMu4zUY46RV7/tfBw+CH7DriIOU7AQO S3TohEHaM+KlXQLduwT0bwp+SdhteHV1By+tLs5r6VoHs88vixij91riKDaLd22AW591 Ej9g== 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=sUSJfkexg7KkY2CuTVEeR2bYeZuOFKrm5GHwZ7Vta6I=; b=xvmUDmlEdp9FwR1S9KT6Fd/jBYfdIz66SaTdK7TWgMdHHCXJ4q6jHUvuzwB1slAulZ ZvWV5vMAj6OVQT9WHX4jJwPqX0Td09WH00+FChi+LgPbd5zDTsR2dKgHusKtDZNRKnhq XFaNNTjZv8mFmJOC1625PLRxYWgeD/0OClqliLWi8kWZCVKnoJwA852hsS61o99k+pv7 87pjD76lS+duZN0NTHZdoyX+m19Ls1hUpCsfEKKCKHwVcD2qs+wquE0xOx3v0wE1oEXN Rsahyp5j0BJiLJpQ/8oN4UKUt07wF/I9a0eu6Z8cNthDT3hFtrv/uVpXxO5nImT8FrRG OHKA== X-Gm-Message-State: AOAM530kg+iSbl/njhw1aCG0UKTllRq0bcmWD04ibx4JXxgio4z0u8J6 NiygyCvzWEGcOOQ+iyuSzNa+qZQWBJc= X-Google-Smtp-Source: ABdhPJyEEHe1pfSti6X929tBQiqSzxAe41nXiiwQWW5P5HWVdAO6N1Bw4Yhx6Pc/NdvHqxJQrOb9mA== X-Received: by 2002:a17:906:1ece:b0:6ce:e14:6d92 with SMTP id m14-20020a1709061ece00b006ce0e146d92mr10189677ejj.408.1646677004305; Mon, 07 Mar 2022 10:16:44 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 11/23] target/i386: Throw a #SS when loading a non-canonical IST Date: Mon, 7 Mar 2022 19:16:21 +0100 Message-Id: <20220307181633.596898-12-pbonzini@redhat.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220307181633.596898-1-pbonzini@redhat.com> References: <20220307181633.596898-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::62a (failed) 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::62a; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x62a.google.com X-Spam_score_int: 0 X-Spam_score: -0.1 X-Spam_bar: / X-Spam_report: (-0.1 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gareth Webb 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: 1646677777202100001 Content-Type: text/plain; charset="utf-8" From: Gareth Webb Loading a non-canonical address into rsp when handling an interrupt or performing a far call should raise a #SS not a #GP. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/870 Signed-off-by: Gareth Webb Message-Id: <164529651121.25406.15337137068584246397-0@git.sr.ht> [Move get_pg_mode to seg_helper.c for user-mode emulators. - Paolo] Signed-off-by: Paolo Bonzini --- target/i386/tcg/seg_helper.c | 49 +++++++++++++++++++++++++++- target/i386/tcg/sysemu/excp_helper.c | 36 -------------------- 2 files changed, 48 insertions(+), 37 deletions(-) diff --git a/target/i386/tcg/seg_helper.c b/target/i386/tcg/seg_helper.c index baa905a0cd..4cf1f973cf 100644 --- a/target/i386/tcg/seg_helper.c +++ b/target/i386/tcg/seg_helper.c @@ -28,6 +28,42 @@ #include "helper-tcg.h" #include "seg_helper.h" =20 +int get_pg_mode(CPUX86State *env) +{ + int pg_mode =3D 0; + if (!(env->cr[0] & CR0_PG_MASK)) { + return 0; + } + if (env->cr[0] & CR0_WP_MASK) { + pg_mode |=3D PG_MODE_WP; + } + if (env->cr[4] & CR4_PAE_MASK) { + pg_mode |=3D PG_MODE_PAE; + if (env->efer & MSR_EFER_NXE) { + pg_mode |=3D PG_MODE_NXE; + } + } + if (env->cr[4] & CR4_PSE_MASK) { + pg_mode |=3D PG_MODE_PSE; + } + if (env->cr[4] & CR4_SMEP_MASK) { + pg_mode |=3D PG_MODE_SMEP; + } + if (env->hflags & HF_LMA_MASK) { + pg_mode |=3D PG_MODE_LMA; + if (env->cr[4] & CR4_PKE_MASK) { + pg_mode |=3D PG_MODE_PKE; + } + if (env->cr[4] & CR4_PKS_MASK) { + pg_mode |=3D PG_MODE_PKS; + } + if (env->cr[4] & CR4_LA57_MASK) { + pg_mode |=3D PG_MODE_LA57; + } + } + return pg_mode; +} + /* return non zero if error */ static inline int load_segment_ra(CPUX86State *env, uint32_t *e1_ptr, uint32_t *e2_ptr, int selector, @@ -795,6 +831,8 @@ static inline target_ulong get_rsp_from_tss(CPUX86State= *env, int level) { X86CPU *cpu =3D env_archcpu(env); int index; + target_ulong rsp; + int32_t sext; =20 #if 0 printf("TR: base=3D" TARGET_FMT_lx " limit=3D%x\n", @@ -808,7 +846,16 @@ static inline target_ulong get_rsp_from_tss(CPUX86Stat= e *env, int level) if ((index + 7) > env->tr.limit) { raise_exception_err(env, EXCP0A_TSS, env->tr.selector & 0xfffc); } - return cpu_ldq_kernel(env, env->tr.base + index); + + rsp =3D cpu_ldq_kernel(env, env->tr.base + index); + + /* test virtual address sign extension */ + sext =3D rsp >> (get_pg_mode(env) & PG_MODE_LA57 ? 56 : 47); + if (sext !=3D 0 && sext !=3D -1) { + raise_exception_err(env, EXCP0C_STACK, 0); + } + + return rsp; } =20 /* 64 bit interrupt */ diff --git a/target/i386/tcg/sysemu/excp_helper.c b/target/i386/tcg/sysemu/= excp_helper.c index 0410170d64..db4c266c86 100644 --- a/target/i386/tcg/sysemu/excp_helper.c +++ b/target/i386/tcg/sysemu/excp_helper.c @@ -21,42 +21,6 @@ #include "cpu.h" #include "tcg/helper-tcg.h" =20 -int get_pg_mode(CPUX86State *env) -{ - int pg_mode =3D 0; - if (!(env->cr[0] & CR0_PG_MASK)) { - return 0; - } - if (env->cr[0] & CR0_WP_MASK) { - pg_mode |=3D PG_MODE_WP; - } - if (env->cr[4] & CR4_PAE_MASK) { - pg_mode |=3D PG_MODE_PAE; - if (env->efer & MSR_EFER_NXE) { - pg_mode |=3D PG_MODE_NXE; - } - } - if (env->cr[4] & CR4_PSE_MASK) { - pg_mode |=3D PG_MODE_PSE; - } - if (env->cr[4] & CR4_SMEP_MASK) { - pg_mode |=3D PG_MODE_SMEP; - } - if (env->hflags & HF_LMA_MASK) { - pg_mode |=3D PG_MODE_LMA; - if (env->cr[4] & CR4_PKE_MASK) { - pg_mode |=3D PG_MODE_PKE; - } - if (env->cr[4] & CR4_PKS_MASK) { - pg_mode |=3D PG_MODE_PKS; - } - if (env->cr[4] & CR4_LA57_MASK) { - pg_mode |=3D PG_MODE_LA57; - } - } - return pg_mode; -} - #define PG_ERROR_OK (-1) =20 typedef hwaddr (*MMUTranslateFunc)(CPUState *cs, hwaddr gphys, MMUAccessTy= pe access_type, --=20 2.34.1 From nobody Sat May 18 21:00:24 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 1646677415126749.1307166702439; Mon, 7 Mar 2022 10:23:35 -0800 (PST) Received: from localhost ([::1]:60720 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nRI17-0006pE-L5 for importer@patchew.org; Mon, 07 Mar 2022 13:23:33 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55394) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRHui-000184-RB for qemu-devel@nongnu.org; Mon, 07 Mar 2022 13:16:56 -0500 Received: from [2a00:1450:4864:20::62a] (port=44941 helo=mail-ej1-x62a.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nRHud-0005Nd-7j for qemu-devel@nongnu.org; Mon, 07 Mar 2022 13:16:56 -0500 Received: by mail-ej1-x62a.google.com with SMTP id qt6so33797542ejb.11 for ; Mon, 07 Mar 2022 10:16:45 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id d8-20020a170906304800b006cdf8a1e146sm4983382ejd.217.2022.03.07.10.16.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 10:16:44 -0800 (PST) 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=ohuOj7/RPeB7VtN1AquejguYaBzi1b7GC1f/dw4ahVU=; b=dgVUNGpfOMpSYcgiLZ87A1qpx0qYLarLdZPLI4orYikX2XwFJKJwNqCr+jjlZSNDNo AD639bORQCsbvz4JCdRvDsT5m8SVfKRm0HWhLhthhHeix31uiJiLOsKOAYoU/sgOBDDA +/9BbvheXRh1VJJYq4LHJbdmEr0JMKaR0jkWe2dWQ8YStd8Y+9Ck4FURNPbd3uydR/5J 8Oz2FPzf7o/TVP6GgE5/WiAcRf3NXPKy2zS0oEJdPhKUIh46/N8glvHuazM/EmuGthXn vBU8MWU++t4cTqyZH/2JA+fhmsj8JgkqH3AHd2qOEJt8ev7mYWF0Ukjj690qvTpg/bOV HXzw== 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=ohuOj7/RPeB7VtN1AquejguYaBzi1b7GC1f/dw4ahVU=; b=7dok4O8yZy1Bu1fU3YR73Am8lGic6Sk4BVY1fEd4BRVjU76dcov7XF2GVxGfpz8FI1 x/WWIyGQ234xxkglhm58u9Vb2Ivxe4xdbWKjBYAJJ4xoL0Fz3RGHcPrf2NPgwiPM1bX6 lqIrYgf5KbQIDebcAFyewRNXmV42wgNxFUcloEGWO/5xI5spisG5+KvEJmUNKJN8AqYL kQXYp0UHFt1r2x9X5M5suWFWaaJ6Ts8h1TO2O2FeOEhmecUbvT8JQnCIBKuuqzusUfVE H+Ix66/ciGa/zhG3uMQyhf5yZxfwxa95m+iXQPCeN37kUF/8tnZ3cdMxncxL09qdMN1Q XyOA== X-Gm-Message-State: AOAM532HDbMTSrUKV/QoOgFcSjNL7TiBm6b5Y5tIKsdvTQnXej9Drk+D 9ZFaZYJQD96yhMDmjhYs2HJgawgIhwA= X-Google-Smtp-Source: ABdhPJwcUh2s6uA32HOG02zhAF55i8cleYHz0FaUzmRwVYYrFloWzHMeJ7KODHYs5BlTuQzjR2fkqw== X-Received: by 2002:a17:906:402:b0:6d5:c6bc:3150 with SMTP id d2-20020a170906040200b006d5c6bc3150mr10176662eja.403.1646677005056; Mon, 07 Mar 2022 10:16:45 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 12/23] linux-headers: include missing changes from 5.17 Date: Mon, 7 Mar 2022 19:16:22 +0100 Message-Id: <20220307181633.596898-13-pbonzini@redhat.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220307181633.596898-1-pbonzini@redhat.com> References: <20220307181633.596898-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::62a (failed) 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::62a; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x62a.google.com X-Spam_score_int: 0 X-Spam_score: -0.1 X-Spam_bar: / X-Spam_report: (-0.1 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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: 1646677415922100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Paolo Bonzini --- linux-headers/asm-x86/kvm.h | 3 +++ linux-headers/linux/kvm.h | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/linux-headers/asm-x86/kvm.h b/linux-headers/asm-x86/kvm.h index 2da3316bb5..bf6e96011d 100644 --- a/linux-headers/asm-x86/kvm.h +++ b/linux-headers/asm-x86/kvm.h @@ -452,6 +452,9 @@ struct kvm_sync_regs { =20 #define KVM_STATE_VMX_PREEMPTION_TIMER_DEADLINE 0x00000001 =20 +/* attributes for system fd (group 0) */ +#define KVM_X86_XCOMP_GUEST_SUPP 0 + struct kvm_vmx_nested_state_data { __u8 vmcs12[KVM_STATE_NESTED_VMX_VMCS_SIZE]; __u8 shadow_vmcs12[KVM_STATE_NESTED_VMX_VMCS_SIZE]; diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h index 00af3bc333..d232feaae9 100644 --- a/linux-headers/linux/kvm.h +++ b/linux-headers/linux/kvm.h @@ -1133,6 +1133,7 @@ struct kvm_ppc_resize_hpt { #define KVM_CAP_VM_MOVE_ENC_CONTEXT_FROM 206 #define KVM_CAP_VM_GPA_BITS 207 #define KVM_CAP_XSAVE2 208 +#define KVM_CAP_SYS_ATTRIBUTES 209 =20 #ifdef KVM_CAP_IRQ_ROUTING =20 @@ -2047,4 +2048,7 @@ struct kvm_stats_desc { =20 #define KVM_GET_STATS_FD _IO(KVMIO, 0xce) =20 +/* Available with KVM_CAP_XSAVE2 */ +#define KVM_GET_XSAVE2 _IOR(KVMIO, 0xcf, struct kvm_xsave) + #endif /* __LINUX_KVM_H */ --=20 2.34.1 From nobody Sat May 18 21:00:24 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 1646677574046371.707218387112; Mon, 7 Mar 2022 10:26:14 -0800 (PST) Received: from localhost ([::1]:41064 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nRI3h-00047F-2R for importer@patchew.org; Mon, 07 Mar 2022 13:26:13 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55410) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRHuj-00019P-3g for qemu-devel@nongnu.org; Mon, 07 Mar 2022 13:16:57 -0500 Received: from [2a00:1450:4864:20::635] (port=42731 helo=mail-ej1-x635.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nRHud-0005Nj-8l for qemu-devel@nongnu.org; Mon, 07 Mar 2022 13:16:56 -0500 Received: by mail-ej1-x635.google.com with SMTP id hw13so33710040ejc.9 for ; Mon, 07 Mar 2022 10:16:46 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id d8-20020a170906304800b006cdf8a1e146sm4983382ejd.217.2022.03.07.10.16.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 10:16:45 -0800 (PST) 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=waGBxRYL0CRLQIlQJnrfINtyYKriftnKcMnSxcPeoYo=; b=F44uYW0assdFRkogJ4AgMCiM9zSUSCjQOWEgqBBHdKgAWqRkU4wSI5OdcLz+9uSUjQ y3VoG2kjZuI+BpeQkQT4Dcj136AnR8yyndoHJZCAJDjftK8jgFUjeXlqBPCMSeD3vtHi +AHyKqh7gwITSR3nS75wD3OEVbujGoKmrqODEy+U8xqgj7gsL1flwXPrFIgOIgYnill3 dhaNGBprwH7zwPbijebPmGweOm2pH6OLNDx5w24AevwHKEydDYORxxoaUgIAbHWHAcNO PWerhG3LizsHPvxepfiCzHUFR26QK7kWCeMHEgO4xdImeExitqLf3DLS+QFWmav3NeES CqjQ== 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=waGBxRYL0CRLQIlQJnrfINtyYKriftnKcMnSxcPeoYo=; b=3c9YmoEu2KikWI03Pyb6UT1cznPIcfA/Ydgp+S7c3ZeB+hns7yAtkHsihLHUU6OUck ktDkk9xQ7KAJL2W/a6Y/I0S9BvhnEz9q9aSEFu4190RtSP3wbSH5LCqGm0zbxcTDGPzG xv9bm953oceK78ntlZOqGn+Y48+CNy+tIfux/Oc8CZ0PaSrQQkuuPQRb6mg+qgrkjYZu ZhohrI8F4d5n1Jz2eVHGVoNQ3MzsAKJ2yimj/C6N542d6+u68zuPB8WGWjHDw1SdMAqC 2OUwpk913sV3tErqnthKZECgCe16j7MXT/+L1tYVgBizt4DyJT7neMCKVd/stlucapVs UwXw== X-Gm-Message-State: AOAM532wbANKyIXCVoRU0yNhAJGKN5aU6g3ZKp+6sOS5hmaDUHC5u2i0 YRtep8SBA1PnkD5xdEPkfFkEw+sDSeI= X-Google-Smtp-Source: ABdhPJztGOeKxR6fnNNS0dOdJU8XovrzUf54l0kqRtCqaiAqopD5FurCWnxob8BH9P7HeU7qyMEmSg== X-Received: by 2002:a17:906:1e42:b0:6d6:df12:7f8d with SMTP id i2-20020a1709061e4200b006d6df127f8dmr10453906ejj.15.1646677005884; Mon, 07 Mar 2022 10:16:45 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 13/23] x86: Fix the 64-byte boundary enumeration for extended state Date: Mon, 7 Mar 2022 19:16:23 +0100 Message-Id: <20220307181633.596898-14-pbonzini@redhat.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220307181633.596898-1-pbonzini@redhat.com> References: <20220307181633.596898-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::635 (failed) 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::635; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x635.google.com X-Spam_score_int: 0 X-Spam_score: -0.1 X-Spam_bar: / X-Spam_report: (-0.1 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Yang Zhong , Jing Liu 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: 1646677574930100001 Content-Type: text/plain; charset="utf-8" From: Jing Liu The extended state subleaves (EAX=3D0Dh, ECX=3Dn, n>1).ECX[1] indicate whether the extended state component locates on the next 64-byte boundary following the preceding state component when the compacted format of an XSAVE area is used. Right now, they are all zero because no supported component needed the bit to be set, but the upcoming AMX feature will use it. Fix the subleaves value according to KVM's supported cpuid. Signed-off-by: Jing Liu Signed-off-by: Yang Zhong Message-Id: <20220217060434.52460-2-yang.zhong@intel.com> Signed-off-by: Paolo Bonzini --- target/i386/cpu.c | 1 + target/i386/cpu.h | 6 ++++++ target/i386/kvm/kvm-cpu.c | 1 + 3 files changed, 8 insertions(+) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 6c7ef1099b..0f3c477dfc 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -5488,6 +5488,7 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, = uint32_t count, const ExtSaveArea *esa =3D &x86_ext_save_areas[count]; *eax =3D esa->size; *ebx =3D esa->offset; + *ecx =3D esa->ecx & ESA_FEATURE_ALIGN64_MASK; } } break; diff --git a/target/i386/cpu.h b/target/i386/cpu.h index e69ab5dd78..7bd9d58505 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -550,6 +550,11 @@ typedef enum X86Seg { #define XSTATE_Hi16_ZMM_MASK (1ULL << XSTATE_Hi16_ZMM_BIT) #define XSTATE_PKRU_MASK (1ULL << XSTATE_PKRU_BIT) =20 +#define ESA_FEATURE_ALIGN64_BIT 1 + +#define ESA_FEATURE_ALIGN64_MASK (1U << ESA_FEATURE_ALIGN64_BIT) + + /* CPUID feature words */ typedef enum FeatureWord { FEAT_1_EDX, /* CPUID[1].EDX */ @@ -1356,6 +1361,7 @@ QEMU_BUILD_BUG_ON(sizeof(XSavePKRU) !=3D 0x8); typedef struct ExtSaveArea { uint32_t feature, bits; uint32_t offset, size; + uint32_t ecx; } ExtSaveArea; =20 #define XSAVE_STATE_AREA_COUNT (XSTATE_PKRU_BIT + 1) diff --git a/target/i386/kvm/kvm-cpu.c b/target/i386/kvm/kvm-cpu.c index d95028018e..ce27d3b1df 100644 --- a/target/i386/kvm/kvm-cpu.c +++ b/target/i386/kvm/kvm-cpu.c @@ -104,6 +104,7 @@ static void kvm_cpu_xsave_init(void) if (sz !=3D 0) { assert(esa->size =3D=3D sz); esa->offset =3D kvm_arch_get_supported_cpuid(s, 0xd, i, R_= EBX); + esa->ecx =3D kvm_arch_get_supported_cpuid(s, 0xd, i, R_ECX= ); } } } --=20 2.34.1 From nobody Sat May 18 21:00:24 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 1646677877779654.2865155464009; Mon, 7 Mar 2022 10:31:17 -0800 (PST) Received: from localhost ([::1]:57948 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nRI8Z-0007L1-1t for importer@patchew.org; Mon, 07 Mar 2022 13:31:16 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55460) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRHuk-0001DN-6b for qemu-devel@nongnu.org; Mon, 07 Mar 2022 13:16:58 -0500 Received: from [2a00:1450:4864:20::62f] (port=45935 helo=mail-ej1-x62f.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nRHud-0005Nn-9u for qemu-devel@nongnu.org; Mon, 07 Mar 2022 13:16:57 -0500 Received: by mail-ej1-x62f.google.com with SMTP id qa43so33763307ejc.12 for ; Mon, 07 Mar 2022 10:16:47 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id d8-20020a170906304800b006cdf8a1e146sm4983382ejd.217.2022.03.07.10.16.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 10:16:46 -0800 (PST) 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=bgnQk/oKm9yMpJRSm1pFwoAeO2+68i+serPntyN6GVM=; b=p4M3cgegboLjZwNk8AbS9Z4uocnCZKiIBf+csMcBTQqtWnIhDcThEwB3l4F9wAxcP5 Sgo1YZRrWxbOuFDmoqlbhTLE0TKI0MkijizTQzfuukH91kP+AzH9qGRNiG8rGqbrKetB AlBB7lrUUY5njxPDSUGNYU3iR1ixNRJGNvSDzwbSOcs3ZURgWDGTBScZsT0k0NF/7Twz gve0nmNeG+mej+IK2O7G1p+1v4HsnHpXuDctNmMpKaJwZCk2d5aYtYu7Y83UucBdUVuf EDgTPvUKU+WJ1FiTRL27a4dk+0P2ejT2NpESAoGa+Mj4AdIqNhiJZx+jP6UNPvWRs3F9 YxoQ== 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=bgnQk/oKm9yMpJRSm1pFwoAeO2+68i+serPntyN6GVM=; b=H2OO9gCJJKhljpZIIy3Jyvfbp3tGbq4ON4Q+WuTzms2kSoITYrJj3Zg+ZSz6VmK5Xn hxOzGIf5589Prbin0Gpw3d3kyHcV3UpQ0ecipFMzI4UQA+lLKrO7e3lNlOThM8vvy1lo V/2qCr4q+riAboydYCKHBfybS3OpmRpfcjuLbVL8/9mCdwNlFR2OzhtRVitCuMlwjxhP oC7yNNJCgtjSf8T83gKxZzTeV4h/2DKdhbznVnftZMZjWnWjrvHKkiFt8OURUadVNtkl wu3vypGNf+8oZT8m/GyhlQvv9IABWPd6WFrJYwuQzcFT1JbQX30LaHdLjc/qp7FK09sV i29Q== X-Gm-Message-State: AOAM532H180Bhx2Vt4mgKSAJ+tu/aobZ7W50wjBzLfscWVI0NFcpmeVC b8mpW4F/3ktyXSrT1i/047du8ctc86Y= X-Google-Smtp-Source: ABdhPJxdL9dFXEcc5XxIMOimLiYCIy3Le8hBaHz8TACqNSEENvbEDQHMRESRLiQuhDR47rIWJRDZtA== X-Received: by 2002:a17:906:2584:b0:6d6:e5c9:221b with SMTP id m4-20020a170906258400b006d6e5c9221bmr10060918ejb.514.1646677006647; Mon, 07 Mar 2022 10:16:46 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 14/23] x86: Add AMX XTILECFG and XTILEDATA components Date: Mon, 7 Mar 2022 19:16:24 +0100 Message-Id: <20220307181633.596898-15-pbonzini@redhat.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220307181633.596898-1-pbonzini@redhat.com> References: <20220307181633.596898-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::62f (failed) 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::62f; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x62f.google.com X-Spam_score_int: 0 X-Spam_score: -0.1 X-Spam_bar: / X-Spam_report: (-0.1 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Yang Zhong , Jing Liu 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: 1646677879992100001 Content-Type: text/plain; charset="utf-8" From: Jing Liu The AMX TILECFG register and the TMMx tile data registers are saved/restored via XSAVE, respectively in state component 17 (64 bytes) and state component 18 (8192 bytes). Add AMX feature bits to x86_ext_save_areas array to set up AMX components. Add structs that define the layout of AMX XSAVE areas and use QEMU_BUILD_BUG_ON to validate the structs sizes. Signed-off-by: Jing Liu Signed-off-by: Yang Zhong Message-Id: <20220217060434.52460-3-yang.zhong@intel.com> Signed-off-by: Paolo Bonzini --- target/i386/cpu.c | 8 ++++++++ target/i386/cpu.h | 18 +++++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 0f3c477dfc..ec35dd1717 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -1402,6 +1402,14 @@ ExtSaveArea x86_ext_save_areas[XSAVE_STATE_AREA_COUN= T] =3D { [XSTATE_PKRU_BIT] =3D { .feature =3D FEAT_7_0_ECX, .bits =3D CPUID_7_0_ECX_PKU, .size =3D sizeof(XSavePKRU) }, + [XSTATE_XTILE_CFG_BIT] =3D { + .feature =3D FEAT_7_0_EDX, .bits =3D CPUID_7_0_EDX_AMX_TILE, + .size =3D sizeof(XSaveXTILECFG), + }, + [XSTATE_XTILE_DATA_BIT] =3D { + .feature =3D FEAT_7_0_EDX, .bits =3D CPUID_7_0_EDX_AMX_TILE, + .size =3D sizeof(XSaveXTILEDATA) + }, }; =20 static uint32_t xsave_area_size(uint64_t mask) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 7bd9d58505..3ff1b49d29 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -539,6 +539,8 @@ typedef enum X86Seg { #define XSTATE_ZMM_Hi256_BIT 6 #define XSTATE_Hi16_ZMM_BIT 7 #define XSTATE_PKRU_BIT 9 +#define XSTATE_XTILE_CFG_BIT 17 +#define XSTATE_XTILE_DATA_BIT 18 =20 #define XSTATE_FP_MASK (1ULL << XSTATE_FP_BIT) #define XSTATE_SSE_MASK (1ULL << XSTATE_SSE_BIT) @@ -847,6 +849,8 @@ typedef uint64_t FeatureWordArray[FEATURE_WORDS]; #define CPUID_7_0_EDX_TSX_LDTRK (1U << 16) /* AVX512_FP16 instruction */ #define CPUID_7_0_EDX_AVX512_FP16 (1U << 23) +/* AMX tile (two-dimensional register) */ +#define CPUID_7_0_EDX_AMX_TILE (1U << 24) /* Speculation Control */ #define CPUID_7_0_EDX_SPEC_CTRL (1U << 26) /* Single Thread Indirect Branch Predictors */ @@ -1350,6 +1354,16 @@ typedef struct XSavePKRU { uint32_t padding; } XSavePKRU; =20 +/* Ext. save area 17: AMX XTILECFG state */ +typedef struct XSaveXTILECFG { + uint8_t xtilecfg[64]; +} XSaveXTILECFG; + +/* Ext. save area 18: AMX XTILEDATA state */ +typedef struct XSaveXTILEDATA { + uint8_t xtiledata[8][1024]; +} XSaveXTILEDATA; + QEMU_BUILD_BUG_ON(sizeof(XSaveAVX) !=3D 0x100); QEMU_BUILD_BUG_ON(sizeof(XSaveBNDREG) !=3D 0x40); QEMU_BUILD_BUG_ON(sizeof(XSaveBNDCSR) !=3D 0x40); @@ -1357,6 +1371,8 @@ QEMU_BUILD_BUG_ON(sizeof(XSaveOpmask) !=3D 0x40); QEMU_BUILD_BUG_ON(sizeof(XSaveZMM_Hi256) !=3D 0x200); QEMU_BUILD_BUG_ON(sizeof(XSaveHi16_ZMM) !=3D 0x400); QEMU_BUILD_BUG_ON(sizeof(XSavePKRU) !=3D 0x8); +QEMU_BUILD_BUG_ON(sizeof(XSaveXTILECFG) !=3D 0x40); +QEMU_BUILD_BUG_ON(sizeof(XSaveXTILEDATA) !=3D 0x2000); =20 typedef struct ExtSaveArea { uint32_t feature, bits; @@ -1364,7 +1380,7 @@ typedef struct ExtSaveArea { uint32_t ecx; } ExtSaveArea; =20 -#define XSAVE_STATE_AREA_COUNT (XSTATE_PKRU_BIT + 1) +#define XSAVE_STATE_AREA_COUNT (XSTATE_XTILE_DATA_BIT + 1) =20 extern ExtSaveArea x86_ext_save_areas[XSAVE_STATE_AREA_COUNT]; =20 --=20 2.34.1 From nobody Sat May 18 21:00:24 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 1646677119228847.2084207786426; Mon, 7 Mar 2022 10:18:39 -0800 (PST) Received: from localhost ([::1]:43616 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nRHwM-0003rw-4m for importer@patchew.org; Mon, 07 Mar 2022 13:18:38 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55310) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRHug-00010e-RX for qemu-devel@nongnu.org; Mon, 07 Mar 2022 13:16:54 -0500 Received: from [2a00:1450:4864:20::636] (port=36728 helo=mail-ej1-x636.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nRHud-0005Nr-2p for qemu-devel@nongnu.org; Mon, 07 Mar 2022 13:16:54 -0500 Received: by mail-ej1-x636.google.com with SMTP id bi12so20718744ejb.3 for ; Mon, 07 Mar 2022 10:16:48 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id d8-20020a170906304800b006cdf8a1e146sm4983382ejd.217.2022.03.07.10.16.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 10:16:47 -0800 (PST) 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=CEOI0S4c7eMH8c+jKZAgenCwfQLZX+PBt0dRjE/LVmg=; b=DLhznl2DgJM2V9GP+aYR5NWTXRiIn+b47S8TY4D0ijmTsITDDAKZY02m8EDPX99jJx o7ESQ+OZ3/PuaflnZ7jqe9lA/xgPvi5MxZSnO/bKyQWqbvvIq3nLo2siewBjFbafRCuR LeaSWX7ZNUwxb9iUKdEshvlLhCVAaC9SVDT/UswB9bCPfEt4lbtz4z3Y1B0gbtDsF2Ie YHWGS+yr3m/+GE4irN3HHr1gGWGvXdKZjRjo5/OoXq9ziGAQomRbx383I6vocpNhk1cj 7j4pJAPFugtoHG74v+bXxds1aqnz9D4T5rQe1UkUm6s0wHMmxwotEGcc5S7WREYRhAzf r9VQ== 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=CEOI0S4c7eMH8c+jKZAgenCwfQLZX+PBt0dRjE/LVmg=; b=BqJzupHuFNINaqd5ykISNXx9pL0pYXNzbsQ5qsLsspvRp+UJlzNWchRSyNmK1oIX90 1XySsw8QsyjxNU1LhXOR6s9x+ngOcJyt8sDud7gzBHFZGD7d+zAZQpGWIS9Uw/zv+Nfi GTRr9y0r/p9d2HEeVohaO7yKGXTD+r1F5u5CCOpPaontJHDLvX97Rwm5XeYnyEnqsD1s CtTaUzJ2UkubfQPkUaAQS9zae0oltkQlHfLZmoH1riX/n04GbL8GwVSSPTTHRS2XEbzq phltQtoR0hRKW4+QLuHdbzQhRvpNnFG3SceRkaLTEmR845pqloX/4wzakU49cLytF/SD GjvA== X-Gm-Message-State: AOAM532/I5zBXqKFWX1BOMI/B5MxzEcl+zUyYC3sfiFQC5LPsXSWhKu8 TjN1yjyqyyxbjFAmSKn6riBCg1AUxWk= X-Google-Smtp-Source: ABdhPJy61Sm36tmKGD+E5jn8HKXqqzQG/hSrmN0f+IFq6O3c6LL+eBOBNmmLGswhx256RcFsp2/CyQ== X-Received: by 2002:a17:906:2b94:b0:6da:c5c8:8383 with SMTP id m20-20020a1709062b9400b006dac5c88383mr9839120ejg.420.1646677007523; Mon, 07 Mar 2022 10:16:47 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 15/23] x86: Grant AMX permission for guest Date: Mon, 7 Mar 2022 19:16:25 +0100 Message-Id: <20220307181633.596898-16-pbonzini@redhat.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220307181633.596898-1-pbonzini@redhat.com> References: <20220307181633.596898-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::636 (failed) 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::636; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x636.google.com X-Spam_score_int: 0 X-Spam_score: -0.1 X-Spam_bar: / X-Spam_report: (-0.1 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Yang Zhong , Jing Liu 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: 1646677120664100001 Content-Type: text/plain; charset="utf-8" From: Yang Zhong Kernel allocates 4K xstate buffer by default. For XSAVE features which require large state component (e.g. AMX), Linux kernel dynamically expands the xstate buffer only after the process has acquired the necessary permissions. Those are called dynamically- enabled XSAVE features (or dynamic xfeatures). There are separate permissions for native tasks and guests. Qemu should request the guest permissions for dynamic xfeatures which will be exposed to the guest. This only needs to be done once before the first vcpu is created. KVM implemented one new ARCH_GET_XCOMP_SUPP system attribute API to get host side supported_xcr0 and Qemu can decide if it can request dynamically enabled XSAVE features permission. https://lore.kernel.org/all/20220126152210.3044876-1-pbonzini@redhat.com/ Suggested-by: Paolo Bonzini Signed-off-by: Yang Zhong Signed-off-by: Jing Liu Message-Id: <20220217060434.52460-4-yang.zhong@intel.com> Signed-off-by: Paolo Bonzini --- target/i386/cpu.c | 7 +++++ target/i386/cpu.h | 4 +++ target/i386/kvm/kvm-cpu.c | 12 ++++---- target/i386/kvm/kvm.c | 57 ++++++++++++++++++++++++++++++++++++++ target/i386/kvm/kvm_i386.h | 1 + 5 files changed, 75 insertions(+), 6 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index ec35dd1717..505ee289bc 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -6007,6 +6007,7 @@ static void x86_cpu_enable_xsave_components(X86CPU *c= pu) CPUX86State *env =3D &cpu->env; int i; uint64_t mask; + static bool request_perm; =20 if (!(env->features[FEAT_1_ECX] & CPUID_EXT_XSAVE)) { env->features[FEAT_XSAVE_COMP_LO] =3D 0; @@ -6022,6 +6023,12 @@ static void x86_cpu_enable_xsave_components(X86CPU *= cpu) } } =20 + /* Only request permission for first vcpu */ + if (kvm_enabled() && !request_perm) { + kvm_request_xsave_components(cpu, mask); + request_perm =3D true; + } + env->features[FEAT_XSAVE_COMP_LO] =3D mask; env->features[FEAT_XSAVE_COMP_HI] =3D mask >> 32; } diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 3ff1b49d29..9630f4712a 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -551,6 +551,10 @@ typedef enum X86Seg { #define XSTATE_ZMM_Hi256_MASK (1ULL << XSTATE_ZMM_Hi256_BIT) #define XSTATE_Hi16_ZMM_MASK (1ULL << XSTATE_Hi16_ZMM_BIT) #define XSTATE_PKRU_MASK (1ULL << XSTATE_PKRU_BIT) +#define XSTATE_XTILE_CFG_MASK (1ULL << XSTATE_XTILE_CFG_BIT) +#define XSTATE_XTILE_DATA_MASK (1ULL << XSTATE_XTILE_DATA_BIT) + +#define XSTATE_DYNAMIC_MASK (XSTATE_XTILE_DATA_MASK) =20 #define ESA_FEATURE_ALIGN64_BIT 1 =20 diff --git a/target/i386/kvm/kvm-cpu.c b/target/i386/kvm/kvm-cpu.c index ce27d3b1df..a35a1bf9fe 100644 --- a/target/i386/kvm/kvm-cpu.c +++ b/target/i386/kvm/kvm-cpu.c @@ -84,7 +84,7 @@ static void kvm_cpu_max_instance_init(X86CPU *cpu) static void kvm_cpu_xsave_init(void) { static bool first =3D true; - KVMState *s =3D kvm_state; + uint32_t eax, ebx, ecx, edx; int i; =20 if (!first) { @@ -100,11 +100,11 @@ static void kvm_cpu_xsave_init(void) ExtSaveArea *esa =3D &x86_ext_save_areas[i]; =20 if (esa->size) { - int sz =3D kvm_arch_get_supported_cpuid(s, 0xd, i, R_EAX); - if (sz !=3D 0) { - assert(esa->size =3D=3D sz); - esa->offset =3D kvm_arch_get_supported_cpuid(s, 0xd, i, R_= EBX); - esa->ecx =3D kvm_arch_get_supported_cpuid(s, 0xd, i, R_ECX= ); + host_cpuid(0xd, i, &eax, &ebx, &ecx, &edx); + if (eax !=3D 0) { + assert(esa->size =3D=3D eax); + esa->offset =3D ebx; + esa->ecx =3D ecx; } } } diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index cfef36a14e..1e4436ee74 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -17,6 +17,7 @@ #include "qapi/error.h" #include #include +#include =20 #include #include "standard-headers/asm-x86/kvm_para.h" @@ -348,6 +349,7 @@ uint32_t kvm_arch_get_supported_cpuid(KVMState *s, uint= 32_t function, struct kvm_cpuid2 *cpuid; uint32_t ret =3D 0; uint32_t cpuid_1_edx; + uint64_t bitmask; =20 cpuid =3D get_supported_cpuid(s); =20 @@ -405,6 +407,25 @@ uint32_t kvm_arch_get_supported_cpuid(KVMState *s, uin= t32_t function, if (!has_msr_arch_capabs) { ret &=3D ~CPUID_7_0_EDX_ARCH_CAPABILITIES; } + } else if (function =3D=3D 0xd && index =3D=3D 0 && + (reg =3D=3D R_EAX || reg =3D=3D R_EDX)) { + struct kvm_device_attr attr =3D { + .group =3D 0, + .attr =3D KVM_X86_XCOMP_GUEST_SUPP, + .addr =3D (unsigned long) &bitmask + }; + + bool sys_attr =3D kvm_check_extension(s, KVM_CAP_SYS_ATTRIBUTES); + if (!sys_attr) { + warn_report("cannot get sys attribute capabilities %d", sys_at= tr); + } + + int rc =3D kvm_ioctl(s, KVM_GET_DEVICE_ATTR, &attr); + if (rc =3D=3D -1 && (errno =3D=3D ENXIO || errno =3D=3D EINVAL)) { + warn_report("KVM_GET_DEVICE_ATTR(0, KVM_X86_XCOMP_GUEST_SUPP) " + "error: %d", rc); + } + ret =3D (reg =3D=3D R_EAX) ? bitmask : bitmask >> 32; } else if (function =3D=3D 0x80000001 && reg =3D=3D R_ECX) { /* * It's safe to enable TOPOEXT even if it's not returned by @@ -5150,3 +5171,39 @@ bool kvm_arch_cpu_check_are_resettable(void) { return !sev_es_enabled(); } + +#define ARCH_REQ_XCOMP_GUEST_PERM 0x1025 + +void kvm_request_xsave_components(X86CPU *cpu, uint64_t mask) +{ + KVMState *s =3D kvm_state; + uint64_t supported; + + mask &=3D XSTATE_DYNAMIC_MASK; + if (!mask) { + return; + } + /* + * Just ignore bits that are not in CPUID[EAX=3D0xD,ECX=3D0]. + * ARCH_REQ_XCOMP_GUEST_PERM would fail, and QEMU has warned + * about them already because they are not supported features. + */ + supported =3D kvm_arch_get_supported_cpuid(s, 0xd, 0, R_EAX); + supported |=3D (uint64_t)kvm_arch_get_supported_cpuid(s, 0xd, 0, R_EDX= ) << 32; + mask &=3D supported; + + while (mask) { + int bit =3D ctz64(mask); + int rc =3D syscall(SYS_arch_prctl, ARCH_REQ_XCOMP_GUEST_PERM, bit); + if (rc) { + /* + * Older kernel version (<5.17) do not support + * ARCH_REQ_XCOMP_GUEST_PERM, but also do not return + * any dynamic feature from kvm_arch_get_supported_cpuid. + */ + warn_report("prctl(ARCH_REQ_XCOMP_GUEST_PERM) failure " + "for feature bit %d", bit); + } + mask &=3D ~BIT_ULL(bit); + } +} diff --git a/target/i386/kvm/kvm_i386.h b/target/i386/kvm/kvm_i386.h index a978509d50..4124912c20 100644 --- a/target/i386/kvm/kvm_i386.h +++ b/target/i386/kvm/kvm_i386.h @@ -52,5 +52,6 @@ bool kvm_hyperv_expand_features(X86CPU *cpu, Error **errp= ); uint64_t kvm_swizzle_msi_ext_dest_id(uint64_t address); =20 bool kvm_enable_sgx_provisioning(KVMState *s); +void kvm_request_xsave_components(X86CPU *cpu, uint64_t mask); =20 #endif --=20 2.34.1 From nobody Sat May 18 21:00:24 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 1646677130554332.90313059318555; Mon, 7 Mar 2022 10:18:50 -0800 (PST) Received: from localhost ([::1]:44342 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nRHwX-0004LT-Ib for importer@patchew.org; Mon, 07 Mar 2022 13:18:49 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55276) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRHug-0000ye-6L for qemu-devel@nongnu.org; Mon, 07 Mar 2022 13:16:54 -0500 Received: from [2a00:1450:4864:20::634] (port=45940 helo=mail-ej1-x634.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nRHud-0005Nv-4I for qemu-devel@nongnu.org; Mon, 07 Mar 2022 13:16:53 -0500 Received: by mail-ej1-x634.google.com with SMTP id qa43so33763460ejc.12 for ; Mon, 07 Mar 2022 10:16:49 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id d8-20020a170906304800b006cdf8a1e146sm4983382ejd.217.2022.03.07.10.16.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 10:16:47 -0800 (PST) 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=byqwazwlVQ/4eJBCyBXwpdV3frwdTuMRkxwEg4OFvTQ=; b=hhR/Axw4o1KctX5ZlONHjOLqAxivn7eula7sXHSDDn8MjWDHXnkmbXROj3EgNQ4cjA OgWjyADBSOenxj5CmbSkueXh/ahg4gCwCDYNu/ew8BuYve9zyK3Iy+wkZZRJANtF8GXL VdO3Dtsf0HDyDCi41DBT3o1C9ixn6PGHXRaSIB3+dphTVenBUKvb3a1RERnkSED5YBEJ 4XxuHhijsxuKAR7IvI8NOOs9xotxLj42yMmsofhnqn0v3IGZdVBXBiUeTUCxltAapO6E 6sSMgE922gVDbeF4lIXLHcKfaHqtBs+xPNWPmKJcV30IwC6EtTK2twonybY2viJj6e0A x7AQ== 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=byqwazwlVQ/4eJBCyBXwpdV3frwdTuMRkxwEg4OFvTQ=; b=gQq4Be5EUbw/s3YZCOESIgJ73GXSXBTHiJ0JlZ77qKnPnAv5x4wzxgrFy9CM9MdvUt f/h+npb5KWcBh1cfP9hJw9yitGh8eVpMl9I88E488Sfzavcyf90R68A0PIdfy2dcqfBv kfMNRVkcLaXT6/0tlsjXOYuRIbO0tWY8kgH2xoilSxL7ttWTz70WTuqH4sEvBYEE1n7i SORBFylt+X+cYoEa2kxg0eUT4pndzJVXP5HjD7AA2NBqrXev/3YyxvU+u1J2NSODxYGm tgS9/jIqpFfd5OZpdB60hNDr57XYmvd3o+BEMSupCII5Mc5P2QPDCN6dxn8anIUGPtlm +3Ng== X-Gm-Message-State: AOAM531vYxqasutVG0Z+NkObAmcpqk7bko02CB/quM1A0OLO2YzMEccq M0x151b6M098newnKQBBtLOngvW4XZQ= X-Google-Smtp-Source: ABdhPJw6wx6euQtoVGPBqetw5LiRF+WcCOxxKuOF9XD8Ihe6nJxEnKV7pqtxX2IFommbgXFdLP6JIA== X-Received: by 2002:a17:906:9751:b0:6db:cf3:e7db with SMTP id o17-20020a170906975100b006db0cf3e7dbmr7785183ejy.58.1646677008332; Mon, 07 Mar 2022 10:16:48 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 16/23] x86: Add XFD faulting bit for state components Date: Mon, 7 Mar 2022 19:16:26 +0100 Message-Id: <20220307181633.596898-17-pbonzini@redhat.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220307181633.596898-1-pbonzini@redhat.com> References: <20220307181633.596898-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::634 (failed) 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::634; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x634.google.com X-Spam_score_int: 0 X-Spam_score: -0.1 X-Spam_bar: / X-Spam_report: (-0.1 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Yang Zhong , Jing Liu 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: 1646677132802100001 Content-Type: text/plain; charset="utf-8" From: Jing Liu Intel introduces XFD faulting mechanism for extended XSAVE features to dynamically enable the features in runtime. If CPUID (EAX=3D0Dh, ECX=3Dn, n>1).ECX[2] is set as 1, it indicates support for XFD faulting of this state component. Signed-off-by: Jing Liu Signed-off-by: Yang Zhong Message-Id: <20220217060434.52460-5-yang.zhong@intel.com> Signed-off-by: Paolo Bonzini --- target/i386/cpu.c | 3 ++- target/i386/cpu.h | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 505ee289bc..79e24bb23f 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -5496,7 +5496,8 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, = uint32_t count, const ExtSaveArea *esa =3D &x86_ext_save_areas[count]; *eax =3D esa->size; *ebx =3D esa->offset; - *ecx =3D esa->ecx & ESA_FEATURE_ALIGN64_MASK; + *ecx =3D esa->ecx & + (ESA_FEATURE_ALIGN64_MASK | ESA_FEATURE_XFD_MASK); } } break; diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 9630f4712a..925d0129e2 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -557,8 +557,10 @@ typedef enum X86Seg { #define XSTATE_DYNAMIC_MASK (XSTATE_XTILE_DATA_MASK) =20 #define ESA_FEATURE_ALIGN64_BIT 1 +#define ESA_FEATURE_XFD_BIT 2 =20 #define ESA_FEATURE_ALIGN64_MASK (1U << ESA_FEATURE_ALIGN64_BIT) +#define ESA_FEATURE_XFD_MASK (1U << ESA_FEATURE_XFD_BIT) =20 =20 /* CPUID feature words */ --=20 2.34.1 From nobody Sat May 18 21:00:24 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 1646677442734135.80593452460266; Mon, 7 Mar 2022 10:24:02 -0800 (PST) Received: from localhost ([::1]:34386 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nRI1Z-00087c-Mz for importer@patchew.org; Mon, 07 Mar 2022 13:24:01 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55284) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRHug-0000z8-DJ for qemu-devel@nongnu.org; Mon, 07 Mar 2022 13:16:54 -0500 Received: from [2a00:1450:4864:20::635] (port=39493 helo=mail-ej1-x635.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nRHud-0005O3-43 for qemu-devel@nongnu.org; Mon, 07 Mar 2022 13:16:54 -0500 Received: by mail-ej1-x635.google.com with SMTP id dr20so33764200ejc.6 for ; Mon, 07 Mar 2022 10:16:50 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id d8-20020a170906304800b006cdf8a1e146sm4983382ejd.217.2022.03.07.10.16.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 10:16:48 -0800 (PST) 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=etf5jxwr29Oh4HbEgyWWV6TrvYS+n1eW5kgscxceipE=; b=GpXOxnzCex2guwgxE3wbCSJLLEbXFydFT8DBjpRS4vhD7L3gMi7o4n1+61q3UHcaHl mQezKyaxdW3i0Jq+T0OeGXE1fOnuJiVMk2HiiWm8yo2n/UgfB1sSWtQRYfvjZ5/eurEF mAgRb/voxs/gD9/k+LWLqeCI62+EpLF2fp65Q42VtFlIjp1QcTuJKhBFosYl13CIJ6gB 69DPs1lwg4tbvS3yJNzpWFVIraeXjXeXrBa6N3qPtT3QMu/9M449pgqgXLr9LMui63jI JJrS2hZqGdL+aOnazrOeFEFJKMpf6cYcpM+n4fMJ7Rr3ZPMeHk8qne4pOU2uBjXuB0WG O88g== 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=etf5jxwr29Oh4HbEgyWWV6TrvYS+n1eW5kgscxceipE=; b=nicKiqT5z10U+Z3cW8umlTCx0p4JET7itPEd1Gk8UzdFou+k1n5EkYiOClaGzyOk4Q nZ7YGWEqpYAgqU+uXflwuV3BS5uz5uBkjjitAag7372uCyd6naoPwMhNYzbXnWTR+Hx5 beghmcye358NQBud/kIF4OLixuUMMWbOBBnIIEsjKpZe2WelKGnJ4WHNU9RRInXi4Sa+ BIRlHonpGT+VYh6jN6aCVu+B2VIXYLDpqhfiuUmWgfExXbeJUTtw2PTWqVPx2lNpEJgw 2I3tA7EYmLQi0EklWK7HebSCVGzz8FV/vl5X5TqhltoVuwqpsW6Tosdet9ULJWxYkPkh vXEQ== X-Gm-Message-State: AOAM532/HHftCQ6M2xe6q9rrG3Li1SwyKtGelB30r6GoDIUOvv+CMzz/ W0KQxsAEMIMqc6O/MYgfgf3k00cnnfs= X-Google-Smtp-Source: ABdhPJyPwrO7ktSL3cLa2ORyPpk6JvqdHIN92rUZnyha/x8lsCJ8LtOfUnm13MhXq0K4+Maj4VKgJA== X-Received: by 2002:a17:906:610:b0:6d6:e68b:136 with SMTP id s16-20020a170906061000b006d6e68b0136mr10400645ejb.332.1646677009215; Mon, 07 Mar 2022 10:16:49 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 17/23] x86: Add AMX CPUIDs enumeration Date: Mon, 7 Mar 2022 19:16:27 +0100 Message-Id: <20220307181633.596898-18-pbonzini@redhat.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220307181633.596898-1-pbonzini@redhat.com> References: <20220307181633.596898-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::635 (failed) 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::635; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x635.google.com X-Spam_score_int: 0 X-Spam_score: -0.1 X-Spam_bar: / X-Spam_report: (-0.1 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Yang Zhong , Jing Liu 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: 1646677444202100001 Content-Type: text/plain; charset="utf-8" From: Jing Liu Add AMX primary feature bits XFD and AMX_TILE to enumerate the CPU's AMX capability. Meanwhile, add AMX TILE and TMUL CPUID leaf and subleaves which exist when AMX TILE is present to provide the maximum capability of TILE and TMUL. Signed-off-by: Jing Liu Signed-off-by: Yang Zhong Message-Id: <20220217060434.52460-6-yang.zhong@intel.com> Signed-off-by: Paolo Bonzini --- target/i386/cpu.c | 55 ++++++++++++++++++++++++++++++++++++++++--- target/i386/kvm/kvm.c | 4 +++- 2 files changed, 55 insertions(+), 4 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 79e24bb23f..351a1e4f2a 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -575,6 +575,18 @@ static CPUCacheInfo legacy_l3_cache =3D { #define INTEL_PT_CYCLE_BITMAP 0x1fff /* Support 0,2^(0~11) */ #define INTEL_PT_PSB_BITMAP (0x003f << 16) /* Support 2K,4K,8K,16K,32= K,64K */ =20 +/* CPUID Leaf 0x1D constants: */ +#define INTEL_AMX_TILE_MAX_SUBLEAF 0x1 +#define INTEL_AMX_TOTAL_TILE_BYTES 0x2000 +#define INTEL_AMX_BYTES_PER_TILE 0x400 +#define INTEL_AMX_BYTES_PER_ROW 0x40 +#define INTEL_AMX_TILE_MAX_NAMES 0x8 +#define INTEL_AMX_TILE_MAX_ROWS 0x10 + +/* CPUID Leaf 0x1E constants: */ +#define INTEL_AMX_TMUL_MAX_K 0x10 +#define INTEL_AMX_TMUL_MAX_N 0x40 + void x86_cpu_vendor_words2str(char *dst, uint32_t vendor1, uint32_t vendor2, uint32_t vendor3) { @@ -844,8 +856,8 @@ FeatureWordInfo feature_word_info[FEATURE_WORDS] =3D { "avx512-vp2intersect", NULL, "md-clear", NULL, NULL, NULL, "serialize", NULL, "tsx-ldtrk", NULL, NULL /* pconfig */, NULL, - NULL, NULL, NULL, "avx512-fp16", - NULL, NULL, "spec-ctrl", "stibp", + NULL, NULL, "amx-bf16", "avx512-fp16", + "amx-tile", "amx-int8", "spec-ctrl", "stibp", NULL, "arch-capabilities", "core-capability", "ssbd", }, .cpuid =3D { @@ -910,7 +922,7 @@ FeatureWordInfo feature_word_info[FEATURE_WORDS] =3D { .type =3D CPUID_FEATURE_WORD, .feat_names =3D { "xsaveopt", "xsavec", "xgetbv1", "xsaves", - NULL, NULL, NULL, NULL, + "xfd", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, @@ -5586,6 +5598,43 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index,= uint32_t count, } break; } + case 0x1D: { + /* AMX TILE */ + *eax =3D 0; + *ebx =3D 0; + *ecx =3D 0; + *edx =3D 0; + if (!(env->features[FEAT_7_0_EDX] & CPUID_7_0_EDX_AMX_TILE)) { + break; + } + + if (count =3D=3D 0) { + /* Highest numbered palette subleaf */ + *eax =3D INTEL_AMX_TILE_MAX_SUBLEAF; + } else if (count =3D=3D 1) { + *eax =3D INTEL_AMX_TOTAL_TILE_BYTES | + (INTEL_AMX_BYTES_PER_TILE << 16); + *ebx =3D INTEL_AMX_BYTES_PER_ROW | (INTEL_AMX_TILE_MAX_NAMES <= < 16); + *ecx =3D INTEL_AMX_TILE_MAX_ROWS; + } + break; + } + case 0x1E: { + /* AMX TMUL */ + *eax =3D 0; + *ebx =3D 0; + *ecx =3D 0; + *edx =3D 0; + if (!(env->features[FEAT_7_0_EDX] & CPUID_7_0_EDX_AMX_TILE)) { + break; + } + + if (count =3D=3D 0) { + /* Highest numbered palette subleaf */ + *ebx =3D INTEL_AMX_TMUL_MAX_K | (INTEL_AMX_TMUL_MAX_N << 8); + } + break; + } case 0x40000000: /* * CPUID code in kvm_arch_init_vcpu() ignores stuff diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index 1e4436ee74..385c5f8ed3 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -1780,7 +1780,9 @@ int kvm_arch_init_vcpu(CPUState *cs) c =3D &cpuid_data.entries[cpuid_i++]; } break; - case 0x14: { + case 0x14: + case 0x1d: + case 0x1e: { uint32_t times; =20 c->function =3D i; --=20 2.34.1 From nobody Sat May 18 21:00:24 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 1646677720029484.27739739844765; Mon, 7 Mar 2022 10:28:40 -0800 (PST) Received: from localhost ([::1]:49586 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nRI62-0001al-JG for importer@patchew.org; Mon, 07 Mar 2022 13:28:38 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55470) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRHuk-0001Et-I5 for qemu-devel@nongnu.org; Mon, 07 Mar 2022 13:16:58 -0500 Received: from [2a00:1450:4864:20::62f] (port=33719 helo=mail-ej1-x62f.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nRHud-0005O9-Co for qemu-devel@nongnu.org; Mon, 07 Mar 2022 13:16:58 -0500 Received: by mail-ej1-x62f.google.com with SMTP id kt27so33957153ejb.0 for ; Mon, 07 Mar 2022 10:16:50 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id d8-20020a170906304800b006cdf8a1e146sm4983382ejd.217.2022.03.07.10.16.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 10:16:49 -0800 (PST) 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=QfcDtP0Hqeo6q6A65VNgvZ2x4KKXPRwR5h/crCJsa3s=; b=b+ltuQSIaoDVXy0I5D0Dy9riPq8gTsOEq0GmiB4d/1WzrWm5xXv+67alBDvP+ClbRY Yh2yml7aMcNL9/zjc38/mzicxlQlhCd3avYu8+TAEqvea+rR+qnEE5aIVA7+mGXEOEGo btkVPhsf9mgwPTBnCd8fMHIFt4ULWLUGXac36shNvIU5wtovgixF3mAwtUJVjdGqpgvq 2Y0kJJb2waFma7coRkjBYrhTP3eKnL3O3JCXFin7YZe26ebI/xqRZJlTTeTpzpijYrY9 sQ5SsFtZGV8NNwtxMsTKBWiP4TXDz5UhW1yzQC2H2FL+I1P3hEKCJxQF/5L5vR5mW8Q9 U07w== 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=QfcDtP0Hqeo6q6A65VNgvZ2x4KKXPRwR5h/crCJsa3s=; b=v0Bheb6jsQ9lxhCGuswI7A85uQjLhLbhxQYl3tm5uTirnBQ0FaJYSb78LKpcLI/wCB Ua5IlWZFxa7O2CFodSghhSHFoMDNALKLSy48VQ8lxCZ497ixW0TUhbQEcZMRT6hY//Ga 0M8rJmWL6dXIaGsyWHypyVNHSQhjhcg8J/CEO/fmH0/DNXhHrq2EW8QKbphB643XBAtR xPyMSkkP6TRWpPsy9Uqn9dkBM1ELYHN6waIDpfg39i1AflQsP/NlKZb6wjqN2iKd7Yh8 lgvvz09Yqh4YcsXNJVM4x7P6t/9sNZLoaNhVV0IjSnHL/McT5JkLK3bRBkL51rrBj3mV PX9g== X-Gm-Message-State: AOAM530BbTi1iMjFOOyc5PcQpPz9Grp04du+sA5Ap5gysOMPSDcwD5t9 6FitXjesMANxqRsWs3xkTDJIQP7D54E= X-Google-Smtp-Source: ABdhPJyeekjulruz08rjr8E2uXnG8+eVZczqQONKRqXDPrCA5FR5Yt3TxZx/Y9SSJJpAnZjF151AKg== X-Received: by 2002:a17:907:334c:b0:6cd:76b7:3948 with SMTP id yr12-20020a170907334c00b006cd76b73948mr10879871ejb.55.1646677010059; Mon, 07 Mar 2022 10:16:50 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 18/23] x86: add support for KVM_CAP_XSAVE2 and AMX state migration Date: Mon, 7 Mar 2022 19:16:28 +0100 Message-Id: <20220307181633.596898-19-pbonzini@redhat.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220307181633.596898-1-pbonzini@redhat.com> References: <20220307181633.596898-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::62f (failed) 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::62f; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x62f.google.com X-Spam_score_int: 0 X-Spam_score: -0.1 X-Spam_bar: / X-Spam_report: (-0.1 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Yang Zhong , Zeng Guang , Wei Wang , Jing Liu 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: 1646677722326100001 Content-Type: text/plain; charset="utf-8" From: Jing Liu When dynamic xfeatures (e.g. AMX) are used by the guest, the xsave area would be larger than 4KB. KVM_GET_XSAVE2 and KVM_SET_XSAVE under KVM_CAP_XSAVE2 works with a xsave buffer larger than 4KB. Always use the new ioctls under KVM_CAP_XSAVE2 when KVM supports it. Signed-off-by: Jing Liu Signed-off-by: Zeng Guang Signed-off-by: Wei Wang Signed-off-by: Yang Zhong Message-Id: <20220217060434.52460-7-yang.zhong@intel.com> Signed-off-by: Paolo Bonzini --- target/i386/cpu.h | 4 ++++ target/i386/kvm/kvm.c | 42 ++++++++++++++++++++++++-------------- target/i386/xsave_helper.c | 28 +++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 15 deletions(-) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 925d0129e2..8c850e74b8 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -1527,6 +1527,10 @@ typedef struct CPUX86State { uint64_t opmask_regs[NB_OPMASK_REGS]; YMMReg zmmh_regs[CPU_NB_REGS]; ZMMReg hi16_zmm_regs[CPU_NB_REGS]; +#ifdef TARGET_X86_64 + uint8_t xtilecfg[64]; + uint8_t xtiledata[8192]; +#endif =20 /* sysenter registers */ uint32_t sysenter_cs; diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index 385c5f8ed3..0fbdeacbb7 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -123,6 +123,7 @@ static uint32_t num_architectural_pmu_gp_counters; static uint32_t num_architectural_pmu_fixed_counters; =20 static int has_xsave; +static int has_xsave2; static int has_xcrs; static int has_pit_state2; static int has_sregs2; @@ -1586,6 +1587,26 @@ static Error *invtsc_mig_blocker; =20 #define KVM_MAX_CPUID_ENTRIES 100 =20 +static void kvm_init_xsave(CPUX86State *env) +{ + if (has_xsave2) { + env->xsave_buf_len =3D QEMU_ALIGN_UP(has_xsave2, 4096); + } else if (has_xsave) { + env->xsave_buf_len =3D sizeof(struct kvm_xsave); + } else { + return; + } + + env->xsave_buf =3D qemu_memalign(4096, env->xsave_buf_len); + memset(env->xsave_buf, 0, env->xsave_buf_len); + /* + * The allocated storage must be large enough for all of the + * possible XSAVE state components. + */ + assert(kvm_arch_get_supported_cpuid(kvm_state, 0xd, 0, R_ECX) <=3D + env->xsave_buf_len); +} + int kvm_arch_init_vcpu(CPUState *cs) { struct { @@ -1615,6 +1636,8 @@ int kvm_arch_init_vcpu(CPUState *cs) =20 cpuid_i =3D 0; =20 + has_xsave2 =3D kvm_check_extension(cs->kvm_state, KVM_CAP_XSAVE2); + r =3D kvm_arch_set_tsc_khz(cs); if (r < 0) { return r; @@ -2004,19 +2027,7 @@ int kvm_arch_init_vcpu(CPUState *cs) if (r) { goto fail; } - - if (has_xsave) { - env->xsave_buf_len =3D sizeof(struct kvm_xsave); - env->xsave_buf =3D qemu_memalign(4096, env->xsave_buf_len); - memset(env->xsave_buf, 0, env->xsave_buf_len); - - /* - * The allocated storage must be large enough for all of the - * possible XSAVE state components. - */ - assert(kvm_arch_get_supported_cpuid(kvm_state, 0xd, 0, R_ECX) - <=3D env->xsave_buf_len); - } + kvm_init_xsave(env); =20 max_nested_state_len =3D kvm_max_nested_state_length(); if (max_nested_state_len > 0) { @@ -3320,13 +3331,14 @@ static int kvm_get_xsave(X86CPU *cpu) { CPUX86State *env =3D &cpu->env; void *xsave =3D env->xsave_buf; - int ret; + int type, ret; =20 if (!has_xsave) { return kvm_get_fpu(cpu); } =20 - ret =3D kvm_vcpu_ioctl(CPU(cpu), KVM_GET_XSAVE, xsave); + type =3D has_xsave2 ? KVM_GET_XSAVE2 : KVM_GET_XSAVE; + ret =3D kvm_vcpu_ioctl(CPU(cpu), type, xsave); if (ret < 0) { return ret; } diff --git a/target/i386/xsave_helper.c b/target/i386/xsave_helper.c index ac61a96344..996e9f3bfe 100644 --- a/target/i386/xsave_helper.c +++ b/target/i386/xsave_helper.c @@ -126,6 +126,20 @@ void x86_cpu_xsave_all_areas(X86CPU *cpu, void *buf, u= int32_t buflen) =20 memcpy(pkru, &env->pkru, sizeof(env->pkru)); } + + e =3D &x86_ext_save_areas[XSTATE_XTILE_CFG_BIT]; + if (e->size && e->offset) { + XSaveXTILECFG *tilecfg =3D buf + e->offset; + + memcpy(tilecfg, &env->xtilecfg, sizeof(env->xtilecfg)); + } + + e =3D &x86_ext_save_areas[XSTATE_XTILE_DATA_BIT]; + if (e->size && e->offset && buflen >=3D e->size + e->offset) { + XSaveXTILEDATA *tiledata =3D buf + e->offset; + + memcpy(tiledata, &env->xtiledata, sizeof(env->xtiledata)); + } #endif } =20 @@ -247,5 +261,19 @@ void x86_cpu_xrstor_all_areas(X86CPU *cpu, const void = *buf, uint32_t buflen) pkru =3D buf + e->offset; memcpy(&env->pkru, pkru, sizeof(env->pkru)); } + + e =3D &x86_ext_save_areas[XSTATE_XTILE_CFG_BIT]; + if (e->size && e->offset) { + const XSaveXTILECFG *tilecfg =3D buf + e->offset; + + memcpy(&env->xtilecfg, tilecfg, sizeof(env->xtilecfg)); + } + + e =3D &x86_ext_save_areas[XSTATE_XTILE_DATA_BIT]; + if (e->size && e->offset && buflen >=3D e->size + e->offset) { + const XSaveXTILEDATA *tiledata =3D buf + e->offset; + + memcpy(&env->xtiledata, tiledata, sizeof(env->xtiledata)); + } #endif } --=20 2.34.1 From nobody Sat May 18 21:00:24 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 1646677985577304.4323686324549; Mon, 7 Mar 2022 10:33:05 -0800 (PST) Received: from localhost ([::1]:36032 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nRIAK-0003BP-HP for importer@patchew.org; Mon, 07 Mar 2022 13:33:04 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55486) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRHuk-0001GM-Tf for qemu-devel@nongnu.org; Mon, 07 Mar 2022 13:16:58 -0500 Received: from [2a00:1450:4864:20::633] (port=33723 helo=mail-ej1-x633.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nRHue-0005OG-90 for qemu-devel@nongnu.org; Mon, 07 Mar 2022 13:16:58 -0500 Received: by mail-ej1-x633.google.com with SMTP id kt27so33957231ejb.0 for ; Mon, 07 Mar 2022 10:16:51 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id d8-20020a170906304800b006cdf8a1e146sm4983382ejd.217.2022.03.07.10.16.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 10:16:50 -0800 (PST) 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=gXFzbYmSw9uySnU8dK/fYNVpZ7je0zBcwVMUebDYEEQ=; b=Fo+DpLkAuxnIYZ5YHZo4TJA9BcDELiD/WeDZVhWc408h3MH9sWFAQ1P/wdsUHbWYDk +zGchvQE96hOqpu+Q7W5cI4XOQ75lm6nrXzb6WMKh5QcqutHbTOyAYD15QtH9r8DJAMf vtonKXmuKssYSXssGmYO57BKSx1iWNfDBQAaZ68DAChp/vlDHhPRhfDp/hhWBgkwDlI8 6ww/dQBrXWc5g21+LXiZxJpiIygn42kxR2Cl3iD52wxfRwRu8LWp8JKvwn0ckaaxKRJ4 q4r9moXB0RYfWNw9+sdlJ3S61HqNXY0VthiCggvRfxG1BpMWnx9pZiLK4CzEo8k6R/+0 q6Jw== 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=gXFzbYmSw9uySnU8dK/fYNVpZ7je0zBcwVMUebDYEEQ=; b=wC2R5el6OtDK1rL/A1PGurx0bYT+YYUlrMp8PGtkjPdAmolmZuHphLLJgmrjAluRFM JLg3laCDGN5qtZHM5/j4p9mrj6iv4eacHfkdSGezBqM4LVe88u5PC9hza5Ds1+qpkqlN oSek/rA9cSVH4ZhmTJX6Nr5Z6wUxeoreLWAXMuCc/Psw8/qUcFSRn84hspxhryMpKuKH jRVCpJQXP1y0bq72hxTFQCaZZdvlJA73vK/Ic9YHQTWN6wx40Jt2FIOu1ywniN2PKnw8 Qv1oVpGRT+8J7E3fVMMxbDvTVduy8Ko+XSCIB4pncbGGPNKDUUCbAd+b8vy5pnktD3Iy xp4Q== X-Gm-Message-State: AOAM533eko9K5VHGvavg7nLLmabmGbgJE+HBH0e3TAW6vcLbf4GUmQHx 6sPHVGzEmSZ1hu1EPNh4F4HRDQsgF38= X-Google-Smtp-Source: ABdhPJxtTTYQQwf5jqsmb++EJ77FF03b/n3PzefUrcC09MGjKVoVJBXRKtzuGNRo/WokANZ3leGnIw== X-Received: by 2002:a17:907:da9:b0:6da:beb8:fdac with SMTP id go41-20020a1709070da900b006dabeb8fdacmr10346753ejc.364.1646677010923; Mon, 07 Mar 2022 10:16:50 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 19/23] x86: Support XFD and AMX xsave data migration Date: Mon, 7 Mar 2022 19:16:29 +0100 Message-Id: <20220307181633.596898-20-pbonzini@redhat.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220307181633.596898-1-pbonzini@redhat.com> References: <20220307181633.596898-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::633 (failed) 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::633; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x633.google.com X-Spam_score_int: 0 X-Spam_score: -0.1 X-Spam_bar: / X-Spam_report: (-0.1 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Yang Zhong , Zeng Guang , Wei Wang 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: 1646677987120100001 Content-Type: text/plain; charset="utf-8" From: Zeng Guang XFD(eXtended Feature Disable) allows to enable a feature on xsave state while preventing specific user threads from using the feature. Support save and restore XFD MSRs if CPUID.D.1.EAX[4] enumerate to be valid. Likewise migrate the MSRs and related xsave state necessarily. Signed-off-by: Zeng Guang Signed-off-by: Wei Wang Signed-off-by: Yang Zhong Message-Id: <20220217060434.52460-8-yang.zhong@intel.com> Signed-off-by: Paolo Bonzini --- target/i386/cpu.h | 9 +++++++++ target/i386/kvm/kvm.c | 18 +++++++++++++++++ target/i386/machine.c | 46 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 73 insertions(+) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 8c850e74b8..efea2c78ec 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -507,6 +507,9 @@ typedef enum X86Seg { =20 #define MSR_VM_HSAVE_PA 0xc0010117 =20 +#define MSR_IA32_XFD 0x000001c4 +#define MSR_IA32_XFD_ERR 0x000001c5 + #define MSR_IA32_BNDCFGS 0x00000d90 #define MSR_IA32_XSS 0x00000da0 #define MSR_IA32_UMWAIT_CONTROL 0xe1 @@ -872,6 +875,8 @@ typedef uint64_t FeatureWordArray[FEATURE_WORDS]; #define CPUID_7_1_EAX_AVX_VNNI (1U << 4) /* AVX512 BFloat16 Instruction */ #define CPUID_7_1_EAX_AVX512_BF16 (1U << 5) +/* XFD Extend Feature Disabled */ +#define CPUID_D_1_EAX_XFD (1U << 4) =20 /* Packets which contain IP payload have LIP values */ #define CPUID_14_0_ECX_LIP (1U << 31) @@ -1616,6 +1621,10 @@ typedef struct CPUX86State { uint64_t msr_rtit_cr3_match; uint64_t msr_rtit_addrs[MAX_RTIT_ADDRS]; =20 + /* Per-VCPU XFD MSRs */ + uint64_t msr_xfd; + uint64_t msr_xfd_err; + /* exception/interrupt handling */ int error_code; int exception_is_int; diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index 0fbdeacbb7..debac04e91 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -3276,6 +3276,13 @@ static int kvm_put_msrs(X86CPU *cpu, int level) env->msr_ia32_sgxlepubkeyhash[3]); } =20 + if (env->features[FEAT_XSAVE] & CPUID_D_1_EAX_XFD) { + kvm_msr_entry_add(cpu, MSR_IA32_XFD, + env->msr_xfd); + kvm_msr_entry_add(cpu, MSR_IA32_XFD_ERR, + env->msr_xfd_err); + } + /* Note: MSR_IA32_FEATURE_CONTROL is written separately, see * kvm_put_msr_feature_control. */ } @@ -3668,6 +3675,11 @@ static int kvm_get_msrs(X86CPU *cpu) kvm_msr_entry_add(cpu, MSR_IA32_SGXLEPUBKEYHASH3, 0); } =20 + if (env->features[FEAT_XSAVE] & CPUID_D_1_EAX_XFD) { + kvm_msr_entry_add(cpu, MSR_IA32_XFD, 0); + kvm_msr_entry_add(cpu, MSR_IA32_XFD_ERR, 0); + } + ret =3D kvm_vcpu_ioctl(CPU(cpu), KVM_GET_MSRS, cpu->kvm_msr_buf); if (ret < 0) { return ret; @@ -3964,6 +3976,12 @@ static int kvm_get_msrs(X86CPU *cpu) env->msr_ia32_sgxlepubkeyhash[index - MSR_IA32_SGXLEPUBKEYHASH= 0] =3D msrs[i].data; break; + case MSR_IA32_XFD: + env->msr_xfd =3D msrs[i].data; + break; + case MSR_IA32_XFD_ERR: + env->msr_xfd_err =3D msrs[i].data; + break; } } =20 diff --git a/target/i386/machine.c b/target/i386/machine.c index 6202f47793..7c54bada81 100644 --- a/target/i386/machine.c +++ b/target/i386/machine.c @@ -1483,6 +1483,48 @@ static const VMStateDescription vmstate_pdptrs =3D { } }; =20 +static bool xfd_msrs_needed(void *opaque) +{ + X86CPU *cpu =3D opaque; + CPUX86State *env =3D &cpu->env; + + return !!(env->features[FEAT_XSAVE] & CPUID_D_1_EAX_XFD); +} + +static const VMStateDescription vmstate_msr_xfd =3D { + .name =3D "cpu/msr_xfd", + .version_id =3D 1, + .minimum_version_id =3D 1, + .needed =3D xfd_msrs_needed, + .fields =3D (VMStateField[]) { + VMSTATE_UINT64(env.msr_xfd, X86CPU), + VMSTATE_UINT64(env.msr_xfd_err, X86CPU), + VMSTATE_END_OF_LIST() + } +}; + +#ifdef TARGET_X86_64 +static bool amx_xtile_needed(void *opaque) +{ + X86CPU *cpu =3D opaque; + CPUX86State *env =3D &cpu->env; + + return !!(env->features[FEAT_7_0_EDX] & CPUID_7_0_EDX_AMX_TILE); +} + +static const VMStateDescription vmstate_amx_xtile =3D { + .name =3D "cpu/intel_amx_xtile", + .version_id =3D 1, + .minimum_version_id =3D 1, + .needed =3D amx_xtile_needed, + .fields =3D (VMStateField[]) { + VMSTATE_UINT8_ARRAY(env.xtilecfg, X86CPU, 64), + VMSTATE_UINT8_ARRAY(env.xtiledata, X86CPU, 8192), + VMSTATE_END_OF_LIST() + } +}; +#endif + const VMStateDescription vmstate_x86_cpu =3D { .name =3D "cpu", .version_id =3D 12, @@ -1622,6 +1664,10 @@ const VMStateDescription vmstate_x86_cpu =3D { &vmstate_msr_tsx_ctrl, &vmstate_msr_intel_sgx, &vmstate_pdptrs, + &vmstate_msr_xfd, +#ifdef TARGET_X86_64 + &vmstate_amx_xtile, +#endif NULL } }; --=20 2.34.1 From nobody Sat May 18 21:00:24 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 1646677867651508.9046834550775; Mon, 7 Mar 2022 10:31:07 -0800 (PST) Received: from localhost ([::1]:57508 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nRI8R-00070P-Es for importer@patchew.org; Mon, 07 Mar 2022 13:31:07 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55484) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRHuk-0001GK-Tg for qemu-devel@nongnu.org; Mon, 07 Mar 2022 13:16:58 -0500 Received: from [2a00:1450:4864:20::532] (port=46710 helo=mail-ed1-x532.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nRHuf-0005OM-2P for qemu-devel@nongnu.org; Mon, 07 Mar 2022 13:16:58 -0500 Received: by mail-ed1-x532.google.com with SMTP id y12so1429790edc.13 for ; Mon, 07 Mar 2022 10:16:52 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id d8-20020a170906304800b006cdf8a1e146sm4983382ejd.217.2022.03.07.10.16.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 10:16:51 -0800 (PST) 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=ZfOpyFRoufciIywj58YNuToW8FcorvQ7w95GMuMr8Iw=; b=DuiOKZ/wBafdC6eTxaKfZ/L3x4BKXxd4qPPoZT310+Rf0aqL8T+BOsnHx3qXwUOt9i zcPlJuJyLZG7kJUebINv17/Vmzj/qItdZFbd8eSGaerb/tylud7H6fRlSkiee+F59uK9 zyiOE+GUkAV1CbMZCdTovrgSOHwVwkMTldts6AsEivn2cnkj4BF27G1WRSXOsEVXsMW9 FzY3hT3mPdbZnqYGYYi7ik/7jqRbyDLNRzwPQH+MiNqh5MwPI/U0AQX2UAZgUNjeyhyi gWwwACaZKq5OI9MaimHPJ5S8rkMwJoCovdfL3lAR8csZsygrMZrdELfsqFgI0GNwZoWF 18mA== 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=ZfOpyFRoufciIywj58YNuToW8FcorvQ7w95GMuMr8Iw=; b=N17fZs5ErpAmUSOEeGu7UzLW4x5z1PvPo6f95rt7rIEI6P8WoR87z73YSACw8ipBXa yWfJK6BRcLj8yDLLxd4Rlz1UtSMOmuzylDGfQMclTz6S/hunAQEmARfo2GKHiwo2zBsE ThhRMABxWqX/c7IrXR/7R6Snz0Zva/oyeZWl9whQZt//TT/FR3Rhz9ieWhE0okojEXkt KgGQL+BFpr6IDd2OmZvzzSNy6Fua7J26BfHXV0+NmLOvpeUwc3RefVqX1txfQPpdZvvQ cVhuKnzSED9dAOVfQJGDAWDVR0y49z5lxiS6V1y8OawNhXkRT+v/oasz7kcxeOwU49ru LCxw== X-Gm-Message-State: AOAM531R+lg5EQ87TU2ws+D80Zx0vuV8eUe8Q+RJBxoRH5USdYZ4YkQo 4x7YB7p42uP7oBOSsFd0wK3u3RORDJc= X-Google-Smtp-Source: ABdhPJyuSrLX6Hr+Mm+n7wALN3Tbt5JGNZxnwqcpPFq4mmUjdf0LGCTeSUID/Z1Jw1NoRSomOApcvA== X-Received: by 2002:aa7:cac8:0:b0:410:cc6c:6512 with SMTP id l8-20020aa7cac8000000b00410cc6c6512mr12407748edt.408.1646677011743; Mon, 07 Mar 2022 10:16:51 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 20/23] i386: Add Icelake-Server-v6 CPU model with 5-level EPT support Date: Mon, 7 Mar 2022 19:16:30 +0100 Message-Id: <20220307181633.596898-21-pbonzini@redhat.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220307181633.596898-1-pbonzini@redhat.com> References: <20220307181633.596898-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::532 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::532; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x532.google.com X-Spam_score_int: 0 X-Spam_score: -0.1 X-Spam_bar: / X-Spam_report: (-0.1 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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: 1646677869957100003 Content-Type: text/plain; charset="utf-8" From: Vitaly Kuznetsov Windows 11 with WSL2 enabled (Hyper-V) fails to boot with Icelake-Server {-v5} CPU model but boots well with '-cpu host'. Apparently, it expects 5-level paging and 5-level EPT support to come in pair but QEMU's Icelake-Server CPU model lacks the later. Introduce 'Icelake-Server-v6' CPU model with 'vmx-page-walk-5' enabled by default. Signed-off-by: Vitaly Kuznetsov Message-Id: <20220221145316.576138-1-vkuznets@redhat.com> Signed-off-by: Paolo Bonzini --- target/i386/cpu.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 351a1e4f2a..916d3354fe 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -3526,6 +3526,14 @@ static const X86CPUDefinition builtin_x86_defs[] =3D= { { /* end of list */ } }, }, + { + .version =3D 6, + .note =3D "5-level EPT", + .props =3D (PropValue[]) { + { "vmx-page-walk-5", "on" }, + { /* end of list */ } + }, + }, { /* end of list */ } } }, --=20 2.34.1 From nobody Sat May 18 21:00:24 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 1646678010403416.35172561097124; Mon, 7 Mar 2022 10:33:30 -0800 (PST) Received: from localhost ([::1]:37412 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nRIAj-00047A-DD for importer@patchew.org; Mon, 07 Mar 2022 13:33:29 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55512) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRHul-0001II-M1 for qemu-devel@nongnu.org; Mon, 07 Mar 2022 13:16:59 -0500 Received: from [2a00:1450:4864:20::633] (port=46894 helo=mail-ej1-x633.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nRHuf-0005OY-SI for qemu-devel@nongnu.org; Mon, 07 Mar 2022 13:16:59 -0500 Received: by mail-ej1-x633.google.com with SMTP id qx21so33792534ejb.13 for ; Mon, 07 Mar 2022 10:16:53 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id d8-20020a170906304800b006cdf8a1e146sm4983382ejd.217.2022.03.07.10.16.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 10:16:52 -0800 (PST) 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=vbENdtqNo7P6LUkUy9opFFE8Xsb+w0xvUOKfrIByXG0=; b=oYM4OFgVuyvqCaD8iwmVmYNwwSmbms2RD4Eq8AWdOve95q7JhzE5ifYau1qDxdy1ej V1cOIegbyuEXV8YRtk1Wq+4stxXggmHvnNfdNhLowQ7Pgw1/C+Cp1ZFOSdVd7MU4UHS1 ew24Tk0DH1dehQOBfCW2xS/GoHXO54SsBQI/yB1/+GfCkEtFfiJWj7qjRXyhJ6FN51t0 sFTmZqclAVtI1Bq8uGzjTQ7c1+xEky83lu/huC/CB7LPdtSBxhmVos4NR8I8vdINfk/B E8Dvc6WKu8WNWtmW+XLacb6UalQzx8t8bL6fZoMQTs0HchihVXP+nyMApR5JLSzJVC7e libQ== 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=vbENdtqNo7P6LUkUy9opFFE8Xsb+w0xvUOKfrIByXG0=; b=I1HnYCKCOAt2JYJNbwsP9ZQ7Krz2neIN3Um7j/gLC44Qn05cX3kko/u+vPFYqNY3GJ kaBH84rFkPOmZjQlbLt7Ko1pdOkOtKYTYA5odBsDMTR/vvjfsygrrQyrEBqQzl26G+Of lC2eEPJpW9XMDLlvcdk+2bdjCQmyyrgO/zCE7qT5lQnVjwC6a/oIsPDZc6Fu03bYwVZd pldML+8Al3FDlyHnuJLrHBmey58lTG7JvlHilupmiBtGrWgwPnXEAtaXGuSuvFbG2zxL sm/63+kgHnrEaevjX6jUgUB4iBo0k9rWOtK5mifE/Ll9iEdLcEuAtnMGZV1MjA/bkEeH 6LIA== X-Gm-Message-State: AOAM533x8M4ADxpohBCafn6L8KS09JrnvpTwcyRInM+C+DFlgz5yyn10 7zX/8yQ+LNAQdMxmDAByIojI+MGFQHA= X-Google-Smtp-Source: ABdhPJwq0ys+qnMwy5y/DftGa5hdsCclsri41DAxZS6JKSlajiiDAjgvn/itjt5/t4sX/5mLHHCqwQ== X-Received: by 2002:a17:907:c16:b0:6da:7d72:1357 with SMTP id ga22-20020a1709070c1600b006da7d721357mr9985820ejc.251.1646677012657; Mon, 07 Mar 2022 10:16:52 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 21/23] KVM: SVM: always set MSR_AMD64_TSC_RATIO to default value Date: Mon, 7 Mar 2022 19:16:31 +0100 Message-Id: <20220307181633.596898-22-pbonzini@redhat.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220307181633.596898-1-pbonzini@redhat.com> References: <20220307181633.596898-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::633 (failed) 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::633; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x633.google.com X-Spam_score_int: 0 X-Spam_score: -0.1 X-Spam_bar: / X-Spam_report: (-0.1 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Maxim Levitsky 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: 1646678010969100001 Content-Type: text/plain; charset="utf-8" From: Maxim Levitsky Even when the feature is not supported in guest CPUID, still set the msr to the default value which will be the only value KVM will accept in this case Signed-off-by: Maxim Levitsky Message-Id: <20220223115824.319821-1-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini --- target/i386/cpu.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 916d3354fe..a88d6554c8 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -5997,9 +5997,7 @@ static void x86_cpu_reset(DeviceState *dev) =20 x86_cpu_set_sgxlepubkeyhash(env); =20 - if (env->features[FEAT_SVM] & CPUID_SVM_TSCSCALE) { - env->amd_tsc_scale_msr =3D MSR_AMD64_TSC_RATIO_DEFAULT; - } + env->amd_tsc_scale_msr =3D MSR_AMD64_TSC_RATIO_DEFAULT; =20 #endif } --=20 2.34.1 From nobody Sat May 18 21:00:24 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 1646678083141185.3608391563081; Mon, 7 Mar 2022 10:34:43 -0800 (PST) Received: from localhost ([::1]:41918 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nRIBt-0007Ay-LU for importer@patchew.org; Mon, 07 Mar 2022 13:34:41 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55520) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRHum-0001LA-EI for qemu-devel@nongnu.org; Mon, 07 Mar 2022 13:17:00 -0500 Received: from [2a00:1450:4864:20::532] (port=43885 helo=mail-ed1-x532.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nRHug-0005Oi-RK for qemu-devel@nongnu.org; Mon, 07 Mar 2022 13:17:00 -0500 Received: by mail-ed1-x532.google.com with SMTP id f8so21138042edf.10 for ; Mon, 07 Mar 2022 10:16:54 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id d8-20020a170906304800b006cdf8a1e146sm4983382ejd.217.2022.03.07.10.16.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 10:16:53 -0800 (PST) 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=lwah2ManLhU1D36NphS3przFakODu70Ms+khHYX1cFA=; b=eH9jJqCm33azGykmhEPNY1BimKVUCNPZ7JvdjG8Xzs0+SjR5ZKfJU7+JlEqsyNgQi5 +34blA94/5H/y46MbC0dNfzODh/JZ/uLwEo17Cg6g67mPP44rFWpWQZQf2KLSrmR5hHr RcF6Et+8pFD43n8HbZuQwp/N7qtUPWK0Dx4t4OcgLVaUTGHGJmqd6FTQXyuX7NvPbfXn kM2xWGQiGC80Nua6NbRhCRc1kk7ZfL2qfPnFFMcs/KdeW7YRDRdxv0cC046wzkTVz1k0 qUcDET3h6I3E6ErGYXsWrWWp/UIK9v23Ixq0hGGlENgP13O73sdgeY75HT5a95J+dpNH yK6A== 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=lwah2ManLhU1D36NphS3przFakODu70Ms+khHYX1cFA=; b=kbUFxw71+Kjw5BO+HZg2sAbDW+o+VV5UL9SuJip/zywBR5IpLiXzhb8xzXXnhySPsh NBaTF4fY76LoxwhYOs0O0aBWEtszDA8u9b6bS5gLB7gjy1A3Rcil7aHeOlYsceIojdmf Q8D2+6AtPZtEHSPfsbBC3HKxEO93Od40Vf3beTPH+cqVGWpHJDuosjqaPj0LtXAbM2En Zeow4UwsS2x+wGdaUGH7bYvrlK1H5ikb1gPXiRWurAsLXEB89obe0991nvKw4DnfZ4jW 2xMbbsDh2HKhBq8otWwtjAQdCKXeMYbSzSmo6Lz3UGdDfDroODUseRsqVeu6zRTB01SU YlpA== X-Gm-Message-State: AOAM531/pU1qXBQ+8VSqN3z0CgI8nyCEKwn5nzQZGi/77GyWyZQu6Nlp LUzk1iH9RmMvoM2w2jz2oTJdrCUk76A= X-Google-Smtp-Source: ABdhPJzXwpnjBNtRrjLX3gyf66BMenXulvNbfTfjoK7pHzKrqJY8k+H8bt2h6j5IOXBLou/c9/kG3g== X-Received: by 2002:a50:c099:0:b0:415:f5c7:700e with SMTP id k25-20020a50c099000000b00415f5c7700emr12029114edf.205.1646677013523; Mon, 07 Mar 2022 10:16:53 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 22/23] check-block: revert TAP output and reintroduce -makecheck Date: Mon, 7 Mar 2022 19:16:32 +0100 Message-Id: <20220307181633.596898-23-pbonzini@redhat.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220307181633.596898-1-pbonzini@redhat.com> References: <20220307181633.596898-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::532 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::532; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x532.google.com X-Spam_score_int: 0 X-Spam_score: -0.1 X-Spam_bar: / X-Spam_report: (-0.1 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell 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: 1646678084303100001 Content-Type: text/plain; charset="utf-8" This reverts commits d316859f4e28c74ab8b618895d2a5e0a865d3cf1 and 308c8475bc9d7e352125dea42950afbaf9daadfe. The TAP output is inferior in that it does not include the diff for failed tests; there are also cases (for skipped tests) where the TAP output is incorrect. Reported-by: Peter Maydell Signed-off-by: Paolo Bonzini Tested-by: Peter Maydell Message-Id: <20220208124432.84924-1-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- tests/check-block.sh | 6 ++-- tests/qemu-iotests/check | 6 ++-- tests/qemu-iotests/meson.build | 1 - tests/qemu-iotests/testenv.py | 30 +++++++++--------- tests/qemu-iotests/testrunner.py | 54 ++++++++++++++------------------ 5 files changed, 45 insertions(+), 52 deletions(-) diff --git a/tests/check-block.sh b/tests/check-block.sh index 18f7433901..470c1521c2 100755 --- a/tests/check-block.sh +++ b/tests/check-block.sh @@ -14,8 +14,8 @@ else fi =20 skip() { - echo "1..0 #SKIP $*" - exit 0 + echo "$*" + exit 77 } =20 # Disable tests with any sanitizer except for specific ones @@ -75,7 +75,7 @@ JOBS=3D$(echo "$MAKEFLAGS" | sed -n 's/\(^\|.* \)-j\([0-9= ]\+\)\( .*\|$\)/-j \2/p') =20 ret=3D0 for fmt in $format_list ; do - ${PYTHON} ./check $JOBS -tap -$fmt $group || ret=3D1 + ${PYTHON} ./check $JOBS -makecheck -$fmt $group || ret=3D1 done =20 exit $ret diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check index 75de1b4691..0c27721a41 100755 --- a/tests/qemu-iotests/check +++ b/tests/qemu-iotests/check @@ -32,6 +32,8 @@ def make_argparser() -> argparse.ArgumentParser: =20 p.add_argument('-n', '--dry-run', action=3D'store_true', help=3D'show me, do not run tests') + p.add_argument('-makecheck', action=3D'store_true', + help=3D'pretty print output for make check') p.add_argument('-j', dest=3D'jobs', type=3Dint, default=3D1, help=3D'run tests in multiple parallel jobs') =20 @@ -51,8 +53,6 @@ def make_argparser() -> argparse.ArgumentParser: p.add_argument('--color', choices=3D['on', 'off', 'auto'], default=3D'auto', help=3D"use terminal colors. The defa= ult " "'auto' value means use colors if terminal stdout detec= ted") - p.add_argument('-tap', action=3D'store_true', - help=3D'produce TAP output') =20 g_env =3D p.add_argument_group('test environment options') mg =3D g_env.add_mutually_exclusive_group() @@ -164,7 +164,7 @@ if __name__ =3D=3D '__main__': if args.dry_run: print('\n'.join(tests)) else: - with TestRunner(env, tap=3Dargs.tap, + with TestRunner(env, makecheck=3Dargs.makecheck, color=3Dargs.color) as tr: paths =3D [os.path.join(env.source_iotests, t) for t in tests] ok =3D tr.run_tests(paths, args.jobs) diff --git a/tests/qemu-iotests/meson.build b/tests/qemu-iotests/meson.build index 9747bb68a5..d959b26a4a 100644 --- a/tests/qemu-iotests/meson.build +++ b/tests/qemu-iotests/meson.build @@ -22,7 +22,6 @@ if have_tools and targetos !=3D 'windows' and not get_opt= ion('gprof') endif test('qemu-iotests ' + format, sh, args: [files('../check-block.sh'), = format], depends: qemu_iotests_binaries, env: qemu_iotests_env, - protocol: 'tap', suite: suites, timeout: 0, is_parallel: false) diff --git a/tests/qemu-iotests/testenv.py b/tests/qemu-iotests/testenv.py index 0f32897fe8..c33454fa68 100644 --- a/tests/qemu-iotests/testenv.py +++ b/tests/qemu-iotests/testenv.py @@ -287,21 +287,21 @@ def __enter__(self) -> 'TestEnv': def __exit__(self, exc_type: Any, exc_value: Any, traceback: Any) -> N= one: self.close() =20 - def print_env(self, prefix: str =3D '') -> None: + def print_env(self) -> None: template =3D """\ -{prefix}QEMU -- "{QEMU_PROG}" {QEMU_OPTIONS} -{prefix}QEMU_IMG -- "{QEMU_IMG_PROG}" {QEMU_IMG_OPTIONS} -{prefix}QEMU_IO -- "{QEMU_IO_PROG}" {QEMU_IO_OPTIONS} -{prefix}QEMU_NBD -- "{QEMU_NBD_PROG}" {QEMU_NBD_OPTIONS} -{prefix}IMGFMT -- {IMGFMT}{imgopts} -{prefix}IMGPROTO -- {IMGPROTO} -{prefix}PLATFORM -- {platform} -{prefix}TEST_DIR -- {TEST_DIR} -{prefix}SOCK_DIR -- {SOCK_DIR} -{prefix}GDB_OPTIONS -- {GDB_OPTIONS} -{prefix}VALGRIND_QEMU -- {VALGRIND_QEMU} -{prefix}PRINT_QEMU_OUTPUT -- {PRINT_QEMU} -{prefix}""" +QEMU -- "{QEMU_PROG}" {QEMU_OPTIONS} +QEMU_IMG -- "{QEMU_IMG_PROG}" {QEMU_IMG_OPTIONS} +QEMU_IO -- "{QEMU_IO_PROG}" {QEMU_IO_OPTIONS} +QEMU_NBD -- "{QEMU_NBD_PROG}" {QEMU_NBD_OPTIONS} +IMGFMT -- {IMGFMT}{imgopts} +IMGPROTO -- {IMGPROTO} +PLATFORM -- {platform} +TEST_DIR -- {TEST_DIR} +SOCK_DIR -- {SOCK_DIR} +GDB_OPTIONS -- {GDB_OPTIONS} +VALGRIND_QEMU -- {VALGRIND_QEMU} +PRINT_QEMU_OUTPUT -- {PRINT_QEMU} +""" =20 args =3D collections.defaultdict(str, self.get_env()) =20 @@ -310,5 +310,5 @@ def print_env(self, prefix: str =3D '') -> None: =20 u =3D os.uname() args['platform'] =3D f'{u.sysname}/{u.machine} {u.nodename} {u.rel= ease}' - args['prefix'] =3D prefix + print(template.format_map(args)) diff --git a/tests/qemu-iotests/testrunner.py b/tests/qemu-iotests/testrunn= er.py index 9a94273975..15788f919e 100644 --- a/tests/qemu-iotests/testrunner.py +++ b/tests/qemu-iotests/testrunner.py @@ -152,10 +152,10 @@ def run_tests_pool(self, tests: List[str], =20 return results =20 - def __init__(self, env: TestEnv, tap: bool =3D False, + def __init__(self, env: TestEnv, makecheck: bool =3D False, color: str =3D 'auto') -> None: self.env =3D env - self.tap =3D tap + self.makecheck =3D makecheck self.last_elapsed =3D LastElapsedTime('.last-elapsed-cache', env) =20 assert color in ('auto', 'on', 'off') @@ -185,16 +185,13 @@ def test_print_one_line(self, test: str, """ Print short test info before/after test run """ test =3D os.path.basename(test) =20 - if test_field_width is None: - test_field_width =3D 8 + if self.makecheck and status !=3D '...': + if status and status !=3D 'pass': + status =3D f' [{status}]' + else: + status =3D '' =20 - if self.tap: - if status =3D=3D 'pass': - print(f'ok {self.env.imgfmt} {test}') - elif status =3D=3D 'fail': - print(f'not ok {self.env.imgfmt} {test}') - elif status =3D=3D 'not run': - print(f'ok {self.env.imgfmt} {test} # SKIP') + print(f' TEST iotest-{self.env.imgfmt}: {test}{status}') return =20 if lasttime: @@ -346,7 +343,7 @@ def run_test(self, test: str, last_el =3D self.last_elapsed.get(test) start =3D datetime.datetime.now().strftime('%H:%M:%S') =20 - if not self.tap: + if not self.makecheck: self.test_print_one_line(test=3Dtest, test_field_width=3Dtest_field_width, status =3D 'started' if mp else '...', @@ -375,9 +372,7 @@ def run_tests(self, tests: List[str], jobs: int =3D 1) = -> bool: notrun =3D [] casenotrun =3D [] =20 - if self.tap: - self.env.print_env('# ') - else: + if not self.makecheck: self.env.print_env() =20 test_field_width =3D max(len(os.path.basename(t)) for t in tests) = + 2 @@ -403,11 +398,10 @@ def run_tests(self, tests: List[str], jobs: int =3D 1= ) -> bool: =20 if res.status =3D=3D 'fail': failed.append(name) + if self.makecheck: + self.env.print_env() if res.diff: - if self.tap: - print('\n'.join(res.diff), file=3Dsys.stderr) - else: - print('\n'.join(res.diff)) + print('\n'.join(res.diff)) elif res.status =3D=3D 'not run': notrun.append(name) elif res.status =3D=3D 'pass': @@ -418,16 +412,16 @@ def run_tests(self, tests: List[str], jobs: int =3D 1= ) -> bool: if res.interrupted: break =20 - if not self.tap: - if notrun: - print('Not run:', ' '.join(notrun)) + if notrun: + print('Not run:', ' '.join(notrun)) =20 - if casenotrun: - print('Some cases not run in:', ' '.join(casenotrun)) + if casenotrun: + print('Some cases not run in:', ' '.join(casenotrun)) =20 - if failed: - print('Failures:', ' '.join(failed)) - print(f'Failed {len(failed)} of {n_run} iotests') - else: - print(f'Passed all {n_run} iotests') - return not failed + if failed: + print('Failures:', ' '.join(failed)) + print(f'Failed {len(failed)} of {n_run} iotests') + return False + else: + print(f'Passed all {n_run} iotests') + return True --=20 2.34.1 From nobody Sat May 18 21:00:24 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 1646677971382525.7779806397991; Mon, 7 Mar 2022 10:32:51 -0800 (PST) Received: from localhost ([::1]:35592 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nRIA6-0002t1-7n for importer@patchew.org; Mon, 07 Mar 2022 13:32:50 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55516) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRHum-0001K1-3h for qemu-devel@nongnu.org; Mon, 07 Mar 2022 13:17:00 -0500 Received: from [2a00:1450:4864:20::534] (port=43887 helo=mail-ed1-x534.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nRHuh-0005PB-Li for qemu-devel@nongnu.org; Mon, 07 Mar 2022 13:16:59 -0500 Received: by mail-ed1-x534.google.com with SMTP id f8so21138088edf.10 for ; Mon, 07 Mar 2022 10:16:55 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id d8-20020a170906304800b006cdf8a1e146sm4983382ejd.217.2022.03.07.10.16.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 10:16:53 -0800 (PST) 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=bQ7QzzDfZTAEzBPQemH/goOcF8IL8Rwa/E0oZZAhyPI=; b=Ctx+b7qnam6DgRiLYavBX+b3ga4c6OwkvGFaGxrAtqB+rJ8f9+H2MbWWhNcNKNRG76 r2UEUoyMpKYGVpMnlO7Mg9lWlFRsD3ZtcraAR0LcXfoE8rclf0bKbhQqYJnt6ZgVWgv3 I0OgfTYO1LWv8Qep86MNKiTNDYSPMFwixkrL0I1OgX/2NJ/4aA19ysZVR8LJ2dZtdp9+ sAhbTZkgZt1q5DGDVaEXmtpcg6wd1CVGjompmne2x68gB/andm3US88PvH0pVdKMDnbp WDHpGkwjxwrpZE1dRezMYbKf+C4Wc50QSRyRqJ6qxydArfV3OtkCDMQtCAWjyMAtspx3 v9cw== 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=bQ7QzzDfZTAEzBPQemH/goOcF8IL8Rwa/E0oZZAhyPI=; b=g2VP5wLBv3jx3XC5NnEOg1/smAygOREyS3Eu6aigT1EF5qbI7BqF2GU9tu/Adww3g5 9sQqRpNyr90NE6P+eYBvjx6XCVfu/ySt4bCIUp/ez2iqNMM0hP+mYO/w36eu+9hCLr2k Own20HXs2tvT08ZKSggZ78CTRW2MjmkEvdG7uoNyxCv9LyV+i2EhSLb/RUH7UB+AP/HI yfh2yrqqhFEYgI0SsZC12PXKdg5u62eLP+tbzbRK/MLZLGhycRqh7v/gLDtL+IDRJgwp /l1ZWy6b+hP9p0DJ2RNNYBhBE6ySB01nvssqu4xm6KnbHowCPppUj0x4C89HRAsTurgL eXeQ== X-Gm-Message-State: AOAM5306I3wJW9cwi1vCIyFRNNZGpWV5iY6QkOg8+e7JSg5yg8lPU+Ws ostaxjKiEXyn544+LYWltYyBGNC08wQ= X-Google-Smtp-Source: ABdhPJzWqSj4F3uVvY6yxEGJb/VK0KKRltTPBvsl4q6Nh6ZohnlFD1q5NTbRIb6kLVOnmta+T9YzPw== X-Received: by 2002:aa7:de0e:0:b0:416:607c:6d45 with SMTP id h14-20020aa7de0e000000b00416607c6d45mr2402905edv.127.1646677014242; Mon, 07 Mar 2022 10:16:54 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 23/23] gitlab-ci: do not run tests with address sanitizer Date: Mon, 7 Mar 2022 19:16:33 +0100 Message-Id: <20220307181633.596898-24-pbonzini@redhat.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220307181633.596898-1-pbonzini@redhat.com> References: <20220307181633.596898-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::534 (failed) 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: 0 X-Spam_score: -0.1 X-Spam_bar: / X-Spam_report: (-0.1 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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: 1646677972727100001 Content-Type: text/plain; charset="utf-8" This is flaky and sometimes fails or hangs unexplicably. Signed-off-by: Paolo Bonzini --- .gitlab-ci.d/buildtest.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml index 0aa70213fb..0aea7ab84c 100644 --- a/.gitlab-ci.d/buildtest.yml +++ b/.gitlab-ci.d/buildtest.yml @@ -515,8 +515,6 @@ build-oss-fuzz: echo Testing ${fuzzer} ... ; "${fuzzer}" -runs=3D1 -seed=3D1 || exit 1 ; done - # Unrelated to fuzzer: run some tests with -fsanitize=3Daddress - - cd build-oss-fuzz && make check-qtest-i386 check-unit =20 build-tci: extends: .native_build_job_template --=20 2.34.1