From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.openvz.org (unknown [69.168.225.77]) by lore.virtuozzo.com (Postfix) with ESMTPS id 050D180726 for ; Wed, 21 Oct 2026 16:58:57 +0000 (UTC) Received: from mail.openvz.org (localhost [127.0.0.1]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 69LGviel023026; Wed, 21 Oct 2026 19:57:45 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 69LGviel023026 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="mQI56F3X" Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 69LGvN1Q022947 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Wed, 21 Oct 2026 19:57:23 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 69LGvN1Q022947 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-48e0389d6f9so575038f8f.1 for ; Wed, 21 Oct 2026 09:57:23 -0700 (PDT) X-Gm-Message-State: AFq9FYKgSnQ4Hfj265hotfTmke0wPffunH5Zd8NYqIz8zw6GSQlQAi8L deltJfEmBz/JVxI09xo+djh5fKW6d2scr21bQC7XwrHP1PeGNqNw8DMWFXGu4fASRnoQ98xKORT 9GCSOYidfbuZ8ekY57Rgti6l/5l8qBvvtztN7nRkGvUnfklkFVgF91w== X-Gm-Gg: AYBFou0T27poDUY76EgCGFhhrtrigrHUhDSbdewCwzwB9b6oUz5TvfEA83Cugml5R78 cqiDproYaakQ0oTZVP0W5ZViLlvt47bKuyor94l0tRQnbyYs7b8wjvu6tIQQcSTBKPkMK1t+lA5 jXkseb/pOVL7kX3LTzZGQN7uQ2ttG6+QD4MWtEzOsoJk1hYTkV0JOKfQcRWKIpHZk/T1vGW0Jwk 4M4GwXHt1ZnIY41cVWUPplj7KqU2Vt1KhrJXqZAe2dCsU2Z6brV0JWHrZLwOEH68DWRwtk+K6R0 +VoOM72VYYfmdHKVPWyU32WnHza1L6DtorFIusadFU5AsCau3/eXntK3y/tjsdS2A/eK8SrNEar 9FFm2xXpa7PCNPqu+ X-Received: by 2002:a05:600c:3547:b0:4a1:dadf:9876 with SMTP id 5b1f17b1804b1-4a1fdd24cebmr60790565e9.23.1792601842763; Wed, 21 Oct 2026 09:57:22 -0700 (PDT) X-Received: by 2002:a05:600c:3547:b0:4a1:dadf:9876 with SMTP id 5b1f17b1804b1-4a1fdd24cebmr60789985e9.23.1792601842233; Wed, 21 Oct 2026 09:57:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1792601842; cv=none; d=google.com; s=arc-20260327; b=FcHHtJ1fYkj77u83Y+mXTZaM2rX6VGfoJYBTa1fwZKig22x776rQerEoGq8HCwI8ku 1JVEBRW8yqcCgWx10S5k0LHxWwOYkcrebR6WzhRqvjR/tS3WeZTvLac8/RnAc1MkgNaH 2u4jognL5E3AUSUWbOZo6Hn0e2zKjSrDjMK3ePdZC1skQ4eW2vWSS2Gul8tqRldUksdb 48+6nT/JZB6EIynIpVGmIQdqANrqafPDmmVsAeHWsbc+CbyOZOsU4YiDucV6xvZrfPAU 8ucR7JcNxopwceiSDg0wpVpkBZ555+rXUFKicZshqNC3xL9vRTlMs/lmKOqV0zTuoLrx NQTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:dkim-signature; bh=TcRkByqJavukx8AXaJ41p6hBF7mUT7IZInrbyXCGdR0=; fh=ORqO450YHYjnAvQVnHrQRoSXc/Ljts4WdUx12SqEe+w=; b=pWqSrjDePXsX6F+yOR+zcHMzDv/IMrQZOwmNdeizw4Kc15JaeoQ2z3Bco7jkBlTLQo rGXSXt4/aLqKooki2es8SO+/hFBvsAR/JZAXK6yc0Fl60iKTnxFdGXH52PoWXc0ijt7e FQSVuCobWoJlI1SFCzSjNhBxFxEDLaNckbCu3V0445gUU7J7HyIvf+j+XbODPcwGtbF9 O84XrQ0bGHg5a2ES+2+dM6SOpb9LxCIdwjhZ7YoiShqBj5IsdXHw5KRB2deqPKClFro4 zIpo3EhDkROUSsk9+vDiw5b0RqvFGqrZ4YysShG+E24OyPd23hZEw8W/Kxf+ETrL9KCj I0kg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=mQI56F3X; spf=pass (google.com: domain of khorenko@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=khorenko@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com Received: from relay.virtuozzo.com (relay.virtuozzo.com. [130.117.225.111]) by mx.google.com with ESMTPS id ffacd0b85a97d-48e25de8a00si5872850f8f.173.2026.10.21.09.57.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Oct 2026 09:57:21 -0700 (PDT) Received-SPF: pass (google.com: domain of khorenko@virtuozzo.com designates 130.117.225.111 as permitted sender) client-ip=130.117.225.111; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=mQI56F3X; spf=pass (google.com: domain of khorenko@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=khorenko@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=virtuozzo.com; s=relay; h=Content-Type:MIME-Version:Message-Id:Date:Subject :From; bh=TcRkByqJavukx8AXaJ41p6hBF7mUT7IZInrbyXCGdR0=; b=mQI56F3XGEJi3QpgOEH +q6yADZSwmbEzAGfstWW+ZthtwbOUVUgZyUB9gJYH/pMnM/4ruQgysTzkZpytShjFbF+tq+9TVhi1 ex6PrQyKvyKcWEUY5yk3G+68qiYNM6/0qysWEKgu312NMBWk0kE/AenVMdiQk6BTLjP9pCFCOzldZ N8Y28CtFoyNyyNUfL1ay+qs5x/Pow4tr7J8cT3jyjCuUMFyC7dQtYHna+SNvD5gIHzO9GPh1TO7h1 MF+hGlO3Maf7B8X1C3NHZDEzEJ9B2UdXcz2UgsQx97C3hPQkxYGu16yNPeQVkS9AHrTz0o8+3ESBl cid5o8HqB6hUnBQ==; Received: from ch-demo-asa.virtuozzo.com ([130.117.225.8] helo=f0.sw.ru) by relay.virtuozzo.com with esmtp (Exim 4.96) (envelope-from ) id 1xJZZI-008y7H-36; Wed, 21 Oct 2026 18:57:19 +0200 From: Konstantin Khorenko Date: Wed, 21 Oct 2026 18:57:13 +0200 Message-Id: <20261021-b4-prep-khorenko-vstor-149847-5-doexec-selftests-v2-0-97dbb5c6e0ab@virtuozzo.com> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAOnu2GoC/52PTU7DMBCFr1J5zbR26roOK25QCRAb1IXHmdSmN K5s1yqtcnfiIDgAyzc/73vvzhJFT4k9Lu4sUvHJh2ESzcOCWWeGA4HvJs0a3ijBhQSUcI50hqM LkYZjgJJyiCBkq+UWNtAFupKFRJ99ppQTyFYZK7bYKq3ZZDt99/46I9+Zsx70UrD9zyJd8INsr sB6iiYRYDSDdXWEclXRqz/028vr7hkEX2vFQf6iS+8DoImpWjhf433N/YqYmf+vUgRwwGaNciN VKzp8Kj7mS7jdwtKGE9uP4/gN9Ac5/lIBAAA= X-Change-ID: 20261014-b4-prep-khorenko-vstor-149847-5-doexec-selftests-496ac17b9688 To: Andrey Drobyshev , Pavel Tikhomirov , Vasileios Almpanis X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3345; i=khorenko@virtuozzo.com; h=from:subject:message-id; bh=5Lp43jqy/NG5JfE1bHoYIbPH6Eq8aL2ddSUMrcP0VmA=; b=owEBbQKS/ZANAwAKAVGWCkf5YVwqAcsmYgBq2O7tj/OPjE13tFWH0sze1lP8CevFRMWnwD1j9 8Xmc2gngZ2JAjMEAAEKAB0WIQRWD23IPcXT0GO9CCxRlgpH+WFcKgUCatju7QAKCRBRlgpH+WFc KrsfD/9Skc89UcyOagcTkLXyIcs8B05yhj8d/45+9u4wizrY2hRBLEWCDTz8OeiW0s9U8EloK4f TdcN9nJ0eEOhTGJs9/z2U3gDHe6NQlNKT7VxBvTjnKqOrxBvjet7u6SbVnXClA72EyEKeLDaJ3p A9TFRQL3IgfQxJHtdWOrymItymqgqrK6hKKznSE3N9ltxy1/pYKhAI0q6Rtj0rrshEXFhe0+4y/ AJzAvxEfhgWZVOoJGaxcQd7/H5J2TStlMzp6lKZwg4slRq3Hj44Gv5oppBV/qdX01ziTS/2HfWP JsMlsk8D0I16lsrakx5EHnEggjxmImrap/RxQV/HOoftzNvNSVv2htSGqK2U6Pd2YGxHLTcFbj1 exidCo3/e5+Uld/tPKyLB8huDrYyfx0bRskUWSiR3PPZV7e57fklDnqldtIDGdukTkj+reGQFjO y+flAhFyDs45l6/2F6VyyLUWc2x5lUAaqC4ySUvSvykGmhpMEGEfOLFakl9y1VpZLYItchwGEM8 1HcHMzKsF+Wk26SjbDXvIUVjQHrT9jKrOUqEcbWeQqIwsu0Q5QmoLATrXpNepzp4+vGux1sapym fXBaOAJrBq/Rw+i+aOYkcsuBrQ6Q/TPDtAB4XdcS3RRszp56XFbL0iNoxW+XGjO6WDHHRzmstm9 4Faed0mr7e4Hfrg== X-Developer-Key: i=khorenko@virtuozzo.com; a=openpgp; fpr=560F6DC83DC5D3D063BD082C51960A47F9615C2A X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH hci-8.1 v2 0/9] selftests/mm: broader MADV_DOEXEC coverage X-BeenThere: devel@openvz.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: OpenVZ development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: devel-bounces@openvz.org Errors-To: devel-bounces@openvz.org Selftests for MADV_DOEXEC beyond the cases the fixes need: the sysctl and the refused mappings, partial and attribute-carrying ranges (mlock, DONTFORK, WIPEONFORK, userfaultfd, memory policy), the opt-in note (missing, malformed, not in the last PT_NOTE), a preserved range under the new stack, large, swapped and partly marked THP ranges, an exec from a vfork() child, VM_MAYEXEC read from smaps and given back to the copies, and a /proc/pid/mem write and a vhost kthread that keep the old mm across the exec. Failing cases say why. Applies on top of "mm: allow MADV_DOEXEC on VFIO BAR mappings". All cases pass on release and debug kernels with the whole stack. https://virtuozzo.atlassian.net/browse/VSTOR-150234 --- Changes in v2: - "selftests/mm: say why a doexec case fails": when a page that should be gone after exec is still mapped, print the smaps entry at that address and its first byte. "MADV_DONTEXEC: range not preserved" failed once with "range still mapped" on a debug kernel with the whole stack and "vfio, exec: two mainline fixes that Oracle carries", and did not fail again, also not as the first run after a reboot. The cause is not found; the next failure will show whether the kernel kept the page or the new image mapped something else there. - Same patch: the VFIO BAR case, skipped unless DOEXEC_VFIO_DEVICE is set, now says how to enable it, and the run_vmtests.sh help names the variable. - Same patch: wrap a line over 100 columns that checkpatch flagged. - New patch "selftests/mm: run repeated live updates through MADV_DOEXEC": a chain of preserving execs, each generation checking and rewriting THP-backed RAM with a long-term pin and, when DOEXEC_VFIO_DEVICE is set, a VFIO BAR, with an idle thread alive at every exec. - New patch "selftests/mm: do not lose doexec failures": write() results are checked, so a clone race failure is not turned into a pass and a shared-mm child cannot stay blocked; the allocation sweep flushes its message before _exit(). Raised by the Sashiko review of v1 of "mm: keep DMA-pinned MADV_DOEXEC memory working across exec". - Link to v1: http://lore.virtuozzo.com/20261014-b4-prep-khorenko-vstor-149847-5-doexec-selftests-v1-0-b23b454691db@virtuozzo.com --- Konstantin Khorenko (9): selftests/mm: cover the MADV_DOEXEC interface and VMA attributes selftests/mm: cover the MADV_DOEXEC opt-in note and the new stack selftests/mm: cover large, swapped and partly marked THP ranges selftests/mm: check that MADV_DOEXEC refuses an exec from a vfork() child selftests/mm: check VM_MAYEXEC of MADV_DOEXEC ranges in smaps selftests/mm: check who can still reach the old mm of a preserving exec selftests/mm: say why a doexec case fails selftests/mm: run repeated live updates through MADV_DOEXEC selftests/mm: do not lose doexec failures tools/testing/selftests/mm/doexec.c | 1799 +++++++++++++++++++++++++---- tools/testing/selftests/mm/run_vmtests.sh | 4 +- 2 files changed, 1574 insertions(+), 229 deletions(-) --- base-commit: aece33e30a95e185591244ec5cadc8bd37e9f1fb change-id: 20261014-b4-prep-khorenko-vstor-149847-5-doexec-selftests-496ac17b9688 Best regards, -- Konstantin Khorenko _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel