From patchwork Mon Jan 18 06:38:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaxun Yang X-Patchwork-Id: 12026669 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3B7B7C433E0 for ; Mon, 18 Jan 2021 06:50:07 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AF2082231F for ; Mon, 18 Jan 2021 06:50:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AF2082231F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=flygoat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:45928 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l1OMX-0008Li-MB for qemu-devel@archiver.kernel.org; Mon, 18 Jan 2021 01:50:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:33602) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1OBW-0002d9-Ph; Mon, 18 Jan 2021 01:38:44 -0500 Received: from wnew4-smtp.messagingengine.com ([64.147.123.18]:36537) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1OBL-0007K1-8v; Mon, 18 Jan 2021 01:38:38 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailnew.west.internal (Postfix) with ESMTP id 53B0E167A; Mon, 18 Jan 2021 01:38:27 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Mon, 18 Jan 2021 01:38:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=JkDA4Wi2GI0B3 bcDDU6/HuHDUW1caUijozfHO0X7odA=; b=Q2f63C4OvLf+Cic/HcnyLKb3GIU6n 6JkVvAbnISPFBLJmqTJdPsntzLxIAIRu7tnVX661Ee9aUJ7tEYF0yYScMpHPuuT3 gWpf+/VrJtKDFqPj459Rffq067mbK5/MDc5NYosp0sYlTHn21QqKnlnBgAeT9f6p g0NwnO2+b5Vu7xRWItwSG8+5gueF0xALnMdTbnngFDdJGznY0SvEu3GKnQLYRwQA TqtBsTB5Rws0rwFArRbt9XBqYozNr8RHPrmXublRcYfl2Rfx10v5Qlmd9DTQ9zrt YAVbUlq9v5KKn6/2+vdZ6FXMQiP0EMOA49V+jsIeRSsC/pbTEoksi0bow== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=JkDA4Wi2GI0B3bcDDU6/HuHDUW1caUijozfHO0X7odA=; b=PsIhX8CC RKPW5WVS7OnLCtCD1JoI026OW7rEzsL+F2E6QHadrxlUBunyW387gYeAw6Olrxx1 FemT9C6kWu8FaxEL5eAOQth89mEiv9bF0XmvPSYgIqoXas4JbJt0iwXli3Jg9Ipm 05FlyQRIYdXf/yDl61PsSqHYarQwdeugt76OEuFnCM8sIofYFr0R5+DQNki0ec0a lXnYabCnDbzMrQnnwgU07GQdmFhW+6ZjDyIGd9QSyLJvHWcXuHV01NNhg5WDr5TS dx1tAe5yhTWXwPEUIolfEOCNbR7mW5nVbKSkg232MWzTlKZ73xMXxvgOa2dTdExr gWJ4/lwaNAaNwQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrtdejgdeliecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomheplfhirgiguhhn ucgjrghnghcuoehjihgrgihunhdrhigrnhhgsehflhihghhorghtrdgtohhmqeenucggtf frrghtthgvrhhnpeejiefhgfetleekleffudektdehvedujedvgeekkeejfefhhffhtedu tefgtdffueenucfkphepudduiedrvddvkedrkeegrddvnecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomhepjhhirgiguhhnrdihrghnghesfhhlhihg ohgrthdrtghomh X-ME-Proxy: Received: from strike.U-LINK.com (unknown [116.228.84.2]) by mail.messagingengine.com (Postfix) with ESMTPA id A3E5424005C; Mon, 18 Jan 2021 01:38:20 -0500 (EST) From: Jiaxun Yang To: qemu-devel@nongnu.org Subject: [PATCH v2 1/9] configure: Add sys/timex.h to probe clock_adjtime Date: Mon, 18 Jan 2021 14:38:00 +0800 Message-Id: <20210118063808.12471-2-jiaxun.yang@flygoat.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210118063808.12471-1-jiaxun.yang@flygoat.com> References: <20210118063808.12471-1-jiaxun.yang@flygoat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=64.147.123.18; envelope-from=jiaxun.yang@flygoat.com; helo=wnew4-smtp.messagingengine.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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_LOW=-0.7, RCVD_IN_SORBS_WEB=1.5, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Laurent Vivier , Thomas Huth , Viktor Prutyanov , kvm@vger.kernel.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Alistair Francis , Greg Kurz , Wainer dos Santos Moschetta , Max Reitz , qemu-ppc@nongnu.org, Kevin Wolf , Paolo Bonzini , qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , David Gibson Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" It is not a part of standard time.h. Glibc put it under time.h however musl treat it as a sys timex extension. Signed-off-by: Jiaxun Yang Reviewed-by: Thomas Huth --- configure | 1 + 1 file changed, 1 insertion(+) diff --git a/configure b/configure index 155dda124c..1a9e1afa39 100755 --- a/configure +++ b/configure @@ -4039,6 +4039,7 @@ fi clock_adjtime=no cat > $TMPC < +#include int main(void) { From patchwork Mon Jan 18 06:38:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jiaxun Yang X-Patchwork-Id: 12026665 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 322C5C433E0 for ; Mon, 18 Jan 2021 06:47:39 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C8292229C4 for ; Mon, 18 Jan 2021 06:47:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C8292229C4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=flygoat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:39676 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l1OK9-0005gB-6I for qemu-devel@archiver.kernel.org; Mon, 18 Jan 2021 01:47:37 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:33626) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1OBY-0002dk-NM; Mon, 18 Jan 2021 01:38:46 -0500 Received: from wnew4-smtp.messagingengine.com ([64.147.123.18]:46713) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1OBW-0007M3-H0; Mon, 18 Jan 2021 01:38:43 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailnew.west.internal (Postfix) with ESMTP id 2B9C51685; Mon, 18 Jan 2021 01:38:33 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Mon, 18 Jan 2021 01:38:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=QGrARgnGjyQp2 jNKv2fGZ+QG4BVHaGI9+gDNhbCJcKg=; b=o7Fy4nhxcw4xN5PZKm8cN4H3XurBl tCGyBmihky5l0w+LFsX1+Jc9M1PGTu8j6y+4+oC76ZbLNU+JMZ3FYzH0sOFADo2g H6oPmKakCTYJfaYLwRq+7NRtDyHqMrKrYofEizIjxcbJgAnHrnDL78B9Vyk4/Yc/ GUcV7LSZAC+8BqRxRSGSxsUB64wopm47bE8mROx+yFEpwmdj3iq7FUwKydFCwEbC VSDDuS8Cn0rUnByLxb693Nz/DYcueDFS3IwQztRFECfxba+pYSwX4XrDlpXaczLH u3ew8RpiXSWNJPXpohCkOWh2R99IftoJLGNw2YE/xv4kjcvU1GznXflJQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=QGrARgnGjyQp2jNKv2fGZ+QG4BVHaGI9+gDNhbCJcKg=; b=X6XbjIn8 zzdxIaqWfegBBZYfl6zD/hyXx2JSH7sTD6Q+X62XcXeo6F01kR3gGQBc/yICbUiK lvwDSkkltphdo99qAvBnOo5RUeH1K1Sgg2C2bfbfEk8/cKk8I2d2Bw/OhOrOpyib JvJfdH1zuqbOOK0RdvGHtBoQ2IoJEel0/bu6UQpAT2esDPFeB2whE9XypZg495ka qFI4293EM8cob5t7SppXT2At6cpgfEOzWtPAh+HI4A7nSmumFIhHUayiWo6G4qax gD1ab1h/TIlndukNnl5Rlxp1mv6bqbze6ahhe/qm56RYHrteXbVuxgUrd+RJewLU 9bcQ6Q0an/KLzg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrtdejgdeliecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomheplfhirgiguhhn ucgjrghnghcuoehjihgrgihunhdrhigrnhhgsehflhihghhorghtrdgtohhmqeenucggtf frrghtthgvrhhnpeejiefhgfetleekleffudektdehvedujedvgeekkeejfefhhffhtedu tefgtdffueenucfkphepudduiedrvddvkedrkeegrddvnecuvehluhhsthgvrhfuihiivg epudenucfrrghrrghmpehmrghilhhfrhhomhepjhhirgiguhhnrdihrghnghesfhhlhihg ohgrthdrtghomh X-ME-Proxy: Received: from strike.U-LINK.com (unknown [116.228.84.2]) by mail.messagingengine.com (Postfix) with ESMTPA id 1E11D24005B; Mon, 18 Jan 2021 01:38:26 -0500 (EST) From: Jiaxun Yang To: qemu-devel@nongnu.org Subject: [PATCH v2 2/9] libvhost-user: Include poll.h instead of sys/poll.h Date: Mon, 18 Jan 2021 14:38:01 +0800 Message-Id: <20210118063808.12471-3-jiaxun.yang@flygoat.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210118063808.12471-1-jiaxun.yang@flygoat.com> References: <20210118063808.12471-1-jiaxun.yang@flygoat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=64.147.123.18; envelope-from=jiaxun.yang@flygoat.com; helo=wnew4-smtp.messagingengine.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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_LOW=-0.7, RCVD_IN_SORBS_WEB=1.5, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Laurent Vivier , Thomas Huth , Viktor Prutyanov , kvm@vger.kernel.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Alistair Francis , Greg Kurz , Wainer dos Santos Moschetta , Max Reitz , qemu-ppc@nongnu.org, Kevin Wolf , Paolo Bonzini , qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , David Gibson Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Musl libc complains about it's wrong usage. In file included from ../subprojects/libvhost-user/libvhost-user.h:20, from ../subprojects/libvhost-user/libvhost-user-glib.h:19, from ../subprojects/libvhost-user/libvhost-user-glib.c:15: /usr/include/sys/poll.h:1:2: error: #warning redirecting incorrect #include to [-Werror=cpp] 1 | #warning redirecting incorrect #include to | ^~~~~~~ Signed-off-by: Jiaxun Yang Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé --- subprojects/libvhost-user/libvhost-user.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subprojects/libvhost-user/libvhost-user.h b/subprojects/libvhost-user/libvhost-user.h index 7d47f1364a..3d13dfadde 100644 --- a/subprojects/libvhost-user/libvhost-user.h +++ b/subprojects/libvhost-user/libvhost-user.h @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include #include "standard-headers/linux/virtio_ring.h" From patchwork Mon Jan 18 06:38:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jiaxun Yang X-Patchwork-Id: 12026663 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DB8F9C433DB for ; Mon, 18 Jan 2021 06:46:36 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 74C67229C4 for ; Mon, 18 Jan 2021 06:46:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 74C67229C4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=flygoat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:38384 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l1OJ9-00052e-7j for qemu-devel@archiver.kernel.org; Mon, 18 Jan 2021 01:46:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:33646) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1OBa-0002eJ-LZ; Mon, 18 Jan 2021 01:38:46 -0500 Received: from wnew4-smtp.messagingengine.com ([64.147.123.18]:51553) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1OBX-0007NP-6z; Mon, 18 Jan 2021 01:38:45 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailnew.west.internal (Postfix) with ESMTP id 3266D1679; Mon, 18 Jan 2021 01:38:40 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Mon, 18 Jan 2021 01:38:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=m0nUlI5kVEPZD 2X5aInSXbR27bFcE8kwt/2olAPs5Ys=; b=OOweqU4vom2803WNTu/dQXB7Jh9xS DKVoe5QTQGemUEAc878M/+ilrlyuZZBPE5JkQcxgQlUjj5gfFt0DZjZne7wGuZX/ ZyEs0Mj6aaO53K3H2wk4DesAlk1gI49SckxDdymMA3tBoe+FVMleO4gEGRExX8WW 5sBjS+1a0E9IZA1xcY5s2E+jbPqczL8J9TMPYe1U0LVRi8Z9IGafQ6HUSdtL22LN 8xgr71r8eWEkPE79vHX6VHhbgLTqbC/Q4Z1iYa6RghLWizxcdcQZETJV3RcECi45 AKTkUdEb2kZu7RGiNqr3OLME42QFSImfjwXQ8P82+1l1qNlr0CuO1uT2w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=m0nUlI5kVEPZD2X5aInSXbR27bFcE8kwt/2olAPs5Ys=; b=OQB73Un0 8ip0HFvMF1jTys7cMYkzLmxveWgnHDb9mBOTm2Zbthc7BmXSxWPKPsGfKmBk8Sxx V2wqsggWR5pvcUbVA5QdpvC4iVZa/OfmGdxonOXR7F2Z9pAVs5bBYfLa/C8NXplm j+KOFMA+NTdBafraTNDBKJURjdAr2q5l2Rbn/UggsYO3gKxPOfYiuHRF2ZR4vgMZ 7z/olhrUpyFEF/khlR6qK9GslvB8a0K5F531+sw4zYLBXXULPv3GOygys2wN/nPH +dF6U4MVuJy4qVFI4bjY5+GcMWNMK2JsNFzjJ0e7Hlm1Mdj5upBCGaqNcsCQIqtj VhFkrEFqOUGoUg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrtdejgdeliecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomheplfhirgiguhhn ucgjrghnghcuoehjihgrgihunhdrhigrnhhgsehflhihghhorghtrdgtohhmqeenucggtf frrghtthgvrhhnpeejiefhgfetleekleffudektdehvedujedvgeekkeejfefhhffhtedu tefgtdffueenucfkphepudduiedrvddvkedrkeegrddvnecuvehluhhsthgvrhfuihiivg epvdenucfrrghrrghmpehmrghilhhfrhhomhepjhhirgiguhhnrdihrghnghesfhhlhihg ohgrthdrtghomh X-ME-Proxy: Received: from strike.U-LINK.com (unknown [116.228.84.2]) by mail.messagingengine.com (Postfix) with ESMTPA id D126224005C; Mon, 18 Jan 2021 01:38:32 -0500 (EST) From: Jiaxun Yang To: qemu-devel@nongnu.org Subject: [PATCH v2 3/9] osdep.h: Remove include Date: Mon, 18 Jan 2021 14:38:02 +0800 Message-Id: <20210118063808.12471-4-jiaxun.yang@flygoat.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210118063808.12471-1-jiaxun.yang@flygoat.com> References: <20210118063808.12471-1-jiaxun.yang@flygoat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=64.147.123.18; envelope-from=jiaxun.yang@flygoat.com; helo=wnew4-smtp.messagingengine.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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_LOW=-0.7, RCVD_IN_SORBS_WEB=1.5, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Laurent Vivier , Thomas Huth , Viktor Prutyanov , kvm@vger.kernel.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Alistair Francis , Greg Kurz , Wainer dos Santos Moschetta , Max Reitz , qemu-ppc@nongnu.org, Kevin Wolf , Michael Forney , Paolo Bonzini , qemu-block@nongnu.org, =?utf-8?q?Phili?= =?utf-8?q?ppe_Mathieu-Daud=C3=A9?= , David Gibson Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Michael Forney Prior to 2a4b472c3c, sys/signal.h was only included on OpenBSD (apart from two .c files). The POSIX standard location for this header is just and in fact, OpenBSD's signal.h includes sys/signal.h itself. Unconditionally including on musl causes warnings for just about every source file: /usr/include/sys/signal.h:1:2: warning: #warning redirecting incorrect #include to [-Wcpp] 1 | #warning redirecting incorrect #include to | ^~~~~~~ Since there don't seem to be any platforms which require including in addition to , and some platforms like Haiku lack it completely, just remove it. Tested building on OpenBSD after removing this include. Signed-off-by: Michael Forney Reviewed-by: Eric Blake [jiaxun.yang@flygoat.com: Move to meson] Signed-off-by: Jiaxun Yang Reviewed-by: Philippe Mathieu-Daudé --- meson.build | 1 - include/qemu/osdep.h | 4 ---- 2 files changed, 5 deletions(-) diff --git a/meson.build b/meson.build index 3d889857a0..af2bc89741 100644 --- a/meson.build +++ b/meson.build @@ -1113,7 +1113,6 @@ config_host_data.set('HAVE_DRM_H', cc.has_header('libdrm/drm.h')) config_host_data.set('HAVE_PTY_H', cc.has_header('pty.h')) config_host_data.set('HAVE_SYS_IOCCOM_H', cc.has_header('sys/ioccom.h')) config_host_data.set('HAVE_SYS_KCOV_H', cc.has_header('sys/kcov.h')) -config_host_data.set('HAVE_SYS_SIGNAL_H', cc.has_header('sys/signal.h')) ignored = ['CONFIG_QEMU_INTERP_PREFIX'] # actually per-target arrays = ['CONFIG_AUDIO_DRIVERS', 'CONFIG_BDRV_RW_WHITELIST', 'CONFIG_BDRV_RO_WHITELIST'] diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index f9ec8c84e9..a434382c58 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -104,10 +104,6 @@ extern int daemon(int, int); #include #include -#ifdef HAVE_SYS_SIGNAL_H -#include -#endif - #ifndef _WIN32 #include #else From patchwork Mon Jan 18 06:38:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaxun Yang X-Patchwork-Id: 12026675 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 665AEC433E0 for ; Mon, 18 Jan 2021 06:55:39 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 007CD2231F for ; Mon, 18 Jan 2021 06:55:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 007CD2231F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=flygoat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:55814 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l1ORg-00044N-RT for qemu-devel@archiver.kernel.org; Mon, 18 Jan 2021 01:55:29 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:33670) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1OBg-0002ij-4g; Mon, 18 Jan 2021 01:38:52 -0500 Received: from wnew4-smtp.messagingengine.com ([64.147.123.18]:54189) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1OBe-0007QT-23; Mon, 18 Jan 2021 01:38:51 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailnew.west.internal (Postfix) with ESMTP id 29F4816AA; Mon, 18 Jan 2021 01:38:47 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Mon, 18 Jan 2021 01:38:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=bDwgdjDoukPi9 JhR44K/N5hfJGNEOGMrMrIINrNgeD0=; b=gdBewku4fRleeO5ZeEVnZFMVXFrSh 5SxAcwUfdnIsED6kA/iCtJGhf6W3PtLa79eBWBBtMxdqJKEc1Qu/WkTJ+4l7sQPi 3Wdjw6e0oMLl0he+233t9fuyNVBzkHoO5k1E40K03nxrYino8HZ4uMCZO4G5V9cy t+Lmg0f9mqDaBBGFqREjcO2t+z2vqZxBXIV4BDw40QPhT1OcfFlqalsXz8aHuuz3 R60r5FL2OxQvaCEnTbAzcW5c1pWgMJ8yMwHJPTAnn9RC9y/oJ9kLqCfHijpnUhqF olJMYOOIPbDQwKwTbouQn63P/v18vVVlkQoIB1s14nvfrdAONOSxNfTiQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=bDwgdjDoukPi9JhR44K/N5hfJGNEOGMrMrIINrNgeD0=; b=TfBJH/jY smmQGGO9rYfBLyi4Vj2JyyhA1bSy/ngjyi7JxzD6XjtG8EjcaY7e/EngcYbxJC5g X9vCbIGom+k9w3tA7aJjNxjHOZ6S4COjn3NE2uBNN0zezSmYBb/Az0c/D14RpcCv MAIBHI6NP5OjEm4BqCKKh5bGV8YIPEy9npB46XNazp7jwLqzk5cyy2rGO6nkOGZX nVZSZMIn2nxKPRO+8z699dGs+fGDg1nZpbvD8Uw1pu/VhH1JWCOoxVZKBfb6VjWR ADubhcdV48qJL2AYF41UJtEKEryqbg7cFm9g60vcP0bQ4tIXwOaF5X+phhXnXIVv 4+cIyQ3sAggv2A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrtdejgdeliecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomheplfhirgiguhhn ucgjrghnghcuoehjihgrgihunhdrhigrnhhgsehflhihghhorghtrdgtohhmqeenucggtf frrghtthgvrhhnpedtveehvdefleeghfeuveffjeeuffetffekhfeviedujeeiieevuddv iedtheffjeenucffohhmrghinhepohhpvghnghhrohhuphdrohhrghenucfkphepudduie drvddvkedrkeegrddvnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghi lhhfrhhomhepjhhirgiguhhnrdihrghnghesfhhlhihgohgrthdrtghomh X-ME-Proxy: Received: from strike.U-LINK.com (unknown [116.228.84.2]) by mail.messagingengine.com (Postfix) with ESMTPA id 9A8EC24005B; Mon, 18 Jan 2021 01:38:39 -0500 (EST) From: Jiaxun Yang To: qemu-devel@nongnu.org Subject: [PATCH v2 4/9] hw/block/nand: Rename PAGE_SIZE to NAND_PAGE_SIZE Date: Mon, 18 Jan 2021 14:38:03 +0800 Message-Id: <20210118063808.12471-5-jiaxun.yang@flygoat.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210118063808.12471-1-jiaxun.yang@flygoat.com> References: <20210118063808.12471-1-jiaxun.yang@flygoat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=64.147.123.18; envelope-from=jiaxun.yang@flygoat.com; helo=wnew4-smtp.messagingengine.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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_LOW=-0.7, RCVD_IN_SORBS_WEB=1.5, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Laurent Vivier , Thomas Huth , Viktor Prutyanov , kvm@vger.kernel.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Alistair Francis , Greg Kurz , Wainer dos Santos Moschetta , Max Reitz , qemu-ppc@nongnu.org, Kevin Wolf , Paolo Bonzini , qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , David Gibson Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" As per POSIX specification of limits.h [1], OS libc may define PAGE_SIZE in limits.h. To prevent collosion of definition, we rename PAGE_SIZE here. [1]: https://pubs.opengroup.org/onlinepubs/7908799/xsh/limits.h.html Signed-off-by: Jiaxun Yang Reviewed-by: Thomas Huth --- hw/block/nand.c | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/hw/block/nand.c b/hw/block/nand.c index 123020aebf..cd26a14d57 100644 --- a/hw/block/nand.c +++ b/hw/block/nand.c @@ -115,24 +115,24 @@ static void mem_and(uint8_t *dest, const uint8_t *src, size_t n) # define NAND_IO # define PAGE(addr) ((addr) >> ADDR_SHIFT) -# define PAGE_START(page) (PAGE(page) * (PAGE_SIZE + OOB_SIZE)) +# define PAGE_START(page) (PAGE(page) * (NAND_PAGE_SIZE + OOB_SIZE)) # define PAGE_MASK ((1 << ADDR_SHIFT) - 1) # define OOB_SHIFT (PAGE_SHIFT - 5) # define OOB_SIZE (1 << OOB_SHIFT) # define SECTOR(addr) ((addr) >> (9 + ADDR_SHIFT - PAGE_SHIFT)) # define SECTOR_OFFSET(addr) ((addr) & ((511 >> PAGE_SHIFT) << 8)) -# define PAGE_SIZE 256 +# define NAND_PAGE_SIZE 256 # define PAGE_SHIFT 8 # define PAGE_SECTORS 1 # define ADDR_SHIFT 8 # include "nand.c" -# define PAGE_SIZE 512 +# define NAND_PAGE_SIZE 512 # define PAGE_SHIFT 9 # define PAGE_SECTORS 1 # define ADDR_SHIFT 8 # include "nand.c" -# define PAGE_SIZE 2048 +# define NAND_PAGE_SIZE 2048 # define PAGE_SHIFT 11 # define PAGE_SECTORS 4 # define ADDR_SHIFT 16 @@ -652,7 +652,7 @@ type_init(nand_register_types) #else /* Program a single page */ -static void glue(nand_blk_write_, PAGE_SIZE)(NANDFlashState *s) +static void glue(nand_blk_write_, NAND_PAGE_SIZE)(NANDFlashState *s) { uint64_t off, page, sector, soff; uint8_t iobuf[(PAGE_SECTORS + 2) * 0x200]; @@ -672,11 +672,11 @@ static void glue(nand_blk_write_, PAGE_SIZE)(NANDFlashState *s) return; } - mem_and(iobuf + (soff | off), s->io, MIN(s->iolen, PAGE_SIZE - off)); - if (off + s->iolen > PAGE_SIZE) { + mem_and(iobuf + (soff | off), s->io, MIN(s->iolen, NAND_PAGE_SIZE - off)); + if (off + s->iolen > NAND_PAGE_SIZE) { page = PAGE(s->addr); - mem_and(s->storage + (page << OOB_SHIFT), s->io + PAGE_SIZE - off, - MIN(OOB_SIZE, off + s->iolen - PAGE_SIZE)); + mem_and(s->storage + (page << OOB_SHIFT), s->io + NAND_PAGE_SIZE - off, + MIN(OOB_SIZE, off + s->iolen - NAND_PAGE_SIZE)); } if (blk_pwrite(s->blk, sector << BDRV_SECTOR_BITS, iobuf, @@ -704,7 +704,7 @@ static void glue(nand_blk_write_, PAGE_SIZE)(NANDFlashState *s) } /* Erase a single block */ -static void glue(nand_blk_erase_, PAGE_SIZE)(NANDFlashState *s) +static void glue(nand_blk_erase_, NAND_PAGE_SIZE)(NANDFlashState *s) { uint64_t i, page, addr; uint8_t iobuf[0x200] = { [0 ... 0x1ff] = 0xff, }; @@ -716,7 +716,7 @@ static void glue(nand_blk_erase_, PAGE_SIZE)(NANDFlashState *s) if (!s->blk) { memset(s->storage + PAGE_START(addr), - 0xff, (PAGE_SIZE + OOB_SIZE) << s->erase_shift); + 0xff, (NAND_PAGE_SIZE + OOB_SIZE) << s->erase_shift); } else if (s->mem_oob) { memset(s->storage + (PAGE(addr) << OOB_SHIFT), 0xff, OOB_SIZE << s->erase_shift); @@ -742,7 +742,7 @@ static void glue(nand_blk_erase_, PAGE_SIZE)(NANDFlashState *s) memset(iobuf, 0xff, 0x200); i = (addr & ~0x1ff) + 0x200; - for (addr += ((PAGE_SIZE + OOB_SIZE) << s->erase_shift) - 0x200; + for (addr += ((NAND_PAGE_SIZE + OOB_SIZE) << s->erase_shift) - 0x200; i < addr; i += 0x200) { if (blk_pwrite(s->blk, i, iobuf, BDRV_SECTOR_SIZE, 0) < 0) { printf("%s: write error in sector %" PRIu64 "\n", @@ -763,7 +763,7 @@ static void glue(nand_blk_erase_, PAGE_SIZE)(NANDFlashState *s) } } -static void glue(nand_blk_load_, PAGE_SIZE)(NANDFlashState *s, +static void glue(nand_blk_load_, NAND_PAGE_SIZE)(NANDFlashState *s, uint64_t addr, int offset) { if (PAGE(addr) >= s->pages) { @@ -777,7 +777,7 @@ static void glue(nand_blk_load_, PAGE_SIZE)(NANDFlashState *s, printf("%s: read error in sector %" PRIu64 "\n", __func__, SECTOR(addr)); } - memcpy(s->io + SECTOR_OFFSET(s->addr) + PAGE_SIZE, + memcpy(s->io + SECTOR_OFFSET(s->addr) + NAND_PAGE_SIZE, s->storage + (PAGE(s->addr) << OOB_SHIFT), OOB_SIZE); s->ioaddr = s->io + SECTOR_OFFSET(s->addr) + offset; @@ -791,23 +791,23 @@ static void glue(nand_blk_load_, PAGE_SIZE)(NANDFlashState *s, } } else { memcpy(s->io, s->storage + PAGE_START(s->addr) + - offset, PAGE_SIZE + OOB_SIZE - offset); + offset, NAND_PAGE_SIZE + OOB_SIZE - offset); s->ioaddr = s->io; } } -static void glue(nand_init_, PAGE_SIZE)(NANDFlashState *s) +static void glue(nand_init_, NAND_PAGE_SIZE)(NANDFlashState *s) { s->oob_shift = PAGE_SHIFT - 5; s->pages = s->size >> PAGE_SHIFT; s->addr_shift = ADDR_SHIFT; - s->blk_erase = glue(nand_blk_erase_, PAGE_SIZE); - s->blk_write = glue(nand_blk_write_, PAGE_SIZE); - s->blk_load = glue(nand_blk_load_, PAGE_SIZE); + s->blk_erase = glue(nand_blk_erase_, NAND_PAGE_SIZE); + s->blk_write = glue(nand_blk_write_, NAND_PAGE_SIZE); + s->blk_load = glue(nand_blk_load_, NAND_PAGE_SIZE); } -# undef PAGE_SIZE +# undef NAND_PAGE_SIZE # undef PAGE_SHIFT # undef PAGE_SECTORS # undef ADDR_SHIFT From patchwork Mon Jan 18 06:38:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jiaxun Yang X-Patchwork-Id: 12026667 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8FFCBC433DB for ; Mon, 18 Jan 2021 06:47:59 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1A1C5229C6 for ; Mon, 18 Jan 2021 06:47:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1A1C5229C6 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=flygoat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:40430 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l1OKU-00062R-1w for qemu-devel@archiver.kernel.org; Mon, 18 Jan 2021 01:47:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:33686) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1OBm-0002oD-2O; Mon, 18 Jan 2021 01:39:01 -0500 Received: from wnew4-smtp.messagingengine.com ([64.147.123.18]:57275) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1OBk-0007Sa-9V; Mon, 18 Jan 2021 01:38:57 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailnew.west.internal (Postfix) with ESMTP id 66B3316B0; Mon, 18 Jan 2021 01:38:53 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Mon, 18 Jan 2021 01:38:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=JTe4D5W39+VsE I965mQwGabhGQ49JRkP3Msu7hBi17U=; b=roAetzHyYROCAOKzP4DJ32++2D8em t1XzogpI2+0xrZ1G0Hd5WDAHMMY9cG0YXaP9o3iDRi+2optlQlbak/qNG9aE+3Ho Xah7Svm6qKbhk9nsgMdSb31Tv8nX1TFA1fYDskblNF+c+GRNsApFtEHyJOT98Zh4 ECYM/ivkxTV4yW/9172fHhBk2PcgPjP5jHy3oFpFHfmru5PS8SwTwJnYdtjwRGFC jlgwo9Kg7Wp+JlGl3gTDDq46dac/vpFRMbltzWQo4mRaE/ZkuNc3rFmSSXkCL+Dq nv1JgW+m0Ay8AAW64tAXFEBJuQPalYPRcW3GRGJzgWKPXDH4sNLONxifA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=JTe4D5W39+VsEI965mQwGabhGQ49JRkP3Msu7hBi17U=; b=iI/ZXW6S YEDfWT71qXGiVYFdL2SpiwMZeSp07qGQXljtV76iEemQb6D4U4DojAm61JTULBnL VgJAyEPUuiycUXPfexfcZiKpWn5pTBH6nP+8lnYdjAeJF8JFKOOzMgkQk7yaNYlX 1I5F4UbtH0sa/bLslt1AlsJzXw3UDDgRaJeTjxnOH/2L6LzMrlKmxri5x6ljEibU RBDKsa7qtDnR/3rBdJHLzw4R9kINgvXZf2mhtCfXlxtYKlpv28QRub3KNF2f/rJz MoHF2/WCbAqtZxSrhJVsBQ49a8RcOhto9u2F6tPfNym5XfvSqvBM4GkWRNfYUJY8 fZBtrNfYnJEjlw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrtdejgdeliecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomheplfhirgiguhhn ucgjrghnghcuoehjihgrgihunhdrhigrnhhgsehflhihghhorghtrdgtohhmqeenucggtf frrghtthgvrhhnpeegudehkeduudehkeetvdevffeiveetteeffeeikeduffeiuddutedv teffieelkeenucffohhmrghinhepohhpvghnghhrohhuphdrohhrghdpphhhhihsihgtrg hlmhgvmhhorhihsghlohgtkhdrrhhunhenucfkphepudduiedrvddvkedrkeegrddvnecu vehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepjhhirgiguh hnrdihrghnghesfhhlhihgohgrthdrtghomh X-ME-Proxy: Received: from strike.U-LINK.com (unknown [116.228.84.2]) by mail.messagingengine.com (Postfix) with ESMTPA id 5D2D924005C; Mon, 18 Jan 2021 01:38:46 -0500 (EST) From: Jiaxun Yang To: qemu-devel@nongnu.org Subject: [PATCH v2 5/9] elf2dmp: Rename PAGE_SIZE to ELF2DMP_PAGE_SIZE Date: Mon, 18 Jan 2021 14:38:04 +0800 Message-Id: <20210118063808.12471-6-jiaxun.yang@flygoat.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210118063808.12471-1-jiaxun.yang@flygoat.com> References: <20210118063808.12471-1-jiaxun.yang@flygoat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=64.147.123.18; envelope-from=jiaxun.yang@flygoat.com; helo=wnew4-smtp.messagingengine.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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_LOW=-0.7, RCVD_IN_SORBS_WEB=1.5, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Laurent Vivier , Thomas Huth , Viktor Prutyanov , kvm@vger.kernel.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Alistair Francis , Greg Kurz , Wainer dos Santos Moschetta , Max Reitz , qemu-ppc@nongnu.org, Kevin Wolf , Paolo Bonzini , qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , David Gibson Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" As per POSIX specification of limits.h [1], OS libc may define PAGE_SIZE in limits.h. To prevent collosion of definition, we rename PAGE_SIZE here. [1]: https://pubs.opengroup.org/onlinepubs/7908799/xsh/limits.h.html Signed-off-by: Jiaxun Yang Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé --- contrib/elf2dmp/addrspace.h | 6 +++--- contrib/elf2dmp/addrspace.c | 4 ++-- contrib/elf2dmp/main.c | 18 +++++++++--------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/contrib/elf2dmp/addrspace.h b/contrib/elf2dmp/addrspace.h index d87f6a18c6..00b44c1218 100644 --- a/contrib/elf2dmp/addrspace.h +++ b/contrib/elf2dmp/addrspace.h @@ -10,9 +10,9 @@ #include "qemu_elf.h" -#define PAGE_BITS 12 -#define PAGE_SIZE (1ULL << PAGE_BITS) -#define PFN_MASK (~(PAGE_SIZE - 1)) +#define ELF2DMP_PAGE_BITS 12 +#define ELF2DMP_PAGE_SIZE (1ULL << ELF2DMP_PAGE_BITS) +#define ELF2DMP_PFN_MASK (~(ELF2DMP_PAGE_SIZE - 1)) #define INVALID_PA UINT64_MAX diff --git a/contrib/elf2dmp/addrspace.c b/contrib/elf2dmp/addrspace.c index 8a76069cb5..53ded17061 100644 --- a/contrib/elf2dmp/addrspace.c +++ b/contrib/elf2dmp/addrspace.c @@ -207,8 +207,8 @@ int va_space_rw(struct va_space *vs, uint64_t addr, void *buf, size_t size, int is_write) { while (size) { - uint64_t page = addr & PFN_MASK; - size_t s = (page + PAGE_SIZE) - addr; + uint64_t page = addr & ELF2DMP_PFN_MASK; + size_t s = (page + ELF2DMP_PAGE_SIZE) - addr; void *ptr; s = (s > size) ? size : s; diff --git a/contrib/elf2dmp/main.c b/contrib/elf2dmp/main.c index ac746e49e0..20b477d582 100644 --- a/contrib/elf2dmp/main.c +++ b/contrib/elf2dmp/main.c @@ -244,8 +244,8 @@ static int fill_header(WinDumpHeader64 *hdr, struct pa_space *ps, WinDumpHeader64 h; size_t i; - QEMU_BUILD_BUG_ON(KUSD_OFFSET_SUITE_MASK >= PAGE_SIZE); - QEMU_BUILD_BUG_ON(KUSD_OFFSET_PRODUCT_TYPE >= PAGE_SIZE); + QEMU_BUILD_BUG_ON(KUSD_OFFSET_SUITE_MASK >= ELF2DMP_PAGE_SIZE); + QEMU_BUILD_BUG_ON(KUSD_OFFSET_PRODUCT_TYPE >= ELF2DMP_PAGE_SIZE); if (!suite_mask || !product_type) { return 1; @@ -281,14 +281,14 @@ static int fill_header(WinDumpHeader64 *hdr, struct pa_space *ps, }; for (i = 0; i < ps->block_nr; i++) { - h.PhysicalMemoryBlock.NumberOfPages += ps->block[i].size / PAGE_SIZE; + h.PhysicalMemoryBlock.NumberOfPages += ps->block[i].size / ELF2DMP_PAGE_SIZE; h.PhysicalMemoryBlock.Run[i] = (WinDumpPhyMemRun64) { - .BasePage = ps->block[i].paddr / PAGE_SIZE, - .PageCount = ps->block[i].size / PAGE_SIZE, + .BasePage = ps->block[i].paddr / ELF2DMP_PAGE_SIZE, + .PageCount = ps->block[i].size / ELF2DMP_PAGE_SIZE, }; } - h.RequiredDumpSpace += h.PhysicalMemoryBlock.NumberOfPages << PAGE_BITS; + h.RequiredDumpSpace += h.PhysicalMemoryBlock.NumberOfPages << ELF2DMP_PAGE_BITS; *hdr = h; @@ -379,7 +379,7 @@ static int pe_get_pdb_symstore_hash(uint64_t base, void *start_addr, size_t pdb_name_sz; size_t i; - QEMU_BUILD_BUG_ON(sizeof(*dos_hdr) >= PAGE_SIZE); + QEMU_BUILD_BUG_ON(sizeof(*dos_hdr) >= ELF2DMP_PAGE_SIZE); if (memcmp(&dos_hdr->e_magic, e_magic, sizeof(e_magic))) { return 1; @@ -509,10 +509,10 @@ int main(int argc, char *argv[]) } printf("CPU #0 IDT[0] -> 0x%016"PRIx64"\n", idt_desc_addr(first_idt_desc)); - KernBase = idt_desc_addr(first_idt_desc) & ~(PAGE_SIZE - 1); + KernBase = idt_desc_addr(first_idt_desc) & ~(ELF2DMP_PAGE_SIZE - 1); printf("Searching kernel downwards from 0x%016"PRIx64"...\n", KernBase); - for (; KernBase >= 0xfffff78000000000; KernBase -= PAGE_SIZE) { + for (; KernBase >= 0xfffff78000000000; KernBase -= ELF2DMP_PAGE_SIZE) { nt_start_addr = va_space_resolve(&vs, KernBase); if (!nt_start_addr) { continue; From patchwork Mon Jan 18 06:38:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jiaxun Yang X-Patchwork-Id: 12026687 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7A00AC433DB for ; Mon, 18 Jan 2021 06:58:50 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E35E22231F for ; Mon, 18 Jan 2021 06:58:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E35E22231F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=flygoat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:33184 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l1OUy-0006Vh-Vz for qemu-devel@archiver.kernel.org; Mon, 18 Jan 2021 01:58:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:33708) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1OBt-0002od-Sa; Mon, 18 Jan 2021 01:39:08 -0500 Received: from wnew4-smtp.messagingengine.com ([64.147.123.18]:59287) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1OBr-0007WH-DQ; Mon, 18 Jan 2021 01:39:05 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailnew.west.internal (Postfix) with ESMTP id 8DBC416B2; Mon, 18 Jan 2021 01:39:00 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Mon, 18 Jan 2021 01:39:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=6/l1gmbJPtuhW OiIQ/udYtmodEoVrJsKo29dldMDHEM=; b=FCwq//oZhtYnvQ5/G2N69zhwSHFn2 xiBIQTLr77eDTsVCnxI/33qB/0/uhS6lt20Xjuw1oq99p2tsoKwzbblXv0PBL4O7 BCdGtkfym3bBe+6+DIHqwY6Yps7vouBukypWV9wUfApf6RsXXPTXi198HT6+4yd2 sVtdSfYh2tr5WOCLv75tbE9VvGn4QS9HxjCYBAviQ/kZoMyfjPRFJtkVKxaaKUBO u5GQJkGy8NMGjf97Ww5lFiTItRdfdmi/tirvIipthVfo+PKqXtGYciieurnzx/pz tTizs450TM1FcWL15d3FjNT7WEgkJ0iTaR95BcqfA8VecKBdiXrZWiESQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=6/l1gmbJPtuhWOiIQ/udYtmodEoVrJsKo29dldMDHEM=; b=TlBhvzip EUXbSEDlq7kmayb7Suf/6s0ymvcOInPZb9T1I3B2wscjuyBpq5TSda/JohfnzeUt xWWEPIzUvEdT8WwOGfAgeEyCiyMMJF7NGg758RZwPYlv2KUfU837ztGRol9+uCWu HVzJcBfhkLoBf058m+KIN3cHGZd6jrPzW5ad47ePg3qzFCuOAj4YmcDKjVL4ZuK/ o58bP+mwcACLIP1BA5796C2m7y+KpNldTDMWIafoOyLByZhDfC+YAQdirPX+RKA/ HwY3DZ0tED+qZ+thNE8T93zsXh0Ur/WK92MiGOVu3TI3VM5iytLUJn6GIW0E/vwW 0HxomvECAbnkiw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrtdejgdeliecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomheplfhirgiguhhn ucgjrghnghcuoehjihgrgihunhdrhigrnhhgsehflhihghhorghtrdgtohhmqeenucggtf frrghtthgvrhhnpedtveehvdefleeghfeuveffjeeuffetffekhfeviedujeeiieevuddv iedtheffjeenucffohhmrghinhepohhpvghnghhrohhuphdrohhrghenucfkphepudduie drvddvkedrkeegrddvnecuvehluhhsthgvrhfuihiivgepudenucfrrghrrghmpehmrghi lhhfrhhomhepjhhirgiguhhnrdihrghnghesfhhlhihgohgrthdrtghomh X-ME-Proxy: Received: from strike.U-LINK.com (unknown [116.228.84.2]) by mail.messagingengine.com (Postfix) with ESMTPA id E3F1C240066; Mon, 18 Jan 2021 01:38:52 -0500 (EST) From: Jiaxun Yang To: qemu-devel@nongnu.org Subject: [PATCH v2 6/9] tests: Rename PAGE_SIZE definitions Date: Mon, 18 Jan 2021 14:38:05 +0800 Message-Id: <20210118063808.12471-7-jiaxun.yang@flygoat.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210118063808.12471-1-jiaxun.yang@flygoat.com> References: <20210118063808.12471-1-jiaxun.yang@flygoat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=64.147.123.18; envelope-from=jiaxun.yang@flygoat.com; helo=wnew4-smtp.messagingengine.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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_LOW=-0.7, RCVD_IN_SORBS_WEB=1.5, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Laurent Vivier , Thomas Huth , Viktor Prutyanov , kvm@vger.kernel.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Alistair Francis , Greg Kurz , Wainer dos Santos Moschetta , Max Reitz , qemu-ppc@nongnu.org, Kevin Wolf , Paolo Bonzini , qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , David Gibson Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" As per POSIX specification of limits.h [1], OS libc may define PAGE_SIZE in limits.h. Self defined PAGE_SIZE is frequently used in tests, to prevent collosion of definition, we give PAGE_SIZE definitons reasonable prefixs. [1]: https://pubs.opengroup.org/onlinepubs/7908799/xsh/limits.h.html Signed-off-by: Jiaxun Yang Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé --- tests/migration/stress.c | 10 ++--- tests/qtest/libqos/malloc-pc.c | 4 +- tests/qtest/libqos/malloc-spapr.c | 4 +- tests/qtest/m25p80-test.c | 54 +++++++++++----------- tests/tcg/multiarch/system/memory.c | 6 +-- tests/test-xbzrle.c | 70 ++++++++++++++--------------- 6 files changed, 74 insertions(+), 74 deletions(-) diff --git a/tests/migration/stress.c b/tests/migration/stress.c index de45e8e490..b7240a15c8 100644 --- a/tests/migration/stress.c +++ b/tests/migration/stress.c @@ -27,7 +27,7 @@ const char *argv0; -#define PAGE_SIZE 4096 +#define RAM_PAGE_SIZE 4096 #ifndef CONFIG_GETTID static int gettid(void) @@ -158,11 +158,11 @@ static unsigned long long now(void) static void stressone(unsigned long long ramsizeMB) { - size_t pagesPerMB = 1024 * 1024 / PAGE_SIZE; + size_t pagesPerMB = 1024 * 1024 / RAM_PAGE_SIZE; g_autofree char *ram = g_malloc(ramsizeMB * 1024 * 1024); char *ramptr; size_t i, j, k; - g_autofree char *data = g_malloc(PAGE_SIZE); + g_autofree char *data = g_malloc(RAM_PAGE_SIZE); char *dataptr; size_t nMB = 0; unsigned long long before, after; @@ -174,7 +174,7 @@ static void stressone(unsigned long long ramsizeMB) * calloc instead :-) */ memset(ram, 0xfe, ramsizeMB * 1024 * 1024); - if (random_bytes(data, PAGE_SIZE) < 0) { + if (random_bytes(data, RAM_PAGE_SIZE) < 0) { return; } @@ -186,7 +186,7 @@ static void stressone(unsigned long long ramsizeMB) for (i = 0; i < ramsizeMB; i++, nMB++) { for (j = 0; j < pagesPerMB; j++) { dataptr = data; - for (k = 0; k < PAGE_SIZE; k += sizeof(long long)) { + for (k = 0; k < RAM_PAGE_SIZE; k += sizeof(long long)) { ramptr += sizeof(long long); dataptr += sizeof(long long); *(unsigned long long *)ramptr ^= *(unsigned long long *)dataptr; diff --git a/tests/qtest/libqos/malloc-pc.c b/tests/qtest/libqos/malloc-pc.c index 16ff9609cc..f1e3b392a5 100644 --- a/tests/qtest/libqos/malloc-pc.c +++ b/tests/qtest/libqos/malloc-pc.c @@ -18,7 +18,7 @@ #include "qemu-common.h" -#define PAGE_SIZE (4096) +#define ALLOC_PAGE_SIZE (4096) void pc_alloc_init(QGuestAllocator *s, QTestState *qts, QAllocOpts flags) { @@ -26,7 +26,7 @@ void pc_alloc_init(QGuestAllocator *s, QTestState *qts, QAllocOpts flags) QFWCFG *fw_cfg = pc_fw_cfg_init(qts); ram_size = qfw_cfg_get_u64(fw_cfg, FW_CFG_RAM_SIZE); - alloc_init(s, flags, 1 << 20, MIN(ram_size, 0xE0000000), PAGE_SIZE); + alloc_init(s, flags, 1 << 20, MIN(ram_size, 0xE0000000), ALLOC_PAGE_SIZE); /* clean-up */ pc_fw_cfg_uninit(fw_cfg); diff --git a/tests/qtest/libqos/malloc-spapr.c b/tests/qtest/libqos/malloc-spapr.c index 84862e4876..05b306c191 100644 --- a/tests/qtest/libqos/malloc-spapr.c +++ b/tests/qtest/libqos/malloc-spapr.c @@ -10,7 +10,7 @@ #include "qemu-common.h" -#define PAGE_SIZE 4096 +#define SPAPR_PAGE_SIZE 4096 /* Memory must be a multiple of 256 MB, * so we have at least 256MB @@ -19,5 +19,5 @@ void spapr_alloc_init(QGuestAllocator *s, QTestState *qts, QAllocOpts flags) { - alloc_init(s, flags, 1 << 20, SPAPR_MIN_SIZE, PAGE_SIZE); + alloc_init(s, flags, 1 << 20, SPAPR_MIN_SIZE, SPAPR_PAGE_SIZE); } diff --git a/tests/qtest/m25p80-test.c b/tests/qtest/m25p80-test.c index 50c6b79fb3..f860cef5f0 100644 --- a/tests/qtest/m25p80-test.c +++ b/tests/qtest/m25p80-test.c @@ -62,7 +62,7 @@ enum { #define FLASH_JEDEC 0x20ba19 /* n25q256a */ #define FLASH_SIZE (32 * 1024 * 1024) -#define PAGE_SIZE 256 +#define FLASH_PAGE_SIZE 256 /* * Use an explicit bswap for the values read/wrote to the flash region @@ -165,7 +165,7 @@ static void read_page(uint32_t addr, uint32_t *page) writel(ASPEED_FLASH_BASE, make_be32(addr)); /* Continuous read are supported */ - for (i = 0; i < PAGE_SIZE / 4; i++) { + for (i = 0; i < FLASH_PAGE_SIZE / 4; i++) { page[i] = make_be32(readl(ASPEED_FLASH_BASE)); } spi_ctrl_stop_user(); @@ -178,15 +178,15 @@ static void read_page_mem(uint32_t addr, uint32_t *page) /* move out USER mode to use direct reads from the AHB bus */ spi_ctrl_setmode(CTRL_READMODE, READ); - for (i = 0; i < PAGE_SIZE / 4; i++) { + for (i = 0; i < FLASH_PAGE_SIZE / 4; i++) { page[i] = make_be32(readl(ASPEED_FLASH_BASE + addr + i * 4)); } } static void test_erase_sector(void) { - uint32_t some_page_addr = 0x600 * PAGE_SIZE; - uint32_t page[PAGE_SIZE / 4]; + uint32_t some_page_addr = 0x600 * FLASH_PAGE_SIZE; + uint32_t page[FLASH_PAGE_SIZE / 4]; int i; spi_conf(CONF_ENABLE_W0); @@ -200,14 +200,14 @@ static void test_erase_sector(void) /* Previous page should be full of zeroes as backend is not * initialized */ - read_page(some_page_addr - PAGE_SIZE, page); - for (i = 0; i < PAGE_SIZE / 4; i++) { + read_page(some_page_addr - FLASH_PAGE_SIZE, page); + for (i = 0; i < FLASH_PAGE_SIZE / 4; i++) { g_assert_cmphex(page[i], ==, 0x0); } /* But this one was erased */ read_page(some_page_addr, page); - for (i = 0; i < PAGE_SIZE / 4; i++) { + for (i = 0; i < FLASH_PAGE_SIZE / 4; i++) { g_assert_cmphex(page[i], ==, 0xffffffff); } @@ -216,8 +216,8 @@ static void test_erase_sector(void) static void test_erase_all(void) { - uint32_t some_page_addr = 0x15000 * PAGE_SIZE; - uint32_t page[PAGE_SIZE / 4]; + uint32_t some_page_addr = 0x15000 * FLASH_PAGE_SIZE; + uint32_t page[FLASH_PAGE_SIZE / 4]; int i; spi_conf(CONF_ENABLE_W0); @@ -225,7 +225,7 @@ static void test_erase_all(void) /* Check some random page. Should be full of zeroes as backend is * not initialized */ read_page(some_page_addr, page); - for (i = 0; i < PAGE_SIZE / 4; i++) { + for (i = 0; i < FLASH_PAGE_SIZE / 4; i++) { g_assert_cmphex(page[i], ==, 0x0); } @@ -236,7 +236,7 @@ static void test_erase_all(void) /* Recheck that some random page */ read_page(some_page_addr, page); - for (i = 0; i < PAGE_SIZE / 4; i++) { + for (i = 0; i < FLASH_PAGE_SIZE / 4; i++) { g_assert_cmphex(page[i], ==, 0xffffffff); } @@ -245,9 +245,9 @@ static void test_erase_all(void) static void test_write_page(void) { - uint32_t my_page_addr = 0x14000 * PAGE_SIZE; /* beyond 16MB */ - uint32_t some_page_addr = 0x15000 * PAGE_SIZE; - uint32_t page[PAGE_SIZE / 4]; + uint32_t my_page_addr = 0x14000 * FLASH_PAGE_SIZE; /* beyond 16MB */ + uint32_t some_page_addr = 0x15000 * FLASH_PAGE_SIZE; + uint32_t page[FLASH_PAGE_SIZE / 4]; int i; spi_conf(CONF_ENABLE_W0); @@ -259,20 +259,20 @@ static void test_write_page(void) writel(ASPEED_FLASH_BASE, make_be32(my_page_addr)); /* Fill the page with its own addresses */ - for (i = 0; i < PAGE_SIZE / 4; i++) { + for (i = 0; i < FLASH_PAGE_SIZE / 4; i++) { writel(ASPEED_FLASH_BASE, make_be32(my_page_addr + i * 4)); } spi_ctrl_stop_user(); /* Check what was written */ read_page(my_page_addr, page); - for (i = 0; i < PAGE_SIZE / 4; i++) { + for (i = 0; i < FLASH_PAGE_SIZE / 4; i++) { g_assert_cmphex(page[i], ==, my_page_addr + i * 4); } /* Check some other page. It should be full of 0xff */ read_page(some_page_addr, page); - for (i = 0; i < PAGE_SIZE / 4; i++) { + for (i = 0; i < FLASH_PAGE_SIZE / 4; i++) { g_assert_cmphex(page[i], ==, 0xffffffff); } @@ -281,9 +281,9 @@ static void test_write_page(void) static void test_read_page_mem(void) { - uint32_t my_page_addr = 0x14000 * PAGE_SIZE; /* beyond 16MB */ - uint32_t some_page_addr = 0x15000 * PAGE_SIZE; - uint32_t page[PAGE_SIZE / 4]; + uint32_t my_page_addr = 0x14000 * FLASH_PAGE_SIZE; /* beyond 16MB */ + uint32_t some_page_addr = 0x15000 * FLASH_PAGE_SIZE; + uint32_t page[FLASH_PAGE_SIZE / 4]; int i; /* Enable 4BYTE mode for controller. This is should be strapped by @@ -300,13 +300,13 @@ static void test_read_page_mem(void) /* Check what was written */ read_page_mem(my_page_addr, page); - for (i = 0; i < PAGE_SIZE / 4; i++) { + for (i = 0; i < FLASH_PAGE_SIZE / 4; i++) { g_assert_cmphex(page[i], ==, my_page_addr + i * 4); } /* Check some other page. It should be full of 0xff */ read_page_mem(some_page_addr, page); - for (i = 0; i < PAGE_SIZE / 4; i++) { + for (i = 0; i < FLASH_PAGE_SIZE / 4; i++) { g_assert_cmphex(page[i], ==, 0xffffffff); } @@ -315,8 +315,8 @@ static void test_read_page_mem(void) static void test_write_page_mem(void) { - uint32_t my_page_addr = 0x15000 * PAGE_SIZE; - uint32_t page[PAGE_SIZE / 4]; + uint32_t my_page_addr = 0x15000 * FLASH_PAGE_SIZE; + uint32_t page[FLASH_PAGE_SIZE / 4]; int i; /* Enable 4BYTE mode for controller. This is should be strapped by @@ -334,14 +334,14 @@ static void test_write_page_mem(void) /* move out USER mode to use direct writes to the AHB bus */ spi_ctrl_setmode(CTRL_WRITEMODE, PP); - for (i = 0; i < PAGE_SIZE / 4; i++) { + for (i = 0; i < FLASH_PAGE_SIZE / 4; i++) { writel(ASPEED_FLASH_BASE + my_page_addr + i * 4, make_be32(my_page_addr + i * 4)); } /* Check what was written */ read_page_mem(my_page_addr, page); - for (i = 0; i < PAGE_SIZE / 4; i++) { + for (i = 0; i < FLASH_PAGE_SIZE / 4; i++) { g_assert_cmphex(page[i], ==, my_page_addr + i * 4); } diff --git a/tests/tcg/multiarch/system/memory.c b/tests/tcg/multiarch/system/memory.c index d124502d73..eb0ec6f8eb 100644 --- a/tests/tcg/multiarch/system/memory.c +++ b/tests/tcg/multiarch/system/memory.c @@ -20,12 +20,12 @@ # error "Target does not specify CHECK_UNALIGNED" #endif -#define PAGE_SIZE 4096 /* nominal 4k "pages" */ -#define TEST_SIZE (PAGE_SIZE * 4) /* 4 pages */ +#define MEM_PAGE_SIZE 4096 /* nominal 4k "pages" */ +#define TEST_SIZE (MEM_PAGE_SIZE * 4) /* 4 pages */ #define ARRAY_SIZE(x) ((sizeof(x) / sizeof((x)[0]))) -__attribute__((aligned(PAGE_SIZE))) +__attribute__((aligned(MEM_PAGE_SIZE))) static uint8_t test_data[TEST_SIZE]; typedef void (*init_ufn) (int offset); diff --git a/tests/test-xbzrle.c b/tests/test-xbzrle.c index f5e08de91e..795d6f1cba 100644 --- a/tests/test-xbzrle.c +++ b/tests/test-xbzrle.c @@ -15,7 +15,7 @@ #include "qemu/cutils.h" #include "../migration/xbzrle.h" -#define PAGE_SIZE 4096 +#define XBZRLE_PAGE_SIZE 4096 static void test_uleb(void) { @@ -41,11 +41,11 @@ static void test_uleb(void) static void test_encode_decode_zero(void) { - uint8_t *buffer = g_malloc0(PAGE_SIZE); - uint8_t *compressed = g_malloc0(PAGE_SIZE); + uint8_t *buffer = g_malloc0(XBZRLE_PAGE_SIZE); + uint8_t *compressed = g_malloc0(XBZRLE_PAGE_SIZE); int i = 0; int dlen = 0; - int diff_len = g_test_rand_int_range(0, PAGE_SIZE - 1006); + int diff_len = g_test_rand_int_range(0, XBZRLE_PAGE_SIZE - 1006); for (i = diff_len; i > 0; i--) { buffer[1000 + i] = i; @@ -55,8 +55,8 @@ static void test_encode_decode_zero(void) buffer[1000 + diff_len + 5] = 105; /* encode zero page */ - dlen = xbzrle_encode_buffer(buffer, buffer, PAGE_SIZE, compressed, - PAGE_SIZE); + dlen = xbzrle_encode_buffer(buffer, buffer, XBZRLE_PAGE_SIZE, compressed, + XBZRLE_PAGE_SIZE); g_assert(dlen == 0); g_free(buffer); @@ -65,11 +65,11 @@ static void test_encode_decode_zero(void) static void test_encode_decode_unchanged(void) { - uint8_t *compressed = g_malloc0(PAGE_SIZE); - uint8_t *test = g_malloc0(PAGE_SIZE); + uint8_t *compressed = g_malloc0(XBZRLE_PAGE_SIZE); + uint8_t *test = g_malloc0(XBZRLE_PAGE_SIZE); int i = 0; int dlen = 0; - int diff_len = g_test_rand_int_range(0, PAGE_SIZE - 1006); + int diff_len = g_test_rand_int_range(0, XBZRLE_PAGE_SIZE - 1006); for (i = diff_len; i > 0; i--) { test[1000 + i] = i + 4; @@ -79,8 +79,8 @@ static void test_encode_decode_unchanged(void) test[1000 + diff_len + 5] = 109; /* test unchanged buffer */ - dlen = xbzrle_encode_buffer(test, test, PAGE_SIZE, compressed, - PAGE_SIZE); + dlen = xbzrle_encode_buffer(test, test, XBZRLE_PAGE_SIZE, compressed, + XBZRLE_PAGE_SIZE); g_assert(dlen == 0); g_free(test); @@ -89,21 +89,21 @@ static void test_encode_decode_unchanged(void) static void test_encode_decode_1_byte(void) { - uint8_t *buffer = g_malloc0(PAGE_SIZE); - uint8_t *test = g_malloc0(PAGE_SIZE); - uint8_t *compressed = g_malloc(PAGE_SIZE); + uint8_t *buffer = g_malloc0(XBZRLE_PAGE_SIZE); + uint8_t *test = g_malloc0(XBZRLE_PAGE_SIZE); + uint8_t *compressed = g_malloc(XBZRLE_PAGE_SIZE); int dlen = 0, rc = 0; uint8_t buf[2]; - test[PAGE_SIZE - 1] = 1; + test[XBZRLE_PAGE_SIZE - 1] = 1; - dlen = xbzrle_encode_buffer(buffer, test, PAGE_SIZE, compressed, - PAGE_SIZE); + dlen = xbzrle_encode_buffer(buffer, test, XBZRLE_PAGE_SIZE, compressed, + XBZRLE_PAGE_SIZE); g_assert(dlen == (uleb128_encode_small(&buf[0], 4095) + 2)); - rc = xbzrle_decode_buffer(compressed, dlen, buffer, PAGE_SIZE); - g_assert(rc == PAGE_SIZE); - g_assert(memcmp(test, buffer, PAGE_SIZE) == 0); + rc = xbzrle_decode_buffer(compressed, dlen, buffer, XBZRLE_PAGE_SIZE); + g_assert(rc == XBZRLE_PAGE_SIZE); + g_assert(memcmp(test, buffer, XBZRLE_PAGE_SIZE) == 0); g_free(buffer); g_free(compressed); @@ -112,18 +112,18 @@ static void test_encode_decode_1_byte(void) static void test_encode_decode_overflow(void) { - uint8_t *compressed = g_malloc0(PAGE_SIZE); - uint8_t *test = g_malloc0(PAGE_SIZE); - uint8_t *buffer = g_malloc0(PAGE_SIZE); + uint8_t *compressed = g_malloc0(XBZRLE_PAGE_SIZE); + uint8_t *test = g_malloc0(XBZRLE_PAGE_SIZE); + uint8_t *buffer = g_malloc0(XBZRLE_PAGE_SIZE); int i = 0, rc = 0; - for (i = 0; i < PAGE_SIZE / 2 - 1; i++) { + for (i = 0; i < XBZRLE_PAGE_SIZE / 2 - 1; i++) { test[i * 2] = 1; } /* encode overflow */ - rc = xbzrle_encode_buffer(buffer, test, PAGE_SIZE, compressed, - PAGE_SIZE); + rc = xbzrle_encode_buffer(buffer, test, XBZRLE_PAGE_SIZE, compressed, + XBZRLE_PAGE_SIZE); g_assert(rc == -1); g_free(buffer); @@ -133,13 +133,13 @@ static void test_encode_decode_overflow(void) static void encode_decode_range(void) { - uint8_t *buffer = g_malloc0(PAGE_SIZE); - uint8_t *compressed = g_malloc(PAGE_SIZE); - uint8_t *test = g_malloc0(PAGE_SIZE); + uint8_t *buffer = g_malloc0(XBZRLE_PAGE_SIZE); + uint8_t *compressed = g_malloc(XBZRLE_PAGE_SIZE); + uint8_t *test = g_malloc0(XBZRLE_PAGE_SIZE); int i = 0, rc = 0; int dlen = 0; - int diff_len = g_test_rand_int_range(0, PAGE_SIZE - 1006); + int diff_len = g_test_rand_int_range(0, XBZRLE_PAGE_SIZE - 1006); for (i = diff_len; i > 0; i--) { buffer[1000 + i] = i; @@ -153,12 +153,12 @@ static void encode_decode_range(void) test[1000 + diff_len + 5] = 109; /* test encode/decode */ - dlen = xbzrle_encode_buffer(test, buffer, PAGE_SIZE, compressed, - PAGE_SIZE); + dlen = xbzrle_encode_buffer(test, buffer, XBZRLE_PAGE_SIZE, compressed, + XBZRLE_PAGE_SIZE); - rc = xbzrle_decode_buffer(compressed, dlen, test, PAGE_SIZE); - g_assert(rc < PAGE_SIZE); - g_assert(memcmp(test, buffer, PAGE_SIZE) == 0); + rc = xbzrle_decode_buffer(compressed, dlen, test, XBZRLE_PAGE_SIZE); + g_assert(rc < XBZRLE_PAGE_SIZE); + g_assert(memcmp(test, buffer, XBZRLE_PAGE_SIZE) == 0); g_free(buffer); g_free(compressed); From patchwork Mon Jan 18 06:38:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaxun Yang X-Patchwork-Id: 12026673 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D3CE5C433E0 for ; Mon, 18 Jan 2021 06:52:36 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 74C112231F for ; Mon, 18 Jan 2021 06:52:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 74C112231F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=flygoat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:50592 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l1OOx-0001v3-Cd for qemu-devel@archiver.kernel.org; Mon, 18 Jan 2021 01:52:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:33802) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1OC4-0002pc-H8; Mon, 18 Jan 2021 01:39:18 -0500 Received: from wnew4-smtp.messagingengine.com ([64.147.123.18]:42981) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1OBy-0007Xv-H3; Mon, 18 Jan 2021 01:39:15 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailnew.west.internal (Postfix) with ESMTP id 5282216B4; Mon, 18 Jan 2021 01:39:06 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Mon, 18 Jan 2021 01:39:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=f02riIqmTLQjf sxRmbAMxWaoH+GGUs+3oNGVdaXSoVI=; b=lz/uwNtjyS4HJK6A9jLDosCCw2xu/ lKGto8uYLz1han+qS4v8X4RhN1ETSsgaWTAwKmwGTQrMnrETkrb3L81AzHVeLQnP wHwjKoDf6w8kDMQ3uRC3tSeZHAnFbWb2ng0dsnfW9tfiTmCFSxgfYx22TpM8jPPf PyfdvSmnRDyrn7ws3cCqPYBmWNuc1/dE/MPMm0kafxzjOhxvPdRYV0TG/TEabjFv LpMbjJTyBKtJzK2a/r6aSPBQdvULxKG9byNOD07E//kUsrzJhUf4PrxEs+arzAer K8D1syicVce8HJNPNvZgDPfSR3zVNYQp2rd+qg10caMfOt0acgJBjYQbA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=f02riIqmTLQjfsxRmbAMxWaoH+GGUs+3oNGVdaXSoVI=; b=IItl3g64 587aclrnXUPhADssPjQRWvNfM0ii43Rjnb0JCnBRL/SnduS5YKmswjKRF8VXkBl9 l0vVfQgcJEQGlfXK2R+VDPSnKTlAEsWBHRxeIYgdPEarC4r44cOWwjmu1YhDxYUU I2UZssX6lde82ljHgxg97F9xF0IbXFk5S9nnke/KQEglnK92ri4GsSVI0W0ddtYX JihmSk3dRSH/4aEHL0IO4c2es4ndc/z5hACTayPKgIjfLGxOyth+GCOtmz5PpNMU FzvmRDAUX0xkFi1UmCzDVrNPzCOEP+BU7fXvOzqGrPQe34vymPbiMvAjyoY+k10z rhsofRywjHaxpw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrtdejgdeliecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomheplfhirgiguhhn ucgjrghnghcuoehjihgrgihunhdrhigrnhhgsehflhihghhorghtrdgtohhmqeenucggtf frrghtthgvrhhnpedtveehvdefleeghfeuveffjeeuffetffekhfeviedujeeiieevuddv iedtheffjeenucffohhmrghinhepohhpvghnghhrohhuphdrohhrghenucfkphepudduie drvddvkedrkeegrddvnecuvehluhhsthgvrhfuihiivgepvdenucfrrghrrghmpehmrghi lhhfrhhomhepjhhirgiguhhnrdihrghnghesfhhlhihgohgrthdrtghomh X-ME-Proxy: Received: from strike.U-LINK.com (unknown [116.228.84.2]) by mail.messagingengine.com (Postfix) with ESMTPA id 97DE424005C; Mon, 18 Jan 2021 01:38:59 -0500 (EST) From: Jiaxun Yang To: qemu-devel@nongnu.org Subject: [PATCH v2 7/9] accel/kvm: avoid using predefined PAGE_SIZE Date: Mon, 18 Jan 2021 14:38:06 +0800 Message-Id: <20210118063808.12471-8-jiaxun.yang@flygoat.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210118063808.12471-1-jiaxun.yang@flygoat.com> References: <20210118063808.12471-1-jiaxun.yang@flygoat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=64.147.123.18; envelope-from=jiaxun.yang@flygoat.com; helo=wnew4-smtp.messagingengine.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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_LOW=-0.7, RCVD_IN_SORBS_WEB=1.5, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Laurent Vivier , Thomas Huth , Viktor Prutyanov , kvm@vger.kernel.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Alistair Francis , Greg Kurz , Wainer dos Santos Moschetta , Max Reitz , qemu-ppc@nongnu.org, Kevin Wolf , Paolo Bonzini , qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , David Gibson Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" As per POSIX specification of limits.h [1], OS libc may define PAGE_SIZE in limits.h. PAGE_SIZE is used in included kernel uapi headers. To prevent collosion of definition, we discard PAGE_SIZE from defined by libc and take QEMU's variable. [1]: https://pubs.opengroup.org/onlinepubs/7908799/xsh/limits.h.html Signed-off-by: Jiaxun Yang --- accel/kvm/kvm-all.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 389eaace72..3feb17d965 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -58,6 +58,9 @@ /* KVM uses PAGE_SIZE in its definition of KVM_COALESCED_MMIO_MAX. We * need to use the real host PAGE_SIZE, as that's what KVM will use. */ +#ifdef PAGE_SIZE +#undef PAGE_SIZE +#endif #define PAGE_SIZE qemu_real_host_page_size //#define DEBUG_KVM From patchwork Mon Jan 18 06:38:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaxun Yang X-Patchwork-Id: 12026693 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3A8AFC433E0 for ; Mon, 18 Jan 2021 07:01:14 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B128E2231F for ; Mon, 18 Jan 2021 07:01:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B128E2231F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=flygoat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:37348 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l1OXI-0008Lc-S9 for qemu-devel@archiver.kernel.org; Mon, 18 Jan 2021 02:01:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:33828) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1OC8-0002qV-CA; Mon, 18 Jan 2021 01:39:20 -0500 Received: from wnew4-smtp.messagingengine.com ([64.147.123.18]:48055) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1OC4-0007ZF-7t; Mon, 18 Jan 2021 01:39:17 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.west.internal (Postfix) with ESMTP id 318C615DB; Mon, 18 Jan 2021 01:39:13 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 18 Jan 2021 01:39:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=yDi3rR9AlpqoZ Pff7ititIXIq7aDJehwY82Gzczm7E0=; b=Xs1Xs32fAu+tIcIncKODym0Mbvxkv w4hiLo05Xll3jpwwYmrU9heNJn6jnJNXVHXIo3NPoVcRN00CDuNZstGfAwP85HXE WiymN5G6K0C8HSAT5tvAkEjIdoxyTDs6MmpqG2W/XfhcYMSSlJ0D2eedTJA7gemQ /tMg4Lztl/h5+zKirk5iIBq5bzCDFoiZ+HVqQJYzwHJqNaU8p2DR27X+o7zrfM1/ fUXHeLZ5umI0KpBBIdrUQqGJVT2Zt019Pe/N2IAMYPzZuJDBYeQ168Zf0pe1hVdN kYmUjgHPaeY6RZ0JDOpqw8JIzEL24b9khvGYvJKODrmfggIHD97FCdFBA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=yDi3rR9AlpqoZPff7ititIXIq7aDJehwY82Gzczm7E0=; b=GbbUBH5e xFrVODVI70fe2WsmMF5YADHM+VCKPr7LdJH0ilRa7dxRbX664HU7EGHPDrRzfWk8 jAG3S1CYDTClCTr4Gc+WK577qdhyCmlZgFOidkjsRJgZI1/PX/OtwliJE4ohjWrL /6PA42tqtq4Phxh+KTwFYApJbbUyxQRSjpXFdCxXWEBk3lok6iMrucOwItbvkWpl qJMzUm6bcAOJuljexvsbXuPIXpdJp+2ihgI+1mpFZyz0EIlBDbQtsht3jYeHMlGd Yn4jOEIZ3CpFCRxe4jKTVc1ZiLAuEXEIevHHgGpvmFgNT4HxbEtpxu96x4Z+28Pv nWcDjMPIsoHlMA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrtdejgdeljecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomheplfhirgiguhhn ucgjrghnghcuoehjihgrgihunhdrhigrnhhgsehflhihghhorghtrdgtohhmqeenucggtf frrghtthgvrhhnpeejuefhkeegheehffetgfeuveeuvdeukeevkeeigeduhffhgfdvvdeh hefhfffhudenucffohhmrghinheprghlphhinhgvlhhinhhugidrohhrghenucfkphepud duiedrvddvkedrkeegrddvnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehm rghilhhfrhhomhepjhhirgiguhhnrdihrghnghesfhhlhihgohgrthdrtghomh X-ME-Proxy: Received: from strike.U-LINK.com (unknown [116.228.84.2]) by mail.messagingengine.com (Postfix) with ESMTPA id 090C524005B; Mon, 18 Jan 2021 01:39:05 -0500 (EST) From: Jiaxun Yang To: qemu-devel@nongnu.org Subject: [PATCH v2 8/9] tests/docker: Add dockerfile for Alpine Linux Date: Mon, 18 Jan 2021 14:38:07 +0800 Message-Id: <20210118063808.12471-9-jiaxun.yang@flygoat.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210118063808.12471-1-jiaxun.yang@flygoat.com> References: <20210118063808.12471-1-jiaxun.yang@flygoat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=64.147.123.18; envelope-from=jiaxun.yang@flygoat.com; helo=wnew4-smtp.messagingengine.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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_LOW=-0.7, RCVD_IN_SORBS_WEB=1.5, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Laurent Vivier , Thomas Huth , Viktor Prutyanov , kvm@vger.kernel.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Alistair Francis , Greg Kurz , Wainer dos Santos Moschetta , Max Reitz , qemu-ppc@nongnu.org, Kevin Wolf , Paolo Bonzini , qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , David Gibson Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Alpine Linux[1] is a security-oriented, lightweight Linux distribution based on musl libc and busybox. It it popular among Docker guests and embedded applications. Adding it to test against different libc. [1]: https://alpinelinux.org/ Signed-off-by: Jiaxun Yang --- tests/docker/dockerfiles/alpine.docker | 57 ++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 tests/docker/dockerfiles/alpine.docker diff --git a/tests/docker/dockerfiles/alpine.docker b/tests/docker/dockerfiles/alpine.docker new file mode 100644 index 0000000000..5be5198d00 --- /dev/null +++ b/tests/docker/dockerfiles/alpine.docker @@ -0,0 +1,57 @@ + +FROM alpine:edge + +RUN apk update +RUN apk upgrade + +# Please keep this list sorted alphabetically +ENV PACKAGES \ + alsa-lib-dev \ + bash \ + bison \ + build-base \ + coreutils \ + curl-dev \ + flex \ + git \ + glib-dev \ + glib-static \ + gnutls-dev \ + gtk+3.0-dev \ + libaio-dev \ + libcap-dev \ + libcap-ng-dev \ + libjpeg-turbo-dev \ + libnfs-dev \ + libpng-dev \ + libseccomp-dev \ + libssh-dev \ + libusb-dev \ + libxml2-dev \ + linux-headers \ + lzo-dev \ + mesa-dev \ + mesa-egl \ + mesa-gbm \ + meson \ + ncurses-dev \ + ninja \ + paxmark \ + perl \ + pulseaudio-dev \ + python3 \ + py3-sphinx \ + shadow \ + snappy-dev \ + spice-dev \ + texinfo \ + usbredir-dev \ + util-linux-dev \ + vde2-dev \ + virglrenderer-dev \ + vte3-dev \ + xfsprogs-dev \ + zlib-dev \ + zlib-static + +RUN apk add $PACKAGES From patchwork Mon Jan 18 06:38:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaxun Yang X-Patchwork-Id: 12026671 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B40FFC433E6 for ; Mon, 18 Jan 2021 06:52:06 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 564BC2231F for ; Mon, 18 Jan 2021 06:52:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 564BC2231F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=flygoat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:49050 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l1OOT-0001CC-EE for qemu-devel@archiver.kernel.org; Mon, 18 Jan 2021 01:52:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:33876) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1OCI-0002td-Aj; Mon, 18 Jan 2021 01:39:35 -0500 Received: from wnew4-smtp.messagingengine.com ([64.147.123.18]:34129) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1OCB-0007bH-3W; Mon, 18 Jan 2021 01:39:27 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailnew.west.internal (Postfix) with ESMTP id 460DE16B6; Mon, 18 Jan 2021 01:39:19 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Mon, 18 Jan 2021 01:39:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=xp8rMS5fYi67I zBTztXoRRHYHPvcz6CsxRtqujbiTX8=; b=XRkZhcuwfbvDW9WPlzqGCkZpgCxXo Ya7cEM0p3uGKSWcWUe+lpfY7E4j+t/Ip4ts+Vih9+Ym7V8pJqU98FfCIFgjwa9xw /kQkhEbnpjj8tZ1wEyDmMAUzee3T0T6YdySmQssumueg5MBII6fH5SmW9tRNRda/ h3wVxdVY695O7rP7RH6pOu6ap+GFtgOX5HzIfzJKFD5T1H3s+XeAVMRK6EWlgaT3 nA5rGqLC2Kjg7K9Gn7j0sGzTpJOzBP0mFoXsrFfa0J/23I2eUliBRFa+NmbdThdj IYyH5VijUXyYrSauFE3v1Taw3XegnyZFKOGStJRBK/kuOKxhYxGfvgGQQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=xp8rMS5fYi67IzBTztXoRRHYHPvcz6CsxRtqujbiTX8=; b=GJpW6OMA OhUqFDRpb15U6GX0ZPNwReD2/b3m4gaptaPIBWUCXpVoAEAMAFtgcsDt7qK7VAIV 96IC7lAbGXh7ZcXAhxHKMvCH+EBJuTbV4CUvPj/4EshTdh5zYWx+F1yxqk18bIUQ nFj2mYcGEAfsi6FUriEhRw2WtqM/chpKmrFGM6/3NcZM2LOcDKB0jYd1+nJaFash cgvVC50ZDUcWHCRYm0oEVlPEUU/TSgyCvywHJkEqVaQcJqk193QnlVCl47Jrbd6q Gb369STdGyYzopKxavO1oWh9BXGh4rbro6sebIX/2vj0qABh7hyxyr9wcItTmiUh wLDoWim57UP5tg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrtdejgdeliecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomheplfhirgiguhhn ucgjrghnghcuoehjihgrgihunhdrhigrnhhgsehflhihghhorghtrdgtohhmqeenucggtf frrghtthgvrhhnpeejiefhgfetleekleffudektdehvedujedvgeekkeejfefhhffhtedu tefgtdffueenucfkphepudduiedrvddvkedrkeegrddvnecuvehluhhsthgvrhfuihiivg epfeenucfrrghrrghmpehmrghilhhfrhhomhepjhhirgiguhhnrdihrghnghesfhhlhihg ohgrthdrtghomh X-ME-Proxy: Received: from strike.U-LINK.com (unknown [116.228.84.2]) by mail.messagingengine.com (Postfix) with ESMTPA id EE8D9240062; Mon, 18 Jan 2021 01:39:11 -0500 (EST) From: Jiaxun Yang To: qemu-devel@nongnu.org Subject: [PATCH v2 9/9] gitlab-ci: Add alpine to pipeline Date: Mon, 18 Jan 2021 14:38:08 +0800 Message-Id: <20210118063808.12471-10-jiaxun.yang@flygoat.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210118063808.12471-1-jiaxun.yang@flygoat.com> References: <20210118063808.12471-1-jiaxun.yang@flygoat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=64.147.123.18; envelope-from=jiaxun.yang@flygoat.com; helo=wnew4-smtp.messagingengine.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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_LOW=-0.7, RCVD_IN_SORBS_WEB=1.5, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Laurent Vivier , Thomas Huth , Viktor Prutyanov , kvm@vger.kernel.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Alistair Francis , Greg Kurz , Wainer dos Santos Moschetta , Max Reitz , qemu-ppc@nongnu.org, Kevin Wolf , Paolo Bonzini , qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , David Gibson Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" We only run build test and check-acceptance as their are too many failures in checks due to minor string mismatch. Signed-off-by: Jiaxun Yang --- .gitlab-ci.d/containers.yml | 5 +++++ .gitlab-ci.yml | 23 +++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/.gitlab-ci.d/containers.yml b/.gitlab-ci.d/containers.yml index 910754a699..90fac85ce4 100644 --- a/.gitlab-ci.d/containers.yml +++ b/.gitlab-ci.d/containers.yml @@ -28,6 +28,11 @@ - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' - if: '$CI_COMMIT_REF_NAME == "testing/next"' +amd64-alpine-container: + <<: *container_job_definition + variables: + NAME: alpine + amd64-centos7-container: <<: *container_job_definition variables: diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4532f1718a..6cc922aedb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -72,6 +72,29 @@ include: - cd build - du -chs ${CI_PROJECT_DIR}/avocado-cache +build-system-alpine: + <<: *native_build_job_definition + variables: + IMAGE: 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 + artifacts: + expire_in: 2 days + paths: + - build + +acceptance-system-alpine: + <<: *native_test_job_definition + needs: + - job: build-system-alpine + artifacts: true + variables: + IMAGE: alpine + MAKE_CHECK_ARGS: check-acceptance + <<: *acceptance_definition + build-system-ubuntu: <<: *native_build_job_definition variables: