From patchwork Fri Mar 1 23:06:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 777106 Delivered-To: patch@linaro.org Received: by 2002:adf:e94d:0:b0:33d:f458:43ce with SMTP id m13csp1603712wrn; Fri, 1 Mar 2024 15:16:26 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCW0Xob/HW+AWooSzG4u05k0uhsblV8fRP+Y6UqevTSIZlZOCY7UtJEkwF6VBvQQHPNS1n7FiGu8XEQSYNdKHB+j X-Google-Smtp-Source: AGHT+IHQ2cAro1tpsAycgBkbAL4gJFxg8VdrIoh0ZCTuZhV8LW3svHj7/ZalcpFYgZCnLXPf4uyu X-Received: by 2002:a0c:fa42:0:b0:68f:cbfa:6876 with SMTP id k2-20020a0cfa42000000b0068fcbfa6876mr3259193qvo.38.1709334985856; Fri, 01 Mar 2024 15:16:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709334985; cv=none; d=google.com; s=arc-20160816; b=K4AlATlgeA5Ley3lUGbIZilVOzlAjLxQ/0kghNHCBSuoo6xhn4HIsYVLGHQNa5bpMw 7PLG5K1qRx5m9W/UctKkVQ12TeGl3DyL1EdCRJG2p5sYlxGM2wpxdQgdQdE+hqMDA+Bx GaxmJVLgswpKxtqWB9MWfEPWoV3/cG+wRhalq9XCOOW2HZ4+365OQEKicwfI3Wb5nSac waEmRILLwyzpr6Sq8c/xbZdqTkCBs9TtiNlg39wsQoONEIpanMkezlx8gXSM5VFNM0d/ PIShK9VC3Iey1WbDMrqqHeuEeKcIyc4SAF22n6pseJbMMlNYuWhfl0HuQCsWFoEzPvZD sn5g== 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=e2NESTxnz6150SuLytNvY5Gmn2U5RKg4GfRtueQZH4I=; fh=H/IsS+LNYM6dBDHt5BZPsM5V9tnyjdUlJ92VVuTs62g=; b=CKGDvjbBzufY+6txGhRu043TrVjvCT754436MJDnXh5lGuk34pjoLRvxwUOPzAgP0o hjZ9oH7KFm/qnw+IfcjeOc0PQf6fmVWt1FnXpzd8Cz5Wfcfpo6F7+WR0oQ6ZsbCuQU/5 SmT2VGgvMJMqaJ5H6uq0diCWWMnmTrklPdilMSdKzTCEuyWKV4QFPVMGJ1yqqb7M09gp BqLp0bJ8SDlqOEK9qjIHuHlXfiZKN0W2xZaJtiM9xeCE/yJWfjuB+y0zIbkwfbyezUY3 MkEHgU9SK9w8dYOllach1yl/wnDdVQTzaV+fCYd9y76/YRd5lkroUai5rwHVqTrj9B4n aazg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zvbezarZ; 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 iu4-20020ad45cc4000000b0068f7071cd09si4474367qvb.100.2024.03.01.15.16.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Mar 2024 15:16:25 -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=zvbezarZ; 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 1rgC2C-0004Gb-2q; Fri, 01 Mar 2024 18:11:21 -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 1rgC1R-0003kN-0J for qemu-devel@nongnu.org; Fri, 01 Mar 2024 18:10:35 -0500 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rgC1O-0005gI-LY for qemu-devel@nongnu.org; Fri, 01 Mar 2024 18:10:32 -0500 Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-6e4560664b5so2238581b3a.1 for ; Fri, 01 Mar 2024 15:10:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709334629; x=1709939429; 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=e2NESTxnz6150SuLytNvY5Gmn2U5RKg4GfRtueQZH4I=; b=zvbezarZ2naOe+xWDLmcprnW0NF10+bLiTDva0y7/3hnWQdqGHRSbtcBbOWLUJJWJe OVYor7mvwc92cGcWa9YJ643pcajYQBrkvzStgB7TezWbc6S4P3CSIluf2j9AA+ylHUSC Hyko3Ga/eCAuSGxkqD0MHyAqJK6wkU69AhTq5lGIu1cDbrycaIbPlqA7YTX11g985Gi2 B6sZaAVcZh0fqCcfIzNFhX31lzxGc5IgQNcG8NggSac8ZtqkqgETzCkvOUEp2UkB+C4l HS0jEXbmAKzSDXjttdT3M1+S8hqkioSdrGYGlgC5oHUxqHdyt2rpXM63OwsVTOzVLelv 0ACw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709334629; x=1709939429; 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=e2NESTxnz6150SuLytNvY5Gmn2U5RKg4GfRtueQZH4I=; b=rev3FRgQNve7/ecc7vmqtfoDnPCtBAQzKkX68Lqv2x0T1YIaXfTXgcg15iXkBYM29g DTMIDoIqHEFFB342P0qh/NU1wM+QhyEzq0+15lhlQ7EkDe+VCaBHRk5PNXm4nn/pzzMx bIEbgWb97GM++RqvwMvUnsOqo0/hCWUgFsbcIlw+9FaEBY37Ewdbd0Xz0LsAetqQfk+g YOlwzwn+fEZ/gpp8ll0GOuHNbgjDtflERFb3audYl67L5T+qNKoJpQ1L9EQjqGkZ2Y09 aaMzkqSu/a52LBDO2B7rZLliEcZC39S1zVK3UVzZZDPCcV+cAzG/QpTLWdv0frnfg+nI QVtQ== X-Gm-Message-State: AOJu0Yw6TQMwTZ+0aBUuQ7deXPGtzBOQnJGFg4RhEbIhPxl8DcOuPtun q2WzSQgoZnpSwBbP3hTgJd56IGaNtDSzWyhZJtexHvwZuyRA1ZhjxaG0+b5426sQgHJoyK6mhG1 X X-Received: by 2002:a05:6a00:2352:b0:6e5:adb9:b955 with SMTP id j18-20020a056a00235200b006e5adb9b955mr3834774pfj.23.1709334628978; Fri, 01 Mar 2024 15:10:28 -0800 (PST) Received: from stoup.. (098-147-055-211.res.spectrum.com. [98.147.55.211]) by smtp.gmail.com with ESMTPSA id c2-20020a634e02000000b005e438fe702dsm3449407pgb.65.2024.03.01.15.10.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 15:10:28 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Ilya Leoshkevich , Helge Deller Subject: [PATCH 45/60] tests/tcg: Extend file in linux-madvise.c Date: Fri, 1 Mar 2024 13:06:04 -1000 Message-Id: <20240301230619.661008-46-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240301230619.661008-1-richard.henderson@linaro.org> References: <20240301230619.661008-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42c; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, 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 Acked-by: Helge Deller Message-Id: <20240102015808.132373-26-richard.henderson@linaro.org> --- 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);