From patchwork Wed Mar 24 14:30:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 407820 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp465724jai; Wed, 24 Mar 2021 07:34:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwTVtSH6WWxsAR4I0orThf5seNsFGOISA8nIrQ4cL2eH9t5jWjTuvoY8HkNcNX8xvJwoXcr X-Received: by 2002:a92:c24a:: with SMTP id k10mr2870880ilo.284.1616596472365; Wed, 24 Mar 2021 07:34:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616596472; cv=none; d=google.com; s=arc-20160816; b=f1pKJNgoC8t8BEbVlv7YHgxT1CTUE1kskeKDdN6uIWPezKZRaHDqAFiiTBstDYAk8u y5QXavng4foyLCSP/KSO7dEptl6+0pochTBfVjj5dqI8MY1lUta6MgMH9L14hMNQYLpI v49gSrkc4qIzN7eeRGqnOnVVNYATuJyYxIseq+qYdaLnyLYKuE4EH+SmMt2aOOIgFbUV yLp5Jkr1VNDsmHA5X53SGn2YxBzXxPPabhBZdU+8V1SjS68I/eX8E6VGhjhSEKT5Oh75 8JSteGeFCRxf6vQboB4Osua+ByIjyT4Qi6JX32SIRrC2F41ifLCiGiyl6mqwgRbEjfm5 1K/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=SZD7khucdGcSc+2blD6LJsOrnrnjjxBS/+7VFFzHNQM=; b=aXdNzu3Cmor79QHnb+0FYb4x9e6cAeidhkeyRRYZsb7SqPnxsLa04K4GuVjYmlzelZ ahGAszXl11n03Q9Mxvu5vU1cLnmd4EjidyEBbFWr/nie513xmGFB5LuRnNxhSF+r7GgZ aVsLTVliqJoBEgcg8GTEYB72hew4pJ8ppRQydd6gkxn2307R0PEM0Nq0iDPNWuhYCyJA EKKt3jWXsDdogfxMmcTi21YGv6yKVm2h9C5IMGYpkzPf3QvzKb2ysG4TGR7GpIUuhLE1 K1pFdSER9psJL7vs6e9s2y6JTnb74OrfXKDhYQFku60NkXfwmHaIE1/oRNMdxihVmfD+ m/aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ZO9bLnNX; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id s21si1560549iov.70.2021.03.24.07.34.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Mar 2021 07:34:32 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ZO9bLnNX; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:52298 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lP4ad-0001GP-M8 for patch@linaro.org; Wed, 24 Mar 2021 10:34:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51512) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lP4Wi-0006EF-9T for qemu-devel@nongnu.org; Wed, 24 Mar 2021 10:30:28 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]:40859) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lP4Wf-0007Gv-MH for qemu-devel@nongnu.org; Wed, 24 Mar 2021 10:30:28 -0400 Received: by mail-wm1-x334.google.com with SMTP id y124-20020a1c32820000b029010c93864955so1305239wmy.5 for ; Wed, 24 Mar 2021 07:30:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SZD7khucdGcSc+2blD6LJsOrnrnjjxBS/+7VFFzHNQM=; b=ZO9bLnNXlkbd0inXyl3/CIme+EGPn3P3JvTOlpaEzvZaJto3P4uPuLAh2ms8wFCNBW YMXzxcK2vvOKurQj+eAzd9G+dvWvwwQ6ORuKR5+KrvJGgiWNr7M7tGsOzw8Yuvk8NbQ1 6+0rviZcRsDgyYaWKAUcnbe/bLdikF0Vse/KAmSNW9g4xi0eAI5YglFuASG7rE1ia2oL omM182IN9XVhPObN91Ju4nXQ2mHp003UqTWRtpXtvtFeFKoDUyx9AuU7/wAFs4AG5gk4 9dWhDjzjuGXZx6ennWtKdkCY+7/oNb+A5OUFsA69UFi7B2o/pr6qHXGQZOqTsMtvIedW LAaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=SZD7khucdGcSc+2blD6LJsOrnrnjjxBS/+7VFFzHNQM=; b=Fw6RYla/F+boXr8+4TAc2QYvSF8cVm5gaIkRVpyghXuJBcuIFyFjh2Luz2qTY/duKX QcfNLwrrV9nl9nKB5nH4Gq1J3Gi+cMxUG6Iwiw7PfLOnLK0rHu/m7pRncQDhESWUPRQL gMUO5h58Wepuq6qfDxpCYPN2mPtIDHrLT/jxhAsSStjBZVsgeKUK2I4SdlpaG2vB+NwD mKqdsvlQhSJFjSew10q+be2SRbybjm727SBgnloStRk5hxGYnbk42Bq5Wv1v2OEIv+H2 E9YDnwTyttzR2O0ICyQl/JjqAP/EZPs95hYsuU4I5Cu6R1fW/t6munlWb7NrFsyg8dEI kr4Q== X-Gm-Message-State: AOAM530m8j+XJdV9CpomwwTJ/gZi69GZxvFhN5k17cQ2JL6ITsuIzVyc C0KimZLdU5kyZHW9fjyijSIrSw== X-Received: by 2002:a1c:a74b:: with SMTP id q72mr3213874wme.158.1616596223886; Wed, 24 Mar 2021 07:30:23 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id u2sm3525600wrp.12.2021.03.24.07.30.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Mar 2021 07:30:22 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id C652B1FF87; Wed, 24 Mar 2021 14:30:21 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 01/22] scripts/kernel-doc: strip QEMU_ from function definitions Date: Wed, 24 Mar 2021 14:30:00 +0000 Message-Id: <20210324143021.8560-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210324143021.8560-1-alex.bennee@linaro.org> References: <20210324143021.8560-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x334.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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 , =?utf-8?q?Alex_Benn?= =?utf-8?b?w6ll?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Some packaged versions of Sphinx (fedora33/alpine so far) have issues with the annotated C code that kernel-doc spits out. Without knowing about things like QEMU_PLUGIN_EXPORT it chokes trying to understand the code. Evidently this is a problem for the kernel as well as the long stream of regex substitutions we add to in this patch can attest. Fortunately we have a fairly common format for all our compiler shenanigans as applied to functions so lets just filter them all out. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson Message-Id: <20210323165308.15244-2-alex.bennee@linaro.org> -- 2.20.1 diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 4b19851b2d..240923d509 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1745,6 +1745,9 @@ sub dump_function($$) { )+ \)\)\s+//x; + # Strip QEMU specific compiler annotations + $prototype =~ s/QEMU_[A-Z_]+ +//; + # Yes, this truly is vile. We are looking for: # 1. Return type (may be nothing if we're looking at a macro) # 2. Function name From patchwork Wed Mar 24 14:30:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 407817 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp462508jai; Wed, 24 Mar 2021 07:31:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwEaIFevNsv3SLZnwPZIyLANC/mq9+CiuRKIswhJE2VztgtXSr31x8nfEQUeINnTKFdxJYm X-Received: by 2002:a5e:c809:: with SMTP id y9mr2755130iol.192.1616596261656; Wed, 24 Mar 2021 07:31:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616596261; cv=none; d=google.com; s=arc-20160816; b=OIh85dq79+oqb62VKGwgZuL2DEyUwKLLod7y3+YtxsqY5Mk8bcCJSiyeYpK5ad9FQB OqE31oS40bepQxiyXWw6/1hLz4wN6ecrdrSJzyDyo4LQxhOu+8je0oqxUXORue5AvdaR g0N15o53ogRqoIer8GFXkDKMSVbc5c5mNuYrqX+hY6PO5h/jpvvuQPsIY5z3YfcDKPcz h6Rol9bt41nFggjs1L9PIuUJpovMxNDiVhd5joaN6Z1uybXwyiH/ZfmX3n5PD7nx+7jr 2VFNZlQTg/7OH0QgaHtiTgxg+N9yc0ndLY5p/Fhii90wpY/K5RR77mA3NsGMGlhar5Xw D+VA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=LoR6KdJgI9L3QJjbSS34AyLS8mbG6iWvfcan+tzTXxg=; b=W/ECcm0BpKYXurju49lL1MsorcdhulCsNtdu6L73rDy9IXxVfdHH8eK424luRkdGip FenITuk6ZIhUMiZ6XM5k0jDUrz1upM9mIpW4O3w8WwpeJgK8kB4I7Kq/x2cyI49MfX33 t8NEwbeU/7NQt35qZhZMjbDYPAa1SSJANavtbGDcMDK/7uM6a5/m8sD4sHJdt+hxK6TE ECVjwdt2RXV49EeJoXK65AdW0jalsXNuli/ZXJUmAq+byKAcmnDJZYRkDt/t2T8/gQcH D9YHVYzERW0zwD/GiAakmWp2g1HEKXS5TC2n6Xs9pY5Mn9Pijcb8fmKbTadVC1k+iWVh F20w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=nGw+qVQe; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id f10si1566990iop.79.2021.03.24.07.31.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Mar 2021 07:31:01 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=nGw+qVQe; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:44200 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lP4XE-0006IL-U5 for patch@linaro.org; Wed, 24 Mar 2021 10:31:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51522) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lP4Wi-0006F1-Tt for qemu-devel@nongnu.org; Wed, 24 Mar 2021 10:30:29 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]:41826) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lP4Wh-0007IN-9N for qemu-devel@nongnu.org; Wed, 24 Mar 2021 10:30:28 -0400 Received: by mail-wm1-x333.google.com with SMTP id t5-20020a1c77050000b029010e62cea9deso1334067wmi.0 for ; Wed, 24 Mar 2021 07:30:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=LoR6KdJgI9L3QJjbSS34AyLS8mbG6iWvfcan+tzTXxg=; b=nGw+qVQeuntjzJRrP+ha2+vzGueFH1oxODHuM4U/yBZLNXyiVKr78QaRvWLGaT4s8n 0AKJcv6yyJyzd/VMKC9W0LkkOIQxDhOOcSDrHefwr/PX15hvAf/2jyZRQoywhoq7BkP8 i/gr3TKmyCSrRifhO05CfdBjQf6KYYmuFgXbhj2snLw/UvyVoqxNKB+b8xA23+Kg1SXW EBKeF5LYiHT7PqrqqG/B3d6x/V4U+mCV6+dlPncPr7KKdHr9ec6unDJN5LNa0et6CtTw 6gP1u46Znqc/cLFDw2UqFHXsEa7WWfsRaZRqytZzEYZ0kE6rmlOEf+1vQw/Wc+QSCUV1 Sx+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=LoR6KdJgI9L3QJjbSS34AyLS8mbG6iWvfcan+tzTXxg=; b=eapeWSPXUw1mpYgkuK3LJTkG5UQgW6SVo0874k/v55+fvfe7WhMwJvtobmoZkj5Jx6 K42YkbA3MnwVHyhoUhWx5860z29YFJw0qkFae3L7yhKDqSsfd0V4Cx9lUANHZcIjFt3o 3a/hRes6EJFYUlW1BCI6cUYabxVe3LjwjVGqa9mP06ESe4geeagIWBG2NkGsyk9W4ize lLEn2j+tP/QSoV+PpmZyNep2tLbp6ylQU/v3dOft/XupMRoc0TiomZmTbw3bCvYVKYem WnZbb/DaNoVy/NdTXQgzAcwRMIglARtGFFVrTKpHAEit9LmnGj87e3fjUp3DcNvOO8Nz UVEQ== X-Gm-Message-State: AOAM5315LA1Yc1E0oYh0ZWCD4jA2etWFYJVwf9bvWDP4jbPs/ee6QAF/ cNGLQaZ4xRVpWmFs+f3E+ZsAAq4Yir2DFOY0 X-Received: by 2002:a7b:cd8f:: with SMTP id y15mr3266788wmj.185.1616596225927; Wed, 24 Mar 2021 07:30:25 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id j123sm2746986wmb.1.2021.03.24.07.30.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Mar 2021 07:30:22 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id DCE5C1FF8C; Wed, 24 Mar 2021 14:30:21 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 02/22] docs/devel: include the plugin API information from the headers Date: Wed, 24 Mar 2021 14:30:01 +0000 Message-Id: <20210324143021.8560-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210324143021.8560-1-alex.bennee@linaro.org> References: <20210324143021.8560-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x333.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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: Aaron Lindsay , =?utf-8?q?Alex_Benn?= =?utf-8?b?w6ll?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We have kerneldoc tags for the headers so we might as well extract them into our developer documentation whilst we are at it. Signed-off-by: Alex Bennée Reviewed-by: Aaron Lindsay Message-Id: <20210323165308.15244-3-alex.bennee@linaro.org> -- 2.20.1 diff --git a/docs/devel/tcg-plugins.rst b/docs/devel/tcg-plugins.rst index 39ce86ed96..18c6581d85 100644 --- a/docs/devel/tcg-plugins.rst +++ b/docs/devel/tcg-plugins.rst @@ -63,6 +63,11 @@ valid during the lifetime of the callback so it is important that any information that is needed is extracted during the callback and saved by the plugin. +API +=== + +.. kernel-doc:: include/qemu/qemu-plugin.h + Usage ===== From patchwork Wed Mar 24 14:30:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 407818 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp462530jai; Wed, 24 Mar 2021 07:31:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw3XF2UxoCR1OFvwnW8JFp7iTx4UJ8ZLHSPLuL2Z03feymA/O8R9vk3TWLJsmU18J89Wubh X-Received: by 2002:a02:971a:: with SMTP id x26mr3140127jai.61.1616596263896; Wed, 24 Mar 2021 07:31:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616596263; cv=none; d=google.com; s=arc-20160816; b=A4aO+icnKCRLJI7Nnyy1EVCEq/hb2qlWUbTsNtJOWyKQwI7i4Q53nExML3i6xNWJ4A dTgHY0TuR6L60vavIGrpLX+e8rKOAPUwderR4Otryc0YMvMxq60i+fyaOYjHsaCWWSQg EIhlULCtnqiOhicVmQzE67crAmb51r+k+73cSh4H7YkuFRhtr7RUYKqi1vVsRwAyUBzP TFnUE2zZ4xDfMcyIAkQZE16SP6jKQSdCTVsHUXPsfiVNTUjNjN4jk7qPREv5kLK6jUEc ar4lTEyZ54i8QVJVWPK65LSwNV4t9/sSNVEYuGYdxMAKudG1AWXWvPe1Ful9sb4V0/Ag xlxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=kLzVba92sB3FPFp388sRp+Thx4lW+oVZeKfAa3xPR1Q=; b=sCrGXyhyOpH4AWBT4i8ZHQqxikiFwXVsJNTvId5Bozsqh7kcSGif5N/21hsZNIH/gp nx0lvr9b3fGq2J3ethYGa0gYHdY+qJKE9LgOU2r2MxPv4Ubgb9HwbwVwTHWr8uhmy7px UDJyt/580FBTB3tvohFzGpg/6Hs8wXEX9DFSjGBClpfm1lgv+aNZqx9BhRchOE+O6B8M pS6AC1nlrjRS7No04TYFyVtexhdZCLotvJKnzES8LREuJ5raBnRBianWqWV0fAT+lCXi /SPWLu6jxDx+tMoeO+q76PxviWdMjP93EZyeICKUh86CEcrZonbuEaiL6nVeA7lgYnED okMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=adnG4M9C; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id i13si1938109ilm.161.2021.03.24.07.31.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Mar 2021 07:31:03 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=adnG4M9C; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:44316 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lP4XH-0006LL-A2 for patch@linaro.org; Wed, 24 Mar 2021 10:31:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51548) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lP4Wk-0006Hx-UX for qemu-devel@nongnu.org; Wed, 24 Mar 2021 10:30:30 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]:52854) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lP4Wj-0007KC-26 for qemu-devel@nongnu.org; Wed, 24 Mar 2021 10:30:30 -0400 Received: by mail-wm1-x334.google.com with SMTP id d191so13009972wmd.2 for ; Wed, 24 Mar 2021 07:30:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kLzVba92sB3FPFp388sRp+Thx4lW+oVZeKfAa3xPR1Q=; b=adnG4M9CBykaDOtOvvr58emmLoAdPbBEwvf1Ill/6WfuUlotqVMemiATHnYKMT3Yni aVLGy0JQsv61e8RZzBZgxN9xQ5N7usT0BKe3GU4nVXk7e0mX6ixDsTFSeaABore8YC0R HVzlzprcLeZIwXySCWM4VRqP1tg7hYRawVtiH/JB2wC/kU0RhkPKujyiTonKqIMGQL6G 5X7kzbcYPAZ3qCXKq9ucUWg5roOg4+tmvy2OSurolC1uA+OK+o1lUEWqWqHUoCbsBoo6 sMAPgxfG8gEaAVNHEkOdmDs9+1O6Ud8vT3K8MX/kL6NLG6oAKoVlhcTJ1rBYgo/SIRLm wZZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kLzVba92sB3FPFp388sRp+Thx4lW+oVZeKfAa3xPR1Q=; b=Y1N8YiEFoD0YSwz4lF6BJ6rBiX628uFtnrRkhPDocU6bZLQCjhm33Gy5Tbxe//zrQ4 TUuDNjKgwRSMN1i75o3ioIXYt7dMV1U7PRAijJ6V73RSjvUvmjQi50sTuis7oixgU4k8 jZmvDFFdUwkBS1TPdSLhdZSaXcKUaCKgJEuGtdwDcdqkZKOjGvGWHteh+ERgODj/nHj1 +2w/VMQaTUNQ+FI/YgRaNqEsKAYIWwPD8yH2WrCWArIZ4Iv2xt34PwuzTvn8bHysHecN H5MbKRiU0NMyx/uVcI4tx20j+wm1tQWhKm54rGzzE24WqzM5qJ/OxmOw4gQk8R1LMe4Y XjTw== X-Gm-Message-State: AOAM530FvelZjnYdwh1WRge2tHV/6pzpAUW8t696tnr5PfZPRcpeKvzY MmlMyQ+5kDJI1ebNGWOUs0dQFw== X-Received: by 2002:a1c:7d4e:: with SMTP id y75mr3266665wmc.168.1616596227741; Wed, 24 Mar 2021 07:30:27 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id w6sm3410048wrl.49.2021.03.24.07.30.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Mar 2021 07:30:25 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id F0EDB1FF8F; Wed, 24 Mar 2021 14:30:21 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 03/22] docs/devel: expand style section of memory management Date: Wed, 24 Mar 2021 14:30:02 +0000 Message-Id: <20210324143021.8560-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210324143021.8560-1-alex.bennee@linaro.org> References: <20210324143021.8560-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x334.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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 , =?utf-8?q?Alex_Benn?= =?utf-8?b?w6ll?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This aims to provide a bit more guidance for those who take on one of our "clean up memory allocation" bite-sized tasks. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson Message-Id: <20210323165308.15244-4-alex.bennee@linaro.org> -- 2.20.1 diff --git a/docs/devel/style.rst b/docs/devel/style.rst index 8b0bdb3570..260e3263fa 100644 --- a/docs/devel/style.rst +++ b/docs/devel/style.rst @@ -385,17 +385,37 @@ avoided. Low level memory management =========================== -Use of the malloc/free/realloc/calloc/valloc/memalign/posix_memalign +Use of the ``malloc/free/realloc/calloc/valloc/memalign/posix_memalign`` APIs is not allowed in the QEMU codebase. Instead of these routines, -use the GLib memory allocation routines g_malloc/g_malloc0/g_new/ -g_new0/g_realloc/g_free or QEMU's qemu_memalign/qemu_blockalign/qemu_vfree -APIs. - -Please note that g_malloc will exit on allocation failure, so there -is no need to test for failure (as you would have to with malloc). -Calling g_malloc with a zero size is valid and will return NULL. - -Prefer g_new(T, n) instead of g_malloc(sizeof(T) ``*`` n) for the following +use the GLib memory allocation routines +``g_malloc/g_malloc0/g_new/g_new0/g_realloc/g_free`` +or QEMU's ``qemu_memalign/qemu_blockalign/qemu_vfree`` APIs. + +Please note that ``g_malloc`` will exit on allocation failure, so +there is no need to test for failure (as you would have to with +``malloc``). Generally using ``g_malloc`` on start-up is fine as the +result of a failure to allocate memory is going to be a fatal exit +anyway. There may be some start-up cases where failing is unreasonable +(for example speculatively loading a large debug symbol table). + +Care should be taken to avoid introducing places where the guest could +trigger an exit by causing a large allocation. For small allocations, +of the order of 4k, a failure to allocate is likely indicative of an +overloaded host and allowing ``g_malloc`` to ``exit`` is a reasonable +approach. However for larger allocations where we could realistically +fall-back to a smaller one if need be we should use functions like +``g_try_new`` and check the result. For example this is valid approach +for a time/space trade-off like ``tlb_mmu_resize_locked`` in the +SoftMMU TLB code. + +If the lifetime of the allocation is within the function and there are +multiple exist paths you can also improve the readability of the code +by using ``g_autofree`` and related annotations. See :ref:`autofree-ref` +for more details. + +Calling ``g_malloc`` with a zero size is valid and will return NULL. + +Prefer ``g_new(T, n)`` instead of ``g_malloc(sizeof(T) * n)`` for the following reasons: * It catches multiplication overflowing size_t; @@ -409,8 +429,8 @@ Declarations like are acceptable, though. -Memory allocated by qemu_memalign or qemu_blockalign must be freed with -qemu_vfree, since breaking this will cause problems on Win32. +Memory allocated by ``qemu_memalign`` or ``qemu_blockalign`` must be freed with +``qemu_vfree``, since breaking this will cause problems on Win32. String manipulation =================== @@ -485,6 +505,8 @@ In addition, QEMU assumes that the compiler does not use the latitude given in C99 and C11 to treat aspects of signed '<<' as undefined, as documented in the GNU Compiler Collection manual starting at version 4.0. +.. _autofree-ref: + Automatic memory deallocation ============================= From patchwork Wed Mar 24 14:30:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 407819 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp462548jai; Wed, 24 Mar 2021 07:31:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMESU7m559BZnxpOsL1dk0EcbO1zJwqsppZ58PnBrxLyYH7N8t9XBopPSHzJvDLkb+D6gM X-Received: by 2002:a92:cf10:: with SMTP id c16mr2727583ilo.92.1616596264718; Wed, 24 Mar 2021 07:31:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616596264; cv=none; d=google.com; s=arc-20160816; b=LPdEFZGpQMevfpyzHJXYJ6woQwkv6Je9SyY9xnPwfGfQlYmioxw+oLYpMeJlzPVmRW RgmsPInNngRNUqITAukxuY64waMq8bg1WU/X6HQt9SXLG7z0m9fP8ZQ+wlW2+JTUu5yH 8/z69ogOkJNx2A77f/sRYJdqI/IGkd8AtkIL+BNUid7nyGGesfhE6Mjh24WPjqzQ5caK OWud1t5MiGg5804wV+czrwqW7FAEX29iMi8GnGUuk13AS+EZxWfuXE8vOPGUoaZcI4tk W9ZDuGm895/VZjinD5HPjBsJF3+Qt9RyHo9MuRmHPpzCW43dVEe1lEQLgNabpNJhgop4 ryFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=PaDgr+5ItkcZ/CJQx3dfdKXW7BWt6FoKuOekenfvtes=; b=HTDz6qVz51RRQtKUGZHbrynPKs1lRctbysbDCSwaFRv4Mt7/5s/HtOlHLJubVyrAap uJFfmlG9HOQYnDyLxxe65yOESU3b6IhbbsTeZocyx+EbROWYyyPY+2zy+VbiAv/rlCVy N4chKSUgkDG07O2juVz3Tv9uWxjarUx6ugSI/gCNlOmKclyPjU+y7wVPbfpki1nixnG1 vvZwXX5HlVTC3XPH4dmBZgifquD5A6ZJobCiiZ+7fNSeb0wF/TweADBOJqN2oT+V3F6g fTptkmuqrPt1Rch8Kmcm/6/sNxx7Bs04dY0NWiIPWNS2ZlYu+yBHx1zxbw2X5aaOHrz6 GL/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ubQNhG8k; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id x9si1680115jan.85.2021.03.24.07.31.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Mar 2021 07:31:04 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ubQNhG8k; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:44382 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lP4XI-0006Mx-3u for patch@linaro.org; Wed, 24 Mar 2021 10:31:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51568) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lP4Wm-0006KH-Hd for qemu-devel@nongnu.org; Wed, 24 Mar 2021 10:30:32 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:34679) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lP4Wk-0007Kp-Mb for qemu-devel@nongnu.org; Wed, 24 Mar 2021 10:30:32 -0400 Received: by mail-wr1-x429.google.com with SMTP id j7so24687465wrd.1 for ; Wed, 24 Mar 2021 07:30:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PaDgr+5ItkcZ/CJQx3dfdKXW7BWt6FoKuOekenfvtes=; b=ubQNhG8kVhkRLawbFS2Plko7ii6srVsy2TwMG4fHzSl69bEncBO0EtqgicFg6/4vSP YjnxQMW0Y7eUpabKd8YIJRfNj9ooqzbTY0CAKLvCJ3FdxvUMwrn6A9Vlx3cS3pSXo3PV IeFg/JbM3WwcJ4nsRv6iMZwxKdGw1lm55IoExS2gsmQm32hEr90m76waOxA5L+P5cgRy +TTs0XoHegJw0/t2wilef1zyC0XfM51zeE9nmzl6RgfKMUheMS/4aA7axIy0oQJQ2Rvk iDBzK+0TIg/XCksCzmrHAKVlgMmhYBIH+md967ywh6qVsnmKTzwhciizXmVTFrK2i/Fs kl+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PaDgr+5ItkcZ/CJQx3dfdKXW7BWt6FoKuOekenfvtes=; b=BvDGT8bNXbj/SmydovYhOcxokSMbOdtEVIBvf5Xr2+l5lQV7Df0ktsUwmGqllfNqvA JitUpgaPvPiHsWJw0CIgG9+tWGlRldM9ZbxFFuC0YTt6NE3kMBu2epJx8JTrCwMGrLa/ M/8IOexQoORA2mgGSHf8/clicQG2MKSq19lhrK/4SJF57sZzxf+tr/uwhZvIeXvcGJIz iOE85B8z+ybXzGpXTLxBJKwFFtJfkiK72LDTI2pvPq22VvjcMResBg5rNGOIsv+EmO8E K2BrRVW3m6hU/EEPomzTWOML9aT5ERMVRmXn9L0/n58/gAKUl6Rw249JglxrrkT94NUy vaxg== X-Gm-Message-State: AOAM533RabbKXWDz5Z6x7FJ/ocAMXJUT3FqYGvgUmIYrVNSdAwFm7Klu pKb3iqXkwhOfXHlQnC2hAnUwuA== X-Received: by 2002:a5d:4e43:: with SMTP id r3mr3730027wrt.280.1616596229376; Wed, 24 Mar 2021 07:30:29 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id s9sm3047150wmh.31.2021.03.24.07.30.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Mar 2021 07:30:25 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 1229F1FF90; Wed, 24 Mar 2021 14:30:22 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 04/22] tools/virtiofsd: include --socket-group in help Date: Wed, 24 Mar 2021 14:30:03 +0000 Message-Id: <20210324143021.8560-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210324143021.8560-1-alex.bennee@linaro.org> References: <20210324143021.8560-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x429.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Connor Kuehl , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, Stefan Hajnoczi , "Dr. David Alan Gilbert" Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" I confused myself wandering if this had been merged by looking at the help output. It seems fuse_opt doesn't automagically add to help output so lets do it now. Signed-off-by: Alex Bennée Reviewed-by: Connor Kuehl Reviewed-by: Stefan Hajnoczi Updates: f6698f2b03 ("tools/virtiofsd: add support for --socket-group") Message-Id: <20210323165308.15244-5-alex.bennee@linaro.org> -- 2.20.1 diff --git a/tools/virtiofsd/fuse_lowlevel.c b/tools/virtiofsd/fuse_lowlevel.c index 1aa26c6333..58e32fc963 100644 --- a/tools/virtiofsd/fuse_lowlevel.c +++ b/tools/virtiofsd/fuse_lowlevel.c @@ -2450,6 +2450,7 @@ void fuse_lowlevel_help(void) printf( " -o allow_root allow access by root\n" " --socket-path=PATH path for the vhost-user socket\n" + " --socket-group=GRNAME name of group for the vhost-user socket\n" " --fd=FDNUM fd number of vhost-user socket\n" " --thread-pool-size=NUM thread pool size limit (default %d)\n", THREAD_POOL_SIZE); From patchwork Wed Mar 24 14:30:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 407824 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp467598jai; Wed, 24 Mar 2021 07:36:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJynZ3QnCnv4l6B6sIar9qTw/Hyz0fd9vKchvXOa+hD1mpD9Bddy9NDoDJ/RFSQSulF2CLwn X-Received: by 2002:a92:db0f:: with SMTP id b15mr2984682iln.236.1616596613721; Wed, 24 Mar 2021 07:36:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616596613; cv=none; d=google.com; s=arc-20160816; b=UMOQ+EcQ8297SAbM5mQyqv8ZjGJZubqCOIdOrqS7BDBgNf+SX+/jLJZrwjJ75DN/rj m0hjymIAm0ceV74/hqGu0wcscdpuM5W8BXH5gB57yLx3TW7vxJW0fqdiv/tuZVWjKu7n O9lSOHEYgjyNkZd13maST6BGT092y/eMgLM69uaxqApjT+wxljye/ElL/VT5YOk51adV 9Qa8EwztBdO9RF3jKNfNtNwOdPj4bDWoSqUFCBDyA8jhnoCzPBCFVWHxFJm+OFtFIOvE H5yFUQv+kVysU5lw+lyVoBxQNY4QE8oC6EKlr62OQCdyUDoDYOabif0t8U8WpwtEhfbV 7S3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=LbNG8pxBZeg2tueV/MXMEFWuxawjlIZ4kqf9FTBm5JU=; b=OlXcuvRb6sihScK3qL3HSOa2Xndv1CCfLgYd70lNhHiUG6lkyW7NlyByLNKvQxgtsZ Tat4PbaI86+KzkTKnhQjolzXQYyAA7antBlmDaMrkgHDaRxj7KmfALNgQ43J/g6AwiTw 1CK4ot6WArbzihuR2RI3e2u/mMWB9cU+Y6fj6oMXZ7t76RwHmGvoLaxgMwoZMgPrko7t i/y+q8gDtr46Spkwssx23usyAC1hTWdSbWKFREbdkKVlodVT6ZqYkzjD6zlcePUE8XC/ qaCUTrP2TKqsZvxGvhILx1853lVhDKNWgjzvbTAzyldO8Tf21Zfa+Ql8IYy/7rb+k75b RPWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=wk+XNnQS; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id y5si1709228iof.34.2021.03.24.07.36.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Mar 2021 07:36:53 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=wk+XNnQS; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:60876 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lP4cu-0004mL-Mt for patch@linaro.org; Wed, 24 Mar 2021 10:36:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51636) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lP4Wq-0006T4-Oo for qemu-devel@nongnu.org; Wed, 24 Mar 2021 10:30:36 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:46024) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lP4Wl-0007L0-Pb for qemu-devel@nongnu.org; Wed, 24 Mar 2021 10:30:36 -0400 Received: by mail-wr1-x42c.google.com with SMTP id 14so1443540wrz.12 for ; Wed, 24 Mar 2021 07:30:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=LbNG8pxBZeg2tueV/MXMEFWuxawjlIZ4kqf9FTBm5JU=; b=wk+XNnQSptklNLyMVD8uRXuwftdTfpVboeoQKNLeaEFTZd7Kq6m/B7y51fbUxTVAq2 RvQ3tk5DBdIJ4GjHcuUffuTufNJaPEg13UH7NCsaUDxNGVgiKYtHxDufp05u83Qr+/G7 xhKhX1A/E/X2ARSaohupoPEvHA396xO+/dnscMOx+4YHKPLtGreRxASgTDYugeRhvHMV OEngfA53FYpJZAbbABEtv5KnOPXrPVLXSbf3k7XfqpyiycqJv57/C6XrA81b4QOr4QLY vEXDXstOCeD/wBWrxBp10GZA5s3MEf2LAlrX4WpN/eraof9j18SKq3jPx1hrT7q2bAj8 CIbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=LbNG8pxBZeg2tueV/MXMEFWuxawjlIZ4kqf9FTBm5JU=; b=Tuvp4ffNPRuMsNZyKN7RTePF5MrlNjZHaxqrgO3JpJAc9uJ+A+EFPBzEgEZlXjCEW0 fe7FeEKH0NlJet61aCdNtqjyHhpTmn0XJD3noDmtHjzWrIkxULu+Pc70vOxjGYNDddDe utLqZoYDCt14hZZdim/BSma6uaZ2q5hypULUSzHp3iHTFiv5r1OSQvMuqxdTBGKD6aj4 VuwarWZr+1gkt/zsg/G9J6PZe9OFfoiSzMxqHvE3o7heBZVLyJzflRVabdHpwYMwztJt qHfaLYP2jkNLVmiarf8+ZKgwT5v3i55nsEw+5ECw4nBYMUerJlSzPqGywKuaraUqL205 PUwg== X-Gm-Message-State: AOAM5333T1zVvbJNdKY05qpfGo/4OG5jGztfPU8ot2OPu5qns9EDVBTK pRdKC3pgM88TdR3C8IykvI7fZw== X-Received: by 2002:adf:f0cb:: with SMTP id x11mr3734548wro.206.1616596230264; Wed, 24 Mar 2021 07:30:30 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id b15sm2898718wmd.41.2021.03.24.07.30.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Mar 2021 07:30:25 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 3AC651FF91; Wed, 24 Mar 2021 14:30:22 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 05/22] semihosting: move semihosting tests to multiarch Date: Wed, 24 Mar 2021 14:30:04 +0000 Message-Id: <20210324143021.8560-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210324143021.8560-1-alex.bennee@linaro.org> References: <20210324143021.8560-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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 , "open list:ARM TCG CPUs" , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" It may be arm-compat-semihosting but more than one architecture uses it so lets move the tests into the multiarch area. We gate it on the feature and split the semicall.h header between the arches. Also clean-up a bit of the Makefile messing about to one common set of runners. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson Message-Id: <20210323165308.15244-6-alex.bennee@linaro.org> -- 2.20.1 diff --git a/tests/tcg/aarch64/semicall.h b/tests/tcg/aarch64/semicall.h new file mode 100644 index 0000000000..8a3fce35c5 --- /dev/null +++ b/tests/tcg/aarch64/semicall.h @@ -0,0 +1,18 @@ +/* + * Semihosting Tests - AArch64 helper + * + * Copyright (c) 2019 + * Written by Alex Bennée + * + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +uintptr_t __semi_call(uintptr_t type, uintptr_t arg0) +{ + register uintptr_t t asm("x0") = type; + register uintptr_t a0 asm("x1") = arg0; + asm("hlt 0xf000" + : "=r" (t) + : "r" (t), "r" (a0)); + return t; +} diff --git a/tests/tcg/arm/semicall.h b/tests/tcg/arm/semicall.h index d4f6818192..ad8ac51310 100644 --- a/tests/tcg/arm/semicall.h +++ b/tests/tcg/arm/semicall.h @@ -1,5 +1,5 @@ /* - * Semihosting Tests + * Semihosting Tests - ARM Helper * * Copyright (c) 2019 * Written by Alex Bennée @@ -7,13 +7,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ -#define SYS_WRITE0 0x04 -#define SYS_READC 0x07 -#define SYS_REPORTEXC 0x18 - uintptr_t __semi_call(uintptr_t type, uintptr_t arg0) { -#if defined(__arm__) register uintptr_t t asm("r0") = type; register uintptr_t a0 asm("r1") = arg0; #ifdef __thumb__ @@ -23,13 +18,5 @@ uintptr_t __semi_call(uintptr_t type, uintptr_t arg0) #endif asm(SVC : "=r" (t) : "r" (t), "r" (a0)); -#else - register uintptr_t t asm("x0") = type; - register uintptr_t a0 asm("x1") = arg0; - asm("hlt 0xf000" - : "=r" (t) - : "r" (t), "r" (a0)); -#endif - return t; } diff --git a/tests/tcg/riscv64/semicall.h b/tests/tcg/riscv64/semicall.h new file mode 100644 index 0000000000..f8c88f32dc --- /dev/null +++ b/tests/tcg/riscv64/semicall.h @@ -0,0 +1,22 @@ +/* + * Semihosting Tests - RiscV64 Helper + * + * Copyright (c) 2021 + * Written by Alex Bennée + * + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +uintptr_t __semi_call(uintptr_t type, uintptr_t arg0) +{ + register uintptr_t t asm("a0") = type; + register uintptr_t a0 asm("a1") = arg0; + asm(".option norvc\n\t" + ".balign 16\n\t" + "slli zero, zero, 0x1f\n\t" + "ebreak\n\t" + "srai zero, zero, 0x7\n\t" + : "=r" (t) + : "r" (t), "r" (a0)); + return t; +} diff --git a/tests/tcg/arm/semiconsole.c b/tests/tcg/multiarch/arm-compat-semi/semiconsole.c similarity index 93% rename from tests/tcg/arm/semiconsole.c rename to tests/tcg/multiarch/arm-compat-semi/semiconsole.c index 6ef0bd2450..1d82efc589 100644 --- a/tests/tcg/arm/semiconsole.c +++ b/tests/tcg/multiarch/arm-compat-semi/semiconsole.c @@ -7,6 +7,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ +#define SYS_READC 0x07 + #include #include #include "semicall.h" diff --git a/tests/tcg/arm/semihosting.c b/tests/tcg/multiarch/arm-compat-semi/semihosting.c similarity index 85% rename from tests/tcg/arm/semihosting.c rename to tests/tcg/multiarch/arm-compat-semi/semihosting.c index 33faac9916..b3fd16cd12 100644 --- a/tests/tcg/arm/semihosting.c +++ b/tests/tcg/multiarch/arm-compat-semi/semihosting.c @@ -7,12 +7,15 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ +#define SYS_WRITE0 0x04 +#define SYS_REPORTEXC 0x18 + #include #include "semicall.h" int main(int argc, char *argv[argc]) { -#if defined(__arm__) +#if UINTPTR_MAX == UINT32_MAX uintptr_t exit_code = 0x20026; #else uintptr_t exit_block[2] = {0x20026, 0}; diff --git a/MAINTAINERS b/MAINTAINERS index 10ed6d7624..554be84b32 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3286,6 +3286,7 @@ M: Alex Bennée S: Maintained F: semihosting/ F: include/semihosting/ +F: tests/tcg/multiarch/arm-compat-semi/ Multi-process QEMU M: Elena Ufimtseva diff --git a/tests/tcg/Makefile.target b/tests/tcg/Makefile.target index 24d75a5801..cab8c6b3a2 100644 --- a/tests/tcg/Makefile.target +++ b/tests/tcg/Makefile.target @@ -32,6 +32,9 @@ all: -include ../../../config-host.mak -include ../config-$(TARGET).mak +ifeq ($(CONFIG_USER_ONLY),y) +-include $(SRC_PATH)/default-configs/targets/$(TARGET).mak +endif # for including , in command strings COMMA := , diff --git a/tests/tcg/aarch64/Makefile.target b/tests/tcg/aarch64/Makefile.target index bf53ad0087..56e48f4b34 100644 --- a/tests/tcg/aarch64/Makefile.target +++ b/tests/tcg/aarch64/Makefile.target @@ -41,24 +41,6 @@ AARCH64_TESTS += mte-1 mte-2 mte-3 mte-4 mte-%: CFLAGS += -march=armv8.5-a+memtag endif -# Semihosting smoke test for linux-user -AARCH64_TESTS += semihosting -run-semihosting: semihosting - $(call run-test,$<,$(QEMU) $< 2> $<.err, "$< on $(TARGET_NAME)") - -run-plugin-semihosting-with-%: - $(call run-test, $@, $(QEMU) $(QEMU_OPTS) \ - -plugin $(PLUGIN_LIB)/$(call extract-plugin,$@) \ - $(call strip-plugin,$<) 2> $<.err, \ - "$< on $(TARGET_NAME) with $*") - -AARCH64_TESTS += semiconsole -run-semiconsole: semiconsole - $(call skip-test, $<, "MANUAL ONLY") - -run-plugin-semiconsole-with-%: - $(call skip-test, $<, "MANUAL ONLY") - ifneq ($(DOCKER_IMAGE)$(CROSS_CC_HAS_SVE),) # System Registers Tests AARCH64_TESTS += sysregs diff --git a/tests/tcg/arm/Makefile.target b/tests/tcg/arm/Makefile.target index ec95156562..5ab59ed6ce 100644 --- a/tests/tcg/arm/Makefile.target +++ b/tests/tcg/arm/Makefile.target @@ -29,37 +29,31 @@ run-fcvt: fcvt $(call run-test,fcvt,$(QEMU) $<,"$< on $(TARGET_NAME)") $(call diff-out,fcvt,$(ARM_SRC)/fcvt.ref) +ifeq ($(CONFIG_ARM_COMPATIBLE_SEMIHOSTING),y) + # Semihosting smoke test for linux-user -ARM_TESTS += semihosting semihosting: CFLAGS += -mthumb -run-semihosting: semihosting - $(call run-test,$<,$(QEMU) $< 2> $<.err, "$< on $(TARGET_NAME)") ARM_TESTS += semihosting-arm -semihosting-arm: CFLAGS += -marm +semihosting-arm: CFLAGS += -marm -I$(SRC_PATH)/tests/tcg/$(TARGET_NAME) semihosting-arm: semihosting.c $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS) run-semihosting-arm: semihosting-arm $(call run-test,$<,$(QEMU) $< 2> $<.err, "$< on $(TARGET_NAME)") -run-plugin-semihosting-with-%: +run-plugin-semihosting-arm-with-%: $(call run-test, $@, $(QEMU) $(QEMU_OPTS) \ -plugin $(PLUGIN_LIB)/$(call extract-plugin,$@) \ $(call strip-plugin,$<) 2> $<.err, \ "$< on $(TARGET_NAME) with $*") -ARM_TESTS += semiconsole semiconsole-arm +ARM_TESTS += semiconsole-arm semiconsole: CFLAGS += -mthumb -run-semiconsole: semiconsole - $(call skip-test, $<, "MANUAL ONLY") -run-plugin-semiconsole-with-%: - $(call skip-test, $<, "MANUAL ONLY") - -semiconsole-arm: CFLAGS += -marm -semiconsole-arm: semiconsole.c +semiconsole-arm: CFLAGS += -marm -I$(SRC_PATH)/tests/tcg/$(TARGET_NAME) +semiconsole-arm: semihosting.c $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS) run-semiconsole-arm: semiconsole-arm @@ -68,6 +62,8 @@ run-semiconsole-arm: semiconsole-arm run-plugin-semiconsole-arm-with-%: $(call skip-test, $<, "MANUAL ONLY") +endif + ARM_TESTS += commpage TESTS += $(ARM_TESTS) diff --git a/tests/tcg/multiarch/Makefile.target b/tests/tcg/multiarch/Makefile.target index abbdb2e126..a3a751723d 100644 --- a/tests/tcg/multiarch/Makefile.target +++ b/tests/tcg/multiarch/Makefile.target @@ -69,6 +69,37 @@ run-gdbstub-%: endif EXTRA_RUNS += run-gdbstub-sha1 run-gdbstub-qxfer-auxv-read +# ARM Compatible Semi Hosting Tests +# +# Despite having ARM in the name we actually have several +# architectures that implement it. We gate the tests on the feature +# appearing in config. +# +ifeq ($(CONFIG_ARM_COMPATIBLE_SEMIHOSTING),y) +VPATH += $(MULTIARCH_SRC)/arm-compat-semi + +# Add -I path back to TARGET_NAME for semicall.h +semihosting: CFLAGS+=-I$(SRC_PATH)/tests/tcg/$(TARGET_NAME) + +run-semihosting: semihosting + $(call run-test,$<,$(QEMU) $< 2> $<.err, "$< on $(TARGET_NAME)") + +run-plugin-semihosting-with-%: + $(call run-test, $@, $(QEMU) $(QEMU_OPTS) \ + -plugin $(PLUGIN_LIB)/$(call extract-plugin,$@) \ + $(call strip-plugin,$<) 2> $<.err, \ + "$< on $(TARGET_NAME) with $*") + +semiconsole: CFLAGS+=-I$(SRC_PATH)/tests/tcg/$(TARGET_NAME) + +run-semiconsole: semiconsole + $(call skip-test, $<, "MANUAL ONLY") + +run-plugin-semiconsole-with-%: + $(call skip-test, $<, "MANUAL ONLY") + +TESTS += semihosting semiconsole +endif # Update TESTS TESTS += $(MULTIARCH_TESTS) From patchwork Wed Mar 24 14:30:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 407821 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp465826jai; Wed, 24 Mar 2021 07:34:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxIHvx7kFbdb8TZALfsx0xtKJnaNwGa2byi+MMWeZRX4uVk4wq8tTVT6bRJg8POb/DtCFKQ X-Received: by 2002:a05:6602:2be1:: with SMTP id d1mr2679442ioy.148.1616596477967; Wed, 24 Mar 2021 07:34:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616596477; cv=none; d=google.com; s=arc-20160816; b=fsat1Byt7v/6Y8AA2pwaLRBZ5Dq/7zRdtQ6tb0A8cGiQJ6Q+jQ6J1cLwDZfYlm7ktu XKqS6uWuBz2mdZ8Ltl2w5EdcHSxCViCLj9wsW5dbRZHQVsTfTkrTUhrL5UYb+L3CFH7z Y4hFFeiMW8UmXRq36xUaeZ7Udd1qMXpahw+7lscXnyV0EI0rdjQGH5Y7UQptdkEa0QO3 ndOKfjVox6nXuZFSf+LGih58ywygHSn1Mt+sS0NJsEXZ9iUSpHj5g6oYeA5Sxx+khkvd ESCl3ESmN9U2HAxIfuU36d755IwDJ2vqmCDpgjoTXaTXFnciiZgjOCqpWtz0u+Jdd6Nt IMMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=xPK6HS62SnTfNvabHBBC22/tzKk4JYeDFr2rp0SujyI=; b=z1CWs+gnt2wMbuL+NeWllcF7j7bx8D9Nc07qsmqDx/RruIPtTwGK48o4kac7VINvgq grCzPG55XDavswdIjfF1nuym+DVfuM77H9QYA+yNpc2tAVV/5Pff6Dwn2rL8Dur9sMUW 7xvbewHxqs3DHXlFM1Phw9zXiC1b/dieXzA7JOt+rGPYofgv6R1RmLiUP1/FZC3TIvGK VFPgSazhg5bhMYg7ZvlFlJlUm2fKMqKTpS4E+2p+CkeMJrO+RzFwBQl/lKUgI1nhCizA ibO36Ubk52ffo06KKfmeJGo1LhdlxZmAcYuWpWaQAHm8Qudz6Iqsg6jxJJBYchDL0p0f JUPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=yE2FcFsY; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id c13si1647231ilm.5.2021.03.24.07.34.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Mar 2021 07:34:37 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=yE2FcFsY; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:52830 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lP4aj-0001Sz-A8 for patch@linaro.org; Wed, 24 Mar 2021 10:34:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51646) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lP4Ws-0006Vg-40 for qemu-devel@nongnu.org; Wed, 24 Mar 2021 10:30:38 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]:33603) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lP4Wq-0007NF-74 for qemu-devel@nongnu.org; Wed, 24 Mar 2021 10:30:37 -0400 Received: by mail-wm1-x32d.google.com with SMTP id w203-20020a1c49d40000b029010c706d0642so2817710wma.0 for ; Wed, 24 Mar 2021 07:30:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xPK6HS62SnTfNvabHBBC22/tzKk4JYeDFr2rp0SujyI=; b=yE2FcFsYrYJT31CK77sFtSy/8Z8nIY9K3pnoZP0NT/54cp4ApXVbG+vftDaW/B1sxl EAqOgmFtXarpLWT3bh2barFHmjKksv6PAsKleENXvcG0lL6+Jh/h5p0ihAbSdSJ2LSWe EXEs0ETuPF6/wOH6AVQuJe/77lH+eriFe6WRQPya7ppdxZGNGKl+pPNrrL5QyUJ0EXYl cgGCLL035s1Q6uhu0D7zl5ektQgA7DKdyYL9SOPSVqUksxJCEAOYVfGi+v/8FlI5wCNd YdA8nFGxe4DOqIYFdh34A4IFQnwSZNd653j+Ozm+gEphK++Pad9OLrRXwc6G0Q1H2/yb WDeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xPK6HS62SnTfNvabHBBC22/tzKk4JYeDFr2rp0SujyI=; b=khCPq5bvndpXToGz/N45o62aSiNQsHUDC63wQL3Ycd0uFgM4/rnYur9wv7pzX1qSKG NXR8kie7aegIY+h24RNPFOS400038de046GjaSrC6Z10BbLC9MlXC2WESdw0d9/trs20 uChzIp35HZPsqBO/hVe9LUM7K29G3L8yxAjPtOqrPG394aMOL9zh8UoYHlOROGyqb0f5 9tvdDA/Q56cJnkTwzIJCrUWQX2GpU0ZiTnQ0M15hoykpbdMfv06QdWzJo074Nd+IHghj GClcolwqwyyBqfzjKj2xKhOTPCbtTaY9MNVmNOnJblWEvSfT8rD6jbuu7ab+PJNPiipc rYAQ== X-Gm-Message-State: AOAM532aNyMddTaKCYWeraMSHYRCIQv2rRk4OTDzKLh9Px6jns71SBc3 lwUXPOF4XGEqGF4ynGMBWlbupw== X-Received: by 2002:a05:600c:4ba2:: with SMTP id e34mr3263525wmp.121.1616596234789; Wed, 24 Mar 2021 07:30:34 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id q15sm3321553wrr.58.2021.03.24.07.30.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Mar 2021 07:30:26 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 5124E1FF92; Wed, 24 Mar 2021 14:30:22 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 06/22] semihosting/arm-compat-semi: unify GET/SET_ARG helpers Date: Wed, 24 Mar 2021 14:30:05 +0000 Message-Id: <20210324143021.8560-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210324143021.8560-1-alex.bennee@linaro.org> References: <20210324143021.8560-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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: Keith Packard , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" >>>From the semihosting point of view what we want to know is the current mode of the processor. Unify this into a single helper and allow us to use the same GET/SET_ARG helpers for the rest of the code. Having the helper will also be useful later. Note: we aren't currently testing riscv32 due to missing toolchain for check-tcg tests. Signed-off-by: Alex Bennée Reviewed-by: Peter Maydell Reviewed-by: Keith Packard Message-Id: <20210323165308.15244-7-alex.bennee@linaro.org> -- 2.20.1 diff --git a/semihosting/arm-compat-semi.c b/semihosting/arm-compat-semi.c index 94950b6c56..0f0e129a7c 100644 --- a/semihosting/arm-compat-semi.c +++ b/semihosting/arm-compat-semi.c @@ -767,15 +767,28 @@ static const GuestFDFunctions guestfd_fns[] = { }, }; -/* Read the input value from the argument block; fail the semihosting - * call if the memory read fails. +/* + * Read the input value from the argument block; fail the semihosting + * call if the memory read fails. Eventually we could use a generic + * CPUState helper function here. */ -#ifdef TARGET_ARM +static inline bool is_64bit_semihosting(CPUArchState *env) +{ +#if defined(TARGET_ARM) + return is_a64(env); +#elif defined(TARGET_RISCV) + return !riscv_cpu_is_32bit(env); +#else +#error un-handled architecture +#endif +} + + #define GET_ARG(n) do { \ - if (is_a64(env)) { \ + if (is_64bit_semihosting(env)) { \ if (get_user_u64(arg ## n, args + (n) * 8)) { \ errno = EFAULT; \ - return set_swi_errno(cs, -1); \ + return set_swi_errno(cs, -1); \ } \ } else { \ if (get_user_u32(arg ## n, args + (n) * 4)) { \ @@ -786,41 +799,10 @@ static const GuestFDFunctions guestfd_fns[] = { } while (0) #define SET_ARG(n, val) \ - (is_a64(env) ? \ + (is_64bit_semihosting(env) ? \ put_user_u64(val, args + (n) * 8) : \ put_user_u32(val, args + (n) * 4)) -#endif -#ifdef TARGET_RISCV - -/* - * get_user_ual is defined as get_user_u32 in softmmu-semi.h, - * we need a macro that fetches a target_ulong - */ -#define get_user_utl(arg, p) \ - ((sizeof(target_ulong) == 8) ? \ - get_user_u64(arg, p) : \ - get_user_u32(arg, p)) - -/* - * put_user_ual is defined as put_user_u32 in softmmu-semi.h, - * we need a macro that stores a target_ulong - */ -#define put_user_utl(arg, p) \ - ((sizeof(target_ulong) == 8) ? \ - put_user_u64(arg, p) : \ - put_user_u32(arg, p)) - -#define GET_ARG(n) do { \ - if (get_user_utl(arg ## n, args + (n) * sizeof(target_ulong))) { \ - errno = EFAULT; \ - return set_swi_errno(cs, -1); \ - } \ - } while (0) - -#define SET_ARG(n, val) \ - put_user_utl(val, args + (n) * sizeof(target_ulong)) -#endif /* * Do a semihosting call. From patchwork Wed Mar 24 14:30:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 407823 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp466267jai; Wed, 24 Mar 2021 07:35:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxGIj1+BQ5H3AA3rUk686OyL9+CQdo24u/O7b2Zk9iXzCQsM88ww0gXWwcXYPiZReToZUy6 X-Received: by 2002:a05:6e02:de2:: with SMTP id m2mr2903257ilj.274.1616596510799; Wed, 24 Mar 2021 07:35:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616596510; cv=none; d=google.com; s=arc-20160816; b=tLViC3aYwgms7jqs5qcMFPqT2V6IUk0nu7G69V32sn9WPuvjYkiL4+SpiqoWPeqqc0 RbiJkFBSBAAl60fQz+J/bL6KL7JiFN0BnTYpY+UjgX75pep5yuKRvP3fqGYfJ2tvSvmg VWnqPgx/3NGr1rnWM+XGNh5T/oIbvU8IY2a5uQQRz8ViqcA1XifkyYG0RPXXyXNdUYSC hsN2iwyWH5t6WyXEt8cNjxSq3MaEo7tXxL+ek1wHzB4erMhqiGoZeD3TcFu3K39uABAH b97U8q4+aICRyXr24vyzRDRYurmtoREA6FgUzywGXQmR4TYbBR/DrbA9vmWAjBc1wlDl yEsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=6sNcGE+fxfYDvF8wTWBRRUANizKHbS8OY1p/YPeXwYg=; b=AtmqfL1vCA6884JxftcfMXHu6qv83sfLtonz8cThb0QD5B4BY0F84ZirsoFcnFrQnb 2zy2SAh7CcEB9tf5xJqJgw4NC46/Sa032j/C9a287PTJv0B7TmLh4+i78xbvAMy0r4yU hzs5PUX2FPiSV+k1ew1ifUmITFHTA00RPxwSB/JHERi5kCzr5QHwcOzE+Ah49gVzylk7 swCSuWhW+GCKOUB5ElOTq18qUP9atbl8Dby7eMsIXKef8Ic969rQ/rSDc/jNhJ4ARgQV n4GZTwB/uhqgJpnGL/C6cKR4tV2tuNW2Zsb5Xbz/nRK+toMGrijxQp38+oGj6EY34kgN /FVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=q1D5XAJX; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id w17si1819569jai.126.2021.03.24.07.35.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Mar 2021 07:35:10 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=q1D5XAJX; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:53724 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lP4bG-0001p1-5C for patch@linaro.org; Wed, 24 Mar 2021 10:35:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51630) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lP4Wq-0006Rd-3J for qemu-devel@nongnu.org; Wed, 24 Mar 2021 10:30:36 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:42879) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lP4Wn-0007Mr-CI for qemu-devel@nongnu.org; Wed, 24 Mar 2021 10:30:35 -0400 Received: by mail-wr1-x42e.google.com with SMTP id x13so24655521wrs.9 for ; Wed, 24 Mar 2021 07:30:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6sNcGE+fxfYDvF8wTWBRRUANizKHbS8OY1p/YPeXwYg=; b=q1D5XAJXxz/IjI2QtEcZ6MaZFNkIOgUblNX80XEri///tovh+QEARHnbDk7QZlnp/O 01JEtIdsVLeLaRMF8mPHOhm9JlUTp/4iePTRreiTVc2R4oLGLVpX9AYmgexeKB4OZCG0 +lk7MNz7h7CO1z/aUErKjmgtzB430MEU23pTqCIKl7bpZCFROoTzDTotKSMVuWk4yRwl XFSU1vkmxNZ3l/m36i2GQc6V8Z+tAhnPMI+auZcB1/kSf6ErhfiN9zJSsWPJwWLF7od6 BZXfDZthZbKBX7/dbnClsDPfWWQut5NWoIQg0Iya8MzytXExTI95OL7xBo7TBVwuoGym ry9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6sNcGE+fxfYDvF8wTWBRRUANizKHbS8OY1p/YPeXwYg=; b=mGI86L+khHIH7GbT1PTwudEB4iEkh2BWVdEjZbS3MI/9OZymiiHWSkxhadmpgb/rde CrFMEv+CHk+ERPE4l0diYXlIKxLluug0zINZPGN+5zIzOdQzIx2quPo3L/8JX/Rdi2Lt z/oN/GNeBlDiPdcFtTtnA65an+4JhwJv36Js2L8ENfN0wPqp8ByOegQqyzh05hSZJbrx 90qmXCR+63y9YKe7+CXJAhG2A1z1ZaXm2rNcuh9CRy16gJF64yryDBNvkMgJkTGYZBdm ygz+BoXqFKCfYJH94FEPVbpZD44g+qdzZm98ajfeeO/zOKuYKKGE/N651UQdcl7+Yz1n okjQ== X-Gm-Message-State: AOAM530XRlHnReiHEW/qFxvI8bLeagUepnWt79iEf0PCW04xzK2B8899 fnJ4LoedhsnnTUNj6IaHUiMagkXJtJ2VLep5 X-Received: by 2002:adf:e392:: with SMTP id e18mr3941538wrm.189.1616596231935; Wed, 24 Mar 2021 07:30:31 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id v14sm3234965wrd.48.2021.03.24.07.30.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Mar 2021 07:30:26 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 6598B1FF93; Wed, 24 Mar 2021 14:30:22 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 07/22] semihosting/arm-compat-semi: don't use SET_ARG to report SYS_HEAPINFO Date: Wed, 24 Mar 2021 14:30:06 +0000 Message-Id: <20210324143021.8560-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210324143021.8560-1-alex.bennee@linaro.org> References: <20210324143021.8560-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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: Bug 1915925 <1915925@bugs.launchpad.net>, Keith Packard , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" As per the spec: the PARAMETER REGISTER contains the address of a pointer to a four-field data block. So we need to follow arg0 and place the results of SYS_HEAPINFO there. Fixes: 3c37cfe0b1 ("semihosting: Change internal common-semi interfaces to use CPUState *") Signed-off-by: Alex Bennée Reviewed-by: Peter Maydell Cc: Bug 1915925 <1915925@bugs.launchpad.net> Cc: Keith Packard Bug: https://bugs.launchpad.net/bugs/1915925 Message-Id: <20210323165308.15244-8-alex.bennee@linaro.org> -- 2.20.1 diff --git a/semihosting/arm-compat-semi.c b/semihosting/arm-compat-semi.c index 0f0e129a7c..fe079ca93a 100644 --- a/semihosting/arm-compat-semi.c +++ b/semihosting/arm-compat-semi.c @@ -1214,7 +1214,11 @@ target_ulong do_common_semihosting(CPUState *cs) for (i = 0; i < ARRAY_SIZE(retvals); i++) { bool fail; - fail = SET_ARG(i, retvals[i]); + if (is_64bit_semihosting(env)) { + fail = put_user_u64(retvals[i], arg0 + i * 8); + } else { + fail = put_user_u32(retvals[i], arg0 + i * 4); + } if (fail) { /* Couldn't write back to argument block */ From patchwork Wed Mar 24 14:30:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 407829 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp470922jai; Wed, 24 Mar 2021 07:41:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyUAcFuAbORAOpibFeP0UNQt8b+EKrYIS/ni/Y7/Z1yF+vdUQHbAxJWUlh98Qoc0i9992Xr X-Received: by 2002:a05:6e02:188f:: with SMTP id o15mr3072169ilu.178.1616596872843; Wed, 24 Mar 2021 07:41:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616596872; cv=none; d=google.com; s=arc-20160816; b=hDnpSId8ctEqjfo3iWbsBjm8hN3axViqx+jQjfaH2s007fsfyT94kcdRK83VCgne65 65D/+HgnkjNfX2oe44MLe5ZxXZbMrtj70iufaT3MbPfupGfAuwwXhkNOQ+8ksA1SSzNn H6sG+EmhZWeg/b4bwgNohd4yxVyKT8Jtftb7LVCmo8ATnYwZrIDyS3pOkm3VmqPimY22 LXlTM7ODkd20eL2pCBinna4OTmoR+U4GODpd34B2gEzInCqDoD2AdzCGMZUJjfVZABmC dHBcmeI9tEQR5jEAcI/NgO8xnnnAS+IzBl0e49gpmM4BTTbKvL53cBQ0qW6zTjSrMLYG UDcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=ma50U0tSPKQlNSM/2UIXylhE0jwIndZoBnvcG4UWEO8=; b=u4Bgr7ACQf3U5BWR5CwOQ1KGP8rAOy9GtKARUH3Qjcpn414Jkv8jqDr863ngB3V+Ze j21Qj8Nu1rtTAfoZCaK3SHC8F2Lupedg3Yez1EdWMZjEtha4v1pyKQvwR14QCzF4uueH t75ieMC54449ATc8/mWma5Gm0br6HiGEh81qYwvQlenALjD/eSgDbZJE3sWCJPlcqniI F+fC7osm0arahz9nhVPFhWCcBuWoYQE95/6tiW7ri5NoRINyjfcxCAKWwlpMMUQxu213 1y8/v4n3OmB4LZQRm18LLLL1QIZUig/XuyQXjEEeF6FJWyN2+SAilnCDGlQ6TkqFIlom lbxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=N8xKYFey; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id o12si1911936ils.62.2021.03.24.07.41.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Mar 2021 07:41:12 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=N8xKYFey; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:45498 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lP4h5-0001aN-Sd for patch@linaro.org; Wed, 24 Mar 2021 10:41:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51692) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lP4Ww-0006dG-0O for qemu-devel@nongnu.org; Wed, 24 Mar 2021 10:30:42 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]:52846) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lP4Wo-0007Mx-0n for qemu-devel@nongnu.org; Wed, 24 Mar 2021 10:30:41 -0400 Received: by mail-wm1-x32b.google.com with SMTP id d191so13010135wmd.2 for ; Wed, 24 Mar 2021 07:30:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ma50U0tSPKQlNSM/2UIXylhE0jwIndZoBnvcG4UWEO8=; b=N8xKYFeyoAcogtXdsFkVQaPlupP2THGf6rpxHeV1qksM8QCEiC/YLuZPpiX8cXEmRu 8mrqyffuXXTekUyIMKPOuqUgQLeLUSmQm+rsJVr6WoIk6r/zQclBDwuddhCWeh/C0EI+ kwwCUz4gjurDsqdQstUKIyhwbg9uBVoOcsTmHcAOGwvIiEdadS9Ax7M9oiavSSDrniGN QFGxmDKE6Aa6igv+YeK/o3Bjs3QzzifIQiBpmD4Tzvv0LdhrQKWi11CfWYO822O1hKG6 YwYDl5k76NhE0QLnFYdsnfSjy1qfIRyS+19YvvvVh1jbtINWgPjW+UKneI81Ft39Hp4a 8MSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ma50U0tSPKQlNSM/2UIXylhE0jwIndZoBnvcG4UWEO8=; b=W9qK2t+zH37j+C1dE0wEBhWUo7zdlnyIfajjNFeHK3z9y77cH/Y/eIB+M9tBApUTB9 y7+nhYBcHABBjx0ilth+cnbNQMhINvp4V17anZPEP8U5PyqtIbe6tSDcJJRQBsiitO16 Ao3emP98uK8rQ9h25r9Ctd6w/e/+iHC2Dnekx5fYSGILSLBDW9mTtzzRuiyM7NiO02zf XF56rwCw3vDyACSvkF1BeCvAF/EclEOi53l27Wi82UAli14Wnr60abVyoYIXS4k+BRly ADNpWNPgu+j51r++pVY5fuuVmH4IeLWDvDjgmRdMgpZD/AU7nPWu3LH9OW+i9ZeIBf1F gWPw== X-Gm-Message-State: AOAM532d2MNVc+cJY+lCHUMoiEpixS06IXQZSXQRWfWDcbIkNzjph6lj 0C+8If2M6sszxz9SCHXuVvjkWA== X-Received: by 2002:a1c:6543:: with SMTP id z64mr3248739wmb.50.1616596232560; Wed, 24 Mar 2021 07:30:32 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id u4sm3488701wrm.24.2021.03.24.07.30.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Mar 2021 07:30:26 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 7A04D1FF96; Wed, 24 Mar 2021 14:30:22 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 08/22] linux-user/riscv: initialise the TaskState heap/stack info Date: Wed, 24 Mar 2021 14:30:07 +0000 Message-Id: <20210324143021.8560-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210324143021.8560-1-alex.bennee@linaro.org> References: <20210324143021.8560-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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 , Alistair Francis , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, Laurent Vivier Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Arguably the target_cpu_copy_regs function for each architecture is misnamed as a number of the architectures also take the opportunity to fill out the TaskState structure. This could arguably be factored out into common code but that would require a wider audit of the architectures. For now just replicate for riscv so we can correctly report semihosting information for SYS_HEAPINFO. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson Acked-by: Alistair Francis Message-Id: <20210323165308.15244-9-alex.bennee@linaro.org> -- 2.20.1 diff --git a/linux-user/riscv/cpu_loop.c b/linux-user/riscv/cpu_loop.c index 6767f941e8..74a9628dc9 100644 --- a/linux-user/riscv/cpu_loop.c +++ b/linux-user/riscv/cpu_loop.c @@ -135,4 +135,9 @@ void target_cpu_copy_regs(CPUArchState *env, struct target_pt_regs *regs) error_report("Incompatible ELF: RVE cpu requires RVE ABI binary"); exit(EXIT_FAILURE); } + + ts->stack_base = info->start_stack; + ts->heap_base = info->brk; + /* This will be filled in on the first SYS_HEAPINFO call. */ + ts->heap_limit = 0; } From patchwork Wed Mar 24 14:30:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 407828 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp470114jai; Wed, 24 Mar 2021 07:40:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQP8DcQUP2FccPmnVnD/GTM2YZTtLKYBAbHiYCydwYj7CkSD9sPqz5ML9UAq+CPG9TQiOk X-Received: by 2002:a92:7605:: with SMTP id r5mr710445ilc.118.1616596804339; Wed, 24 Mar 2021 07:40:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616596804; cv=none; d=google.com; s=arc-20160816; b=J4BA0dvaXKNialJCETh5YgpdcuVnloet5lpv34VzGEJEj1rGpKldNBqu2dWTD3RQOz 8Rja3C5ABcC8gghyJBB1Xue4+EeMoGutpfXJJBhbC/DBsw35i7+ZsJRV3EOQi22nEGw/ tE58M3KXB0gHFqbpPy6zzXizM/WMQmH9WIhNvmPv0b9tecf+n7hhxmRKR/TsYvoCKQho 6sCiWWsQF6yxV2jeRJBLaL+vpFT+O8s1kAyzCperYwuNN6f6QY7PY+7nTPbbi2n7Dob3 jM5Sxg0BmOvkkxniUmAeShOuq/fF9PJwmljGT7j0O++nQe4IUOgrpkcqJ39CL8E7rSux b1dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=N0CjjwpIsCiA1S6uAh8eizahoCBP1Ilxlznoe0kQyms=; b=qq1YrUghKaFZwYG+fAnFOOa2VFfxM1QOUKTrYhUM0Xj9nGszKufOjhh9/hjGBKTiWO tLgl8zzUmrkl0mxqAPibxOLnaOwpAPNPfc/3yPggA9YYl2+fBt+8uJUOaegTHEtjHS3J lZSHENF3pSoUk/26jcoCRhMOj6efxzr3fWYmLEY/6AsHhIuI7fVglO0jUqXozUgDIY93 fUvzPNqZV2keJ3b0d3APV6xtSzLg/TwpITqm2mfFdQbNKkdG8ErhPH/yXU3QpB6iZr2I qTSyhfGYXyM553uZc3U4xCiVfuLHy4EohtixsuyNiS2rNpQ1JalEYUM8QCtCazr0QsVb Mx6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="vOkw/zbL"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id s8si1903499jan.65.2021.03.24.07.40.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Mar 2021 07:40:04 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="vOkw/zbL"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:41908 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lP4fz-00005Q-Pt for patch@linaro.org; Wed, 24 Mar 2021 10:40:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51754) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lP4X2-0006gK-R2 for qemu-devel@nongnu.org; Wed, 24 Mar 2021 10:30:50 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:39788) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lP4Wy-0007Sa-6R for qemu-devel@nongnu.org; Wed, 24 Mar 2021 10:30:48 -0400 Received: by mail-wr1-x42c.google.com with SMTP id e18so24679172wrt.6 for ; Wed, 24 Mar 2021 07:30:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=N0CjjwpIsCiA1S6uAh8eizahoCBP1Ilxlznoe0kQyms=; b=vOkw/zbLap2x+zA5/zQSlqry+41cNf/WmO62+1zpsjb5uEg3quh91GjMg4hUkwh9I+ Y0zFb2PzZP3wkp8vJ/AEbuVokmO6QgXN1pwwuERHHxLd36EGd0+v8yN3GuRmjVuddZ6u dLKJeYx/oteF1ztyxF5IeYHeiWutJN8JV8uUfKJFiErfWmeGMlkh3jyDnhve0JgAc0p4 Zc5nt9GVTvlEcWm8wyYAOL18wLKI2FXGaQZaFOxHr5R18X1X7RwEIy13xGGCwpxutqJL ZyKDXe7LUtaxqaJqnnGrmyWAV+9iL24dKTpJnrLyTRPY9IWBUvxJTiR7YYSfADfBJKFx 3iPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=N0CjjwpIsCiA1S6uAh8eizahoCBP1Ilxlznoe0kQyms=; b=FUEa0d4xvoZVbAyTOjx0s3VOuxrEwc0MKKtRayi7KtZxWcsP5Z6WaqjmnEgFQFLLUI ez+alsd3KLG4bTjbnu7Lcd6RwRYln9AsAWkrK3HuAB9rkUmmBcVku6huX03cszTpT6+L FSS5AUb3pF10V4uG4Ad29ilrREp7jH2Q/nDpL9s7opSjRawKqkA+7OIvrJ4Q6mkRLCup FV2TT5Tdt+Joj+SxXIaVzNDGQMejw2GA7MVjbuKen5cxte1fEAdgm+9Psd4SYsaLCTDn ZX8WFEVJUsJ1PE5NU1okXmWJmKekXZQS1AYtyFLlAoGTopSZ54xNs48zIMzi+297EZyV wqUw== X-Gm-Message-State: AOAM531cZoK74gKAANV0owAnAvRVxf3m37dMhkKT2TEZEi57992iK7Py 9BX83WZcyfJ0fJVCkENO31wuvw== X-Received: by 2002:a5d:640b:: with SMTP id z11mr3716466wru.327.1616596242345; Wed, 24 Mar 2021 07:30:42 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id e6sm3524155wrw.60.2021.03.24.07.30.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Mar 2021 07:30:34 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 908671FF98; Wed, 24 Mar 2021 14:30:22 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 09/22] tests/tcg: add HeapInfo checking to semihosting test Date: Wed, 24 Mar 2021 14:30:08 +0000 Message-Id: <20210324143021.8560-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210324143021.8560-1-alex.bennee@linaro.org> References: <20210324143021.8560-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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 , Thomas Huth , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Query the SYS_HEAPINFO semicall and do some basic verification of the information via libc calls. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth Message-Id: <20210323165308.15244-10-alex.bennee@linaro.org> -- 2.20.1 diff --git a/tests/tcg/multiarch/arm-compat-semi/semihosting.c b/tests/tcg/multiarch/arm-compat-semi/semihosting.c index b3fd16cd12..8627eee3cf 100644 --- a/tests/tcg/multiarch/arm-compat-semi/semihosting.c +++ b/tests/tcg/multiarch/arm-compat-semi/semihosting.c @@ -8,9 +8,13 @@ */ #define SYS_WRITE0 0x04 +#define SYS_HEAPINFO 0x16 #define SYS_REPORTEXC 0x18 #include +#include +#include +#include #include "semicall.h" int main(int argc, char *argv[argc]) @@ -21,8 +25,57 @@ int main(int argc, char *argv[argc]) uintptr_t exit_block[2] = {0x20026, 0}; uintptr_t exit_code = (uintptr_t) &exit_block; #endif + struct { + void *heap_base; + void *heap_limit; + void *stack_base; + void *stack_limit; + } info; + void *ptr_to_info = (void *) &info; - __semi_call(SYS_WRITE0, (uintptr_t) "Hello World"); + __semi_call(SYS_WRITE0, (uintptr_t) "Checking HeapInfo\n"); + + memset(&info, 0, sizeof(info)); + __semi_call(SYS_HEAPINFO, (uintptr_t) &ptr_to_info); + + if (info.heap_base == NULL || info.heap_limit == NULL) { + printf("null heap: %p -> %p\n", info.heap_base, info.heap_limit); + exit(1); + } + + /* Error if heap base is above limit */ + if ((uintptr_t) info.heap_base >= (uintptr_t) info.heap_limit) { + printf("heap base %p >= heap_limit %p\n", + info.heap_base, info.heap_limit); + exit(2); + } + + if (info.stack_base == NULL || info.stack_limit) { + printf("null stack: %p -> %p\n", info.stack_base, info.stack_limit); + exit(3); + } + + /* check our local variables are indeed inside the reported stack */ + if (ptr_to_info > info.stack_base) { + printf("info appears to be above stack: %p > %p\n", ptr_to_info, + info.stack_base); + exit(4); + } else if (ptr_to_info < info.stack_limit) { + printf("info appears to be outside stack: %p < %p\n", ptr_to_info, + info.stack_limit); + exit(5); + } + + if (ptr_to_info > info.heap_base && ptr_to_info < info.heap_limit) { + printf("info appears to be inside the heap: %p in %p:%p\n", + ptr_to_info, info.heap_base, info.heap_limit); + exit(6); + } + + printf("heap: %p -> %p\n", info.heap_base, info.heap_limit); + printf("stack: %p -> %p\n", info.stack_base, info.stack_limit); + + __semi_call(SYS_WRITE0, (uintptr_t) "Passed HeapInfo checks"); __semi_call(SYS_REPORTEXC, exit_code); /* if we get here we failed */ return -1; From patchwork Wed Mar 24 14:30:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 407826 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp468598jai; Wed, 24 Mar 2021 07:38:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyI1VxHaFJBaH/thU9/hgo2ldRdMWH1uR0hjcVI+ugBRUxd3JVCyW/Drmic34zUG1nu+Gwa X-Received: by 2002:a5e:de0d:: with SMTP id e13mr2697084iok.208.1616596682458; Wed, 24 Mar 2021 07:38:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616596682; cv=none; d=google.com; s=arc-20160816; b=RWITi72bjgs2WKNNgxCLg3MiDHotd6MpdklG5RMeZXkRmvZg2BToIv36HOxqyhSuDU u4UdL4x5L9HwSZ75ItSS7xUO4vdz6wzFLYb9innzm0PeIJM4wvhF7ivEtf2QAzG9YddP v7w1k2NtJYYK2USEoyXMIqugiqWs18fFzFn4KB0rGf/w8POk41CAsXM12X2ECYU0UFHe BDd+53+cDwxGra/246aUAdlDooz+fUeMquBoLgUBwAg7crIeed/YOBz7hs2bteMImH1y a5OflFjLLjpGxbJKFfTOBo1u8E6AYGIHyCj8O1Tpvazw6uTf5Y9hP926eqTt1qBxBOU8 cjIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=iTIRV2au7uDnVgnh+e3nvQfcgQFM6RJm5G7qLpBLBrw=; b=Q1OarfoTfQFTv71ZMFGuRT3ElpvWtb2GnOs78TRxu1FUdIYoxysJ0v8mhNwHwxFfV2 sJPQ8oKMmO8v3bfggkQbTzPUcKfaLFbUZ8o25omZ3yBqlYXH71jSeFiomULjVyJgAsC1 irybUM1QuxvhlrQFGplHbzOJiUzR6MNp0tyFMnD30n0mEoQZo/biLZMB89zkzFaIwgZj hANry6uW0L2WKfRu77+qNIRBm7igRpum9HBs8gA9/7SkdYJhwORAyCl/kErMO6LmUOJS qsj3qPy1YcMnJ1CLtLnW/Y+KcmLXL30bBZgvCSBA7T9uqRrVBmb3DWrCfDysH2o8hg+v gwDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=i4NTPUhL; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d17si1658169ilu.106.2021.03.24.07.38.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Mar 2021 07:38:02 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=i4NTPUhL; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:36976 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lP4e1-0006Xp-Rf for patch@linaro.org; Wed, 24 Mar 2021 10:38:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51680) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lP4Wv-0006cb-0M for qemu-devel@nongnu.org; Wed, 24 Mar 2021 10:30:41 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:39788) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lP4Ws-0007PD-TB for qemu-devel@nongnu.org; Wed, 24 Mar 2021 10:30:40 -0400 Received: by mail-wr1-x42d.google.com with SMTP id e18so24678876wrt.6 for ; Wed, 24 Mar 2021 07:30:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iTIRV2au7uDnVgnh+e3nvQfcgQFM6RJm5G7qLpBLBrw=; b=i4NTPUhL3a3RmbczQKpO0xNOgJ9+C6oZXifouVcFPbRqWNhGE9rYbTvVjY0Ie94iqC I7UrJB68sw3tfw/1Vb4UYrZFdRsMv7+fhOpNL9Q3Sw/Wm0cqRQa+WNc1pAnYvsAFHil2 YWiyBLq5iljKiL7U/Pi3mcyeVk2fsikJBgedjdgM4zyAgFACEk/JCtUFl2nGcZ7jlqwY pOQLrJ8IeoYCKlJsdvfDGDLFmQ01I1thSqj2SW2ib872Nb54QaghEpMikcPhqGfCEWDi PtYHPDULnS2n1HpBfGERqbtRuPdZ7afOr7/bWVInyJ19VVZVw/m4tgz7trRNoCoyANR7 zIyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iTIRV2au7uDnVgnh+e3nvQfcgQFM6RJm5G7qLpBLBrw=; b=XelBy3I18mY4C58SiXtscXa9WAl1tGhgZKYC6q3sN68KrXZz79Sr4ni9t6YIXqTnIu KIBEa+hRt2ZwBCkzW4c3kOSYIQHpabveCLa4gq1t2iho7/WUyTgAxe8AiPijDzZla6kN U8w8sXyT0JmiklIRbVt7t+tjnJ8pc1nGYHOpEMCzgbpjKyeq2VQ2pWhYe2tqXi1pslqY 1nUjYZire/aQafbacSs2FHuXJMgklXmQMVQw0zVYgD8PZFMZRX4lwYq0FEOt7Em59LGe XvD2J4nGCEarXm2ZAHwbFGFAE+2yZC6X12Z3PaKK720ZstUQjohfJ/mZuiCqR4ANhMf+ ZGsQ== X-Gm-Message-State: AOAM530qGPIVqxsqgulqqvI7xXHJEV8bvtDSDNNYzS5JmhOYxankcqBZ FPFd3ebbG+qME1YwiIMkULXFhF7imtyIs3oL X-Received: by 2002:adf:b355:: with SMTP id k21mr3896250wrd.156.1616596237423; Wed, 24 Mar 2021 07:30:37 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id n8sm2158632wrm.70.2021.03.24.07.30.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Mar 2021 07:30:34 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id A79801FF99; Wed, 24 Mar 2021 14:30:22 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 10/22] gitlab-ci.yml: Merge the trace-backend testing into other jobs Date: Wed, 24 Mar 2021 14:30:09 +0000 Message-Id: <20210324143021.8560-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210324143021.8560-1-alex.bennee@linaro.org> References: <20210324143021.8560-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , qemu-devel@nongnu.org, Wainer dos Santos Moschetta , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , Willian Rampazzo , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Thomas Huth Our gitlab-ci got quite slow in the past weeks, due to the immense amount of jobs that we have, so we should try to reduce the number of jobs. There is no real good reason for having separate jobs just to test the trace backends, we can do this just fine in other jobs, too. Signed-off-by: Thomas Huth Signed-off-by: Alex Bennée Reviewed-by: Wainer dos Santos Moschetta Reviewed-by: Willian Rampazzo Message-Id: <20210319095726.45965-1-thuth@redhat.com> Message-Id: <20210323165308.15244-11-alex.bennee@linaro.org> -- 2.20.1 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f65cb11c4d..f746d5fbea 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -87,7 +87,7 @@ build-system-alpine: TARGETS: aarch64-softmmu alpha-softmmu cris-softmmu hppa-softmmu moxie-softmmu microblazeel-softmmu mips64el-softmmu MAKE_CHECK_ARGS: check-build - CONFIGURE_ARGS: --enable-docs + CONFIGURE_ARGS: --enable-docs --enable-trace-backends=log,simple,syslog artifacts: expire_in: 2 days paths: @@ -605,7 +605,7 @@ tsan-build: variables: IMAGE: ubuntu2004 CONFIGURE_ARGS: --enable-tsan --cc=clang-10 --cxx=clang++-10 --disable-docs - --enable-fdt=system --enable-slirp=system + --enable-trace-backends=ust --enable-fdt=system --enable-slirp=system TARGETS: x86_64-softmmu ppc64-softmmu riscv64-softmmu x86_64-linux-user MAKE_CHECK_ARGS: bench V=1 @@ -702,6 +702,7 @@ build-coroutine-sigaltstack: variables: IMAGE: ubuntu2004 CONFIGURE_ARGS: --with-coroutine=sigaltstack --disable-tcg + --enable-trace-backends=ftrace MAKE_CHECK_ARGS: check-unit # Most jobs test latest gcrypt or nettle builds @@ -739,31 +740,6 @@ crypto-only-gnutls: MAKE_CHECK_ARGS: check -# We don't need to exercise every backend with every front-end -build-trace-multi-user: - <<: *native_build_job_definition - needs: - job: amd64-ubuntu2004-container - variables: - IMAGE: ubuntu2004 - CONFIGURE_ARGS: --enable-trace-backends=log,simple,syslog --disable-system - -build-trace-ftrace-system: - <<: *native_build_job_definition - needs: - job: amd64-ubuntu2004-container - variables: - IMAGE: ubuntu2004 - CONFIGURE_ARGS: --enable-trace-backends=ftrace --target-list=x86_64-softmmu - -build-trace-ust-system: - <<: *native_build_job_definition - needs: - job: amd64-ubuntu2004-container - variables: - IMAGE: ubuntu2004 - CONFIGURE_ARGS: --enable-trace-backends=ust --target-list=x86_64-softmmu - # Check our reduced build configurations build-without-default-devices: <<: *native_build_job_definition From patchwork Wed Mar 24 14:30:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 407827 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp469433jai; Wed, 24 Mar 2021 07:39:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy41FN6BBxMoXVVEG73XwaAuKzsaBuKXu+w8GILKC761+KmrB8d7CoxM+w8ZdfiO+b4XLzx X-Received: by 2002:a05:6638:191c:: with SMTP id p28mr3222649jal.39.1616596748926; Wed, 24 Mar 2021 07:39:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616596748; cv=none; d=google.com; s=arc-20160816; b=qPMYH0xIE+iJASJE6bLlxtu3x7QsfibR9R2/HX3o3+xzRckznWjii8wBJO913yrb6J ceh4wZknyryrvCBWKvf8IPqCJeBv7JlQKuIAaoICCT/+NZJVbs7CfD1TXtTCSvsMvcV7 0DzOkeybYSThrFmiKfbgUctMrzNUeA3ko/XmLE9PG0l64+4yz3RyW92KdBdZQEFRL92I 7PEmBzPwSgB2OXD99C1khXE811EY85U/cSwiIS8A1NnsGfxuUJ2g10kC4jMn960apLi2 YZ20pWfnoMUE6fO4GtRIIg9Au7LM28mmL7lNRsucpxFQcW1F3oKlOlo7glTbwx7xWfs5 loUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=EQ6CyjRWV4zJk3tXYM7i3XWmVgXsciBwzt1eUVUQ5Yg=; b=Mq292mVr0C+4Tg5059ZyQNUO4Aoros84JFWThyyrfAblrQtrQ7cA+2Q4iFAhQ2Wa8F BRq+PpbIky+Ddl/+ftBCgJsumO+fkyfn02l2BtmkIZEnrRrmVpBuUfmgaOyl/qz28Vfe yB05AZJOfF6ts0zD+TEgroPo/G8v7Xf0YoFolP2Ue44CjT4QDrxaiSG4uH/ujr7NUJkD wZ7yVtlJbcJFN6U9+fDUc+rcWsVCFul4ffcglGQ9SBXCTg1X0JV+5Kazt35Fe4gZiAWv QSJHjxmESIFOTBml8wZ4dBKq60VcG6beho84E/01jsfMgePsUbX33LUguSx9WN6QLooE 6lMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=u+Z2H6T3; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id i14si1628977ilu.67.2021.03.24.07.39.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Mar 2021 07:39:08 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=u+Z2H6T3; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:41132 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lP4f6-0008EC-AG for patch@linaro.org; Wed, 24 Mar 2021 10:39:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51678) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lP4Wu-0006bd-Ex for qemu-devel@nongnu.org; Wed, 24 Mar 2021 10:30:40 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:33422) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lP4Ws-0007Oa-5h for qemu-devel@nongnu.org; Wed, 24 Mar 2021 10:30:40 -0400 Received: by mail-wr1-x434.google.com with SMTP id o16so24691179wrn.0 for ; Wed, 24 Mar 2021 07:30:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=EQ6CyjRWV4zJk3tXYM7i3XWmVgXsciBwzt1eUVUQ5Yg=; b=u+Z2H6T3gA4RnkbRTn66m4SURlRxJddVo7Uxi2L07Gxbv29vfX4zHngCptcjLGrzMP 3uXD6CpmuHvp/M474UeefnbW8+6asA7R0n6xaEF5c4Cgfi0m14ZwEgINBUva8gq62OXZ eOE+v5ua0LLR5d5f5Ed63tk7QrZ4ShaAcuP2yXhOKC86OnkXMkPP6k6NO7r2/T25r6bO ge/9Y2JGvN8N8+lsCqvKnRWJxpViHhgNqY+0l5Xbc6oXitnK247iw3Ld4sxcwuR82X1g hcUAgAPUvvQ+ax+Z3oOiD1wG+QUKMUEGPvI4Ib5BprnKUH1wp/nxiLKm00biSP0PFBfg 6xHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=EQ6CyjRWV4zJk3tXYM7i3XWmVgXsciBwzt1eUVUQ5Yg=; b=mFseNNInqK/21IAotyp1xWrM2CJiWFmyENBdJSSNznumAoTWB8uDNj4+PDQ2KpOshZ MsYIZUZr0Tkk074rnrRrFrM4Et85K19JtKgLOh8A4ddos92iaM/cbnnuPwUFQIaOHScR ZOjmopQ95kA7Q2WePZB5QEpI8RznVXKBdl6OTsFZZOaUeOqzUWFAqyaNykh3ZsTqfABy vwkP6wGOUEpmf/mn9/AvpPj0HnK7Rq2qOtRnGsogBJY9ZZ+finN5lKySD9kvLfNTz2kd s3CuAiVAVESYzN387Pj/s9ts6n8TtzI/FekOjIcyvZbxO3EgbOtmo/xu2072gSw41bTV Zdog== X-Gm-Message-State: AOAM533pQtEUf3t1lsRaZXfjr54PgvTsZg+m0BO3c36IbcvFAlnAgLBV MSALeyqW+f1PfofBA3P5/68GPg== X-Received: by 2002:a5d:6684:: with SMTP id l4mr3767163wru.381.1616596236749; Wed, 24 Mar 2021 07:30:36 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id u23sm2759517wmn.26.2021.03.24.07.30.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Mar 2021 07:30:34 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id BEF8E1FF9A; Wed, 24 Mar 2021 14:30:22 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 11/22] configure: Don't use the __atomic_*_16 functions for testing 128-bit support Date: Wed, 24 Mar 2021 14:30:10 +0000 Message-Id: <20210324143021.8560-12-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210324143021.8560-1-alex.bennee@linaro.org> References: <20210324143021.8560-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x434.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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 , Thomas Huth , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, Paolo Bonzini Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Thomas Huth The test for 128-bit atomics is causing trouble with FreeBSD 12.2 and --enable-werror: cc -Werror -fPIE -DPIE -std=gnu99 -Wall -m64 -mcx16 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -Wold-style-definition -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempty-body -Wnested-externs -Wendif-labels -Wexpansion-to-defined -Wno-initializer-overrides -Wno-missing-include-dirs -Wno-shift-negative-value -Wno-string-plus-int -Wno-typedef-redefinition -Wno-tautological-type-limit-compare -fstack-protector-strong -o config-temp/qemu-conf.exe config-temp/qemu-conf.c -pie -Wl,-z,relro -Wl,-z,now -m64 -fstack-protector-strong config-temp/qemu-conf.c:4:7: error: implicit declaration of function '__atomic_load_16' is invalid in C99 [-Werror,-Wimplicit-function-declaration] y = __atomic_load_16(&x, 0); ^ config-temp/qemu-conf.c:5:3: error: implicit declaration of function '__atomic_store_16' is invalid in C99 [-Werror,-Wimplicit-function-declaration] __atomic_store_16(&x, y, 0); ^ config-temp/qemu-conf.c:5:3: note: did you mean '__atomic_load_16'? config-temp/qemu-conf.c:4:7: note: '__atomic_load_16' declared here y = __atomic_load_16(&x, 0); ^ config-temp/qemu-conf.c:6:3: error: implicit declaration of function '__atomic_compare_exchange_16' is invalid in C99 [-Werror,-Wimplicit-function-declaration] __atomic_compare_exchange_16(&x, &y, x, 0, 0, 0); ^ 3 errors generated. Looking for they way we are using atomic functions in QEMU, we are not using these functions with the _16 suffix anyway. Switch to the same functions that we use in the include/qemu/atomic.h header. Signed-off-by: Thomas Huth Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson Acked-by: Paolo Bonzini Message-Id: <20210317110512.583747-2-thuth@redhat.com> Message-Id: <20210323165308.15244-12-alex.bennee@linaro.org> -- 2.20.1 diff --git a/configure b/configure index edf9dc8985..535e6a9269 100755 --- a/configure +++ b/configure @@ -4779,9 +4779,9 @@ if test "$int128" = "yes"; then int main(void) { unsigned __int128 x = 0, y = 0; - y = __atomic_load_16(&x, 0); - __atomic_store_16(&x, y, 0); - __atomic_compare_exchange_16(&x, &y, x, 0, 0, 0); + y = __atomic_load(&x, 0); + __atomic_store(&x, y, 0); + __atomic_compare_exchange(&x, &y, x, 0, 0, 0); return 0; } EOF From patchwork Wed Mar 24 14:30:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 407822 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp465910jai; Wed, 24 Mar 2021 07:34:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwccDrMunbn21qu+lWjtr1N37gjnNM1EePkdcXwX4wO4lXT30dPpXkRWXRWNOhesdGSOuUx X-Received: by 2002:a05:6e02:216a:: with SMTP id s10mr3066909ilv.94.1616596483517; Wed, 24 Mar 2021 07:34:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616596483; cv=none; d=google.com; s=arc-20160816; b=nGTEYKYFMJi7zAOL9ND3mM3YVnLpxkP4a+AycfxS2SBlPaQYqBfLiglaq+g5Luis3I xidvs64bngBczE+BlFHvfQZPmdMck/GJHRil7oWcV6AMYdFrusB0xWZ9nAemXyVBHAcA QbdXaPTKarHqaYUEOcfaYfdBbPNdJVTk7AlJokpDdRm1JtQ2/N2s0QRCuaw5tEb2WvFN 7ZpnRhp9+vnoOI37yP7FEv9Lq/Dx2DF/JcPs8HnXo5pqFV+MoTMZPoUuNoyUTpbgjHfW togRQspIZ0s1BXW93ldVXhHwhFOao/D2nFYZ61Xvvhk9b+FkGdV00JyAgotzpQLFgFRU cGUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=npU6r7xZSGyA8GLtc47RoK9WHIJiinn1HgWpSszKGrI=; b=oX8io6EqpI16NC68scJIi8paqZPUIlOpVvTzZHzI+apQ52r7FMAmW8O/TOYUQr7Srs Znn9xzviBsI56TSvXZJSHbGw6G0b9KeSijx6hDXIR4DrV7CTcsx1g0pirmgOvvMu59Jk DhbTCiPYtA891wdjhbKD2qdwoqZV4mP082vzyYpxw7qd8HNy0AUhS/3fD0YQhAi/iODV 9d7fMf9C78ws7j1qVzpEhr3pb2dsTtXk8A6C4SSGcurFAOlI4HYPDYt8tsqnrq6stzG4 7tmJfjqxf7rVjYx2cAuxPEjJDWhzyJqzklq2lDt79w+KRXgnjVHdMI401a1hg999vbur 6qMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=pRKAgewO; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id s21si1560880iov.70.2021.03.24.07.34.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Mar 2021 07:34:43 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=pRKAgewO; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:53428 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lP4ao-0001he-Sq for patch@linaro.org; Wed, 24 Mar 2021 10:34:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51746) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lP4X0-0006fr-Sa for qemu-devel@nongnu.org; Wed, 24 Mar 2021 10:30:48 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:40589) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lP4Wy-0007Sj-8v for qemu-devel@nongnu.org; Wed, 24 Mar 2021 10:30:46 -0400 Received: by mail-wr1-x42b.google.com with SMTP id v11so24655068wro.7 for ; Wed, 24 Mar 2021 07:30:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=npU6r7xZSGyA8GLtc47RoK9WHIJiinn1HgWpSszKGrI=; b=pRKAgewOPsKbYrGmNBZqECTHNdIR5UKiefbQHVahw/0zhBgVIKZXhpwjsRq+SVNfOs JMBLj/mgtGRGE9Bq4J8c+5uTXTSpvowunuJZB9XQxJCpIOfXCEL+ye6M7mCXGOa+rnRu AHAkPgROwYrqIwdQsLbamlB+isxVDTRw4QUNAEL3ODaT8ucad9i9o8Gs77vUlzJC70tI q7pCM9DlmWRO4exclcpVw62d1fov4Q6JS4VHyUru0JcnESE6fi4/VfrJKSoDS+33RpHK SF+JNJC4HQ9aVSwQQj3jPqEjREgM6cT02E3ncFdPqjHLgH27xMEcqiT3fMK7wx7mfXF7 KgGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=npU6r7xZSGyA8GLtc47RoK9WHIJiinn1HgWpSszKGrI=; b=bZ5E5upi2pSB52p1r4YD/232nBunIMJhYtDz1/PBGdX3SnW1GSNClO3u+cFm7Otk71 AdDoHZvmYziv7FtDQt4E7HupoQaF2j42PbVGlRpBPvPwM9ItWgeDaZrIQAC5TcelmB1Y x2RQtClXzxhAIn1fwzNO7lIGWObx6ju0jNtzMhpO3VtYs90a00b4zAjLJZrASTQHyqfD 6SNQfBAR3axeSVm9d/Lrmg9KS3Btsm/aDkUat8qFOumyR+mF7GZ3V8WoQ8Cf7dP/4hSe DTbaDWjfj1w8hyJWMgtpSdL1CA78i8EYWrhbRYXnwG6jCNJNxJ4FFq8aq+3z7pmPtFK6 TNTQ== X-Gm-Message-State: AOAM532BnPnB3SjLk0LwIuLwD65n5vJvKaamlNTvVm9yPSUtA3mEYVUo LcaVIwDVsVPiguSWOkNIiYweDw== X-Received: by 2002:a05:6000:1acb:: with SMTP id i11mr3920246wry.68.1616596242956; Wed, 24 Mar 2021 07:30:42 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id p6sm3419861wru.2.2021.03.24.07.30.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Mar 2021 07:30:34 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id D43EE1FF9B; Wed, 24 Mar 2021 14:30:22 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 12/22] cirrus.yml: Update the FreeBSD task to version 12.2 Date: Wed, 24 Mar 2021 14:30:11 +0000 Message-Id: <20210324143021.8560-13-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210324143021.8560-1-alex.bennee@linaro.org> References: <20210324143021.8560-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , Ed Maste , qemu-devel@nongnu.org, Yonggang Luo , =?utf-8?q?Alex_Benn=C3=A9e?= , Li-Wen Hsu Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Thomas Huth FreeBSD version 12.1 is out of service now, and the task in the Cirrus-CI is failing. Update to 12.2 to get it working again. Unfortunately, there is a bug in libtasn1 that triggers with the new version of Clang that is used there (see this thread for details: https://lists.gnu.org/archive/html/qemu-devel/2021-02/msg00739.html ), so we have to disable gnutls for now to make it work again. We can enable it later again once libtasn1 has been fixed in FreeBSD. Signed-off-by: Thomas Huth Signed-off-by: Alex Bennée Message-Id: <20210319101402.48871-1-thuth@redhat.com> Message-Id: <20210323165308.15244-13-alex.bennee@linaro.org> -- 2.20.1 diff --git a/.cirrus.yml b/.cirrus.yml index bc40a0550d..f53c519447 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -3,7 +3,7 @@ env: freebsd_12_task: freebsd_instance: - image_family: freebsd-12-1 + image_family: freebsd-12-2 cpu: 8 memory: 8G install_script: @@ -13,7 +13,10 @@ freebsd_12_task: script: - mkdir build - cd build - - ../configure --enable-werror || { cat config.log meson-logs/meson-log.txt; exit 1; } + # TODO: Enable gnutls again once FreeBSD's libtasn1 got fixed + # See: https://gitlab.com/gnutls/libtasn1/-/merge_requests/71 + - ../configure --enable-werror --disable-gnutls + || { cat config.log meson-logs/meson-log.txt; exit 1; } - gmake -j$(sysctl -n hw.ncpu) - gmake -j$(sysctl -n hw.ncpu) check V=1 From patchwork Wed Mar 24 14:30:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 407825 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp468351jai; Wed, 24 Mar 2021 07:37:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyKmFtr+bG9U+YyTBzTMUOlaochviHiJ5+4Bd7HNdvyMSu47E2P14nkv/x0thyR1tg3o0dk X-Received: by 2002:a02:ce8d:: with SMTP id y13mr3145534jaq.29.1616596662643; Wed, 24 Mar 2021 07:37:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616596662; cv=none; d=google.com; s=arc-20160816; b=DmB+FujNbBcbDX7S7Ux8P8xCeGjjjRb2ZChwjFwk7lH1jVZunFNWMyHDRHPYsmzZq8 32UTBvezyeREEboQLvhdcaf8ekrZJZBsur8Zmx07YNgBtkeYrOVEnfAH5RNGylHuCky/ k7hzFi/ZCcXzxVXGiwgNzQsyrUgsyHJ9YnZOfojo3LUB7rUrppyQ1e4LgEIHC7YHq27r h4v3r6CZOittPKW2BywODtDT8/RX9Ypf4+3uxmWx2MqqQE8vODJfRtGuCNA9eb8KcmCZ pC3wn+B73GoeJ45Bz2wFqDdNDyBozZmisp6PZvmPUu6/j49x2gHtKkHCdZ3DDjJBgXtv G12A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=Z+eNxdVqj9XwdqB3itCU8v+02JuB6rI1ammJaGntp3g=; b=iYSmbS65XWM950KvyxPWRtLd8myS2h+4pcmVylYnuVRpp8iIGT0pqlpVr6hSBh8vt4 ypP86LORRQOeU+wboM3muzHMWB+cAt4MG+6h9ptuGIcXQwhUVDjqTgjF/CPT/FhPO1as XkkQtQISFa4DxFAY/UhTMzle0B2nEoHgl9vxvOIglf0qIXSWThp2/DWyMsTqBIfCVIbU GlLoZPcP0Go72dpCtuNXX6Bb8iUcERhHWrPlDWZi7KWdF/xX98tE/DG/k5fq60Z7Vr8o 2X5sh2ri8iWcpsBNmeZmCzK7cK1KUmloUh/D8rSkftfSuHwo/KVJzqQTvsFZs0oWUI4j M2wA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="b/VF5N3s"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id x21si1822287jaq.64.2021.03.24.07.37.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Mar 2021 07:37:42 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="b/VF5N3s"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:33172 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lP4dh-0004z5-Uq for patch@linaro.org; Wed, 24 Mar 2021 10:37:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51738) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lP4Wz-0006fN-1u for qemu-devel@nongnu.org; Wed, 24 Mar 2021 10:30:46 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:40597) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lP4Wv-0007RG-NV for qemu-devel@nongnu.org; Wed, 24 Mar 2021 10:30:44 -0400 Received: by mail-wr1-x434.google.com with SMTP id v11so24654904wro.7 for ; Wed, 24 Mar 2021 07:30:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Z+eNxdVqj9XwdqB3itCU8v+02JuB6rI1ammJaGntp3g=; b=b/VF5N3sZPhu1u9I+Vd8cQ0+hbmk4kfe8a8DivCRf4/C3YE0oTJrv07HmasidQZG4I fglb5BUPnppyN6IiVxp/ocYQGS1tc+yXZ0SoF3i5URJJz3SZcyM65veiqL3PmJgM9Uaj INm0FDI7wdhFlnhsUWWLbosdlCQCIig3HkCjQbDiN3hLdgwyTJklX6LB5UflG8CS1SA0 6dS4jUcvk2WdktivCccreHRU5G3wBEa1ESngSB557x5eC/mGPFdnjEddeAGs6jqeTi8u KANyhUwmqxqOzudgaTPO9eTQIbNkkMi7sT8f0+sg34j8ubtZYu8GmDr1u4qBjbb4j7wT 75aA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Z+eNxdVqj9XwdqB3itCU8v+02JuB6rI1ammJaGntp3g=; b=XhKbCrHuXJfINUL6OjG1qXEBWS63TaXGIP3RcutjnMlecIfe1UQZgIE1niRcXQxa+j infKqoVSxHsRnW8QggVqvOhIn+P3HN2Xj6RajWSq/EY58kslctMhLdQRHhPOsfxwkYOC vzIxeLta65fDy+tw13uI07R4NE5/I2ai99qfLyCw3nh1Hyt8uzaq1pSWmsbV9UKRqIQq 4eXvVrdSVKPVaW4CiRp2N4P36QgLSaLkUyGzHEvl/BSwsXWY5DkIsXCb5Q2fNGE2Ykz6 lobEEa7gQWd1PBqN4R0mZM98GBoyDsM4BJHyzKXw3zrlsr4LcweIRGLWMgmkmQxbg9H9 GunA== X-Gm-Message-State: AOAM533Nm+a6jpRdfF3Xn7ZkfOUGx8iaif2TjjKKGZjbcn24pNhkn7sg ER9qYHs0Tn7Ua0Va5VydL1ZhcQ== X-Received: by 2002:adf:c3c8:: with SMTP id d8mr3784686wrg.167.1616596240293; Wed, 24 Mar 2021 07:30:40 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id b15sm2898987wmd.41.2021.03.24.07.30.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Mar 2021 07:30:34 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id EC5B51FF9C; Wed, 24 Mar 2021 14:30:22 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 13/22] utils: Tighter tests for qemu_strtosz Date: Wed, 24 Mar 2021 14:30:12 +0000 Message-Id: <20210324143021.8560-14-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210324143021.8560-1-alex.bennee@linaro.org> References: <20210324143021.8560-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x434.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Thomas Huth , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Eric Blake Our tests were not validating the return value in all cases, nor was it guaranteeing our documented claim that 'res' is unchanged on error. For that matter, it wasn't as thorough as the existing tests for qemu_strtoi() and friends for proving that endptr and res are sanely set. Enhancing the test found one case where we violated our documentation: namely, when failing with EINVAL when endptr is NULL, we shouldn't modify res. Signed-off-by: Eric Blake Signed-off-by: Alex Bennée Reviewed-by: Thomas Huth Message-Id: <20210317143325.2165821-2-eblake@redhat.com> Message-Id: <20210323165308.15244-14-alex.bennee@linaro.org> -- 2.20.1 diff --git a/tests/unit/test-cutils.c b/tests/unit/test-cutils.c index e025b54c05..5908de4fd0 100644 --- a/tests/unit/test-cutils.c +++ b/tests/unit/test-cutils.c @@ -1952,9 +1952,11 @@ static void test_qemu_strtosz_simple(void) const char *str; const char *endptr; int err; - uint64_t res = 0xbaadf00d; + uint64_t res; str = "0"; + endptr = str; + res = 0xbaadf00d; err = qemu_strtosz(str, &endptr, &res); g_assert_cmpint(err, ==, 0); g_assert_cmpint(res, ==, 0); @@ -1962,6 +1964,8 @@ static void test_qemu_strtosz_simple(void) /* Leading 0 gives decimal results, not octal */ str = "08"; + endptr = str; + res = 0xbaadf00d; err = qemu_strtosz(str, &endptr, &res); g_assert_cmpint(err, ==, 0); g_assert_cmpint(res, ==, 8); @@ -1969,46 +1973,61 @@ static void test_qemu_strtosz_simple(void) /* Leading space is ignored */ str = " 12345"; + endptr = str; + res = 0xbaadf00d; err = qemu_strtosz(str, &endptr, &res); g_assert_cmpint(err, ==, 0); g_assert_cmpint(res, ==, 12345); g_assert(endptr == str + 6); + res = 0xbaadf00d; err = qemu_strtosz(str, NULL, &res); g_assert_cmpint(err, ==, 0); g_assert_cmpint(res, ==, 12345); str = "9007199254740991"; /* 2^53-1 */ + endptr = str; + res = 0xbaadf00d; err = qemu_strtosz(str, &endptr, &res); g_assert_cmpint(err, ==, 0); g_assert_cmpint(res, ==, 0x1fffffffffffff); g_assert(endptr == str + 16); str = "9007199254740992"; /* 2^53 */ + endptr = str; + res = 0xbaadf00d; err = qemu_strtosz(str, &endptr, &res); g_assert_cmpint(err, ==, 0); g_assert_cmpint(res, ==, 0x20000000000000); g_assert(endptr == str + 16); str = "9007199254740993"; /* 2^53+1 */ + endptr = str; + res = 0xbaadf00d; err = qemu_strtosz(str, &endptr, &res); g_assert_cmpint(err, ==, 0); g_assert_cmpint(res, ==, 0x20000000000001); g_assert(endptr == str + 16); str = "18446744073709549568"; /* 0xfffffffffffff800 (53 msbs set) */ + endptr = str; + res = 0xbaadf00d; err = qemu_strtosz(str, &endptr, &res); g_assert_cmpint(err, ==, 0); g_assert_cmpint(res, ==, 0xfffffffffffff800); g_assert(endptr == str + 20); str = "18446744073709550591"; /* 0xfffffffffffffbff */ + endptr = str; + res = 0xbaadf00d; err = qemu_strtosz(str, &endptr, &res); g_assert_cmpint(err, ==, 0); g_assert_cmpint(res, ==, 0xfffffffffffffbff); g_assert(endptr == str + 20); str = "18446744073709551615"; /* 0xffffffffffffffff */ + endptr = str; + res = 0xbaadf00d; err = qemu_strtosz(str, &endptr, &res); g_assert_cmpint(err, ==, 0); g_assert_cmpint(res, ==, 0xffffffffffffffff); @@ -2020,21 +2039,27 @@ static void test_qemu_strtosz_hex(void) const char *str; const char *endptr; int err; - uint64_t res = 0xbaadf00d; + uint64_t res; str = "0x0"; + endptr = str; + res = 0xbaadf00d; err = qemu_strtosz(str, &endptr, &res); g_assert_cmpint(err, ==, 0); g_assert_cmpint(res, ==, 0); g_assert(endptr == str + 3); str = "0xab"; + endptr = str; + res = 0xbaadf00d; err = qemu_strtosz(str, &endptr, &res); g_assert_cmpint(err, ==, 0); g_assert_cmpint(res, ==, 171); g_assert(endptr == str + 4); str = "0xae"; + endptr = str; + res = 0xbaadf00d; err = qemu_strtosz(str, &endptr, &res); g_assert_cmpint(err, ==, 0); g_assert_cmpint(res, ==, 174); @@ -2053,44 +2078,60 @@ static void test_qemu_strtosz_units(void) const char *e = "1E"; int err; const char *endptr; - uint64_t res = 0xbaadf00d; + uint64_t res; /* default is M */ + endptr = NULL; + res = 0xbaadf00d; err = qemu_strtosz_MiB(none, &endptr, &res); g_assert_cmpint(err, ==, 0); g_assert_cmpint(res, ==, MiB); g_assert(endptr == none + 1); + endptr = NULL; + res = 0xbaadf00d; err = qemu_strtosz(b, &endptr, &res); g_assert_cmpint(err, ==, 0); g_assert_cmpint(res, ==, 1); g_assert(endptr == b + 2); + endptr = NULL; + res = 0xbaadf00d; err = qemu_strtosz(k, &endptr, &res); g_assert_cmpint(err, ==, 0); g_assert_cmpint(res, ==, KiB); g_assert(endptr == k + 2); + endptr = NULL; + res = 0xbaadf00d; err = qemu_strtosz(m, &endptr, &res); g_assert_cmpint(err, ==, 0); g_assert_cmpint(res, ==, MiB); g_assert(endptr == m + 2); + endptr = NULL; + res = 0xbaadf00d; err = qemu_strtosz(g, &endptr, &res); g_assert_cmpint(err, ==, 0); g_assert_cmpint(res, ==, GiB); g_assert(endptr == g + 2); + endptr = NULL; + res = 0xbaadf00d; err = qemu_strtosz(t, &endptr, &res); g_assert_cmpint(err, ==, 0); g_assert_cmpint(res, ==, TiB); g_assert(endptr == t + 2); + endptr = NULL; + res = 0xbaadf00d; err = qemu_strtosz(p, &endptr, &res); g_assert_cmpint(err, ==, 0); g_assert_cmpint(res, ==, PiB); g_assert(endptr == p + 2); + endptr = NULL; + res = 0xbaadf00d; err = qemu_strtosz(e, &endptr, &res); g_assert_cmpint(err, ==, 0); g_assert_cmpint(res, ==, EiB); @@ -2102,9 +2143,11 @@ static void test_qemu_strtosz_float(void) const char *str; int err; const char *endptr; - uint64_t res = 0xbaadf00d; + uint64_t res; str = "0.5E"; + endptr = str; + res = 0xbaadf00d; err = qemu_strtosz(str, &endptr, &res); g_assert_cmpint(err, ==, 0); g_assert_cmpint(res, ==, EiB / 2); @@ -2112,6 +2155,8 @@ static void test_qemu_strtosz_float(void) /* For convenience, a fraction of 0 is tolerated even on bytes */ str = "1.0B"; + endptr = str; + res = 0xbaadf00d; err = qemu_strtosz(str, &endptr, &res); g_assert_cmpint(err, ==, 0); g_assert_cmpint(res, ==, 1); @@ -2119,6 +2164,8 @@ static void test_qemu_strtosz_float(void) /* An empty fraction is tolerated */ str = "1.k"; + endptr = str; + res = 0xbaadf00d; err = qemu_strtosz(str, &endptr, &res); g_assert_cmpint(err, ==, 0); g_assert_cmpint(res, ==, 1024); @@ -2126,6 +2173,8 @@ static void test_qemu_strtosz_float(void) /* For convenience, we permit values that are not byte-exact */ str = "12.345M"; + endptr = str; + res = 0xbaadf00d; err = qemu_strtosz(str, &endptr, &res); g_assert_cmpint(err, ==, 0); g_assert_cmpint(res, ==, (uint64_t) (12.345 * MiB + 0.5)); @@ -2140,67 +2189,91 @@ static void test_qemu_strtosz_invalid(void) uint64_t res = 0xbaadf00d; str = ""; + endptr = NULL; err = qemu_strtosz(str, &endptr, &res); g_assert_cmpint(err, ==, -EINVAL); + g_assert_cmpint(res, ==, 0xbaadf00d); g_assert(endptr == str); str = " \t "; + endptr = NULL; err = qemu_strtosz(str, &endptr, &res); g_assert_cmpint(err, ==, -EINVAL); + g_assert_cmpint(res, ==, 0xbaadf00d); g_assert(endptr == str); str = "crap"; + endptr = NULL; err = qemu_strtosz(str, &endptr, &res); g_assert_cmpint(err, ==, -EINVAL); + g_assert_cmpint(res, ==, 0xbaadf00d); g_assert(endptr == str); str = "inf"; + endptr = NULL; err = qemu_strtosz(str, &endptr, &res); g_assert_cmpint(err, ==, -EINVAL); + g_assert_cmpint(res, ==, 0xbaadf00d); g_assert(endptr == str); str = "NaN"; + endptr = NULL; err = qemu_strtosz(str, &endptr, &res); g_assert_cmpint(err, ==, -EINVAL); + g_assert_cmpint(res, ==, 0xbaadf00d); g_assert(endptr == str); /* Fractional values require scale larger than bytes */ str = "1.1B"; + endptr = NULL; err = qemu_strtosz(str, &endptr, &res); g_assert_cmpint(err, ==, -EINVAL); + g_assert_cmpint(res, ==, 0xbaadf00d); g_assert(endptr == str); str = "1.1"; + endptr = NULL; err = qemu_strtosz(str, &endptr, &res); g_assert_cmpint(err, ==, -EINVAL); + g_assert_cmpint(res, ==, 0xbaadf00d); g_assert(endptr == str); /* No floating point exponents */ str = "1.5e1k"; + endptr = NULL; err = qemu_strtosz(str, &endptr, &res); g_assert_cmpint(err, ==, -EINVAL); + g_assert_cmpint(res, ==, 0xbaadf00d); g_assert(endptr == str); str = "1.5E+0k"; + endptr = NULL; err = qemu_strtosz(str, &endptr, &res); g_assert_cmpint(err, ==, -EINVAL); + g_assert_cmpint(res, ==, 0xbaadf00d); g_assert(endptr == str); /* No hex fractions */ str = "0x1.8k"; + endptr = NULL; err = qemu_strtosz(str, &endptr, &res); g_assert_cmpint(err, ==, -EINVAL); + g_assert_cmpint(res, ==, 0xbaadf00d); g_assert(endptr == str); /* No negative values */ str = "-0"; + endptr = NULL; err = qemu_strtosz(str, &endptr, &res); g_assert_cmpint(err, ==, -EINVAL); + g_assert_cmpint(res, ==, 0xbaadf00d); g_assert(endptr == str); str = "-1"; + endptr = NULL; err = qemu_strtosz(str, &endptr, &res); g_assert_cmpint(err, ==, -EINVAL); + g_assert_cmpint(res, ==, 0xbaadf00d); g_assert(endptr == str); } @@ -2209,48 +2282,72 @@ static void test_qemu_strtosz_trailing(void) const char *str; const char *endptr; int err; - uint64_t res = 0xbaadf00d; + uint64_t res; str = "123xxx"; + endptr = NULL; + res = 0xbaadf00d; err = qemu_strtosz_MiB(str, &endptr, &res); + g_assert_cmpint(err, ==, 0); g_assert_cmpint(res, ==, 123 * MiB); g_assert(endptr == str + 3); + res = 0xbaadf00d; err = qemu_strtosz(str, NULL, &res); g_assert_cmpint(err, ==, -EINVAL); + g_assert_cmpint(res, ==, 0xbaadf00d); str = "1kiB"; + endptr = NULL; + res = 0xbaadf00d; err = qemu_strtosz(str, &endptr, &res); g_assert_cmpint(err, ==, 0); g_assert_cmpint(res, ==, 1024); g_assert(endptr == str + 2); + res = 0xbaadf00d; err = qemu_strtosz(str, NULL, &res); g_assert_cmpint(err, ==, -EINVAL); + g_assert_cmpint(res, ==, 0xbaadf00d); str = "0x"; + endptr = NULL; + res = 0xbaadf00d; err = qemu_strtosz(str, &endptr, &res); + g_assert_cmpint(err, ==, 0); g_assert_cmpint(res, ==, 0); g_assert(endptr == str + 1); + res = 0xbaadf00d; err = qemu_strtosz(str, NULL, &res); g_assert_cmpint(err, ==, -EINVAL); + g_assert_cmpint(res, ==, 0xbaadf00d); str = "0.NaN"; + endptr = NULL; + res = 0xbaadf00d; err = qemu_strtosz(str, &endptr, &res); g_assert_cmpint(err, ==, 0); + g_assert_cmpint(res, ==, 0); g_assert(endptr == str + 2); + res = 0xbaadf00d; err = qemu_strtosz(str, NULL, &res); g_assert_cmpint(err, ==, -EINVAL); + g_assert_cmpint(res, ==, 0xbaadf00d); str = "123-45"; + endptr = NULL; + res = 0xbaadf00d; err = qemu_strtosz(str, &endptr, &res); + g_assert_cmpint(err, ==, 0); g_assert_cmpint(res, ==, 123); g_assert(endptr == str + 3); + res = 0xbaadf00d; err = qemu_strtosz(str, NULL, &res); g_assert_cmpint(err, ==, -EINVAL); + g_assert_cmpint(res, ==, 0xbaadf00d); } static void test_qemu_strtosz_erange(void) @@ -2261,13 +2358,17 @@ static void test_qemu_strtosz_erange(void) uint64_t res = 0xbaadf00d; str = "18446744073709551616"; /* 2^64; see strtosz_simple for 2^64-1 */ + endptr = NULL; err = qemu_strtosz(str, &endptr, &res); g_assert_cmpint(err, ==, -ERANGE); + g_assert_cmpint(res, ==, 0xbaadf00d); g_assert(endptr == str + 20); str = "20E"; + endptr = NULL; err = qemu_strtosz(str, &endptr, &res); g_assert_cmpint(err, ==, -ERANGE); + g_assert_cmpint(res, ==, 0xbaadf00d); g_assert(endptr == str + 3); } @@ -2276,15 +2377,19 @@ static void test_qemu_strtosz_metric(void) const char *str; int err; const char *endptr; - uint64_t res = 0xbaadf00d; + uint64_t res; str = "12345k"; + endptr = str; + res = 0xbaadf00d; err = qemu_strtosz_metric(str, &endptr, &res); g_assert_cmpint(err, ==, 0); g_assert_cmpint(res, ==, 12345000); g_assert(endptr == str + 6); str = "12.345M"; + endptr = str; + res = 0xbaadf00d; err = qemu_strtosz_metric(str, &endptr, &res); g_assert_cmpint(err, ==, 0); g_assert_cmpint(res, ==, 12345000); diff --git a/util/cutils.c b/util/cutils.c index c442882b88..b425ed6570 100644 --- a/util/cutils.c +++ b/util/cutils.c @@ -362,7 +362,6 @@ static int do_strtosz(const char *nptr, const char **end, } } - *result = val; retval = 0; out: @@ -371,6 +370,9 @@ out: } else if (*endptr) { retval = -EINVAL; } + if (retval == 0) { + *result = val; + } return retval; } From patchwork Wed Mar 24 14:30:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 407830 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp471673jai; Wed, 24 Mar 2021 07:42:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx77wOtzIGPTKHjNYlkF0ZxBEBIadKaojjA3UdGM7NHVfCs5CzrE46XCrwGV3i/rj4XSPWT X-Received: by 2002:a05:6e02:1d95:: with SMTP id h21mr2969193ila.276.1616596934854; Wed, 24 Mar 2021 07:42:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616596934; cv=none; d=google.com; s=arc-20160816; b=eq/Efhwq/qjTRqWf3KrHZw3Z1go6LvKTOYR9T9vHA+Ya2+hcQp+tBRISJ+879HksW0 JBcIaFhltDakvx5FY5dHfMdfKf3G5S+LtQDfA4FbgF6rHIbgVR3oGB4rN6q2aapS+qGn rgm5EOxxZoqKhBKFcspQixUdJXJftF85IdGG9UZPCtBlcvfnuWvgnsMnchEjmxglsrOk K2BeFK84yXMHTpThHE7Fa2PjMC8Te4DVP91nwhr14Nj+GYtYNcj1QX2mMLi0dJyKUjZ3 SNdGD00j7gD2uXgHLoy2X4CCvzhs14eEJvmx1yTR+YMT6rQl5oeYTuDiLjDDN59uJyiL Ok6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=AfuU0XAxoVYMVMyAnGddSWe2J1DQfdiLrSJW8lizDJE=; b=lh/p5SUYLeDpYhfgI/IJOzEnFjZtXmShm5Y8Y/nEMoNWw/p2mSFLTodBjcXJv7cIVX 8Va+8HlI6nS410024hpVE2dBHkZRms4CFJibm7RORcEsUgZ6a0d0GBkvJ2oPdnLI8K3+ V5x81gy72mp0kK3Pe0WjvTqVCreQW1suxIJ80RohkNlvpwyNZ/W6x9teTf4wLk6oZY9X LnGkx+ir6NWdPkMxI1LmEOSIagaS+hd3zW8mZ20uDMctUeY4aVqVoxCO1i04Ab2LJBFm NxmIjHM9YPw/a64sYHCudfM8HPYfrFhgcExKSBQ8+IyEbhDVK3PbDAmtImrahp6rj6EP FV4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=yuUe7QYH; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 15si1817172ilz.9.2021.03.24.07.42.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Mar 2021 07:42:14 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=yuUe7QYH; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:49756 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lP4i6-0003JX-2E for patch@linaro.org; Wed, 24 Mar 2021 10:42:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51714) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lP4Wx-0006ez-5A for qemu-devel@nongnu.org; Wed, 24 Mar 2021 10:30:44 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]:34485) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lP4Wv-0007Qs-0F for qemu-devel@nongnu.org; Wed, 24 Mar 2021 10:30:42 -0400 Received: by mail-wm1-x330.google.com with SMTP id n11-20020a05600c4f8bb029010e5cf86347so2804572wmq.1 for ; Wed, 24 Mar 2021 07:30:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=AfuU0XAxoVYMVMyAnGddSWe2J1DQfdiLrSJW8lizDJE=; b=yuUe7QYHdFmKYc4VZGe+F4kPCyMeJTraSrBT6+1s5u9AsWRpyCs6OColnnxmLQaKMZ 4JMpWdMCOt8eEmrabNbBzHkfCzFUPMBQYpYKoNNVI5VsWNjcGtLN+W5RBjTwCykEqBy2 A6J8IQtv7MG5NtpZxWEQ/JP5Vz/uZ3v7D5yYRdXT3YDGWgtQFylnAzBQxtPZT7Mw11Ab K3sf68TGZumNKCGQ6KXnTBOiiLXM90u/q1LnHIKCxryflFr+kGBlVzp8LR1IZnAvO73U PrefQsd+xGbi0XUaPn61gxdlwhInpeif8ghElJzSaTWRfYxMbsYJQieb5VV7BRmIJn4+ 2UMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=AfuU0XAxoVYMVMyAnGddSWe2J1DQfdiLrSJW8lizDJE=; b=AmZp0J39a3kVJ9BaDQoephqAXSmsM91O6U8CKL+RP2H4aqTFu65TD8ngx9WfBcwikk 3LBfeYI+07kcmnefSIq1h0OMb2uPKjSeunWRJsIod6PqX8GBbOUs5aLlmxGgF5glnbZC EwbnbSxcWRBuAIumSN6rUuwN7pXm4UgCaDG5t0kNOmKQjzSMFnhsl7Ad+64C4JeobaQ/ 0FBFciKe1dYk8iLwCCOojFMl7jo1jCpDKdqE0hZHkAN9B3FsqWT7aJFyDoWIUC23uwNI y5PrpU3nTRBNyblfOjHWbC94atWwT2OOCP7BLRb0eycZtAQ1omFJKYmwSml0IO7ODA/s n0Ig== X-Gm-Message-State: AOAM532MwPQbKTp6cFqL4iHUp871IACcudo70lfIQVlpga0/E7CleMnJ Yet2/hEdPUmTkl5RV4PvTvnIug== X-Received: by 2002:a05:600c:198d:: with SMTP id t13mr3303353wmq.73.1616596239541; Wed, 24 Mar 2021 07:30:39 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id w132sm2584902wmg.39.2021.03.24.07.30.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Mar 2021 07:30:34 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 10A061FF9D; Wed, 24 Mar 2021 14:30:23 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 14/22] utils: Work around mingw strto*l bug with 0x Date: Wed, 24 Mar 2021 14:30:13 +0000 Message-Id: <20210324143021.8560-15-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210324143021.8560-1-alex.bennee@linaro.org> References: <20210324143021.8560-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x330.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Thomas Huth , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Eric Blake Mingw recognizes that "0x" has value 0 without setting errno, but fails to advance endptr to the trailing garbage 'x'. This in turn showed up in our recent testsuite additions for qemu_strtosz (commit 1657ba44b4 utils: Enhance testsuite for do_strtosz()); adjust our remaining tests to show that we now work around this windows bug. This patch intentionally fails check-syntax for use of strtol. Signed-off-by: Eric Blake Signed-off-by: Alex Bennée Reviewed-by: Thomas Huth Message-Id: <20210317143325.2165821-3-eblake@redhat.com> Message-Id: <20210323165308.15244-15-alex.bennee@linaro.org> -- 2.20.1 diff --git a/tests/unit/test-cutils.c b/tests/unit/test-cutils.c index 5908de4fd0..98671f1ac3 100644 --- a/tests/unit/test-cutils.c +++ b/tests/unit/test-cutils.c @@ -378,6 +378,15 @@ static void test_qemu_strtoi_hex(void) g_assert_cmpint(err, ==, 0); g_assert_cmpint(res, ==, 0x123); g_assert(endptr == str + strlen(str)); + + str = "0x"; + res = 999; + endptr = &f; + err = qemu_strtoi(str, &endptr, 16, &res); + + g_assert_cmpint(err, ==, 0); + g_assert_cmpint(res, ==, 0); + g_assert(endptr == str + 1); } static void test_qemu_strtoi_max(void) @@ -669,6 +678,15 @@ static void test_qemu_strtoui_hex(void) g_assert_cmpint(err, ==, 0); g_assert_cmphex(res, ==, 0x123); g_assert(endptr == str + strlen(str)); + + str = "0x"; + res = 999; + endptr = &f; + err = qemu_strtoui(str, &endptr, 16, &res); + + g_assert_cmpint(err, ==, 0); + g_assert_cmphex(res, ==, 0); + g_assert(endptr == str + 1); } static void test_qemu_strtoui_max(void) @@ -955,6 +973,15 @@ static void test_qemu_strtol_hex(void) g_assert_cmpint(err, ==, 0); g_assert_cmpint(res, ==, 0x123); g_assert(endptr == str + strlen(str)); + + str = "0x"; + res = 999; + endptr = &f; + err = qemu_strtol(str, &endptr, 16, &res); + + g_assert_cmpint(err, ==, 0); + g_assert_cmpint(res, ==, 0); + g_assert(endptr == str + 1); } static void test_qemu_strtol_max(void) @@ -1244,6 +1271,15 @@ static void test_qemu_strtoul_hex(void) g_assert_cmpint(err, ==, 0); g_assert_cmphex(res, ==, 0x123); g_assert(endptr == str + strlen(str)); + + str = "0x"; + res = 999; + endptr = &f; + err = qemu_strtoul(str, &endptr, 16, &res); + + g_assert_cmpint(err, ==, 0); + g_assert_cmphex(res, ==, 0); + g_assert(endptr == str + 1); } static void test_qemu_strtoul_max(void) @@ -1528,6 +1564,15 @@ static void test_qemu_strtoi64_hex(void) g_assert_cmpint(err, ==, 0); g_assert_cmpint(res, ==, 0x123); g_assert(endptr == str + strlen(str)); + + str = "0x"; + endptr = &f; + res = 999; + err = qemu_strtoi64(str, &endptr, 16, &res); + + g_assert_cmpint(err, ==, 0); + g_assert_cmpint(res, ==, 0); + g_assert(endptr == str + 1); } static void test_qemu_strtoi64_max(void) @@ -1815,6 +1860,15 @@ static void test_qemu_strtou64_hex(void) g_assert_cmpint(err, ==, 0); g_assert_cmphex(res, ==, 0x123); g_assert(endptr == str + strlen(str)); + + str = "0x"; + endptr = &f; + res = 999; + err = qemu_strtou64(str, &endptr, 16, &res); + + g_assert_cmpint(err, ==, 0); + g_assert_cmphex(res, ==, 0); + g_assert(endptr == str + 1); } static void test_qemu_strtou64_max(void) diff --git a/util/cutils.c b/util/cutils.c index b425ed6570..ee908486da 100644 --- a/util/cutils.c +++ b/util/cutils.c @@ -396,9 +396,22 @@ int qemu_strtosz_metric(const char *nptr, const char **end, uint64_t *result) * Helper function for error checking after strtol() and the like */ static int check_strtox_error(const char *nptr, char *ep, - const char **endptr, int libc_errno) + const char **endptr, bool check_zero, + int libc_errno) { assert(ep >= nptr); + + /* Windows has a bug in that it fails to parse 0 from "0x" in base 16 */ + if (check_zero && ep == nptr && libc_errno == 0) { + char *tmp; + + errno = 0; + if (strtol(nptr, &tmp, 10) == 0 && errno == 0 && + (*tmp == 'x' || *tmp == 'X')) { + ep = tmp; + } + } + if (endptr) { *endptr = ep; } @@ -465,7 +478,7 @@ int qemu_strtoi(const char *nptr, const char **endptr, int base, } else { *result = lresult; } - return check_strtox_error(nptr, ep, endptr, errno); + return check_strtox_error(nptr, ep, endptr, lresult == 0, errno); } /** @@ -524,7 +537,7 @@ int qemu_strtoui(const char *nptr, const char **endptr, int base, *result = lresult; } } - return check_strtox_error(nptr, ep, endptr, errno); + return check_strtox_error(nptr, ep, endptr, lresult == 0, errno); } /** @@ -566,7 +579,7 @@ int qemu_strtol(const char *nptr, const char **endptr, int base, errno = 0; *result = strtol(nptr, &ep, base); - return check_strtox_error(nptr, ep, endptr, errno); + return check_strtox_error(nptr, ep, endptr, *result == 0, errno); } /** @@ -613,7 +626,7 @@ int qemu_strtoul(const char *nptr, const char **endptr, int base, if (errno == ERANGE) { *result = -1; } - return check_strtox_error(nptr, ep, endptr, errno); + return check_strtox_error(nptr, ep, endptr, *result == 0, errno); } /** @@ -639,7 +652,7 @@ int qemu_strtoi64(const char *nptr, const char **endptr, int base, QEMU_BUILD_BUG_ON(sizeof(int64_t) != sizeof(long long)); errno = 0; *result = strtoll(nptr, &ep, base); - return check_strtox_error(nptr, ep, endptr, errno); + return check_strtox_error(nptr, ep, endptr, *result == 0, errno); } /** @@ -668,7 +681,7 @@ int qemu_strtou64(const char *nptr, const char **endptr, int base, if (errno == ERANGE) { *result = -1; } - return check_strtox_error(nptr, ep, endptr, errno); + return check_strtox_error(nptr, ep, endptr, *result == 0, errno); } /** @@ -708,7 +721,7 @@ int qemu_strtod(const char *nptr, const char **endptr, double *result) errno = 0; *result = strtod(nptr, &ep); - return check_strtox_error(nptr, ep, endptr, errno); + return check_strtox_error(nptr, ep, endptr, false, errno); } /** From patchwork Wed Mar 24 14:30:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 407839 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp480391jai; Wed, 24 Mar 2021 07:54:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLMyeMVZKutdrfK9NLex1QCNXePGb2pewuxcbloPvLtLMIWPYsuUtEwk0ll6IGNndyinnL X-Received: by 2002:a6b:4f09:: with SMTP id d9mr2815713iob.60.1616597677318; Wed, 24 Mar 2021 07:54:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616597677; cv=none; d=google.com; s=arc-20160816; b=Dem3geE8jm1dUpb6OXSBxtWE2+dP29J/Y5p1KPzFiuQLNQTmONqb7ctu8y8byypxl5 O0+ApCntdoqG8OFeeu+XTeIAdghewXj6fsWHgFirOJsxNUB7hVLezdkmQ1bzx3ic4Hxh QRuzEYBNLQJXN1JJ01dDEZ2BSdJVwWLchMrXqICKMeqg6Yu1Lxq0IL7vaRqUGpdvuvGX fChXoONnZS0b3doeuaK68lVJMCN4rzLN9B+QGH7tgFKRJJtgddSFguyRlDD6FO/d0mjS eNsV7CAussVTjwlimMu+23tNh/uD6DS6E/8KtiOCRnMgKaO/Vjz1RsTAPqcY/4fxE5HD c/Ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=J/FXnYHxF99XSKiPCq/PPY58O6zMCmVG8ygc3pMoNMc=; b=IwD3BnuxWTRk3XCisPifqjxxTRat0EhJ6YZM6sBVJPtIQg9DDzfJYp3Cfgl3qq5MJH lleJ6yBpZ1F8FsN3wBJW+iOVp374vpZIov9luu2yKrrkxngP7wYRPBMtzTHORp4Ua6MF cvTqx+iDkpqTv1JHNuDiOwwT0fJFZDq6ZlkNZZx6u6hBA9g49k9YUBcNMo9cw0aK6ATI IJYYPJgqykc5iF8Hans9qrfJAtgnhPuq2Zj0zWdqNHI0JtpqfInpum96NTPjGRco+Nmj aXWhQswBR0AIZiH1SW6CgqFJt+/5OOSVhbc6GMEMBHRTfRzjPwZW3JQhBwyE3gHu/oVI VTZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ONsd0TYm; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id t7si2144479jaj.40.2021.03.24.07.54.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Mar 2021 07:54:37 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ONsd0TYm; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:56282 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lP4u4-00010Y-O3 for patch@linaro.org; Wed, 24 Mar 2021 10:54:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53752) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lP4f9-0000Qw-B9 for qemu-devel@nongnu.org; Wed, 24 Mar 2021 10:39:11 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:43807) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lP4f6-0003S0-2t for qemu-devel@nongnu.org; Wed, 24 Mar 2021 10:39:11 -0400 Received: by mail-wr1-x42b.google.com with SMTP id x7so2238954wrw.10 for ; Wed, 24 Mar 2021 07:39:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=J/FXnYHxF99XSKiPCq/PPY58O6zMCmVG8ygc3pMoNMc=; b=ONsd0TYm5Q/iPi/E6G86ZwK4lJ0zTyF/Oui0hG/tl7350t03aUrAGV8LEp1qAiKgK2 gmZ+HHehEdRKZN6egBZ/slCbnAF/sGlRSTis0JrsnD9p2g1pSF3QXEqKO51aEmSGL2u+ //qCoAxdOQRQMxFDzl9KlUw+7XV6AmiuTbTD/h/lM0oYXMfFvip5/NwuaYCIukbOm3ts Nmmirl2jpCtcDVCWqU1+ZrDJkvoQ6rVY/YJWkySLuSaU1lnaPFp4caLd2TRMJeL6JLXY 1+VA7S0awbIvHi8ippbwIhThcTSxXym3eqkH6EyDTs6qAeHR4t5uV5MXs/LbANtX2kSg LhhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=J/FXnYHxF99XSKiPCq/PPY58O6zMCmVG8ygc3pMoNMc=; b=UYPsYGXyld927FgO1o3JhR+W25bQWZE3KWaZV1YuI1Hl2a3BB8nSd12JggKXOS+v7I 5W1QNc71ZBzrXK8WA8GIg+7okyX7LnV/ssS14fiz0WCD+/ynx/Vs6uBKggSPJNrox2k3 5g9vAgyXlKqYH8S1HixoiUuICWLA+VnzyW28TjEEMkll4/EJoPJf+VwttoHB9V48oQ38 TrlHH2v+6CmYQn9rdUcefBJz02HDYWYLlusXwDycYA2aYi6HdfRzX0BWRWJzfKJUI0nW iPGdQ/kZFxpPRjfoTIgiU/nQ8EHtnIgmZtgHEh2lDrQuwR1lfqOsOQS+UK9XovZxw/O8 gpLw== X-Gm-Message-State: AOAM530TtG6hxJB3oyUIw1cSqvNG3R0DmULGveU1jXW+o+/0wc9AAgri 8Y4d+FM6/WH1Ae2aKiI0qhc05Q== X-Received: by 2002:a5d:550b:: with SMTP id b11mr3899577wrv.313.1616596746593; Wed, 24 Mar 2021 07:39:06 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id r11sm3470853wrm.26.2021.03.24.07.38.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Mar 2021 07:39:03 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 2680F1FF9E; Wed, 24 Mar 2021 14:30:23 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 15/22] gitlab: extend timeouts for CFI builds Date: Wed, 24 Mar 2021 14:30:14 +0000 Message-Id: <20210324143021.8560-16-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210324143021.8560-1-alex.bennee@linaro.org> References: <20210324143021.8560-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , qemu-devel@nongnu.org, Wainer dos Santos Moschetta , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , Willian Rampazzo , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" These builds are running very close to the default build limit and as they are already pared down the only other option is to extend the timeout a little to give some breathing room. Signed-off-by: Alex Bennée Reviewed-by: Thomas Huth Reviewed-by: Willian Rampazzo Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20210323165308.15244-16-alex.bennee@linaro.org> -- 2.20.1 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f746d5fbea..9ffbaa7ffb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -502,6 +502,7 @@ build-cfi-aarch64: --enable-safe-stack --enable-slirp=git TARGETS: aarch64-softmmu MAKE_CHECK_ARGS: check-build + timeout: 70m artifacts: expire_in: 2 days paths: @@ -538,6 +539,7 @@ build-cfi-ppc64-s390x: --enable-safe-stack --enable-slirp=git TARGETS: ppc64-softmmu s390x-softmmu MAKE_CHECK_ARGS: check-build + timeout: 70m artifacts: expire_in: 2 days paths: @@ -574,6 +576,7 @@ build-cfi-x86_64: --enable-safe-stack --enable-slirp=git TARGETS: x86_64-softmmu MAKE_CHECK_ARGS: check-build + timeout: 70m artifacts: expire_in: 2 days paths: From patchwork Wed Mar 24 14:30:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 407837 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp478517jai; Wed, 24 Mar 2021 07:51:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxLJqj0FDjm9s8ZulKMB6hRJngXJ2YmfHGlE5I7peprmviKPNpGF2MJHeC+tJADiKiQXW0M X-Received: by 2002:a05:6e02:148b:: with SMTP id n11mr3138622ilk.6.1616597507502; Wed, 24 Mar 2021 07:51:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616597507; cv=none; d=google.com; s=arc-20160816; b=mmLvaMPln/P3bx3w2n48SNDXZUDvUfuihY4+gVb8QE1U1yQrScA+4qt48fcEDVVHYd anbJYgseyd/yyxEad3yWJNGKPkiif2kxBZVg+nkOtCxWk7Ou9B7Wnr5Gg+HlXvX4ABqB Gg4xApPwHcB/dTSTj+xaKFE5UbUYOVE7+BoQqodAxTF9N3MhJMrEHMfz9/g+EDw6O3Oh 85J5p7255NnMq+Czl2vOeefUxh2sLK5vv+GkQAjtQ0Fx2FhuANAmjL7q82lrwUwyUuul lBxLL1IIVeQIjvoVDIietoUUsfNigGvbtYqY+wxl6zayzDzii0Mt59nq1wfTXPn8GxhE gk0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=Y6jHpz4FecCSC+FwcChPhRloSKRaxaISexMbz45msss=; b=q/qqVP9vXq+P1bfrn2d0DIUkPJeeNtVHHpZKU4rIef8d4t/SFp5iyzFFEifuQ7bnPh kvXbtrzzM7WfcHJUQOAhkF7gs+n89Xw1juP56cFDk3mHx4EtdgdYGUPV8HJf8yDqKuV6 8trAcvWjay+iJnp+/p4BhOVND6Zg6MuIC6tuzoDs8lV6WNLZ+7GiEL498x4mjK0kXN9Z UAKLr76HZZra5NcEPSODmiEiT8zi+mpgTQyZcWPBOT53qg5iK6itTv47nJKJjS5PpqdJ xVAvZZN9F9Y2FlHzsNv6dpghk08RtRCJttWmsSyLrhmKEGc1WpO6GIjBWghV9H5ziX4Q WwXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Ja4y9P2C; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id u12si1771688ilv.137.2021.03.24.07.51.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Mar 2021 07:51:47 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Ja4y9P2C; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:48270 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lP4rK-0006As-Qh for patch@linaro.org; Wed, 24 Mar 2021 10:51:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53670) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lP4f4-0000CQ-4t for qemu-devel@nongnu.org; Wed, 24 Mar 2021 10:39:06 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]:40906) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lP4f0-0003Ou-Or for qemu-devel@nongnu.org; Wed, 24 Mar 2021 10:39:05 -0400 Received: by mail-wm1-x32e.google.com with SMTP id y124-20020a1c32820000b029010c93864955so1321639wmy.5 for ; Wed, 24 Mar 2021 07:39:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Y6jHpz4FecCSC+FwcChPhRloSKRaxaISexMbz45msss=; b=Ja4y9P2CmAEu8kWqsU/GZzgogLXI46BXAzYVbD5Y8X1u+S449cRlQGx8DH2TUxY2aB MryLzOZ+sWM1wjt4zBg6783INd4+TKrYL6weEkaHKQCpMMfdi1pDvOSfxbXwjXVTYB+E RcNu6kiIPNfxO7qLeBLVoLkZkkBsx8tEn9sJBItkhKZhXiv7Q9iPeYUAgX7goAhuaJBO nwBunoT9IMe2xhHUrzFINugVXBZb5EA2O2uhVjzh9ClSdoUC+QPoKDglikV+1pCEzFOR dXbKuJodK+sqXQzOW1R6O1ptZiH7HAlITHmINX2nBLXt/igFh71RSY9P0mgb+CXtOAME Nf+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Y6jHpz4FecCSC+FwcChPhRloSKRaxaISexMbz45msss=; b=OCEf7i2SGuVx3HdGlSKslXH9aHvNcBSYpq6+Rpl93u9+tV+sICIn/Xk3u0XDHdiN8J Sg3T0r2IbBX6uAJwC2O+a+9gl1651vNtJbOf1yqoJObpdNPca8CJAcLPoYqLg/5oMIUH HIeRFgTb+FYu7ZRqbqzPzAzecnqtoDExoUuy7p6Qwz412r8OuZwt9lztc8qsqIcA+Mam LJG+CEjuZNzt6tfzrCie8MEoJdmzO2lapS1SdDc2D3lb35Ufhsp23ZTzsfNtDajX208A z9JO//DamqUOLfvnJnWya/f033d25Dhrfluq7ORtIyYfiBt87zAJSPk7qzYaopjhIbYD xroA== X-Gm-Message-State: AOAM530Pdncy6qbV7huSBwafWHQGtNc9cGFuA/NMGt6ctjjJSiv3lsrI aUzxbc2TxW3nRdFNXkD/VAHxnA== X-Received: by 2002:a05:600c:3515:: with SMTP id h21mr3317745wmq.9.1616596741240; Wed, 24 Mar 2021 07:39:01 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id k13sm3714848wri.27.2021.03.24.07.38.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Mar 2021 07:38:56 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 401B61FF7E; Wed, 24 Mar 2021 14:30:23 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 16/22] qdev: define list of archs with virtio-pci or virtio-ccw Date: Wed, 24 Mar 2021 14:30:15 +0000 Message-Id: <20210324143021.8560-17-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210324143021.8560-1-alex.bennee@linaro.org> References: <20210324143021.8560-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Cornelia Huck , qemu-devel@nongnu.org, Laurent Vivier , Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Laurent Vivier This is used to define virtio-*-pci and virtio-*-ccw aliases rather than substracting the CCW architecture from all the others. Signed-off-by: Laurent Vivier Signed-off-by: Alex Bennée Reviewed-by: Cornelia Huck Message-Id: <20210319202335.2397060-2-laurent@vivier.eu> Message-Id: <20210323165308.15244-17-alex.bennee@linaro.org> -- 2.20.1 diff --git a/include/sysemu/arch_init.h b/include/sysemu/arch_init.h index 54f069d491..0c90706516 100644 --- a/include/sysemu/arch_init.h +++ b/include/sysemu/arch_init.h @@ -35,4 +35,12 @@ extern const uint32_t arch_type; int kvm_available(void); int xen_available(void); +/* default virtio transport per architecture */ +#define QEMU_ARCH_VIRTIO_PCI (QEMU_ARCH_ALPHA | QEMU_ARCH_ARM | \ + QEMU_ARCH_HPPA | QEMU_ARCH_I386 | \ + QEMU_ARCH_MIPS | QEMU_ARCH_PPC | \ + QEMU_ARCH_RISCV | QEMU_ARCH_SH4 | \ + QEMU_ARCH_SPARC | QEMU_ARCH_XTENSA) +#define QEMU_ARCH_VIRTIO_CCW (QEMU_ARCH_S390X) + #endif diff --git a/softmmu/qdev-monitor.c b/softmmu/qdev-monitor.c index 8dc656becc..0b40c97c6e 100644 --- a/softmmu/qdev-monitor.c +++ b/softmmu/qdev-monitor.c @@ -60,34 +60,31 @@ static const QDevAlias qdev_alias_table[] = { { "ES1370", "es1370" }, /* -soundhw name */ { "ich9-ahci", "ahci" }, { "lsi53c895a", "lsi" }, - { "virtio-9p-ccw", "virtio-9p", QEMU_ARCH_S390X }, - { "virtio-9p-pci", "virtio-9p", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X }, - { "virtio-balloon-ccw", "virtio-balloon", QEMU_ARCH_S390X }, - { "virtio-balloon-pci", "virtio-balloon", - QEMU_ARCH_ALL & ~QEMU_ARCH_S390X }, - { "virtio-blk-ccw", "virtio-blk", QEMU_ARCH_S390X }, - { "virtio-blk-pci", "virtio-blk", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X }, - { "virtio-gpu-ccw", "virtio-gpu", QEMU_ARCH_S390X }, - { "virtio-gpu-pci", "virtio-gpu", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X }, - { "virtio-input-host-ccw", "virtio-input-host", QEMU_ARCH_S390X }, - { "virtio-input-host-pci", "virtio-input-host", - QEMU_ARCH_ALL & ~QEMU_ARCH_S390X }, - { "virtio-iommu-pci", "virtio-iommu", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X }, - { "virtio-keyboard-ccw", "virtio-keyboard", QEMU_ARCH_S390X }, - { "virtio-keyboard-pci", "virtio-keyboard", - QEMU_ARCH_ALL & ~QEMU_ARCH_S390X }, - { "virtio-mouse-ccw", "virtio-mouse", QEMU_ARCH_S390X }, - { "virtio-mouse-pci", "virtio-mouse", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X }, - { "virtio-net-ccw", "virtio-net", QEMU_ARCH_S390X }, - { "virtio-net-pci", "virtio-net", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X }, - { "virtio-rng-ccw", "virtio-rng", QEMU_ARCH_S390X }, - { "virtio-rng-pci", "virtio-rng", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X }, - { "virtio-scsi-ccw", "virtio-scsi", QEMU_ARCH_S390X }, - { "virtio-scsi-pci", "virtio-scsi", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X }, - { "virtio-serial-ccw", "virtio-serial", QEMU_ARCH_S390X }, - { "virtio-serial-pci", "virtio-serial", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X }, - { "virtio-tablet-ccw", "virtio-tablet", QEMU_ARCH_S390X }, - { "virtio-tablet-pci", "virtio-tablet", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X }, + { "virtio-9p-ccw", "virtio-9p", QEMU_ARCH_VIRTIO_CCW }, + { "virtio-9p-pci", "virtio-9p", QEMU_ARCH_VIRTIO_PCI }, + { "virtio-balloon-ccw", "virtio-balloon", QEMU_ARCH_VIRTIO_CCW }, + { "virtio-balloon-pci", "virtio-balloon", QEMU_ARCH_VIRTIO_PCI }, + { "virtio-blk-ccw", "virtio-blk", QEMU_ARCH_VIRTIO_CCW }, + { "virtio-blk-pci", "virtio-blk", QEMU_ARCH_VIRTIO_PCI }, + { "virtio-gpu-ccw", "virtio-gpu", QEMU_ARCH_VIRTIO_CCW }, + { "virtio-gpu-pci", "virtio-gpu", QEMU_ARCH_VIRTIO_PCI }, + { "virtio-input-host-ccw", "virtio-input-host", QEMU_ARCH_VIRTIO_CCW }, + { "virtio-input-host-pci", "virtio-input-host", QEMU_ARCH_VIRTIO_PCI }, + { "virtio-iommu-pci", "virtio-iommu", QEMU_ARCH_VIRTIO_PCI }, + { "virtio-keyboard-ccw", "virtio-keyboard", QEMU_ARCH_VIRTIO_CCW }, + { "virtio-keyboard-pci", "virtio-keyboard", QEMU_ARCH_VIRTIO_PCI }, + { "virtio-mouse-ccw", "virtio-mouse", QEMU_ARCH_VIRTIO_CCW }, + { "virtio-mouse-pci", "virtio-mouse", QEMU_ARCH_VIRTIO_PCI }, + { "virtio-net-ccw", "virtio-net", QEMU_ARCH_VIRTIO_CCW }, + { "virtio-net-pci", "virtio-net", QEMU_ARCH_VIRTIO_PCI }, + { "virtio-rng-ccw", "virtio-rng", QEMU_ARCH_VIRTIO_CCW }, + { "virtio-rng-pci", "virtio-rng", QEMU_ARCH_VIRTIO_PCI }, + { "virtio-scsi-ccw", "virtio-scsi", QEMU_ARCH_VIRTIO_CCW }, + { "virtio-scsi-pci", "virtio-scsi", QEMU_ARCH_VIRTIO_PCI }, + { "virtio-serial-ccw", "virtio-serial", QEMU_ARCH_VIRTIO_CCW }, + { "virtio-serial-pci", "virtio-serial", QEMU_ARCH_VIRTIO_PCI}, + { "virtio-tablet-ccw", "virtio-tablet", QEMU_ARCH_VIRTIO_CCW }, + { "virtio-tablet-pci", "virtio-tablet", QEMU_ARCH_VIRTIO_PCI }, { } }; From patchwork Wed Mar 24 14:30:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 407834 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp476583jai; Wed, 24 Mar 2021 07:49:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx6W5aSfF1MBX1nfY3qah5+zsxvIq2Lc5jYIhyKjnk0MkfeZXlpGBX9oDEB49XSejpX51H0 X-Received: by 2002:a05:6e02:1094:: with SMTP id r20mr2884845ilj.154.1616597341355; Wed, 24 Mar 2021 07:49:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616597341; cv=none; d=google.com; s=arc-20160816; b=bLTOQajI/d/okFmQdZxA8mpHWEo8Z7J2pv5W3wil+y4foHpTlTWBYpn+rA18yAwC4m xxCzU7qKsTjhsOsY+ZpM8C9JKG6t20WwDB426Jv8Yok0s43fKhZ5toqGUm+Zx+U8dKpZ gYqnwTftI3C4XtV5Wy4WOiccKl/qj8v/Kq94uMVQIkht6oSj02f2D6i4/WyZ0f8m6XKV h+/XTtg691iDdBQTFl8GWhPhvU4GK505J7SjGTbACWBqDTJJFkYq7LrHv3+Gy6r3S/DL DS1qFrA4tSRcV5NGdFfxjVBk7WyjIC328MaoynK6H/guLKpr7QkOiZc6/WJ7q1RvsT9A ADQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=LYtY8WstaP7kuj1GgptrAmRoMMv/ADLOwkzOGpAVJtI=; b=HM92eriqOHPXv2lWYAhL1TJFDHv5P+sR/m1pnKAtY0Za/5Ivfp2Wp5A8qZEGUpxsDn Ky9xrDr0Wn8q8wpTajTOyBVu/8jvnvBFmbuVOit1wcb40vI8OJItwjzmPyXhcz8QbSme I9MZ/JCUMiZnt8mFV5EwXizTJKgsX86l3YaiB2NVTZahG09ZuF3dNR7IbqwPbkz8839c rIujZQE1zz955AKq/pLDJBruqxK0/PXznYk197bucIa136npr8/6Z89rjD3eJlh6/stg i6Ak63rfQ1kTABVIMWABiezK7+jOp5u2x28cQtX74RUd/pvW/0ClLD53Ocaf6rl+UD6D tkWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=FF3JMkf2; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id z6si1952237ilb.14.2021.03.24.07.49.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Mar 2021 07:49:01 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=FF3JMkf2; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:41030 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lP4oe-00033W-LZ for patch@linaro.org; Wed, 24 Mar 2021 10:49:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53722) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lP4f7-0000K4-1l for qemu-devel@nongnu.org; Wed, 24 Mar 2021 10:39:09 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:40687) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lP4f2-0003Qb-Pp for qemu-devel@nongnu.org; Wed, 24 Mar 2021 10:39:08 -0400 Received: by mail-wr1-x433.google.com with SMTP id v11so24684309wro.7 for ; Wed, 24 Mar 2021 07:39:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=LYtY8WstaP7kuj1GgptrAmRoMMv/ADLOwkzOGpAVJtI=; b=FF3JMkf21WzUKirBnvrpbZOXU2adk8wVK070JInTbEddMbeeDtGnmf29eoNmWaeWbC 8Y6Cyu7Nwsh3wXLFuBPUJcvA56iuYkIRN+3cjs+mEK/AutCLz3icE1m5YP1Je/odqFcV qiQotswVEb5xy+PjOHniOiIsWyVdibLANFvrZuhZgkojpqqegtOLaHdPU39GfEn99WQH DOWlvb2cw9pNwrofXG6E7f9YaKB3g5xS8aPsT3grHtRPXG9fOH9wzct1YJTj8GMluMHq OcntVhIYU0xaysHgPUZBC0C183sNczaXpilTzbG32lJ2TrNyfVq4G8rq2G4ug8pVi/M9 27FQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=LYtY8WstaP7kuj1GgptrAmRoMMv/ADLOwkzOGpAVJtI=; b=dVgdwIkPU7wC3Lh2Dv64jn7y/l3gG52VkJI7SErCaUmiOugjvcL5NM1BK9AyYoGMDM cTHmqaanNwByUZEy4/+aMBtZHaZCIMt7D1/IZQoR6Wn+C4961uymIkUHwq/zxRXSxTWn vFt2uqcF6aHr8NMcUm+YvCgnUweHx00fRntGWeSHjpnUDOGpGlbyV5K/O1qBlFNTrxDr XRGSQAaG/1CWokE6iDCSbP1N/KgsYotTCbEvf2+Q5MYejLzGNSiGpa0M70NvxmPHm/fm bi+ZulcDSd0X3orBy61mdMZNNdDPNhY/zLDBeWUOV2jdx6YeJ5NVfjWM4SGmclcJb7sq u86A== X-Gm-Message-State: AOAM530aJ3/MlkS58HDAsF+6+1vgpzo6XvBMRnhsVhLlz003LKmyeK/z MMegBSsh1Vv5IbLCje+4u+La0g== X-Received: by 2002:a5d:4710:: with SMTP id y16mr3919750wrq.344.1616596743365; Wed, 24 Mar 2021 07:39:03 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id j20sm2664934wmp.30.2021.03.24.07.38.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Mar 2021 07:38:56 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 57DDC1FF9F; Wed, 24 Mar 2021 14:30:23 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 17/22] m68k: add the virtio devices aliases Date: Wed, 24 Mar 2021 14:30:16 +0000 Message-Id: <20210324143021.8560-18-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210324143021.8560-1-alex.bennee@linaro.org> References: <20210324143021.8560-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x433.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Cornelia Huck , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , qemu-devel@nongnu.org, Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= , Laurent Vivier Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Laurent Vivier Similarly to 5f629d943cb0 ("s390x: fix s390 virtio aliases"), define the virtio aliases. This allows to start machines with virtio devices without knowledge of the implementation type. For instance, we can use "-device virtio-scsi" on m68k, s390x or PC, and the device will be respectively "virtio-scsi-device", "virtio-scsi-ccw" or "virtio-scsi-pci". This already exists for s390x and -ccw interfaces, add them for m68k and MMIO (-device) interfaces. Signed-off-by: Laurent Vivier Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Cornelia Huck Message-Id: <20210319202335.2397060-3-laurent@vivier.eu> Message-Id: <20210323165308.15244-18-alex.bennee@linaro.org> -- 2.20.1 diff --git a/include/sysemu/arch_init.h b/include/sysemu/arch_init.h index 0c90706516..16da279696 100644 --- a/include/sysemu/arch_init.h +++ b/include/sysemu/arch_init.h @@ -42,5 +42,6 @@ int xen_available(void); QEMU_ARCH_RISCV | QEMU_ARCH_SH4 | \ QEMU_ARCH_SPARC | QEMU_ARCH_XTENSA) #define QEMU_ARCH_VIRTIO_CCW (QEMU_ARCH_S390X) +#define QEMU_ARCH_VIRTIO_MMIO (QEMU_ARCH_M68K) #endif diff --git a/softmmu/qdev-monitor.c b/softmmu/qdev-monitor.c index 0b40c97c6e..a9955b97a0 100644 --- a/softmmu/qdev-monitor.c +++ b/softmmu/qdev-monitor.c @@ -60,29 +60,41 @@ static const QDevAlias qdev_alias_table[] = { { "ES1370", "es1370" }, /* -soundhw name */ { "ich9-ahci", "ahci" }, { "lsi53c895a", "lsi" }, + { "virtio-9p-device", "virtio-9p", QEMU_ARCH_VIRTIO_MMIO }, { "virtio-9p-ccw", "virtio-9p", QEMU_ARCH_VIRTIO_CCW }, { "virtio-9p-pci", "virtio-9p", QEMU_ARCH_VIRTIO_PCI }, + { "virtio-balloon-device", "virtio-balloon", QEMU_ARCH_VIRTIO_MMIO }, { "virtio-balloon-ccw", "virtio-balloon", QEMU_ARCH_VIRTIO_CCW }, { "virtio-balloon-pci", "virtio-balloon", QEMU_ARCH_VIRTIO_PCI }, + { "virtio-blk-device", "virtio-blk", QEMU_ARCH_VIRTIO_MMIO }, { "virtio-blk-ccw", "virtio-blk", QEMU_ARCH_VIRTIO_CCW }, { "virtio-blk-pci", "virtio-blk", QEMU_ARCH_VIRTIO_PCI }, + { "virtio-gpu-device", "virtio-gpu", QEMU_ARCH_VIRTIO_MMIO }, { "virtio-gpu-ccw", "virtio-gpu", QEMU_ARCH_VIRTIO_CCW }, { "virtio-gpu-pci", "virtio-gpu", QEMU_ARCH_VIRTIO_PCI }, + { "virtio-input-host-device", "virtio-input-host", QEMU_ARCH_VIRTIO_MMIO }, { "virtio-input-host-ccw", "virtio-input-host", QEMU_ARCH_VIRTIO_CCW }, { "virtio-input-host-pci", "virtio-input-host", QEMU_ARCH_VIRTIO_PCI }, { "virtio-iommu-pci", "virtio-iommu", QEMU_ARCH_VIRTIO_PCI }, + { "virtio-keyboard-device", "virtio-keyboard", QEMU_ARCH_VIRTIO_MMIO }, { "virtio-keyboard-ccw", "virtio-keyboard", QEMU_ARCH_VIRTIO_CCW }, { "virtio-keyboard-pci", "virtio-keyboard", QEMU_ARCH_VIRTIO_PCI }, + { "virtio-mouse-device", "virtio-mouse", QEMU_ARCH_VIRTIO_MMIO }, { "virtio-mouse-ccw", "virtio-mouse", QEMU_ARCH_VIRTIO_CCW }, { "virtio-mouse-pci", "virtio-mouse", QEMU_ARCH_VIRTIO_PCI }, + { "virtio-net-device", "virtio-net", QEMU_ARCH_VIRTIO_MMIO }, { "virtio-net-ccw", "virtio-net", QEMU_ARCH_VIRTIO_CCW }, { "virtio-net-pci", "virtio-net", QEMU_ARCH_VIRTIO_PCI }, + { "virtio-rng-device", "virtio-rng", QEMU_ARCH_VIRTIO_MMIO }, { "virtio-rng-ccw", "virtio-rng", QEMU_ARCH_VIRTIO_CCW }, { "virtio-rng-pci", "virtio-rng", QEMU_ARCH_VIRTIO_PCI }, + { "virtio-scsi-device", "virtio-scsi", QEMU_ARCH_VIRTIO_MMIO }, { "virtio-scsi-ccw", "virtio-scsi", QEMU_ARCH_VIRTIO_CCW }, { "virtio-scsi-pci", "virtio-scsi", QEMU_ARCH_VIRTIO_PCI }, + { "virtio-serial-device", "virtio-serial", QEMU_ARCH_VIRTIO_MMIO }, { "virtio-serial-ccw", "virtio-serial", QEMU_ARCH_VIRTIO_CCW }, { "virtio-serial-pci", "virtio-serial", QEMU_ARCH_VIRTIO_PCI}, + { "virtio-tablet-device", "virtio-tablet", QEMU_ARCH_VIRTIO_MMIO }, { "virtio-tablet-ccw", "virtio-tablet", QEMU_ARCH_VIRTIO_CCW }, { "virtio-tablet-pci", "virtio-tablet", QEMU_ARCH_VIRTIO_PCI }, { } From patchwork Wed Mar 24 14:30:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 407833 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp476489jai; Wed, 24 Mar 2021 07:48:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzknEQ+m61HTBvBh6DtPBxTZwbQYIAqaDsmgi+V1NgyDNGWF5m6iSB+zcGeQcWwIIUC4BYO X-Received: by 2002:a02:cd33:: with SMTP id h19mr3208953jaq.88.1616597331502; Wed, 24 Mar 2021 07:48:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616597331; cv=none; d=google.com; s=arc-20160816; b=uvGue2NUOdlJqyazEZVaw0MX6w7fEpl054X9/kh6Pi1Hve8jE2ZULU2TjuZr/uLJCY QuqqGskrEHKlbGQZiTI1A/H5zyrruhhzCgD6g5MxOcGgXC0k7WwJ3uxemonyfadR7DuM nWeBxRoIXIMUa5vsYCMBGyjA3PujWj5DZN7lM1hRu/fFpya5a0WA0wQk34dFrUcPVzke 7xrOHKjCX+cVaZo/3syo6irdTrqu/1Ih0vK7zW+3JfPrjBe6EUr5NqbKVRiNc5R49iLu ES56bTa5dh37przKWXJZRo0RToNlQLL6g/Fai/ZIlq53j3rInjPn6VNZj1d5zuV83fcz VvYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=MGgvFyxsPVyUauSOkbs2e+OMiesteGJSjt/ekiCpmdg=; b=ElIMitnRYuQJW2j59WR6TTYJAJ7p8BFZajIpY+4UzYcy5DZ3ipHnGzceRRTrJOgrTY xdF4uQJ1GRGydm3iIC8zhWTLN8kLHtnQG0KQk25zxSQz3AUynDQwfH3EcYZSbnXxQ3R2 exFnMBdRhtfwI5AxzjwHrwTE1X+dc0h/kOvZ03Z4wwZNPTVl99/4Rzfe761W0EaEplnt qIihuYGouw2MNfXtAqs7rjyahbBsPSST5lmvl8xGHxwsJACX930ZPJdYPTIM0J/DjRmf iNmhifj/QHARrAlTWFyHjL+OCOTktE6c22srm43uPM7xio9RvmQBXbizsGtsRaGv58wH TiiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=aCWZ8ZLL; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id g19si2097025jat.91.2021.03.24.07.48.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Mar 2021 07:48:51 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=aCWZ8ZLL; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:40112 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lP4oU-0002dZ-S0 for patch@linaro.org; Wed, 24 Mar 2021 10:48:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53526) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lP4ey-0008RV-Vf for qemu-devel@nongnu.org; Wed, 24 Mar 2021 10:39:00 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:42966) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lP4ex-0003MZ-7p for qemu-devel@nongnu.org; Wed, 24 Mar 2021 10:39:00 -0400 Received: by mail-wr1-x42c.google.com with SMTP id x13so24684538wrs.9 for ; Wed, 24 Mar 2021 07:38:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MGgvFyxsPVyUauSOkbs2e+OMiesteGJSjt/ekiCpmdg=; b=aCWZ8ZLL1iUerulpZzY/6LCPja/CmOgTTCg3Z5KaKX+vovtghj07T+D/BHiBwQUKB1 GH+F0THMa38wpF9KlnpJLB23S8pMGE9mZoOth706UwdhZvI+oy/ew7FWlJmWiCN1rsz6 O/O9sMluitdJs3mAhAvvehx3vt2wltzaHvTQfYi9qIwHH9D9l6vMZifKI8TxFMAcZIEw Xt8rrSmTPXPdTNsebk4NhdG87ZIBVfq2PrYg9PDGULPcFxfXDc/h6hpO5UHoB49WlY+A f16KLUhwTnP1ERv3cgyPfh68Az3xtamaWO1n5Ei1CJb4WtgfqFgjQbeCJeNgvq3Q8QTK fdTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MGgvFyxsPVyUauSOkbs2e+OMiesteGJSjt/ekiCpmdg=; b=Q6tHcqhangm69BU41X+PjwB1k+1pi3TzY7lVm1K0c9knEj+N3waRhJh8iaIPJ0Olg7 75cr4Cf04NNj3wSkYtuKd43Q8Ieqt7RjuOatuNChAPqxYK4S8SQs/17ERMoM91f0gzMQ ainqB8muX/1Vj7XNX7oQ3qEPpuYmfhIIVSh6m0wRCQJ5WU+VJcmxtyLk/Vdv62L5sHCY SHEaTZhOyF6GTKdXDaPcfdfPA1YFOLOeLF3KmkoDwir/DgmTHJmIPe2NIs8EpKJqSFIW UcAp4GERxNUk3EV6Toyuk5+4qti6PHVwwQvpSdnN+fHDw6licVwqO1/hT1QR+AMPKU1m dEaQ== X-Gm-Message-State: AOAM531gJdnnzy3WJyg+widXyWtV7v+Wul6x7mrwIxYpddOdGvhlTiSk ZmxYwIPIyXqMUwBEXLrZXclcuA== X-Received: by 2002:a5d:4286:: with SMTP id k6mr3810165wrq.278.1616596737470; Wed, 24 Mar 2021 07:38:57 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id s9sm3080311wmh.31.2021.03.24.07.38.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Mar 2021 07:38:56 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 6D9621FFA5; Wed, 24 Mar 2021 14:30:23 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 18/22] blockdev: with -drive if=virtio, use generic virtio-blk Date: Wed, 24 Mar 2021 14:30:17 +0000 Message-Id: <20210324143021.8560-19-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210324143021.8560-1-alex.bennee@linaro.org> References: <20210324143021.8560-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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: Kevin Wolf , "open list:Block layer core" , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, Markus Armbruster , Max Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Laurent Vivier Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Laurent Vivier Rather than checking if the machine is an s390x to use virtio-blk-ccw instead of virtio-blk-pci, use the alias virtio-blk that is set to the expected target. This also enables the use of virtio-blk-device for targets without PCI or CCW. Signed-off-by: Laurent Vivier Signed-off-by: Alex Bennée Tested-by: Philippe Mathieu-Daudé Reviewed-by: Philippe Mathieu-Daudé Acked-by: Markus Armbruster Message-Id: <20210319202335.2397060-4-laurent@vivier.eu> Message-Id: <20210323165308.15244-19-alex.bennee@linaro.org> -- 2.20.1 diff --git a/blockdev.c b/blockdev.c index 621cc3b7c4..a57590aae4 100644 --- a/blockdev.c +++ b/blockdev.c @@ -962,11 +962,7 @@ DriveInfo *drive_new(QemuOpts *all_opts, BlockInterfaceType block_default_type, QemuOpts *devopts; devopts = qemu_opts_create(qemu_find_opts("device"), NULL, 0, &error_abort); - if (arch_type == QEMU_ARCH_S390X) { - qemu_opt_set(devopts, "driver", "virtio-blk-ccw", &error_abort); - } else { - qemu_opt_set(devopts, "driver", "virtio-blk-pci", &error_abort); - } + qemu_opt_set(devopts, "driver", "virtio-blk", &error_abort); qemu_opt_set(devopts, "drive", qdict_get_str(bs_opts, "id"), &error_abort); } From patchwork Wed Mar 24 14:30:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 407832 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp475031jai; Wed, 24 Mar 2021 07:46:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXzfFfWGtYLVWTFYnGM+AYb6zky6ndUMN+ZDCP4AwJoE8kxwc/+n4MzkwL0lErqv8qS5k2 X-Received: by 2002:a05:6602:1207:: with SMTP id y7mr2792797iot.23.1616597203143; Wed, 24 Mar 2021 07:46:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616597203; cv=none; d=google.com; s=arc-20160816; b=unN5S5NtY+FW1Gg0M/Vqky3Wh3oSagSU9G7GR/iGzZjGITHnGW+uwhAPYJdFlNu0Ag UDwOpeYU80gIKxgOSA9UYdjBmHgsc44PmXSSar5itgHB9oky/ZAJSyVvdk7onZl4SnSA iqTwidffoE/W0V6YAxiThPJQuK5gHNDEwPIYAGsnsp2sbtWOvwbeWeQCQgpaanVpoBUE NwYglNy7B9KYnHKaTtNG/xEh3D4192cnDwdxuTiysNMJtmji94XukG166E9qr5hwIMb7 TF1CBQ6BuBnhQuJ63THS06zGBU/tQw/cUICjosJ2E236J7EETx6W531uUdD0eYSLsaP4 FUow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=XksdYAKamza61JCIXgkeNsgm0T3+uDsF6mEoMCxikEk=; b=CiDe10ZQG1GY442Oo0Y7vpE2Laef49JIFY5EzxTh2ZsLsLVkE/yvbVdZ2VeJoZ7OLz N8pNUpRge/5x0bkpH2s5r/mkRyal7hMk3y1rRzShhOrLQenKQx3NSSDXYimUQnMLHkQp obQ8h6JQ/O2YDn+ikXzlZPOX2c13yHaxv+cZEFwa2Osk4d4of6gPoec8OtA7WqqSRU4v swelaJc3gPojkD06+TxPCfbIT/m0St2d2xkS2FgNihfHfx1V/UGQPKCaM1mmTAgcOgms JAsejDDGOQ4mUNfBJw6WcTukQbSOvGZHEzIIPbs7na3Dz0dBb9JZ0OULgRdy64vktd1F +b1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=sQ317gBI; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id p16si1836318ioj.48.2021.03.24.07.46.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Mar 2021 07:46:43 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=sQ317gBI; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:60426 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lP4mQ-0007jm-GS for patch@linaro.org; Wed, 24 Mar 2021 10:46:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53676) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lP4f4-0000DI-Gu for qemu-devel@nongnu.org; Wed, 24 Mar 2021 10:39:06 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:34771) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lP4f0-0003Om-6i for qemu-devel@nongnu.org; Wed, 24 Mar 2021 10:39:06 -0400 Received: by mail-wr1-x429.google.com with SMTP id j7so24718109wrd.1 for ; Wed, 24 Mar 2021 07:39:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XksdYAKamza61JCIXgkeNsgm0T3+uDsF6mEoMCxikEk=; b=sQ317gBIdAIhZ8O1mS8Uy1gYxqiBxjOv7JONf+QtUsdNayBYFYVxbur5ntBmkX8alh Wmkm6VINrmF7ya5XmB63An51h+O7OMJwoN5rUEtzMgxTYbRmyDTe0AC7IPe0OKG0W2aP 57PEZ2MufbpSpSFiINf0X2StaelNgQ0L4i5WVlF0R8H94+Bcu2kNh9i2WEW6mVHfUFF+ LQwu+PnCT5cip9852AQOK4GXbPPYR0Qp2dQUSaNIuP2nam6uVkWs43ANnCtZus3ulzIP K6ZDySbsLjjXbv9WS0LJrxw2NBswDuz+3JpahSJbzdCJisLs8oy5bEuua5PaaFoVL+DL /HfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XksdYAKamza61JCIXgkeNsgm0T3+uDsF6mEoMCxikEk=; b=H26yRvaay+spP6iYAydRvcoPDnG3Hsi+Y/oDbsKokt0A3BkESlwerHCJwRWQjlBFp5 XxE6tKTU9tggUN1RfWKuK+PsLGZ+/8uc/aHigpVq4WK674q+8i26WmEqoxygCnScdPsZ Hda6x3ILWsQsEh8nO/dyA1T/u2mPpPeH0o77fYOSa/+zVyp9/NKEUQc7MZbS0iSE9+Lt U53bje8T4ClxVA+JjvEnJfvDeLmfj/8FF6m8iCAtMejls+T+/dAU9fkzGD/OerX7Ndd9 aXNXoYfOLzsvVqdhGDsCnabr+IikV5XjY/T9ySDlo3ynYAH6cooLyn+a2GinXvTQjg4y mPaQ== X-Gm-Message-State: AOAM531IT3Aow27zlR1wt/j5X7DM4xQLoQGv40yJPrsPldJLb5auGI+S 3qOYEOVk/haY5t6Cz4YbrKOuAw== X-Received: by 2002:adf:ed87:: with SMTP id c7mr3927680wro.9.1616596740504; Wed, 24 Mar 2021 07:39:00 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id m9sm3507775wro.52.2021.03.24.07.38.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Mar 2021 07:38:56 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 9AC551FFA6; Wed, 24 Mar 2021 14:30:23 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 19/22] iotests: Revert "iotests: use -ccw on s390x for 040, 139, and 182" Date: Wed, 24 Mar 2021 14:30:18 +0000 Message-Id: <20210324143021.8560-20-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210324143021.8560-1-alex.bennee@linaro.org> References: <20210324143021.8560-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x429.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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: Kevin Wolf , Thomas Huth , "open list:Block layer core" , =?utf-8?q?Alex_Benn?= =?utf-8?b?w6ll?= , Cornelia Huck , qemu-devel@nongnu.org, Laurent Vivier , "open list:S390 general arch..." , Max Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Laurent Vivier Commit f1d5516ab583 introduces a test in some iotests to check if the machine is a s390-ccw-virtio and to select virtio-*-ccw rather than virtio-*-pci. We don't need that because QEMU already provides aliases to use the correct virtio interface according to the machine type. This patch removes all virtio-*-pci and virtio-*-ccw to use virtio-* instead and remove get_virtio_scsi_device(). This also enables virtio-mmio devices (virtio-*-device) Signed-off-by: Laurent Vivier Signed-off-by: Alex Bennée Tested-by: Philippe Mathieu-Daudé Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Cornelia Huck Message-Id: <20210319202335.2397060-5-laurent@vivier.eu> Message-Id: <20210323165308.15244-20-alex.bennee@linaro.org> -- 2.20.1 diff --git a/tests/qemu-iotests/040 b/tests/qemu-iotests/040 index 336ff7c4f2..ba7cb34ce8 100755 --- a/tests/qemu-iotests/040 +++ b/tests/qemu-iotests/040 @@ -89,7 +89,7 @@ class TestSingleDrive(ImageCommitTestCase): qemu_io('-f', 'raw', '-c', 'write -P 0xab 0 524288', backing_img) qemu_io('-f', iotests.imgfmt, '-c', 'write -P 0xef 524288 524288', mid_img) self.vm = iotests.VM().add_drive(test_img, "node-name=top,backing.node-name=mid,backing.backing.node-name=base", interface="none") - self.vm.add_device(iotests.get_virtio_scsi_device()) + self.vm.add_device('virtio-scsi') self.vm.add_device("scsi-hd,id=scsi0,drive=drive0") self.vm.launch() self.has_quit = False diff --git a/tests/qemu-iotests/051 b/tests/qemu-iotests/051 index f92161d8ef..333cc81818 100755 --- a/tests/qemu-iotests/051 +++ b/tests/qemu-iotests/051 @@ -119,17 +119,7 @@ echo echo === Device without drive === echo -case "$QEMU_DEFAULT_MACHINE" in - s390-ccw-virtio) - virtio_scsi=virtio-scsi-ccw - ;; - *) - virtio_scsi=virtio-scsi-pci - ;; -esac - -run_qemu -device $virtio_scsi -device scsi-hd | - sed -e "s/$virtio_scsi/VIRTIO_SCSI/" +run_qemu -device virtio-scsi -device scsi-hd echo echo === Overriding backing file === diff --git a/tests/qemu-iotests/051.out b/tests/qemu-iotests/051.out index de4771bcb3..437053c839 100644 --- a/tests/qemu-iotests/051.out +++ b/tests/qemu-iotests/051.out @@ -72,7 +72,7 @@ QEMU_PROG: -drive file=TEST_DIR/t.qcow2,node-name=foo#12: Invalid node name === Device without drive === -Testing: -device VIRTIO_SCSI -device scsi-hd +Testing: -device virtio-scsi -device scsi-hd QEMU X.Y.Z monitor - type 'help' for more information (qemu) QEMU_PROG: -device scsi-hd: drive property not set diff --git a/tests/qemu-iotests/051.pc.out b/tests/qemu-iotests/051.pc.out index a28e3fc124..e95bd42b8d 100644 --- a/tests/qemu-iotests/051.pc.out +++ b/tests/qemu-iotests/051.pc.out @@ -72,7 +72,7 @@ QEMU_PROG: -drive file=TEST_DIR/t.qcow2,node-name=foo#12: Invalid node-name: 'fo === Device without drive === -Testing: -device VIRTIO_SCSI -device scsi-hd +Testing: -device virtio-scsi -device scsi-hd QEMU X.Y.Z monitor - type 'help' for more information (qemu) QEMU_PROG: -device scsi-hd: drive property not set diff --git a/tests/qemu-iotests/068 b/tests/qemu-iotests/068 index 03e03508a6..54e49c8ffa 100755 --- a/tests/qemu-iotests/068 +++ b/tests/qemu-iotests/068 @@ -49,11 +49,9 @@ IMG_SIZE=128K case "$QEMU_DEFAULT_MACHINE" in s390-ccw-virtio) platform_parm="-no-shutdown" - hba=virtio-scsi-ccw ;; *) platform_parm="" - hba=virtio-scsi-pci ;; esac @@ -61,7 +59,7 @@ _qemu() { $QEMU $platform_parm -nographic -monitor stdio -serial none \ -drive if=none,id=drive0,file="$TEST_IMG",format="$IMGFMT" \ - -device $hba,id=hba0 \ + -device virtio-scsi,id=hba0 \ -device scsi-hd,drive=drive0 \ "$@" |\ _filter_qemu | _filter_hmp diff --git a/tests/qemu-iotests/093 b/tests/qemu-iotests/093 index 7745cb04b6..93274dc8cb 100755 --- a/tests/qemu-iotests/093 +++ b/tests/qemu-iotests/093 @@ -371,8 +371,7 @@ class ThrottleTestGroupNames(iotests.QMPTestCase): class ThrottleTestRemovableMedia(iotests.QMPTestCase): def setUp(self): self.vm = iotests.VM() - self.vm.add_device("{},id=virtio-scsi".format( - iotests.get_virtio_scsi_device())) + self.vm.add_device("{},id=virtio-scsi".format('virtio-scsi')) self.vm.launch() def tearDown(self): diff --git a/tests/qemu-iotests/139 b/tests/qemu-iotests/139 index e79b3c21fd..178b1ee230 100755 --- a/tests/qemu-iotests/139 +++ b/tests/qemu-iotests/139 @@ -26,18 +26,13 @@ import time base_img = os.path.join(iotests.test_dir, 'base.img') new_img = os.path.join(iotests.test_dir, 'new.img') -if iotests.qemu_default_machine == 's390-ccw-virtio': - default_virtio_blk = 'virtio-blk-ccw' -else: - default_virtio_blk = 'virtio-blk-pci' class TestBlockdevDel(iotests.QMPTestCase): def setUp(self): iotests.qemu_img('create', '-f', iotests.imgfmt, base_img, '1M') self.vm = iotests.VM() - self.vm.add_device("{},id=virtio-scsi".format( - iotests.get_virtio_scsi_device())) + self.vm.add_device("{},id=virtio-scsi".format('virtio-scsi')) self.vm.launch() def tearDown(self): @@ -93,7 +88,7 @@ class TestBlockdevDel(iotests.QMPTestCase): self.checkBlockDriverState(node, expect_error) # Add a device model - def addDeviceModel(self, device, backend, driver = default_virtio_blk): + def addDeviceModel(self, device, backend, driver = 'virtio-blk'): result = self.vm.qmp('device_add', id = device, driver = driver, drive = backend) self.assert_qmp(result, 'return', {}) diff --git a/tests/qemu-iotests/182 b/tests/qemu-iotests/182 index 55a0384c08..fcd1d796eb 100755 --- a/tests/qemu-iotests/182 +++ b/tests/qemu-iotests/182 @@ -46,26 +46,17 @@ _supported_proto file size=32M -case "$QEMU_DEFAULT_MACHINE" in - s390-ccw-virtio) - virtioblk=virtio-blk-ccw - ;; - *) - virtioblk=virtio-blk-pci - ;; -esac - _make_test_img $size echo "Starting QEMU" _launch_qemu -drive file=$TEST_IMG,if=none,id=drive0,file.locking=on \ - -device $virtioblk,drive=drive0 + -device virtio-blk,drive=drive0 echo echo "Starting a second QEMU using the same image should fail" echo 'quit' | $QEMU -nographic -monitor stdio \ -drive file=$TEST_IMG,if=none,id=drive0,file.locking=on \ - -device $virtioblk,drive=drive0 2>&1 | _filter_testdir 2>&1 | + -device virtio-blk,drive=drive0 2>&1 | _filter_testdir 2>&1 | _filter_qemu | sed -e '/falling back to POSIX file/d' \ -e '/locks can be lost unexpectedly/d' diff --git a/tests/qemu-iotests/238 b/tests/qemu-iotests/238 index 8a10af57f1..38bd3744e6 100755 --- a/tests/qemu-iotests/238 +++ b/tests/qemu-iotests/238 @@ -26,14 +26,12 @@ from iotests import log iotests.script_initialize() -virtio_scsi_device = iotests.get_virtio_scsi_device() - vm = iotests.VM() vm.launch() log(vm.qmp('blockdev-add', node_name='hd0', driver='null-co', read_zeroes=True)) log(vm.qmp('object-add', qom_type='iothread', id='iothread0')) -log(vm.qmp('device_add', id='scsi0', driver=virtio_scsi_device, iothread='iothread0')) +log(vm.qmp('device_add', id='scsi0', driver='virtio-scsi', iothread='iothread0')) log(vm.qmp('device_add', id='scsi-hd0', driver='scsi-hd', drive='hd0')) log(vm.qmp('block_set_io_throttle', id='scsi-hd0', bps=0, bps_rd=0, bps_wr=0, iops=1000, iops_rd=0, iops_wr=0, conv_keys=False)) diff --git a/tests/qemu-iotests/240 b/tests/qemu-iotests/240 index ab077f4ceb..9b281e1dc0 100755 --- a/tests/qemu-iotests/240 +++ b/tests/qemu-iotests/240 @@ -42,7 +42,7 @@ class TestCase(iotests.QMPTestCase): iotests.log('==Unplug a SCSI disk and then plug it again==') self.vm.qmp_log('blockdev-add', driver='null-co', read_zeroes=True, node_name='hd0') self.vm.qmp_log('object-add', qom_type='iothread', id="iothread0") - self.vm.qmp_log('device_add', id='scsi0', driver=iotests.get_virtio_scsi_device(), iothread='iothread0', filters=[iotests.filter_qmp_virtio_scsi]) + self.vm.qmp_log('device_add', id='scsi0', driver='virtio-scsi', iothread='iothread0', filters=[iotests.filter_qmp_virtio_scsi]) self.vm.qmp_log('device_add', id='scsi-hd0', driver='scsi-hd', drive='hd0') self.vm.qmp_log('device_del', id='scsi-hd0') self.vm.event_wait('DEVICE_DELETED') @@ -55,7 +55,7 @@ class TestCase(iotests.QMPTestCase): iotests.log('==Attach two SCSI disks using the same block device and the same iothread==') self.vm.qmp_log('blockdev-add', driver='null-co', read_zeroes=True, node_name='hd0', read_only=True) self.vm.qmp_log('object-add', qom_type='iothread', id="iothread0") - self.vm.qmp_log('device_add', id='scsi0', driver=iotests.get_virtio_scsi_device(), iothread='iothread0', filters=[iotests.filter_qmp_virtio_scsi]) + self.vm.qmp_log('device_add', id='scsi0', driver='virtio-scsi', iothread='iothread0', filters=[iotests.filter_qmp_virtio_scsi]) self.vm.qmp_log('device_add', id='scsi-hd0', driver='scsi-hd', drive='hd0') self.vm.qmp_log('device_add', id='scsi-hd1', driver='scsi-hd', drive='hd0') @@ -73,8 +73,8 @@ class TestCase(iotests.QMPTestCase): self.vm.qmp_log('object-add', qom_type='iothread', id="iothread0") self.vm.qmp_log('object-add', qom_type='iothread', id="iothread1") - self.vm.qmp_log('device_add', id='scsi0', driver=iotests.get_virtio_scsi_device(), iothread='iothread0', filters=[iotests.filter_qmp_virtio_scsi]) - self.vm.qmp_log('device_add', id='scsi1', driver=iotests.get_virtio_scsi_device(), iothread='iothread1', filters=[iotests.filter_qmp_virtio_scsi]) + self.vm.qmp_log('device_add', id='scsi0', driver='virtio-scsi', iothread='iothread0', filters=[iotests.filter_qmp_virtio_scsi]) + self.vm.qmp_log('device_add', id='scsi1', driver='virtio-scsi', iothread='iothread1', filters=[iotests.filter_qmp_virtio_scsi]) self.vm.qmp_log('device_add', id='scsi-hd0', driver='scsi-hd', drive='hd0', bus="scsi0.0") self.vm.qmp_log('device_add', id='scsi-hd1', driver='scsi-hd', drive='hd0', bus="scsi1.0") @@ -99,7 +99,7 @@ class TestCase(iotests.QMPTestCase): self.vm.qmp_log('nbd-server-add', device='hd0') self.vm.qmp_log('object-add', qom_type='iothread', id="iothread0") - self.vm.qmp_log('device_add', id='scsi0', driver=iotests.get_virtio_scsi_device(), iothread='iothread0', filters=[iotests.filter_qmp_virtio_scsi]) + self.vm.qmp_log('device_add', id='scsi0', driver='virtio-scsi', iothread='iothread0', filters=[iotests.filter_qmp_virtio_scsi]) self.vm.qmp_log('device_add', id='scsi-hd0', driver='scsi-hd', drive='hd0') if __name__ == '__main__': diff --git a/tests/qemu-iotests/257 b/tests/qemu-iotests/257 index 7cd2520829..c72c82a171 100755 --- a/tests/qemu-iotests/257 +++ b/tests/qemu-iotests/257 @@ -292,7 +292,7 @@ def test_bitmap_sync(bsync_mode, msync_mode='bitmap', failure=None): log('--- Preparing image & VM ---\n') drive0 = Drive(img_path, vm=vm) drive0.img_create(iotests.imgfmt, SIZE) - vm.add_device("{},id=scsi0".format(iotests.get_virtio_scsi_device())) + vm.add_device("{},id=scsi0".format('virtio-scsi')) vm.launch() file_config = { @@ -449,7 +449,7 @@ def test_backup_api(): log('--- Preparing image & VM ---\n') drive0 = Drive(img_path, vm=vm) drive0.img_create(iotests.imgfmt, SIZE) - vm.add_device("{},id=scsi0".format(iotests.get_virtio_scsi_device())) + vm.add_device("{},id=scsi0".format('virtio-scsi')) vm.launch() file_config = { diff --git a/tests/qemu-iotests/307 b/tests/qemu-iotests/307 index 9008974346..c7685347bc 100755 --- a/tests/qemu-iotests/307 +++ b/tests/qemu-iotests/307 @@ -40,13 +40,11 @@ with iotests.FilePath('image') as img, \ iotests.log('=== Launch VM ===') - virtio_scsi_device = iotests.get_virtio_scsi_device() - vm.add_object('iothread,id=iothread0') vm.add_blockdev(f'file,filename={img},node-name=file') vm.add_blockdev(f'{iotests.imgfmt},file=file,node-name=fmt') vm.add_blockdev('raw,file=file,node-name=ro,read-only=on') - vm.add_device(f'id=scsi0,driver={virtio_scsi_device},iothread=iothread0') + vm.add_device(f'id=scsi0,driver=virtio-scsi,iothread=iothread0') vm.launch() vm.qmp_log('nbd-server-start', diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 90d0b62523..1e9e6a066e 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -234,11 +234,6 @@ def qemu_io_silent_check(*args): stderr=subprocess.STDOUT) return exitcode == 0 -def get_virtio_scsi_device(): - if qemu_default_machine == 's390-ccw-virtio': - return 'virtio-scsi-ccw' - return 'virtio-scsi-pci' - class QemuIoInteractive: def __init__(self, *args): self.args = qemu_io_args_no_fmt + list(args) From patchwork Wed Mar 24 14:30:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 407831 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp472024jai; Wed, 24 Mar 2021 07:42:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyGMHVjeHeH0TOUndAvqTC1wFk/kONPjGwE2Lm2sxMFFx2RiCmKPs8Ivcsc3t640E8ekA38 X-Received: by 2002:a6b:8b16:: with SMTP id n22mr2756870iod.79.1616596966685; Wed, 24 Mar 2021 07:42:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616596966; cv=none; d=google.com; s=arc-20160816; b=O+wU2v98IKfEXu0tR80I1oiOtkBZMcUxMrNHOhcLkgcM38Nv5nAzPrDUqOWiXo9El/ mmWP0ojhro8EUL5OD2o6W7GgzGrGzAxfvtSOtzc90vUI1D5WwQN00Wi2bUuGOQA3oIfw hFgYYLApKTMcxgvJ7ryLQjfWO6O7MMatTuQxHOedAROnZmBQ687POthUHOAJ5OoUJP// Jf8QLiAuAkRR34SFwLld0gc9yUX+K3IxbdLxSBYgjuFRGMyUCuV8ePlRYZmxW2AJLobu gHwHsF6VL/APQCX1a/hSFG+ABoDIMF1tBnJsO3XwtTRV8KuIVjOwh62jGVPtrLLe4Dvp 0UqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=+kUQYhzIpYJedPSa1pUwupzboguGi6iQwNCx5cgFBSM=; b=IDvA1Lgf6qZNtdeaiH9kKHG8svuaOgsyXg+MqVJz/ykgnfA83zls8ZgGHSXHxMQqa9 8qKZDxvjcCuKKnQuMRYahazB08hA6HFHjM43LREx5OxDqdAzhUeKQxg38Oas11UmByy2 wbvIim6lTyndTvV1b9sqSNhOXosuFHoWg0CdM2wCCQaUIM1fYjk9B4LtXbMORijH+fTZ BSkSRBMHGf3anQqp54ErJ+wc/nO/tQ9vCf01zdcxOIFMA6iYhG9TPG+hgqSugDWuG0iG pzudSGlzhAt/3RRmu2wN7XPQqOaguFdPDm43k9p4VaUJUmlwsgQbji9sO9NDmSFzjcHb JoBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=XYKWiFiM; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id z8si1823103ilq.142.2021.03.24.07.42.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Mar 2021 07:42:46 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=XYKWiFiM; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:51078 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lP4ic-0003uT-1Z for patch@linaro.org; Wed, 24 Mar 2021 10:42:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53576) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lP4f0-0008VN-NQ for qemu-devel@nongnu.org; Wed, 24 Mar 2021 10:39:02 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]:37704) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lP4ex-0003NB-L9 for qemu-devel@nongnu.org; Wed, 24 Mar 2021 10:39:02 -0400 Received: by mail-wm1-x32d.google.com with SMTP id f22-20020a7bc8d60000b029010c024a1407so1340092wml.2 for ; Wed, 24 Mar 2021 07:38:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+kUQYhzIpYJedPSa1pUwupzboguGi6iQwNCx5cgFBSM=; b=XYKWiFiMwOe/P4IPvxODhvJWe394eaNO0TGMcfeofKmHnI7PSl+vaT7qdJ5UDQR5D8 IYXDD3qdLwUHv0ZLv8Z4cAftRF74BUUo6/NLy3SNouIKD2jhFxaeDlQSJ1h2Ctj+SrSS UVZcEV1Z4iITU/VCqoeU1M6MukF4ZouUAdxc/Srj5SYNov/7i1qlPfdqJz86St4crLBT Nlr/LrNxr3Vg+f05c9IOHnyRJqgjewcTOSh4sp6akVzeUCAe/WsjPm+ZfrnQsofV+vVS GSlIkXps6YMdWI/S5SEXVlLiMi5kyu693grHsgsyTqs+eA+IwizEZ3OnHTvE1Uv4ezOu NlDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+kUQYhzIpYJedPSa1pUwupzboguGi6iQwNCx5cgFBSM=; b=eYv6HelVD22VwFu6tXdR3KS09d1Yabw03O5qt1SYZ49P20ghWeAGuqKHPS5F3Vjpmv Nhda006eajd/1EX+k9H4yVPWh1LK710XQ6G7nXgWeU7OiC5GUeYLHl1hPC9vnxUx1cDY fRMNpwqZoJ8u13yT07OpDm4NVkY3p9/K4lDsq9A9GdfMxTDuWbNVtYvhISeMFFEGQfGp 7b8bg6K3lrDpiJyThkdHTCNPIdZETdlLIy6EBSJsuml67OQvMJuHHWs52oi8uGmIbDQ8 WS0usF3jmKssIFhyi/4kCAccsS1FJxEZc6oafMqyJ8QMjSZtaif9aGg6w+bY9kQSAwfg X1Hw== X-Gm-Message-State: AOAM531TtLHfggaki0fBwOkoMKbOhwhpmusVk3/HEw7uKOozkZZsZU/Y hLY27saLTV0Qp63RTUElPHJXHg== X-Received: by 2002:a05:600c:b57:: with SMTP id k23mr3167995wmr.145.1616596738220; Wed, 24 Mar 2021 07:38:58 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id a8sm2534265wmm.46.2021.03.24.07.38.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Mar 2021 07:38:56 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id B0CB31FFA9; Wed, 24 Mar 2021 14:30:23 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 20/22] iotests: test m68k with the virt machine Date: Wed, 24 Mar 2021 14:30:19 +0000 Message-Id: <20210324143021.8560-21-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210324143021.8560-1-alex.bennee@linaro.org> References: <20210324143021.8560-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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: Kevin Wolf , "open list:Block layer core" , Cornelia Huck , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , qemu-devel@nongnu.org, Max Reitz , =?utf-8?q?Alex_?= =?utf-8?q?Benn=C3=A9e?= , Laurent Vivier Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Laurent Vivier This allows to cover the virtio tests with a 32bit big-endian virtio-mmio machine. Signed-off-by: Laurent Vivier Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Cornelia Huck Message-Id: <20210319202335.2397060-6-laurent@vivier.eu> Message-Id: <20210323165308.15244-21-alex.bennee@linaro.org> -- 2.20.1 diff --git a/tests/qemu-iotests/testenv.py b/tests/qemu-iotests/testenv.py index 1fbec854c1..6d27712617 100644 --- a/tests/qemu-iotests/testenv.py +++ b/tests/qemu-iotests/testenv.py @@ -208,6 +208,7 @@ def __init__(self, imgfmt: str, imgproto: str, aiomode: str, ('arm', 'virt'), ('aarch64', 'virt'), ('avr', 'mega2560'), + ('m68k', 'virt'), ('rx', 'gdbsim-r5f562n8'), ('tricore', 'tricore_testboard') ) From patchwork Wed Mar 24 14:30:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 407835 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp477139jai; Wed, 24 Mar 2021 07:49:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyUo9I8Buz1qL/OFycjhWSlglZ3FpXk4ZIG0JfXUP9wOC97wAj9sgIBcvkX2x77AybP4PnP X-Received: by 2002:a92:650d:: with SMTP id z13mr2751975ilb.293.1616597395167; Wed, 24 Mar 2021 07:49:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616597395; cv=none; d=google.com; s=arc-20160816; b=X/nw2ECV4tv9ZKZR1RVDSg6KjMo/C8S3TTCIQbygo2Jj0JPz1PFut0zQoTnKjriftk ob1xz59PXH+88Akjry6q5vuPtG4/6hcUgbMf1blIR/c9eAPT2SUPHAHSIZYj6hxGNEea fUEtz6XwNZ9ekIww0urvaYyAny8SNmYUaHJjjZfCbaP/aasTdP14Ii5PBTgjUpw/Y6m+ W/x4MMtoN49qAWPOL03SVWxorJYYxgwOqJBvj4bjFiMhemXujMmsLyakVci5Xnag4ybd yk3YoRN2zRnF5TnZPgQIP8EyFY7MrUJAl6n+r3oHZU4Dik9he35HoEwEJ0UcwdMhhfnp 6gKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=6V3I/617iDbb/+WUozJNJUkeoG1NJQtGMXaybo4P6+c=; b=AueW251Wj7eXlP3UOpVF9rWeyzGWKQ2CH/Yr6epx9IWMoanGh4OSrd6yrmr4UxbcB4 stikCA+P7sDyWn+N6gqtY8bEc+Zqr1lrZ2JUcEEj45dNKnuhXolel8G1Pv30rXyYwN33 RYGeqNcsPKbKVdptUo0ZVeY5T0b5SxvwpL6kkpa0YxjWP3BHgpdvwAO7gK1nbUPwMNVW rdJRtPJdtyJbSrZ9ASOsHKZOuj/dj5TzTCikPm9UGBUelbvonD8yJ77cYc/l5tDgBlvJ 3wjrcPEUgHdw7RqK9SsQDNmWSkzspbdLQdjY/S9dZwY0EW2ROcmYW+GSbQ9PUgtJRcDC ULOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=NCR7iikv; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id t13si1819716ilm.100.2021.03.24.07.49.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Mar 2021 07:49:55 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=NCR7iikv; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:44574 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lP4pV-0004Va-OC for patch@linaro.org; Wed, 24 Mar 2021 10:49:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53694) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lP4f5-0000GI-KW for qemu-devel@nongnu.org; Wed, 24 Mar 2021 10:39:07 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]:55251) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lP4f3-0003RS-PQ for qemu-devel@nongnu.org; Wed, 24 Mar 2021 10:39:07 -0400 Received: by mail-wm1-x32e.google.com with SMTP id k128so10637696wmk.4 for ; Wed, 24 Mar 2021 07:39:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6V3I/617iDbb/+WUozJNJUkeoG1NJQtGMXaybo4P6+c=; b=NCR7iikvhLuh6qliDuePFeWVUUAc9nmNHSO65l1JEm6yqwmuFRDpnLQPO49cElPBde dE6D3/kw4t5Rwc95T2NL7j8JK82hMqDev/Drb/Ksx4xsJSrQqZsv5k/R+HclJawL5y5B CpFizT7FIjTJdaBAo/Q4sHesJqcag3n9P+Xf/p876Op9T0gqmnXRuz2ZONZ2x83B10Pd 6HDAXM0V4T2P/B1m5jfkUpPN0Ni6RVtu218DjbWSBPqpP9sRsPUP2sf5/MKUsSi/M8Y8 iFvF5+k/eXRV70ZbVmDCV9fL1sAd8CIPrqkzOo9XXuSkHHb1tIM5+3+YTwQb8xBcue6g iM4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6V3I/617iDbb/+WUozJNJUkeoG1NJQtGMXaybo4P6+c=; b=kDtgpoCy1PGhRIof495HUarpKxgEpbneOoyziA7M9Asy7/mwVu/0ZC2SEqdQQa//kc vxlMeIuBnNpNqOnOjOm/uyy/P3SHhTEfXr7e4C8R9xiDBut0p7pzzHTxgnqpOKJXNMfS KAFdDEZ7apT5ghIqW2mRlcOrOOYkDTfnSZUXIGWI9S/qia+oHjOuW/SH7iEnOi0F/z2t DNM1d+D4+yV9qDFy8K2QhMFZD9mlOfUUifyqAgiKTm9/Fx4pdBS3Sb0k1fHJWeShitpg jLEc06+v4al4906NixO+RGBGilcKKLXSad3h3wvDTndWK+VQqwrXppiBk0AC21XoVHa9 0k3Q== X-Gm-Message-State: AOAM532E8WJ34rcTkf2OYEgtbHTv4QoJrov+ixSBfeeTkkYAIbvBwGBd E3urxfR01b/ptnX4LihAMQkxcA== X-Received: by 2002:a1c:bc56:: with SMTP id m83mr3294863wmf.174.1616596744436; Wed, 24 Mar 2021 07:39:04 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id u23sm2785424wmn.26.2021.03.24.07.38.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Mar 2021 07:39:03 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id CBA431FFAA; Wed, 24 Mar 2021 14:30:23 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 21/22] iotests: iothreads need ioeventfd Date: Wed, 24 Mar 2021 14:30:20 +0000 Message-Id: <20210324143021.8560-22-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210324143021.8560-1-alex.bennee@linaro.org> References: <20210324143021.8560-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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: Kevin Wolf , Thomas Huth , "open list:Block layer core" , qemu-devel@nongnu.org, Max Reitz , =?utf-8?q?Alex_Benn=C3=A9e?= , Laurent Vivier Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Laurent Vivier And ioeventfd are only available with virtio-scsi-pci or virtio-scsi-ccw, use the alias but add a rule to require virtio-scsi-pci or virtio-scsi-ccw for the tests that use iothreads. Signed-off-by: Laurent Vivier Signed-off-by: Alex Bennée Reviewed-by: Thomas Huth Message-Id: <20210319202335.2397060-7-laurent@vivier.eu> Message-Id: <20210323165308.15244-22-alex.bennee@linaro.org> -- 2.20.1 diff --git a/tests/qemu-iotests/127 b/tests/qemu-iotests/127 index 98e8e82a82..32edc3b068 100755 --- a/tests/qemu-iotests/127 +++ b/tests/qemu-iotests/127 @@ -44,7 +44,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fmt qcow2 _supported_proto file fuse -_require_devices virtio-scsi scsi-hd +_require_devices scsi-hd +_require_one_device_of virtio-scsi-pci virtio-scsi-ccw IMG_SIZE=64K diff --git a/tests/qemu-iotests/256 b/tests/qemu-iotests/256 index 8d82a1dd86..13666813bd 100755 --- a/tests/qemu-iotests/256 +++ b/tests/qemu-iotests/256 @@ -24,6 +24,8 @@ import os import iotests from iotests import log +iotests._verify_virtio_scsi_pci_or_ccw() + iotests.script_initialize(supported_fmts=['qcow2']) size = 64 * 1024 * 1024 @@ -61,8 +63,8 @@ with iotests.FilePath('img0') as img0_path, \ log('--- Preparing images & VM ---\n') vm.add_object('iothread,id=iothread0') vm.add_object('iothread,id=iothread1') - vm.add_device('virtio-scsi-pci,id=scsi0,iothread=iothread0') - vm.add_device('virtio-scsi-pci,id=scsi1,iothread=iothread1') + vm.add_device('virtio-scsi,id=scsi0,iothread=iothread0') + vm.add_device('virtio-scsi,id=scsi1,iothread=iothread1') iotests.qemu_img_create('-f', iotests.imgfmt, img0_path, str(size)) iotests.qemu_img_create('-f', iotests.imgfmt, img1_path, str(size)) vm.add_drive(img0_path, interface='none') diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc index 65cdba5723..7f49c9716d 100644 --- a/tests/qemu-iotests/common.rc +++ b/tests/qemu-iotests/common.rc @@ -977,5 +977,18 @@ _require_devices() done } +_require_one_device_of() +{ + available=$($QEMU -M none -device help | \ + grep ^name | sed -e 's/^name "//' -e 's/".*$//') + for device + do + if echo "$available" | grep -q "$device" ; then + return + fi + done + _notrun "$* not available" +} + # make sure this script returns success true diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 1e9e6a066e..5af0182895 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -1146,6 +1146,11 @@ def _verify_virtio_blk() -> None: if 'virtio-blk' not in out: notrun('Missing virtio-blk in QEMU binary') +def _verify_virtio_scsi_pci_or_ccw() -> None: + out = qemu_pipe('-M', 'none', '-device', 'help') + if 'virtio-scsi-pci' not in out and 'virtio-scsi-ccw' not in out: + notrun('Missing virtio-scsi-pci or virtio-scsi-ccw in QEMU binary') + def supports_quorum(): return 'quorum' in qemu_img_pipe('--help') From patchwork Wed Mar 24 14:30:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 407838 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp478633jai; Wed, 24 Mar 2021 07:51:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKRDADUL9tT4OAOn/QKvccruA7UCNlMUPkU0H/QJSJzY7AD2v500Cik+hO1wFmCHUyozkv X-Received: by 2002:a02:8801:: with SMTP id r1mr3316493jai.51.1616597515323; Wed, 24 Mar 2021 07:51:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616597515; cv=none; d=google.com; s=arc-20160816; b=M98fnIv/km3DFZm/LBbkRDht+IqA+FzwTYWSdAcf0L1NwrALMmZfR6sIZkURBTjSUh l/zBH8KmdqCglu9h+SH3RNcQ0W8A1ril67cbTswMNP9hzEf2CIssrR0ApCF0TrQ+oFrR 87OdZNm5KuitKo1EAmKfecqU+i0lKdjCO3IeUICqE7/pMqZfeuGuUCz93z6NSCs3akgg STu5UjO3E14jASVHpGcRO8S2m7rdDaWpyDfeDtmAFLNH4U0Jo8Irzsk5OTwSQ/ZpJ1JK XbRbvbV5MDe46iB5zqi+t1J5a+S7iYNbpL5wsqWK3VNz26nWuJwDRXitIcNTPY5jKbLI gtUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=oPq46WkfMIfhC+35R00H1uei8HDXcw6U7w4p2WsTbhg=; b=gO7kErWXWlRpByc3NUPG0U/GrfyWsJgphM+TTRpRPsdtmURdIbTvi4mlpvG6Y10HpB zpzVH26kG59sQEd2q2++Ny3lDWss4HlmkqrP5GR1wz7mefagNqZy2qeo1ZrmWin0CDHU XE2ESedDOL9HRuXHKT6ZzCMDRwc+2DTOUgRy2vOSW2BcZcrVNOI0VFNXsfzeCmK6QFOP yjWUFwsf0o0sy5w7VF98zc7x4s4QwcriBiMBCR7mA0xwIurcqNbOJTg69/ATNZY1IIbV wV2sYetDPjnDt5vGPS0kzuCFE6akxUpxTRTQOyuQAYIhfitQc8RoPM6Sb+tRYqwhxiqF r2+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=nB2cswVC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id x18si1982047jas.18.2021.03.24.07.51.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Mar 2021 07:51:55 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=nB2cswVC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:48998 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lP4rS-0006Sd-Nm for patch@linaro.org; Wed, 24 Mar 2021 10:51:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53734) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lP4f8-0000ON-GS for qemu-devel@nongnu.org; Wed, 24 Mar 2021 10:39:10 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:33503) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lP4f6-0003Sv-H2 for qemu-devel@nongnu.org; Wed, 24 Mar 2021 10:39:10 -0400 Received: by mail-wr1-x42b.google.com with SMTP id o16so24720910wrn.0 for ; Wed, 24 Mar 2021 07:39:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oPq46WkfMIfhC+35R00H1uei8HDXcw6U7w4p2WsTbhg=; b=nB2cswVC45QUTOKs/4MngkHLUP/iy5f+QR35lPRFBcwaJY61goUkgW86cAFOOdqDIf K1D/nP2G5BEt5OpC5DDIIWafkG8TBaY533VnCLmEoP7CuO5gEQwPEu+xtRbmb65Q7Rxn iCyIjPc90vZE5ugHD04PTOCvkRKoAtlpSRQiuE4ACI7yaw0rV33rFmnLR6x+/gvh9aBe XIRQJ72k6ygOJYKqGmI6BuztCvzFsQ8nnDFEyvDXmzAWsdf80fhmDIcC3tEUGnzRPmzG aZzAokG/cBB3wwSb2gt1L25YzSMdIFK6qUazo0Nqi4JPjdUOosldlF+N5/C4+qolV+0H zDIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oPq46WkfMIfhC+35R00H1uei8HDXcw6U7w4p2WsTbhg=; b=QCM7CCt/Lmgmw4RiLbJrseArfpnoe0AVcsGOFyMScKWF0aQwDsbt64tzER2ioEtEIs T9VMgB6SVsaNetaXO+znuMgzKDWQYwykBkjyKygMkawzuD007iTszltENgU5+r4nS6Ae AekP0Z93GP9woW38EK1FpgQZgJGgVnubQ+8trQc/yxfBUR948iaw/a9malgolPZGL9tw AATpEZfxnHvehtr4oGfuMN7z1Xt0hTxrXa5CtfAsFabXKp3CCn2idI3EOfk6I8KpROYw RS4Bnc/prIfXjfuQGtbqlcOBgI90hS81ABguDYQS49tY94LDseYerwWWqxyBCPEtAPEq IPtg== X-Gm-Message-State: AOAM532kpFQXD+Cyvs3VR5DAqStMH4dB0XeaeYiP5jF9IuMTBfgWlN5d RphPfho6NTrOaANQ9BuV7MhJHg== X-Received: by 2002:a5d:6ccb:: with SMTP id c11mr3932320wrc.122.1616596747280; Wed, 24 Mar 2021 07:39:07 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id f7sm2553789wmq.11.2021.03.24.07.38.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Mar 2021 07:39:03 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id E35CC1FFAB; Wed, 24 Mar 2021 14:30:23 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 22/22] gitlab: default to not building the documentation Date: Wed, 24 Mar 2021 14:30:21 +0000 Message-Id: <20210324143021.8560-23-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210324143021.8560-1-alex.bennee@linaro.org> References: <20210324143021.8560-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , qemu-devel@nongnu.org, Wainer dos Santos Moschetta , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , Willian Rampazzo , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" In d0f26e68a0 ("gitlab: force enable docs build in Fedora, Ubuntu, Debian") we made sure we can build the documents on more than one system. However we don't want to build documents all the time as it's a waste of cycles (and energy). So lets reduce the total amount of documentation we build while still keeping coverage of at least one build on each supported target. Fixes: a8a3abe0b3 ("gitlab: move docs and tools build across from Travis") Signed-off-by: Alex Bennée Reviewed-by: Willian Rampazzo Reviewed-by: Thomas Huth Message-Id: <20210323165308.15244-23-alex.bennee@linaro.org> -- 2.20.1 diff --git a/.gitlab-ci.d/crossbuilds.yml b/.gitlab-ci.d/crossbuilds.yml index d5098c986b..2d95784ed5 100644 --- a/.gitlab-ci.d/crossbuilds.yml +++ b/.gitlab-ci.d/crossbuilds.yml @@ -6,10 +6,10 @@ - mkdir build - cd build - PKG_CONFIG_PATH=$PKG_CONFIG_PATH - ../configure --enable-werror $QEMU_CONFIGURE_OPTS --disable-user - --target-list-exclude="arm-softmmu cris-softmmu i386-softmmu - microblaze-softmmu mips-softmmu mipsel-softmmu mips64-softmmu - ppc-softmmu sh4-softmmu xtensa-softmmu" + ../configure --enable-werror --disable-docs $QEMU_CONFIGURE_OPTS + --disable-user --target-list-exclude="arm-softmmu cris-softmmu + i386-softmmu microblaze-softmmu mips-softmmu mipsel-softmmu + mips64-softmmu ppc-softmmu sh4-softmmu xtensa-softmmu" - make -j$(expr $(nproc) + 1) all check-build $MAKE_CHECK_ARGS # Job to cross-build specific accelerators. @@ -25,8 +25,8 @@ - mkdir build - cd build - PKG_CONFIG_PATH=$PKG_CONFIG_PATH - ../configure --enable-werror $QEMU_CONFIGURE_OPTS --disable-tools - --enable-${ACCEL:-kvm} $ACCEL_CONFIGURE_OPTS + ../configure --enable-werror --disable-docs $QEMU_CONFIGURE_OPTS + --disable-tools --enable-${ACCEL:-kvm} $ACCEL_CONFIGURE_OPTS - make -j$(expr $(nproc) + 1) all check-build .cross_user_build_job: @@ -36,7 +36,8 @@ - mkdir build - cd build - PKG_CONFIG_PATH=$PKG_CONFIG_PATH - ../configure --enable-werror $QEMU_CONFIGURE_OPTS --disable-system + ../configure --enable-werror --disable-docs $QEMU_CONFIGURE_OPTS + --disable-system - make -j$(expr $(nproc) + 1) all check-build $MAKE_CHECK_ARGS cross-armel-system: diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9ffbaa7ffb..3480d79db3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -23,9 +23,9 @@ include: - cd build - if test -n "$TARGETS"; then - ../configure --enable-werror $CONFIGURE_ARGS --target-list="$TARGETS" ; + ../configure --enable-werror --disable-docs $CONFIGURE_ARGS --target-list="$TARGETS" ; else - ../configure --enable-werror $CONFIGURE_ARGS ; + ../configure --enable-werror --disable-docs $CONFIGURE_ARGS ; fi || { cat config.log meson-logs/meson-log.txt && exit 1; } - if test -n "$LD_JOBS"; then @@ -119,7 +119,7 @@ build-system-ubuntu: job: amd64-ubuntu2004-container variables: IMAGE: ubuntu2004 - CONFIGURE_ARGS: --enable-fdt=system --enable-slirp=system + CONFIGURE_ARGS: --enable-docs --enable-fdt=system --enable-slirp=system TARGETS: aarch64-softmmu alpha-softmmu cris-softmmu hppa-softmmu moxie-softmmu microblazeel-softmmu mips64el-softmmu MAKE_CHECK_ARGS: check-build @@ -607,7 +607,7 @@ tsan-build: job: amd64-ubuntu2004-container variables: IMAGE: ubuntu2004 - CONFIGURE_ARGS: --enable-tsan --cc=clang-10 --cxx=clang++-10 --disable-docs + CONFIGURE_ARGS: --enable-tsan --cc=clang-10 --cxx=clang++-10 --enable-trace-backends=ust --enable-fdt=system --enable-slirp=system TARGETS: x86_64-softmmu ppc64-softmmu riscv64-softmmu x86_64-linux-user MAKE_CHECK_ARGS: bench V=1 @@ -619,7 +619,7 @@ build-deprecated: job: amd64-debian-user-cross-container variables: IMAGE: debian-all-test-cross - CONFIGURE_ARGS: --disable-docs --disable-tools + CONFIGURE_ARGS: --disable-tools MAKE_CHECK_ARGS: build-tcg TARGETS: ppc64abi32-linux-user lm32-softmmu unicore32-softmmu artifacts: