From patchwork Tue Jan 2 01:58:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 759361 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp5857642wrw; Mon, 1 Jan 2024 18:03:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IGidYfGzI3Gw5Pfzj/zCG3TNNWQYViThHg6wKCZAPWujd2bHH28cCvNGXDv+tcjDztXWzW/ X-Received: by 2002:a05:620a:2441:b0:781:b186:d52b with SMTP id h1-20020a05620a244100b00781b186d52bmr3061972qkn.155.1704161031110; Mon, 01 Jan 2024 18:03:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704161031; cv=none; d=google.com; s=arc-20160816; b=W2PisOUrkiJJFhkEBw+EcfwBQRlgK2OecoGKG3/Wrx0mu/VfnTth9rWQdqDEbpneu5 lplQPWH0JvLIe2oTPlDeTGZAHBtN5rRaDqK2zu36uKAR0T8VQJldMJhUEt+MTh7O2Sm5 BgJUQtgB1ILBkhbPJ3SJTmxcFc4ifxnj6+6M8NsiKK2DIdZaC6BGjjEOUbxDxviAc5uD LRKe38Qv1mrhptBwAmXKPe4rcJIzoTPYHcXEaGzxJyuCcIFDN+cvA3cbN7rifQ3ddGWu fvemnSkJPYUYHqitWz17B4XQHpMpDx5XGq4WX3rz7V8u38I+qY/bVe0RjibxgvxWtzz9 LOrA== 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=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=uur1ofPIJC7K2kBA4XtCPh19ARPDjmpnzjmQQRAF8A21Yaf8M4k6Hux2qrZJnTi20T iL4gqleT6gt1Y+OC+1/8/X8wEttOk7ObVFXJNTOYoV/mYnHq/tgG/4RvdN/MFRgDmWGk vq5TYAp2IosE+KNEcT3IhkHv6nrgKQ73r0Gm9VaR7dFXrNkMLLnl3YFv1cSgLW73qNxd IvNHlGpPEmQ+1WYJsbVlMBrwPxeEgh7ct4gPk2t13uxY5f6boA7uMr5vFEK13lJoT/+h xIXb7WcuzYqymE5YFLDZe3R8q1ng929K2+NhA6dyeHUd3c+MAYkpb47bvO9HXjQ1QOR6 1tSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MPckM0Yu; 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 v19-20020a05620a123300b00781240e468dsi23699658qkj.362.2024.01.01.18.03.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 01 Jan 2024 18:03:51 -0800 (PST) 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=MPckM0Yu; 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 1rKU3n-0003mI-Dg; Mon, 01 Jan 2024 20:59:15 -0500 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 1rKU3f-0003i5-Iu for qemu-devel@nongnu.org; Mon, 01 Jan 2024 20:59:10 -0500 Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rKU3e-00075W-2P for qemu-devel@nongnu.org; Mon, 01 Jan 2024 20:59:07 -0500 Received: by mail-pg1-x533.google.com with SMTP id 41be03b00d2f7-5c21e185df5so6728040a12.1 for ; Mon, 01 Jan 2024 17:59:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704160744; x=1704765544; 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=MPckM0YuV/jFqFQXkL4L3ij7UFn8w2pCpZEHmpn+IL2RfR5jbjDktgy5t4Z6Wy1MtL wONNQiuRd4U9nyiJxrxq7rexQeBT01y29735acTYma7+OvbXFXo1Vkl2FRtYhMbHJYCp XpNmb/3yjJWeKZsnkqwbGEikK9nBEOzVbIHJNeGYjuqN4d4c1fRQNFZngH4Qqr/Q5pVT i02PEQ7CC4b0YBaC93mcqT5FNSAiGXa3cftdBFS14IXVk5pPs8mU1WhjpUboe2m/tygN VogTsoOCAHXbAPXvNbzTRWLWpH4ZkrvVZk6kbMr9XpoT5NS/375NcWa/tAEDQfBLxPzD ppMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704160744; x=1704765544; 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=iYHo4d6TtDC/OcAGHk0W2McCOVL7KyDnJaQknabJqWwvIQ/xOk0m6anW2EWa8jSgmo 9wz6BZ8WS/sia9HN2Biwh6nVYClO0spf2JECy9s4diAOXTlNEL/6P9uAnzJdXJyRneVR 2tCgswJ03ofsfmDg1L06FP4m4mllQYDloHoXhMTw37uS4n5zlXgfwqyCvrHVBXusM+Ns 25FltSO7UVnviyRTQJg3E71sqAFUuKI9/q24S3UmFlPXmHqxH/9KteDFEfghT5Hu26GP ZH3HTB/Dr9wQu+CQSZSk9MD41lemfbqrSIUzVqUP6/XA5cEE0oMC4H2XAb6ne+zhcF6G BoSw== X-Gm-Message-State: AOJu0Yzbc0B8ErW0ajTtGiI9eVD04LyqBa5bTgf7qeI8owIVWBFjd3rv W1fe9QZj3nrzQvkQ+KPidl7s1vKVu0oSaTPs6Ov1CHcdjGI= X-Received: by 2002:a05:6a20:3791:b0:194:ae7b:3847 with SMTP id q17-20020a056a20379100b00194ae7b3847mr16474705pze.34.1704160744753; Mon, 01 Jan 2024 17:59:04 -0800 (PST) Received: from stoup.. (124-149-254-207.tpgi.com.au. [124.149.254.207]) by smtp.gmail.com with ESMTPSA id g33-20020a635221000000b0058ee60f8e4dsm19561891pgb.34.2024.01.01.17.59.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jan 2024 17:59:04 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v3 25/33] tests/tcg: Extend file in linux-madvise.c Date: Tue, 2 Jan 2024 12:58:00 +1100 Message-Id: <20240102015808.132373-26-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240102015808.132373-1-richard.henderson@linaro.org> References: <20240102015808.132373-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::533; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x533.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, T_SCC_BODY_TEXT_LINE=-0.01 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 Reviewed-by: Ilya Leoshkevich --- 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);