From patchwork Fri Sep 1 02:23:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 719474 Delivered-To: patch@linaro.org Received: by 2002:ab3:1981:0:b0:23f:8cfb:5ad7 with SMTP id 1csp17015lti; Thu, 31 Aug 2023 19:25:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEpXGEQA10WiVBPPr8rUBCw3p3va6i9XltHiIjrX8Dz9Swwa6f14KV02w3C825Wh4OdlHPl X-Received: by 2002:a05:620a:7e5:b0:767:b196:e88 with SMTP id k5-20020a05620a07e500b00767b1960e88mr1127093qkk.42.1693535123168; Thu, 31 Aug 2023 19:25:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693535123; cv=none; d=google.com; s=arc-20160816; b=xoU9OmDqAgNcZ1byjgny9Fk6HhgcOHA5kiUbOejcJtIFCi++kdIBiXAg6v8bc67QpX +cyw1WZ6GKfXJ+DmFO8IHeclO7GySHALRZ1AuP4BpMR7YLmkDZxP7nxpQPfgS0+jVIY3 ThGGo3M+YQ799nsub62Pf+n/89ROSG1ytkrDD77qq02ZBxYwcT0WITlSSKEW0hf9Cqqu uVygZEYqLpNdkixcZrxNvoz5neDI0qXorlAv6OTgXuQ8UktQ1INpr8Zi9txU3JfCf/Fu ua/3GNedFdx7as25LmwWPMd2GJ7rn6iXWIBO2kbnHWVqR4s/LH5WhgKu2ToNuPZ3E6J9 TnXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=NKBqBWVnteg7nBg0Ct8xapNabPHsKvd3tq3kc9va8Z0=; fh=SfxhhCERWPFe9EfsSkQ0zw+VJgdUi+jLlAbxANM8dQo=; b=qZir6WwFBNSklAzjBVOpIIZZOI5ZoBdPArFYIbVGfirw0nDq9wJ+rFl8+OALGEXpum kaqHcWVkPNa+Emd6Dmx6ONXAMnyE9MTYhakbTcpkB2ySxTdnlIf8OXjTH+JqAlQJLwHA Z8MTGZCckqyQxDAM3N5//jW4GAuCBdsCzLrGwLaUWI70tKayqJ4YWyfZGJ46PFqmaYmk YG0Iti7Otpexfd1zJORQuzikvLaA/zA5vQmw+Ucri5ZDz9D3AWf0npB7ZC/jjuzsCHqO sQMgE8zpZfWsc9I8nzrOCG2nKCNgWrK8ZMA2ufZm9vontNAiQ857kBkLozrEraaPojDv y6gA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nRjNEN53; 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=pass (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 b2-20020a05620a088200b0076d9e0df338si1790737qka.377.2023.08.31.19.25.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 31 Aug 2023 19:25:23 -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=pass header.i=@linaro.org header.s=google header.b=nRjNEN53; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qbtpT-0006wd-Gc; Thu, 31 Aug 2023 22:24:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qbtpR-0006wM-HD for qemu-devel@nongnu.org; Thu, 31 Aug 2023 22:24:09 -0400 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qbtpG-0001SX-RL for qemu-devel@nongnu.org; Thu, 31 Aug 2023 22:24:09 -0400 Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-68a3ced3ec6so1287305b3a.1 for ; Thu, 31 Aug 2023 19:23:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693535033; x=1694139833; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=NKBqBWVnteg7nBg0Ct8xapNabPHsKvd3tq3kc9va8Z0=; b=nRjNEN53iW8r9Y5eWZONgwSvQ4WTdV6jcr+U9/LyPcHfsCjxsWUuwfvydxX/nbCr2h 4T3vs7JgWaCDZxVF3xp8AdDz5JXp2wCRe4/huTaZ0pzoeJFO4X/FwKFRr4DThpPGjItC 5bTqKldoWuKKTtKFGRCRFDLL4YA9Z/1YfvJCjaHNGQ7myAUOVInIFhez3YotG+XyDb87 s+EAgKhAgAJhsbYypI/NXuNbT14rQTA5rZJwQAhYgI67zK38e0cJOEuD7IAjQOOfMQdi Bqztp+mvFZu6DdOXntAbzo+WpU+pJAfZl5R92Zly1+8wR/qiqkJpVRIWoU9+lzqXPagy 4+vQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693535033; x=1694139833; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NKBqBWVnteg7nBg0Ct8xapNabPHsKvd3tq3kc9va8Z0=; b=h8zBQf9APAdkpriZ+BhBLFLLKOGLgZbqT0XhMcJESSxyoQpS9FQq6jdUNbYJjMPhT0 JlLzWLxc0lXlsSbXPjUjqnhm8WI5bjn8f0fiWP++MFYqvzUuxupDlZUyJQyTUDnlmo68 y4ZgWvXubt3zpWJ5tXKjm5Slwk56Ss4kwV2iD5+ThqpF4/c/iDh1DoCk+lltqPJUJSFO 4UVv8ipaWaJNuU4HyXA662pqB6VAArp2B/+0DsiV6VhCoHUZGLUAylDmMIom93n0q2IY 1NIrAUFKATRwZ+gZVc9llrsj6VyMYhG6IBI2B44zJfX5yvqbUZQ+dtro/U6hrIwE1M86 wd6Q== X-Gm-Message-State: AOJu0YwsDy0nJjq/kuE8hpHNjV38Plc4FALz+rUqCS4zRE1Nq4yNSsBX Mj/b2Y/3X4RjoDfcTSG6jFizIc+DKwHNmww9M9U= X-Received: by 2002:a05:6a20:8f15:b0:129:d944:2e65 with SMTP id b21-20020a056a208f1500b00129d9442e65mr1874328pzk.13.1693535033039; Thu, 31 Aug 2023 19:23:53 -0700 (PDT) Received: from stoup.. ([71.212.131.115]) by smtp.gmail.com with ESMTPSA id c25-20020aa781d9000000b0068a54866ca8sm1906977pfn.134.2023.08.31.19.23.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Aug 2023 19:23:52 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: laurent@vivier.eu, alex.bennee@linaro.org, =?utf-8?q?Philippe_Mathieu-Da?= =?utf-8?q?ud=C3=A9?= Subject: [PATCH v2 25/33] tests/tcg: Extend file in linux-madvise.c Date: Thu, 31 Aug 2023 19:23:23 -0700 Message-Id: <20230901022331.115247-26-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230901022331.115247-1-richard.henderson@linaro.org> References: <20230901022331.115247-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::434; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org When guest page size > host page size, this test can fail due to the SIGBUS protection hack. Avoid this by making sure that the file size is at least one guest page. Visible with alpha guest on x86_64 host. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tests/tcg/multiarch/linux/linux-madvise.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/tcg/multiarch/linux/linux-madvise.c b/tests/tcg/multiarch/linux/linux-madvise.c index 29d0997e68..539fb3b772 100644 --- a/tests/tcg/multiarch/linux/linux-madvise.c +++ b/tests/tcg/multiarch/linux/linux-madvise.c @@ -42,6 +42,8 @@ static void test_file(void) assert(ret == 0); written = write(fd, &c, sizeof(c)); assert(written == sizeof(c)); + ret = ftruncate(fd, pagesize); + assert(ret == 0); page = mmap(NULL, pagesize, PROT_READ, MAP_PRIVATE, fd, 0); assert(page != MAP_FAILED);