From patchwork Thu Jul 29 12:47:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 12408571 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6AA60C4338F for ; Thu, 29 Jul 2021 12:49:01 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 00C666018A for ; Thu, 29 Jul 2021 12:49:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 00C666018A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:60764 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m95T9-00062D-Tp for qemu-devel@archiver.kernel.org; Thu, 29 Jul 2021 08:48:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39366) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m95RX-0003S8-56 for qemu-devel@nongnu.org; Thu, 29 Jul 2021 08:47:19 -0400 Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]:37758) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m95RV-0007VL-JA for qemu-devel@nongnu.org; Thu, 29 Jul 2021 08:47:18 -0400 Received: by mail-ed1-x535.google.com with SMTP id h8so8053642ede.4 for ; Thu, 29 Jul 2021 05:47:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bVkJDxISQsJiDctueFKDZan7YC/pcML2RCP1C418uk4=; b=c06BUHB91VgQ+8E6/MrKgA2a2Ws/JgbUomkSp4pt16jwo+DLrjJueCCc5BjFhFGpzr lMITfegCQcQ5wwpZ9xrCjLDxfwKJkYECh5jjfxKFWMyPJ7zDRB845ZiuEWiD0K0J28JR 6qDdu5eOEHhyNba9NM4A2IzrdkvtmrA3Fvw1Jmf5ASQYlOku8Tgxep3y/eFVU6yd/8FL uK3aTxccc3g2ddBCbwrHXi9tmvujAxrhyv8TecUrUORr4dWGndfqb4k2wek96uNWHncI OqMZr7HO12zsQbyD1yv8ErnHV/9W5Ti7D8OfRmHDNLBzWZ9ExtRyi5NsDd80S5S7Vdke Bx6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=bVkJDxISQsJiDctueFKDZan7YC/pcML2RCP1C418uk4=; b=hJhLMGAiFmaFg/OE2Vveccq20fcK3JOyY1/wj4HcKoRQGk8XY3OA+zNOxThniFCemG ZfmPyL9bgtDgSH335vt1A+uOCVa4JRv3AqYq98j2tUmBcGhq5Zsek+3acjkIx5zAY4oo xFhD70fREqw7JAM6UAWnpSa9ggGEAYwX4RgPRfA1UiYgrZybRNmrKM4hrTPNXBniKy6G o8Be3asQb1sXcPmAWC5CmI3ilO7W5SNGvDtccHF44NGm/sbjPTYSdTn9ZbWAyM98gBHf lwsgwYpqdX82pU1aQWPqrU3lg2qghuGFobtl28b9vRIBmG/2/1+6W/0Es0ZGUOLhUuXH EiyQ== X-Gm-Message-State: AOAM532wIlJn3v8k+P6QlB0E6BR9nFBPd6p0s41N4Fwi8L3xafSpgMkw 4sIKUktYAM/j+b++ZTkcC/ghPll121fUcg== X-Google-Smtp-Source: ABdhPJy9FHz9OB/nJCj1/QqX5UdqbW4GlOH97zct1Rnjl33wPrJy4PQoC91FwWd9qgV9f/yz2MAUqg== X-Received: by 2002:a05:6402:1778:: with SMTP id da24mr2707480edb.385.1627562836164; Thu, 29 Jul 2021 05:47:16 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:5e2c:eb9a:a8b6:fd3e]) by smtp.gmail.com with ESMTPSA id m12sm954659ejd.21.2021.07.29.05.47.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jul 2021 05:47:15 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 1/7] i386: assert 'cs->kvm_state' is not null Date: Thu, 29 Jul 2021 14:47:07 +0200 Message-Id: <20210729124713.208422-2-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210729124713.208422-1-pbonzini@redhat.com> References: <20210729124713.208422-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::535; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x535.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vitaly Kuznetsov Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Vitaly Kuznetsov Coverity reports potential NULL pointer dereference in get_supported_hv_cpuid_legacy() when 'cs->kvm_state' is NULL. While 'cs->kvm_state' can indeed be NULL in hv_cpuid_get_host(), kvm_hyperv_expand_features() makes sure that it only happens when KVM_CAP_SYS_HYPERV_CPUID is supported and KVM_CAP_SYS_HYPERV_CPUID implies KVM_CAP_HYPERV_CPUID so get_supported_hv_cpuid_legacy() is never really called. Add asserts to strengthen the protection against broken KVM behavior. Coverity: CID 1458243 Signed-off-by: Vitaly Kuznetsov Message-Id: <20210716115852.418293-1-vkuznets@redhat.com> Signed-off-by: Paolo Bonzini --- target/i386/kvm/kvm.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index 59ed8327ac..e69abe48e3 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -974,6 +974,12 @@ static struct kvm_cpuid2 *get_supported_hv_cpuid(CPUState *cs) do_sys_ioctl = kvm_check_extension(kvm_state, KVM_CAP_SYS_HYPERV_CPUID) > 0; + /* + * Non-empty KVM context is needed when KVM_CAP_SYS_HYPERV_CPUID is + * unsupported, kvm_hyperv_expand_features() checks for that. + */ + assert(do_sys_ioctl || cs->kvm_state); + /* * When the buffer is too small, KVM_GET_SUPPORTED_HV_CPUID fails with * -E2BIG, however, it doesn't report back the right size. Keep increasing @@ -1105,6 +1111,14 @@ static uint32_t hv_cpuid_get_host(CPUState *cs, uint32_t func, int reg) if (kvm_check_extension(kvm_state, KVM_CAP_HYPERV_CPUID) > 0) { cpuid = get_supported_hv_cpuid(cs); } else { + /* + * 'cs->kvm_state' may be NULL when Hyper-V features are expanded + * before KVM context is created but this is only done when + * KVM_CAP_SYS_HYPERV_CPUID is supported and it implies + * KVM_CAP_HYPERV_CPUID. + */ + assert(cs->kvm_state); + cpuid = get_supported_hv_cpuid_legacy(cs); } hv_cpuid_cache = cpuid; From patchwork Thu Jul 29 12:47:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 12408577 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7736CC4338F for ; Thu, 29 Jul 2021 12:51:21 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 269EF60249 for ; Thu, 29 Jul 2021 12:51:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 269EF60249 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:40910 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m95VQ-0003ZD-9U for qemu-devel@archiver.kernel.org; Thu, 29 Jul 2021 08:51:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39382) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m95RY-0003T5-HS for qemu-devel@nongnu.org; Thu, 29 Jul 2021 08:47:20 -0400 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]:34459) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m95RX-0007WX-3z for qemu-devel@nongnu.org; Thu, 29 Jul 2021 08:47:20 -0400 Received: by mail-ed1-x532.google.com with SMTP id da26so8070548edb.1 for ; Thu, 29 Jul 2021 05:47:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=V7u3spPMXKKHXP+HJV/7psbE6yjKKmmYZelJx4HC01Q=; b=h2ckxjk9CtCrB5rvNmbOWZ+7G0BLZtfbCfI4zwOt4Fb2EwMOqXw1SKzdpMQesGhsRV g11W4tOjcMDfaofrOs84gS4SdSRLx9F1wys5A9xT/hIeanfPQ1CglcqWRYwLkTX/t2Dn img1jhLlMyawkW9Dgt/EZ2QESFUF5F/hqb72UhUWmdCwBG7CSylKngDriQWSNz/J+Ilw 2klDfFiqdvUf9Ap1SEeAJwTI/vy+xmqtjY1k5cU/Tm3oYlYl0dDzrwIu8S/6MM981Upa IgUsqFTi7YODwpK5Ue8zOUR8mvLr5UwxMCTNIIRF4HW1SA/WhlOzGeHm7vW19R+NUO4P PQgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=V7u3spPMXKKHXP+HJV/7psbE6yjKKmmYZelJx4HC01Q=; b=uZm/MvUlTsxNbFMNhfD76K9SeVH14gpu4jVOSGFYGhr9WhKx2d/gx/4B6cKpmI9IVT rTZQandT1FugWN6fjYTODo3trsHd54udyHMamsVs6gKx57Kk1xSpMWWeKupqbl4dkhSa lvJLtJadiGi+9iFmYjYTCCjdPPsEqC7AZeEqonEDb1XSWkGFpgXxO5lLK2M8yfzO4Ze6 Xbrn7TG7VFH4CWJSDYq3zjJlgSGvhEv8r27OTg1T3rBdU54cTkCqk22pEH3TALdcrOHP jJcM8dsm/cvQ65KYofhDQHaSFsglxpmFH/EVN4q+vYc0iDxV4Cfn4QsreBxw3xkmTrdH qDPg== X-Gm-Message-State: AOAM5311Kht/tGryoUZCQElrl4MQEr1fNah/ZjoUEyRRIxu0Qgtderpb 6OlLuUKx8sV9msSTcPXQujE4sCvttuG3BA== X-Google-Smtp-Source: ABdhPJxSzQLw0KHj1WABF1+bI2n3VV7d83x0R36zbsaYimP2u2o3DL53P/TN8naUjyaO7lP9L7tsrg== X-Received: by 2002:a50:d64a:: with SMTP id c10mr6022403edj.199.1627562837709; Thu, 29 Jul 2021 05:47:17 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:5e2c:eb9a:a8b6:fd3e]) by smtp.gmail.com with ESMTPSA id m12sm954659ejd.21.2021.07.29.05.47.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jul 2021 05:47:17 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 2/7] Makefile: ignore long options Date: Thu, 29 Jul 2021 14:47:08 +0200 Message-Id: <20210729124713.208422-3-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210729124713.208422-1-pbonzini@redhat.com> References: <20210729124713.208422-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::532; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x532.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexey Neyman Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Alexey Neyman When searching for options like -n in MAKEFLAGS, current code may result in a false positive match when make is invoked with long options like --no-print-directory. This has been observed with certain versions of host make (e.g. 3.82) while building the Qemu package in buildroot. Filter out such long options before searching for one-character options. Signed-off-by: Alexey Neyman Message-Id: <20210722020846.3678817-1-stilor@att.net> Signed-off-by: Paolo Bonzini --- Makefile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 6c36330eef..401c623a65 100644 --- a/Makefile +++ b/Makefile @@ -129,9 +129,11 @@ endif # 4. Rules to bridge to other makefiles ifneq ($(NINJA),) -MAKE.n = $(findstring n,$(firstword $(MAKEFLAGS))) -MAKE.k = $(findstring k,$(firstword $(MAKEFLAGS))) -MAKE.q = $(findstring q,$(firstword $(MAKEFLAGS))) +# Filter out long options to avoid flags like --no-print-directory which +# may result in false positive match for MAKE.n +MAKE.n = $(findstring n,$(firstword $(filter-out --%,$(MAKEFLAGS)))) +MAKE.k = $(findstring k,$(firstword $(filter-out --%,$(MAKEFLAGS)))) +MAKE.q = $(findstring q,$(firstword $(filter-out --%,$(MAKEFLAGS)))) MAKE.nq = $(if $(word 2, $(MAKE.n) $(MAKE.q)),nq) NINJAFLAGS = $(if $V,-v) $(if $(MAKE.n), -n) $(if $(MAKE.k), -k0) \ $(filter-out -j, $(lastword -j1 $(filter -l% -j%, $(MAKEFLAGS)))) \ From patchwork Thu Jul 29 12:47:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 12408585 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D0065C4338F for ; Thu, 29 Jul 2021 12:53:58 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8BFDE60524 for ; Thu, 29 Jul 2021 12:53:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8BFDE60524 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:49264 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m95Xx-0000w0-N2 for qemu-devel@archiver.kernel.org; Thu, 29 Jul 2021 08:53:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39404) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m95Ra-0003Xy-FJ for qemu-devel@nongnu.org; Thu, 29 Jul 2021 08:47:22 -0400 Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]:43565) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m95RY-0007Xc-VE for qemu-devel@nongnu.org; Thu, 29 Jul 2021 08:47:22 -0400 Received: by mail-ed1-x52e.google.com with SMTP id n2so7997396eda.10 for ; Thu, 29 Jul 2021 05:47:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YnCVY1ZWNmUlC0ht0KAn5MbtR3nNzeZ/8T3oekadPC8=; b=CvM6H2PS8AvNVbaPyLWr3KoIin1fdtdERzu7fPJcVjU6Xr8pa3MQtW6vHhIXTTa9IC o8QIkNCDizBT6W7rnT1MUvFFO5LvBlrfjInY7mnmWbUO2H4NiwU1y1v4NwYCdjjI4xVr vjVfC6MwmbkTlIQ8PHV4yokbq8mJCH6k1QFdjgLG00/mHvvTM/N54jKkcnYBkgV/kps+ 7A++Kc5LjlIs1v6y1QC176db9I2HuCWoi5CxyStw6YCYQcZPgmjcTuDJIdKye2UGJmv2 7DKMJFRxmkD5Syrt3icx+c1N2wD/OZx9PkxAibuQhaSSFwIvwnErCBh2wTqE29o6QQN6 Edcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=YnCVY1ZWNmUlC0ht0KAn5MbtR3nNzeZ/8T3oekadPC8=; b=daRG9vmr1TdIR4SSjVp9nUcWpypYkPB374hOaZAxxXtvb/FyLBUkrqGQ88l+PyhSFn GrlMem3nUdxSOjNjaQg5bT8TakFU8Ji1KwzlFqA4Ey1nEZm3wjiFL9rxCXfIteDbgsoU E6m3eNHUcypuEWqp8zvvaoC7Ve34HPeLucba3x1xxtejXkw7wTpgoWdSGFVZxD3WbiA+ Bv7tbbCiL9zNzLNeKlxz3zmtuhnxoLHdHav4cTWdLQRSiZVYyO64iV5vaB5a1/KR1nYv 7nV96Iy+YHxq0ClQLLBeFx4lXWeVduO4ZlEm40ZFnYy5cUnBSKBw0Bnidbio7RvNN3+a lPvg== X-Gm-Message-State: AOAM53229/YbVkPl1itMiIMgF1+ec8VUrxZz8kOBiEFslwkNSoPcXIbL AqBuDUouE7tAX9a7tQJ81Gtkeq2A3oq+Vg== X-Google-Smtp-Source: ABdhPJwhVgqFNqaO896TuhVgUkjWcQaVN7xZ/O1MKuUW6HiOs3VhuQphYdrHOE0ZH7JXwRY8M5415g== X-Received: by 2002:a05:6402:35c1:: with SMTP id z1mr5833560edc.89.1627562839692; Thu, 29 Jul 2021 05:47:19 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:5e2c:eb9a:a8b6:fd3e]) by smtp.gmail.com with ESMTPSA id m12sm954659ejd.21.2021.07.29.05.47.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jul 2021 05:47:19 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 3/7] configure: Add -Werror to avx2, avx512 tests Date: Thu, 29 Jul 2021 14:47:09 +0200 Message-Id: <20210729124713.208422-4-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210729124713.208422-1-pbonzini@redhat.com> References: <20210729124713.208422-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52e; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x52e.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Henderson Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson When using clang, we get ERROR: configure test passed without -Werror but failed with -Werror. This is probably a bug in the configure script. The failing command will be at the bottom of config.log. You can run configure with --disable-werror to bypass this check. What we really want from these two tests is whether the entire code sequence is supported, including pragmas. Adding -Werror makes the test properly fail for clang. Signed-off-by: Richard Henderson Message-Id: <20210719200112.295316-1-richard.henderson@linaro.org> Signed-off-by: Paolo Bonzini --- configure | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 79e2ddc74e..422a456f0b 100755 --- a/configure +++ b/configure @@ -3881,7 +3881,7 @@ static int bar(void *a) { } int main(int argc, char *argv[]) { return bar(argv[0]); } EOF - if compile_object "" ; then + if compile_object "-Werror" ; then avx2_opt="yes" else avx2_opt="no" @@ -3911,7 +3911,7 @@ int main(int argc, char *argv[]) return bar(argv[0]); } EOF - if ! compile_object "" ; then + if ! compile_object "-Werror" ; then avx512f_opt="no" fi else From patchwork Thu Jul 29 12:47:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 12408573 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EE3F8C4338F for ; Thu, 29 Jul 2021 12:49:05 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A26866018A for ; Thu, 29 Jul 2021 12:49:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A26866018A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:33074 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m95TE-0006Pk-NL for qemu-devel@archiver.kernel.org; Thu, 29 Jul 2021 08:49:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39420) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m95Rb-0003ac-C8 for qemu-devel@nongnu.org; Thu, 29 Jul 2021 08:47:23 -0400 Received: from mail-ej1-x62b.google.com ([2a00:1450:4864:20::62b]:36804) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m95RZ-0007Yc-Tf for qemu-devel@nongnu.org; Thu, 29 Jul 2021 08:47:23 -0400 Received: by mail-ej1-x62b.google.com with SMTP id gn26so10528664ejc.3 for ; Thu, 29 Jul 2021 05:47:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=h0gR4If4geV9J8dvQ27wXatAz2EbMix2f+K8mxX0nUg=; b=rIfm+F19ZosTrXNQwW0nF4n2+fV56ShNim36QsqNzOOHvUvvz47DsA3+IbROSzajkc uvJtVU0GfYzg3QyiU0UdUd+ENNB7euFYldCzqQohZxUjm0TVxlbCNM4kw0dlakkoYjBh hDVSOkRIJQRUKY9q3c/78rzEVaYOSyZD/kklvBWTtc4Xg4i5g3WBkzGSK4Alc68uQgLa 8DpNRatFcGJzMaDgdEpEaCNaCyULNGx4IBCabrSXpkZVV0tfq61IOPRmuKkOQpPbcrM4 P7nmbv3IfUSxUC2h7EMKnUFN51EU7kBQWDO6x1oXG3E/GcCvuwXCV/DtgBVWHZPwVJ8g H4Vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=h0gR4If4geV9J8dvQ27wXatAz2EbMix2f+K8mxX0nUg=; b=mCKyOWBiZsneYHlFofIgWJTFpmCg1ZGUmuAtVKY7plpABDy9n/1GMcumi2tUIK4Rrl 6GV+aCMZOguyIyrK/HVx2C5IhGMb11bilQQYIf5R39C2n/fo+qaQAXGeLXFl8EiuhapN KOZEV8E2Bw0lKXV239tmn9Z24JODs5IKLX8YM2PsRsDcYrpE6dwwlyPCe2DIHCbrNIqh eKmjXfSZTGG3gJ+EtYt1OYqV0Ptk2h5lg1gvSMtRMevUdnokFgzL6IkVlkMINmbU6fWK jiOxXAxeNBqMuwQb0YIR+GR1qnw7DkZcXoxsTyr8NALYUGq/pbzgoSIzOKDs/mL/h44h rMug== X-Gm-Message-State: AOAM530x4lIa84EXlnJg30fYJouAwXrj7mQjybnRQd7T8qGkftpxTD3N f1pnzx8Tx7419GcHki3+hNP4m4QHZKKixQ== X-Google-Smtp-Source: ABdhPJyV2iVbYqccTFnx03KiwCK+JDBuP9/fAZdM9qQdpUJnw6cv1zihygzxbeScRGGauof+cJ/cPw== X-Received: by 2002:a17:906:af02:: with SMTP id lx2mr4290699ejb.133.1627562840656; Thu, 29 Jul 2021 05:47:20 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:5e2c:eb9a:a8b6:fd3e]) by smtp.gmail.com with ESMTPSA id m12sm954659ejd.21.2021.07.29.05.47.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jul 2021 05:47:20 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 4/7] target/i386: Added consistency checks for event injection Date: Thu, 29 Jul 2021 14:47:10 +0200 Message-Id: <20210729124713.208422-5-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210729124713.208422-1-pbonzini@redhat.com> References: <20210729124713.208422-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62b; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x62b.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lara Lazier Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Lara Lazier VMRUN exits with SVM_EXIT_ERR if either: * The event injected has a reserved type. * When the event injected is of type 3 (exception), and the vector that has been specified does not correspond to an exception. This does not fix the entire exc_inj test in kvm-unit-tests. Signed-off-by: Lara Lazier Message-Id: <20210725090855.19713-1-laramglazier@gmail.com> Signed-off-by: Paolo Bonzini --- target/i386/tcg/sysemu/svm_helper.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/target/i386/tcg/sysemu/svm_helper.c b/target/i386/tcg/sysemu/svm_helper.c index 145511d635..90a9de30f8 100644 --- a/target/i386/tcg/sysemu/svm_helper.c +++ b/target/i386/tcg/sysemu/svm_helper.c @@ -383,6 +383,9 @@ void helper_vmrun(CPUX86State *env, int aflag, int next_eip_addend) cpu_loop_exit(cs); break; case SVM_EVTINJ_TYPE_EXEPT: + if (vector == EXCP02_NMI || vector >= 31) { + cpu_vmexit(env, SVM_EXIT_ERR, 0, GETPC()); + } cs->exception_index = vector; env->error_code = event_inj_err; env->exception_is_int = 0; @@ -398,6 +401,9 @@ void helper_vmrun(CPUX86State *env, int aflag, int next_eip_addend) qemu_log_mask(CPU_LOG_TB_IN_ASM, "SOFT"); cpu_loop_exit(cs); break; + default: + cpu_vmexit(env, SVM_EXIT_ERR, 0, GETPC()); + break; } qemu_log_mask(CPU_LOG_TB_IN_ASM, " %#x %#x\n", cs->exception_index, env->error_code); From patchwork Thu Jul 29 12:47:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 12408575 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B3A27C432BE for ; Thu, 29 Jul 2021 12:49:07 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7DBCB60EBC for ; Thu, 29 Jul 2021 12:49:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7DBCB60EBC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:33102 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m95TG-0006Qn-LJ for qemu-devel@archiver.kernel.org; Thu, 29 Jul 2021 08:49:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39434) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m95Rb-0003cH-VX for qemu-devel@nongnu.org; Thu, 29 Jul 2021 08:47:23 -0400 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]:36762) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m95Ra-0007ZE-It for qemu-devel@nongnu.org; Thu, 29 Jul 2021 08:47:23 -0400 Received: by mail-ed1-x52b.google.com with SMTP id b7so8070958edu.3 for ; Thu, 29 Jul 2021 05:47:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NQTJTVGWD0gMMK6Mr7hopAaxEGk+XTCb5RPoB6Pqwy8=; b=lhb0mqLoMc9I6+Vx9Rh/2fUjrUOKRBBFaRZdXEIPWRb+a5sAiXGdf+zr1sDBL+I329 IcSClWBGD7VVCdYeD5ST52fB2Lehq/r4XXQTUY0oKF/Jx0nOpBX4BqU2tnzgShbT4tVt mBzqruWjPpsSbCCNd4g5BE+yW+w0s25mMoVXnoiVqhkD48NBmTkuQYsZigeUKJF8Wi1w F6bKnVnsOOqZiF7dyni0tw++4MV+75YEovmggnuOhw+2UDWDsCq2CzCtCKmKxThwdySB dv/TEXP0xxWZBo37HxrpfimFiqIL4WZII8Dm5nMuP3V6JBhJUl/TdxL9B/OTMBrBmzjj FqMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=NQTJTVGWD0gMMK6Mr7hopAaxEGk+XTCb5RPoB6Pqwy8=; b=OGV+m9abSGK35lfb/E6Kt1D5X4eHpJYT5L00hko384Pw6V3BjLDEpUUBWGHL/PEJHP 9GWqmwWWW6w8V3bWZ1BDQosp2ntFHjEr3mGDSL+q91H+LeflJUS9evDsoQmqXiYyxA9D M/xrnuNjhVl9aiPn2fDEzntuHc584w/NishbfTdn6A5Z8E2VsbAJo9xc+jCAf+j2ziXO xehcV7gwdELD0hz7Ixz/KB01eoxS/1HlsdULyH/WYK2ibqXS1IZDmiGYro0TyZfBnh6y cw0C2YBYnJsd9EIume5yk8N1QLf0dP76ZrHr9YGcRkkGZwWrJU/VciPYnk/Y6+WpB1a+ aihg== X-Gm-Message-State: AOAM533VJh6U1FXnahnpDOt+apHgQAS+4y0R7Ssemm5SmRTu676w3/5C jnBuV4828xP+UHiLRPOrCUxKSjT4iC3BtA== X-Google-Smtp-Source: ABdhPJw56k+3Ncc8hNRb0TgOKbV56tSsulqf29ARr3kUb6Uq0Xt3GduIYwhxap1xFG3Okw19LWCBfA== X-Received: by 2002:a05:6402:3192:: with SMTP id di18mr5950586edb.186.1627562841389; Thu, 29 Jul 2021 05:47:21 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:5e2c:eb9a:a8b6:fd3e]) by smtp.gmail.com with ESMTPSA id m12sm954659ejd.21.2021.07.29.05.47.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jul 2021 05:47:21 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 5/7] target/i386: fix typo in ctl_has_irq Date: Thu, 29 Jul 2021 14:47:11 +0200 Message-Id: <20210729124713.208422-6-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210729124713.208422-1-pbonzini@redhat.com> References: <20210729124713.208422-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52b; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x52b.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lara Lazier Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" The shift constant was incorrect, causing int_prio to always be zero. Signed-off-by: Lara Lazier [Rewritten commit message since v1 had already been included. - Paolo] Signed-off-by: Paolo Bonzini --- target/i386/tcg/sysemu/svm_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/i386/tcg/sysemu/svm_helper.c b/target/i386/tcg/sysemu/svm_helper.c index 90a9de30f8..e151104b4e 100644 --- a/target/i386/tcg/sysemu/svm_helper.c +++ b/target/i386/tcg/sysemu/svm_helper.c @@ -70,7 +70,7 @@ static inline bool ctl_has_irq(uint32_t int_ctl) uint32_t int_prio; uint32_t tpr; - int_prio = (int_ctl & V_INTR_PRIO_MASK) >> V_INTR_MASKING_SHIFT; + int_prio = (int_ctl & V_INTR_PRIO_MASK) >> V_INTR_PRIO_SHIFT; tpr = int_ctl & V_TPR_MASK; return (int_ctl & V_IRQ_MASK) && (int_prio >= tpr); } From patchwork Thu Jul 29 12:47:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 12408603 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4C831C4338F for ; Thu, 29 Jul 2021 12:55:41 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0872460F12 for ; Thu, 29 Jul 2021 12:55:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0872460F12 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:56762 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m95Zc-0006Bf-5o for qemu-devel@archiver.kernel.org; Thu, 29 Jul 2021 08:55:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39454) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m95Rd-0003g5-4l for qemu-devel@nongnu.org; Thu, 29 Jul 2021 08:47:25 -0400 Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]:36765) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m95Rb-0007Zf-Dl for qemu-devel@nongnu.org; Thu, 29 Jul 2021 08:47:24 -0400 Received: by mail-ed1-x52e.google.com with SMTP id b7so8071054edu.3 for ; Thu, 29 Jul 2021 05:47:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4My7fDRNl/n4YU7RcFSpoBqlYhQPCBDcmizGiZlhv0U=; b=icKmYtuX9raAfE0GDUXMSjC6kUB5ztOdA3i+qjbSlWs4TFPm+OTs5+7VCXECyc+KO/ KU0Y0hLVUwBawxhTRTP2sq5q4qSHuM23HZtgSh6VLZSYCwDxg/HgL2wZ3fDs7yEMxa3X bjOsrsQy8Iz5+Gj6yvn0ZZv+n3dbRDvpQwXNEdR4EQXlY++v6ja7E0vWP3LeKamiDn4D 6hPqHyNrSqz4Cq0xAG928/aaLkNrwoQYvIuFD6RRkSK/ZlHZRFVSNX5O0GEovaZI3s3Z z5o0gz6aV/m1oDV1tZJ4ZAqWHlTbT/nJmlVmFH4s1iP94O8D+f7kEXIjeTRfUqqtmyeB Va2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=4My7fDRNl/n4YU7RcFSpoBqlYhQPCBDcmizGiZlhv0U=; b=gpGP7DJtIwy+mA9XUABazelt0uUSw+9X7vUGPAZVU3Fv7JSM5Ny96vmKu3cayUCErz 8o/3Bo6cOVnSdxXG+oAqIARnMR7wKSC3uRoWxH2zQASqnPhI9Vfqm0KwX0NEpMlM8Ols 8Ke080zXsZQe63axu+NguFLt9Uspn4woPPEPVtQEAyozl9P1Z5uPJeRd6Axper0w9F4q bIEV2mAz9O2gKo/6fLU7nRpk/r/TFQ5YsbP321VUprd11g+6zRd6QsgOLQWI48O2aEFI N2Vo+ADrBrjdI376URqziqZhrAoXQsmximglW/BSLJ6kGmdekFeu82t1cqCFALLKcQ3e aDSw== X-Gm-Message-State: AOAM530xGq4C8Bpyi4XawkoXHMFK9Yk03K9mOFOW8b9gE/i8Fl91YBow MWchBcw5pbyiEtCn90kFfibMF/b5FSWG6Q== X-Google-Smtp-Source: ABdhPJzc3AOE15MeKhmEWwkW/lxlHY6L/H+XA9D8nzfmNZM8fOcXWomUwF7GMVC1paLbUZSYEBp2Kw== X-Received: by 2002:a05:6402:1603:: with SMTP id f3mr5844483edv.274.1627562842225; Thu, 29 Jul 2021 05:47:22 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:5e2c:eb9a:a8b6:fd3e]) by smtp.gmail.com with ESMTPSA id m12sm954659ejd.21.2021.07.29.05.47.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jul 2021 05:47:21 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 6/7] meson: fix meson 0.58 warning with libvhost-user subproject Date: Thu, 29 Jul 2021 14:47:12 +0200 Message-Id: <20210729124713.208422-7-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210729124713.208422-1-pbonzini@redhat.com> References: <20210729124713.208422-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52e; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x52e.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Meson now checks that subprojects do not access files from parent project. While we all agree this is best practice, libvhost-user also want to share a few headers with QEMU, and libvhost-user isn't really a standalone project at this point (although this is making the dependency a bit more explicit). Signed-off-by: Marc-André Lureau Message-Id: <20210505151313.203258-1-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- subprojects/libvhost-user/include/atomic.h | 1 + subprojects/libvhost-user/libvhost-user.c | 2 +- subprojects/libvhost-user/meson.build | 6 +----- subprojects/libvhost-user/standard-headers/linux | 1 + 4 files changed, 4 insertions(+), 6 deletions(-) create mode 120000 subprojects/libvhost-user/include/atomic.h create mode 120000 subprojects/libvhost-user/standard-headers/linux diff --git a/subprojects/libvhost-user/include/atomic.h b/subprojects/libvhost-user/include/atomic.h new file mode 120000 index 0000000000..8c2be64f7b --- /dev/null +++ b/subprojects/libvhost-user/include/atomic.h @@ -0,0 +1 @@ +../../../include/qemu/atomic.h \ No newline at end of file diff --git a/subprojects/libvhost-user/libvhost-user.c b/subprojects/libvhost-user/libvhost-user.c index fab7ca17ee..2971ba0112 100644 --- a/subprojects/libvhost-user/libvhost-user.c +++ b/subprojects/libvhost-user/libvhost-user.c @@ -40,7 +40,7 @@ #endif -#include "qemu/atomic.h" +#include "include/atomic.h" #include "libvhost-user.h" diff --git a/subprojects/libvhost-user/meson.build b/subprojects/libvhost-user/meson.build index b03446e7cd..39825d9404 100644 --- a/subprojects/libvhost-user/meson.build +++ b/subprojects/libvhost-user/meson.build @@ -4,21 +4,17 @@ project('libvhost-user', 'c', threads = dependency('threads') glib = dependency('glib-2.0') -inc = include_directories('../../include', '../../linux-headers') vhost_user = static_library('vhost-user', files('libvhost-user.c'), - include_directories: inc, dependencies: threads, c_args: '-D_GNU_SOURCE') executable('link-test', files('link-test.c'), - link_whole: vhost_user, - include_directories: inc) + link_whole: vhost_user) vhost_user_glib = static_library('vhost-user-glib', files('libvhost-user-glib.c'), - include_directories: inc, link_with: vhost_user, dependencies: glib) diff --git a/subprojects/libvhost-user/standard-headers/linux b/subprojects/libvhost-user/standard-headers/linux new file mode 120000 index 0000000000..15a2378139 --- /dev/null +++ b/subprojects/libvhost-user/standard-headers/linux @@ -0,0 +1 @@ +../../../include/standard-headers/linux \ No newline at end of file From patchwork Thu Jul 29 12:47:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 12408579 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E9DF5C4338F for ; Thu, 29 Jul 2021 12:51:27 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AEF5E604DC for ; Thu, 29 Jul 2021 12:51:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org AEF5E604DC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:41448 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m95VW-0003vm-QP for qemu-devel@archiver.kernel.org; Thu, 29 Jul 2021 08:51:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39456) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m95Rd-0003iE-PC for qemu-devel@nongnu.org; Thu, 29 Jul 2021 08:47:25 -0400 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]:39713) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m95Rc-0007Zw-7i for qemu-devel@nongnu.org; Thu, 29 Jul 2021 08:47:25 -0400 Received: by mail-ed1-x530.google.com with SMTP id y12so8035501edo.6 for ; Thu, 29 Jul 2021 05:47:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=InPTgA7QqpX0ZseNHj/4LRLcFSFpucQ8s+I0td4sp/o=; b=oEtyqyLNiL1xZbcQm8ZKcFnrsj8NB3m9xqQ4f2a//bGlqwdHsv687AsQTm++GOo9K3 OgLWgHNbdC6WCgA3UxRT16wSv0jwXwy6MywuqbpDCgA5z3SZMoJbcXIy4mVKAsNcCp7v Mvi++4XfNAnRvaUBiBBP8Oc9cO3yaA721sixkzDCoSJgPH+afetv866TslRMSQhNnOJO t++mScy2zwDGJnGhoG6iVZsQeURTG4FLS5KqagtpfTAfoXoZ+a8NgHzFTfHstzQLt4Hz ViPsdEhfBU3/5NAlURMLnoHO/rWkJsSKCxAm/XFEsuP5xvaRNzWGgH5DIytD9F7tLseg dcDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=InPTgA7QqpX0ZseNHj/4LRLcFSFpucQ8s+I0td4sp/o=; b=R3W9B0oB3pgxl/stDSAM+/5xVNd9DMXT49/2W8ajO9AcDCrRkZiGK4DWCSRakjyZYY gOJoD7aDpW3yMyeVSqIKOfuGN8jDJ2Y43H5Lpl3lcuiyMTs/hjtHxYMVoL/kHW4PsfGT YE0tlj3AxXbiLGf1HierLfJflfbXVTTgWEUlfUKZDkLHt7xEbpDYfvRrPYaBFMhzHnEq hJWVOCbNk5lqnxKYsGgi82lZ+UA2kNUYksVSdoI0kUjmfmntcBE21Qh7fm1B2SK3mJDC LnVkF0VFF8e+3cCoISG8VAlGuM6lrSvdH/JGiqrOfJNSUoGF30s4WDHbss23rbDolRCs fDow== X-Gm-Message-State: AOAM530H29kkfAc9+zn8Nr44Lt0HdGbxkN59MklcNCuVxKhpxDOgzzxl P3xYIo2sV3YKQhk4qHzXeSM77z/WhYmddw== X-Google-Smtp-Source: ABdhPJwvp97ueMGC/bRaUFUojHX6W4M+EXG7We1yn51afoxkyGnRU0uJSqTq5MjKZJF9kXy6027arA== X-Received: by 2002:a05:6402:60c:: with SMTP id n12mr5798342edv.189.1627562842928; Thu, 29 Jul 2021 05:47:22 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:5e2c:eb9a:a8b6:fd3e]) by smtp.gmail.com with ESMTPSA id m12sm954659ejd.21.2021.07.29.05.47.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jul 2021 05:47:22 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 7/7] libvhost-user: fix -Werror=format= warnings with __u64 fields Date: Thu, 29 Jul 2021 14:47:13 +0200 Message-Id: <20210729124713.208422-8-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210729124713.208422-1-pbonzini@redhat.com> References: <20210729124713.208422-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::530; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x530.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau ../subprojects/libvhost-user/libvhost-user.c:1070:12: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘__u64’ {aka ‘long long unsigned int’} [-Werror=format=] 1070 | DPRINT(" desc_user_addr: 0x%016" PRIx64 "\n", vra->desc_user_addr); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~ | | | __u64 {aka long long unsigned int} Rather than using %llx, which may fail if __u64 is declared differently elsewhere, let's just cast the values. Feel free to propose a better solution! Signed-off-by: Marc-André Lureau Message-Id: <20210505151313.203258-2-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- subprojects/libvhost-user/libvhost-user.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/subprojects/libvhost-user/libvhost-user.c b/subprojects/libvhost-user/libvhost-user.c index 2971ba0112..bf09693255 100644 --- a/subprojects/libvhost-user/libvhost-user.c +++ b/subprojects/libvhost-user/libvhost-user.c @@ -1067,10 +1067,10 @@ vu_set_vring_addr_exec(VuDev *dev, VhostUserMsg *vmsg) DPRINT("vhost_vring_addr:\n"); DPRINT(" index: %d\n", vra->index); DPRINT(" flags: %d\n", vra->flags); - DPRINT(" desc_user_addr: 0x%016" PRIx64 "\n", vra->desc_user_addr); - DPRINT(" used_user_addr: 0x%016" PRIx64 "\n", vra->used_user_addr); - DPRINT(" avail_user_addr: 0x%016" PRIx64 "\n", vra->avail_user_addr); - DPRINT(" log_guest_addr: 0x%016" PRIx64 "\n", vra->log_guest_addr); + DPRINT(" desc_user_addr: 0x%016" PRIx64 "\n", (uint64_t)vra->desc_user_addr); + DPRINT(" used_user_addr: 0x%016" PRIx64 "\n", (uint64_t)vra->used_user_addr); + DPRINT(" avail_user_addr: 0x%016" PRIx64 "\n", (uint64_t)vra->avail_user_addr); + DPRINT(" log_guest_addr: 0x%016" PRIx64 "\n", (uint64_t)vra->log_guest_addr); vq->vra = *vra; vq->vring.flags = vra->flags;