From patchwork Fri Nov 15 20:58:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 843513 Delivered-To: patch@linaro.org Received: by 2002:adf:9bcc:0:b0:382:184f:390f with SMTP id e12csp1056983wrc; Fri, 15 Nov 2024 12:59:57 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWXiUasvOvbk57SjQLTzN1pLERab+0x7jEJBdefZ5yiQx8+Wa/Uzt/Sw0XXdvzof5OIlHRLlw==@linaro.org X-Google-Smtp-Source: AGHT+IG6c90I3LZVUExLiV69R0V5qkZgo1KD1BqqYxoNvFlH/f7/anur3w7g1O+B3bguSKGofp8F X-Received: by 2002:a05:620a:c4d:b0:7b1:4536:8dc1 with SMTP id af79cd13be357-7b36236406dmr626160585a.62.1731704397451; Fri, 15 Nov 2024 12:59:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1731704397; cv=none; d=google.com; s=arc-20240605; b=X+0l/bOenU19wtzgm/deLRLFdBrq0UqA2X99OdP0IcitUKq3tm+/WkO9Wh7gGpElz6 z/mr8pYu4H5PRzHeaoICSmHKITzJIzIYjkoZ+xIKWfE9T5Nz0j5z5Ez9tQQctFNa+828 lJqvVLcXp43K3ruMrchrx9R0j/+wRr4F/SyPdHylgS3DpEl/NuJraSVausFn2VvhkaeI hvnKSEGSiQrbGWyG9UYNbDnx4b7OiooqlSk5J2VoimF9XdDS+CFyfuLt1VjfsMMhXqLi hw1X/KVBY2Rty8yfE1BLhxO/d6ECAL4NmvckB2Mr0A2Mi14Bs5vMEMCI8+byifVJmSNl JfRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=IefchHLUObrdReiKezDwvf7im5w8O51AN5OkZQmzJ08=; fh=qoFg0j8bGPifMOj9VfbL1YMQC3/qe81FjErpwoAQ4Cc=; b=cvw/QQ8DBQpgTEgDIU6VhqhwWgrtPZbUBiD3r8KyoZoYY1mS0lyD1WjnPSRzeVqICZ cDbetbblU6lsamOK1zOfSESOA0ru1zKXmTqAtnkgZKoCuTKWAtiEmfDVoufShPUke4cr fIaSRUS7OtpM+atdu02ZvRYoRXgQJ3PKrgUwMu1CfpxwsrkWqtHQv+cwlerxg/kdaLkw JUJFQPP5ehLmcE1GUh7qfL0GCSKu9p8j1tu/kLP42oozzVGXSfLEBHcQE2ZMjwBKByZx deMhZ6pNOiypdhvprM/8QYKalN3jNPTPHCgsxpQIWg+Bl+TwT9nSHLpeiX9jk0Fii7wl 0gcg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CoNftJ7Q; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7b35c96f373si447743085a.142.2024.11.15.12.59.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Nov 2024 12:59:57 -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=CoNftJ7Q; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tC3P8-0007VX-AB; Fri, 15 Nov 2024 15:58:58 -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 1tC3P5-0007U2-4Z for qemu-devel@nongnu.org; Fri, 15 Nov 2024 15:58:55 -0500 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tC3P3-0004M4-99 for qemu-devel@nongnu.org; Fri, 15 Nov 2024 15:58:54 -0500 Received: by mail-pj1-x1033.google.com with SMTP id 98e67ed59e1d1-2ea0f91d381so57714a91.1 for ; Fri, 15 Nov 2024 12:58:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1731704332; x=1732309132; 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=IefchHLUObrdReiKezDwvf7im5w8O51AN5OkZQmzJ08=; b=CoNftJ7QhOgSBwunaGQ4fNfpun+k9w/yh4yNaKe0rOwSZi5wFeUWi0xCYL6aThu+9o pSKBsQHX9IRzfyWy0c84Q4mPte606+8ZlssYM+507H3dG6wYLlENTEORqDhRA5Qwc0VH n5DDGXECJMCU4c83QbOTixckYTLcaPqLe/gs7K8Qov7p4U9I1m1SYszgFlatPE3ETu2L 9jda/cfemuuiX92xe42zHFH5GzsWXOa1LCgtv27Go5eWyuPDDh/iLbFEeW59o4URCOnL UHFccIhqBe8YQxlHqyWCnhqw0KoFoGf8QvT7JdUxyTijSjSd3d9Z0N8TDXHM/IHBGh+Q isCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731704332; x=1732309132; 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=IefchHLUObrdReiKezDwvf7im5w8O51AN5OkZQmzJ08=; b=wehsNO3P/IUp+jElAzlZFUNmSLiQ5+CmFEb7AEItadkKsIe61tvHYOWdZH2EhUCGu6 tuMy/DKnSb0MVzvIjEtpyByiRRHqGwxmZQct+bI+lRPg0pfm2qIkbNNesDMCaMu56GTJ a6JMII3KDOTxL86PwT3Pc5gNdZ37+x5iZzfBLgV1lzguzfXwk/nYsNtOZ2+x6S0atCCY QLhQS+MnIXrNeVXfWGDAdsQTJN4iZHPLUMgJhsJ6IzUPaHF/ocyPPPYgDWbEfCod5uQE qTw9vk/8FCnO1jWrzae58fpBtGbW2ykNQtjoJLN19ypwqnLLdYBpvFq1c0NqHost4fcb XjdQ== X-Gm-Message-State: AOJu0YwVb7bAKaJ1hMxpbIAuf/u2512we8ypP69n+0quISr9QBf6+2/J ANF1oCd2owJLeZEGsSH0Hm5+rl4HZnLBjE+TH2INlhiAGmWwsnY9pCnOgCOIG/vm3wUsUcAw65+ n X-Received: by 2002:a17:90b:4ecd:b0:2e2:cd5e:7eef with SMTP id 98e67ed59e1d1-2ea15585ba3mr4287368a91.27.1731704331827; Fri, 15 Nov 2024 12:58:51 -0800 (PST) Received: from stoup.. ([71.212.136.242]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2ea024a49a8sm3362274a91.23.2024.11.15.12.58.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2024 12:58:51 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Helge Deller , qemu-stable@nongnu.org, Helge Deller , Ilya Leoshkevich Subject: [PULL 01/14] linux-user: Fix setreuid and setregid to use direct syscalls Date: Fri, 15 Nov 2024 12:58:36 -0800 Message-ID: <20241115205849.266094-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241115205849.266094-1-richard.henderson@linaro.org> References: <20241115205849.266094-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1033; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1033.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 From: Helge Deller The commit fd6f7798ac30 ("linux-user: Use direct syscalls for setuid(), etc") added direct syscall wrappers for setuid(), setgid(), etc since the system calls have different semantics than the libc functions. Add and use the corresponding wrappers for setreuid and setregid which were missed in that commit. This fixes the build of the debian package of the uid_wrapper library (https://cwrap.org/uid_wrapper.html) when running linux-user. Cc: qemu-stable@nongnu.org Signed-off-by: Helge Deller Reviewed-by: Richard Henderson Reviewed-by: Ilya Leoshkevich Message-ID: Signed-off-by: Richard Henderson --- linux-user/syscall.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 59b2080b98..0279f23576 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -7233,12 +7233,24 @@ static inline int tswapid(int id) #else #define __NR_sys_setgroups __NR_setgroups #endif +#ifdef __NR_sys_setreuid32 +#define __NR_sys_setreuid __NR_setreuid32 +#else +#define __NR_sys_setreuid __NR_setreuid +#endif +#ifdef __NR_sys_setregid32 +#define __NR_sys_setregid __NR_setregid32 +#else +#define __NR_sys_setregid __NR_setregid +#endif _syscall1(int, sys_setuid, uid_t, uid) _syscall1(int, sys_setgid, gid_t, gid) _syscall3(int, sys_setresuid, uid_t, ruid, uid_t, euid, uid_t, suid) _syscall3(int, sys_setresgid, gid_t, rgid, gid_t, egid, gid_t, sgid) _syscall2(int, sys_setgroups, int, size, gid_t *, grouplist) +_syscall2(int, sys_setreuid, uid_t, ruid, uid_t, euid); +_syscall2(int, sys_setregid, gid_t, rgid, gid_t, egid); void syscall_init(void) { @@ -11932,9 +11944,9 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1, return get_errno(high2lowgid(getegid())); #endif case TARGET_NR_setreuid: - return get_errno(setreuid(low2highuid(arg1), low2highuid(arg2))); + return get_errno(sys_setreuid(low2highuid(arg1), low2highuid(arg2))); case TARGET_NR_setregid: - return get_errno(setregid(low2highgid(arg1), low2highgid(arg2))); + return get_errno(sys_setregid(low2highgid(arg1), low2highgid(arg2))); case TARGET_NR_getgroups: { /* the same code as for TARGET_NR_getgroups32 */ int gidsetsize = arg1; @@ -12264,11 +12276,11 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1, #endif #ifdef TARGET_NR_setreuid32 case TARGET_NR_setreuid32: - return get_errno(setreuid(arg1, arg2)); + return get_errno(sys_setreuid(arg1, arg2)); #endif #ifdef TARGET_NR_setregid32 case TARGET_NR_setregid32: - return get_errno(setregid(arg1, arg2)); + return get_errno(sys_setregid(arg1, arg2)); #endif #ifdef TARGET_NR_getgroups32 case TARGET_NR_getgroups32: From patchwork Fri Nov 15 20:58:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 843522 Delivered-To: patch@linaro.org Received: by 2002:adf:9bcc:0:b0:382:184f:390f with SMTP id e12csp1058923wrc; Fri, 15 Nov 2024 13:03:10 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCX2AbpZVFIkvCHA5OzW3Mj8PSFZNkB6v6O9i4OBetCV10ErmwErGWgsyFtvAqESxLyt4leuyw==@linaro.org X-Google-Smtp-Source: AGHT+IGqucrCXHScoiWNCZohDDBrPB5JF0U7EVUtxqo7AfkWcAateF1et5Bj65NODXsn/l9AqI3o X-Received: by 2002:a05:6830:6805:b0:718:3b7:23e4 with SMTP id 46e09a7af769-71a77a248c0mr3921416a34.23.1731704589836; Fri, 15 Nov 2024 13:03:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1731704589; cv=none; d=google.com; s=arc-20240605; b=Sjnr44LFVzEOvi4Igjx/cOrCh0gWduhS4jKH5Ume6HyVEBOTEkL1BZe/42JdelMjkA paTkiCzQdN+8zm0C7R9jO/W8x95+PD14QbVbPRJWogj5d0lifwaGFYlYz9DVz1SktbcO oaJfLdH6+WxgyaLDYyn8iH69FRmwegZD2rVXKEfGfx1sqPUpA4fY9YgEVd9yVNziphHh 72MIgvYyr8nG4GoArL1BiffV671OY0onBcQfnuE+ZP0DXuUpRx1jDDUNPyrQ/WNQkS3A w41KmbChPS2VJc4wNz76R2UIZulm6sLxINgvT6IVcTAKRX3LCJC+70naU5/hvpvugJEv jEbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=7URjfhdJJgJViY9xy3HGWdoffZ4Bx5+TNtC2smFn9cA=; fh=mnw+9DwEUea7x4FcuVZcSRMYzohcZl+IvzTDrM28dxc=; b=YuSgAgD4zcOcl3MGX/gi1yzZ+r4//T/zrYM0vT2ysKivwwl8VUkMw40ecwUnhPb8Lb /LZtmeDYfwo0KRaLfTOYzOZyxV/KNVD6Ftr5JgbDTpJzeTxjGSo7ci4Li82XVuxXCCGw uBMcEj91EHCy76ncvEGdWmsBmMVmjhZQfZvzIlbRLe1fdbo9wMwxfq0HoOj2CFTi+4ny MrCDGelUBcfHcI759kDu6T3uRd0KA10pyZ1aFsyWN6Ahl2VQ6i/MIZyf6JlTm4O5kpRR qKbiZxeJRUEo3qSpNaxFEuIo9FKD9HnzUxnbWCQ/T7HpxwkSSyE3yn43/PTjUXLGLe4Y OVRA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=v8Hy9w5m; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id ada2fe7eead31-4ad647715a8si720889137.211.2024.11.15.13.03.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Nov 2024 13:03:09 -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=v8Hy9w5m; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tC3P8-0007Vc-UT; Fri, 15 Nov 2024 15:58:58 -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 1tC3P6-0007UH-3s for qemu-devel@nongnu.org; Fri, 15 Nov 2024 15:58:56 -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 1tC3P4-0004MF-5A for qemu-devel@nongnu.org; Fri, 15 Nov 2024 15:58:55 -0500 Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-72410cc7be9so1997032b3a.0 for ; Fri, 15 Nov 2024 12:58:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1731704333; x=1732309133; 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=7URjfhdJJgJViY9xy3HGWdoffZ4Bx5+TNtC2smFn9cA=; b=v8Hy9w5muerd/afaeZpO4O9jmJVNH0mG8o0/TYRNzmfiujoBYex5a9zRAJETUj16Gu LLgX/+9AZG0dqPG+ewSUJtyl79LSN0/MjmerAbcALvdwRxHlc1m1x89ltXCqVVaVhpDh zi3tQMok9PM8s4/LAzeriJJH1bM71AND2Zp5ZdFvsF7xIJ0DcI2pz3QcOS2AR+rb8sT/ 8DnFDJ6YnnouwOnckeseVu1XUQMJr2Azl1KSS8j0tWmmHeC7lYH9cRt6eovKbRgVM5hF kEMa/Vy6twvBylEneupoZIHikOP3ClnN1ZYX+dTc6QELw5QUQ3WJ1w+lFb3/nlRTV9HL X2Kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731704333; x=1732309133; 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=7URjfhdJJgJViY9xy3HGWdoffZ4Bx5+TNtC2smFn9cA=; b=Xe5FmI5ZsNw4xH8Lq0UJwB8JqEn8yK/atSOYka4ssx+sctKU7FsWWa7PXJuOMGwVk2 FVvu1xqz8z+rrluZWMcyOZdpzXbVBWX+ZduGFd68T2mG4+D+Y5O6heyD0kf1HjiCNGvw 4PiS26JfM0H6Qk1GTEs1KoBHFlBDsjb62DbntY75i9kx5iU4M1+L2CBYxjwQxgmIoBdw 3nINoHq0MDH3q/sFd7KT8Pg/oeiGY1Kcb/5d1W3Nt9+FcXk4xW5df/42Xeep/YeIm9uh /W6DAD/i8Lg2RJY2PTbEbtBs1KfWBe4Q0/RcI7QYPnC5LcYIhlyZmTM92rmzuaZonLRv NU0Q== X-Gm-Message-State: AOJu0YyYVHUMZaIpsCHQTaS8LL7iNMhosIrCRIyiOcd7sy8V0Huan4Qc 6LI+sBjqSfRVWYYwO5h738uaQlMJeItVkCwAmMUhHt+HJherPlgDucef/smAEjgBfAJH61fX2Ab q X-Received: by 2002:a17:90b:1d05:b0:2e9:2e69:ee10 with SMTP id 98e67ed59e1d1-2ea1552274bmr4652293a91.19.1731704332696; Fri, 15 Nov 2024 12:58:52 -0800 (PST) Received: from stoup.. ([71.212.136.242]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2ea024a49a8sm3362274a91.23.2024.11.15.12.58.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2024 12:58:52 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PULL 02/14] accel/tcg: Fix user-only probe_access_internal plugin check Date: Fri, 15 Nov 2024 12:58:37 -0800 Message-ID: <20241115205849.266094-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241115205849.266094-1-richard.henderson@linaro.org> References: <20241115205849.266094-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 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 The acc_flag check for write should have been against PAGE_WRITE_ORG, not PAGE_WRITE. But it is better to combine two acc_flag checks to a single check against access_type. This matches the system code in cputlb.c. Cc: qemu-stable@nongnu.org Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2647 Signed-off-by: Richard Henderson Message-Id: 20241111145002.144995-1-richard.henderson@linaro.org Reviewed-by: Alex Bennée --- accel/tcg/user-exec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c index aa8af52cc3..06016eb030 100644 --- a/accel/tcg/user-exec.c +++ b/accel/tcg/user-exec.c @@ -800,7 +800,7 @@ static int probe_access_internal(CPUArchState *env, vaddr addr, if (guest_addr_valid_untagged(addr)) { int page_flags = page_get_flags(addr); if (page_flags & acc_flag) { - if ((acc_flag == PAGE_READ || acc_flag == PAGE_WRITE) + if (access_type != MMU_INST_FETCH && cpu_plugin_mem_cbs_enabled(env_cpu(env))) { return TLB_MMIO; } From patchwork Fri Nov 15 20:58:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 843517 Delivered-To: patch@linaro.org Received: by 2002:adf:9bcc:0:b0:382:184f:390f with SMTP id e12csp1057886wrc; Fri, 15 Nov 2024 13:01:21 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVQeorE+M2FIXubgm7w/QTk9Jv3Kp8z6m4y761gQE3YsgSoCQrQnP34k6OxT1ELUn/7LMJq+g==@linaro.org X-Google-Smtp-Source: AGHT+IGmIYUliidberScaGq4iY/Fops6p5yFJg5tOjkW6JDKiRl2X7l8vJgEVAhaS1dXT5Gdg54Y X-Received: by 2002:a05:6359:7608:b0:1c3:7503:86bd with SMTP id e5c5f4694b2df-1c6cd0dea30mr341633555d.14.1731704481563; Fri, 15 Nov 2024 13:01:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1731704481; cv=none; d=google.com; s=arc-20240605; b=jQ6H8GV8NtrZ3hzrQbXOiihup5Z3Cfd4KH2SmklYhX7pUSuXIyfvdqZyiJ9gYHcvVD +oyT5aTjp8g/tZMix9IsJ2DR7K0HXc5gn3XBbrf767zizXFQmyMQBBkcLco9Bdkwl5Nm +jBrAwjPgWbL0gomK9ucBZF6Vg2QudH7RiM8c8Fr0aM8ZzrEhhA+ZaNBKh2oOiJcWiuT VMNMGwhTVY6UBKsgjaTg90gdiJ1v9iA8IKDEHawPaTOb7Xnx83gNILyC+Z6yAyYKHRaF sd9K+5yOY04Om3io3ND7UElAosSiJrzJ4X2Men8xR3OjF+jQpSRDJVq34I0SOjtef1sM +BTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=rexE46PmQpKj/6771gZyfiaf0DpwcDNDhSjq6mWlBi8=; fh=4RqdLMIrR7qTEUmnmFFI+83EHhKCrT2Fs4rC7TcdDhw=; b=iO5bb56fEAv7YG+i4+MTd1kTjt/4ca+/LBjMH1lfpIW7qSf4+MThoErlXgb0fj9ium laX5n2LvuBnI8s5EHH0VyEgWDd4H1WYr9vuZuZPa0wOOvXbqQ7rk8IJ1lX6UvNqw9OcM j8TKQ4e8VFPL4uyqZkLpYoV81f45pioTOnC5DTghTmNUd1c1lhjiPpZLp744Nt9CYGmR SN5agX1rNNq8NBbSplZ46cHyqHy2DRfgwlyWaAbhBWrkORzigjWjQ1UD87JjgBx9pgPj D51WycPaa10H/6sjuXvbQRnIAeNSUC7ghb2ffnYs1fissNeVW/xjuyBRCL8T3plN8IXz kaCg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dEf7hsQU; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-4635aaec7cbsi48265351cf.407.2024.11.15.13.01.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Nov 2024 13:01:21 -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=dEf7hsQU; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tC3PA-0007W9-9n; Fri, 15 Nov 2024 15:59:00 -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 1tC3P6-0007Uz-V9 for qemu-devel@nongnu.org; Fri, 15 Nov 2024 15:58:56 -0500 Received: from mail-pg1-x530.google.com ([2607:f8b0:4864:20::530]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tC3P5-0004MU-AT for qemu-devel@nongnu.org; Fri, 15 Nov 2024 15:58:56 -0500 Received: by mail-pg1-x530.google.com with SMTP id 41be03b00d2f7-7ae3d7222d4so795712a12.3 for ; Fri, 15 Nov 2024 12:58:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1731704334; x=1732309134; 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=rexE46PmQpKj/6771gZyfiaf0DpwcDNDhSjq6mWlBi8=; b=dEf7hsQUp3LRk44wpGX3uudWOfm8CCB5IgHTs1n5PKs8Ni7LHpvyzgBFFK+CHGgrjb Se/U2JjO6g+8vcxjcBMf6krCIak93q+QNS67HKKHJ8KnwRXq36Soc2qQxIJL1qcMmji5 iVQwxTXBW8vGG9YsWl6quf9JwODcCaNYU6uwuxmBi7dzolYAf0wg4PtF+LEB2+48+c3n yQyrTzBPgl6P0ZK6necJYVo3Ymj5ShA5XLhQm02ECvr6qNz/z3+Tdj4sE5vH7du6MkEu fhcSxMAbC4om+nKvnc3czp7e7vUbfBFoSx+/DZF4zMozal2PtT5feXeSAxCwuacyubpY 7rRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731704334; x=1732309134; 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=rexE46PmQpKj/6771gZyfiaf0DpwcDNDhSjq6mWlBi8=; b=QbAG3R2tJKDfVUfQ/BnlazuZ1Eq3x2SNwokMaqPK42OH01qwWybafmT+WrrnsmSzTn drfndGcWK8xogYEf/8yKb8MtnQvOMuEXm6aqkfpdLkoAsCevX7soNrT5KM2ZFTSll0Jt AlETyelO0wwlLwaf1Bj3I2QYmbZqaXdbht9ffvWd8h6C46RiubD+Dl2C3SilIzs1Z0Y5 15B7OqPVbgWt6UthMsnNcwgefkGdqnp6Nydg+QIQALTD5glw4OLQ8l4R0RJf0QtuhV9N LOtDJWio96v6k1168yVWQfL8iYVe52XoatfkOH2JgaCGC/IxNxmE3BLKF+vAIg5APnPi 7FCQ== X-Gm-Message-State: AOJu0YzkbPCFaB2cT0xNx7u14xbMF3xCe70SFu7hcPv8ZsW/BmL/WBEC IOcDso7KirRj8+Te9CSXF2YpOIMNMfUMai+fnU5lkLno5Mlq1sLTOpBExrDrM1cszwOrhmgUihS g X-Received: by 2002:a17:90a:e70c:b0:2e2:d181:6808 with SMTP id 98e67ed59e1d1-2ea15587b4dmr4924629a91.30.1731704333648; Fri, 15 Nov 2024 12:58:53 -0800 (PST) Received: from stoup.. ([71.212.136.242]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2ea024a49a8sm3362274a91.23.2024.11.15.12.58.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2024 12:58:53 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Ilya Leoshkevich , qemu-stable@nongnu.org Subject: [PULL 03/14] linux-user: Tolerate CONFIG_LSM_MMAP_MIN_ADDR Date: Fri, 15 Nov 2024 12:58:38 -0800 Message-ID: <20241115205849.266094-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241115205849.266094-1-richard.henderson@linaro.org> References: <20241115205849.266094-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::530; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x530.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=unavailable 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 From: Ilya Leoshkevich Running qemu-i386 on a system running with SELinux in enforcing mode (more precisely: s390x trixie container on Fedora 40) fails with: qemu-i386: tests/tcg/i386-linux-user/sigreturn-sigmask: Unable to find a guest_base to satisfy all guest address mapping requirements 00000000-ffffffff The reason is that main() determines mmap_min_addr from /proc/sys/vm/mmap_min_addr, but SELinux additionally defines CONFIG_LSM_MMAP_MIN_ADDR, which is normally larger: 32K or 64K, but, in general, can be anything. There is no portable way to query its value: /boot/config, /proc/config and /proc/config.gz are distro- and environment-specific. Once the identity map fails, the magnitude of guest_base does not matter, so fix by starting the search from 1M or 1G. Cc: qemu-stable@nongnu.org Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2598 Suggested-by: Richard Henderson Signed-off-by: Ilya Leoshkevich Message-ID: <20241023002558.34589-1-iii@linux.ibm.com> Signed-off-by: Richard Henderson --- linux-user/elfload.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 6cef8db3b5..d6ad77d27d 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -2898,7 +2898,7 @@ static uintptr_t pgb_try_itree(const PGBAddrs *ga, uintptr_t base, static uintptr_t pgb_find_itree(const PGBAddrs *ga, IntervalTreeRoot *root, uintptr_t align, uintptr_t brk) { - uintptr_t last = mmap_min_addr; + uintptr_t last = sizeof(uintptr_t) == 4 ? MiB : GiB; uintptr_t base, skip; while (true) { From patchwork Fri Nov 15 20:58:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 843519 Delivered-To: patch@linaro.org Received: by 2002:adf:9bcc:0:b0:382:184f:390f with SMTP id e12csp1058402wrc; Fri, 15 Nov 2024 13:02:08 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCW4L5ptSGTzdWJIogoJfmFhO5D5aT1oaZ1nt53jqq5UN110/ZvPNoD7ggG6gR6ALA5DsyLEdg==@linaro.org X-Google-Smtp-Source: AGHT+IEdTP6VhVXvgPEPSU9FMrJya4K1cKZhMBYCncS5wB5ajyi0Cza7Bj8TQ5T6awxmO2jq4C2O X-Received: by 2002:a54:4002:0:b0:3e7:be26:e2e4 with SMTP id 5614622812f47-3e7be26e3damr2987531b6e.0.1731704527784; Fri, 15 Nov 2024 13:02:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1731704527; cv=none; d=google.com; s=arc-20240605; b=Q87OD9PDA8aSxYLZm4wY05kX4QKBiMFAfBS37TIJvwiWc6ngALpSa/T40WtYG7G9vN k65fN6Zyq+PjGykskzgOY2N2x45NcBz5Qnadx1fwRY8oMlsIvwDPDOOYj+otaZ4tR/Ny N8qbjDvrvyPOYFHXGqhskcBYPHrE5qYxzZBI4yp9geQoPFOIJb5MDZm5SpN/trcC8X5G 331MmmRHDYK+obSOmixYeAHxYEH5B0PN0Ja+h+Sr3QtohMKHB/WE7+sMZNpuNwUfUHSq ePjaNQMV9ePtEDowoa2e9KF9PotP5Lk+oOiwsn3fmkTjZ2B3oVimCryeF0jL723H/qj3 HzZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=mQ2OtP14Y6YgrVCa1qLJ59lo8Li0ZXwEANDkZj5mi5k=; fh=o2XzhdKG+B45MJCghEfnYoypmHvLX2hd4SL6yXeiyXI=; b=hzgKoG67VOizU7L2ob8Q4ItHoxUJSiPXE8P1pY89EvDP7r2zef/NV759jPkJXMo+zZ 3i/5gm10YQeX6os2JVx/0BslomzO1FuCmdMrGgEUb2Iof5cw2++HhkKKA7Fe9oDPKkjh vaBITCvq7XCec+QKzNlwrJLCZwnC8VIUvydL6E9iYMQPvU3V5iLgLgqLsGED7MlrjnYl 5V8Y6jKBmby75I6gl2B3GL3YQtqZ4fo1zcKZMKznHOY4zJm/s/t4kOHyvJuDaqmCgiy5 wbdPjOA1u9CWwZjOAse4XIqhBvc4AVsuSXdUobjczgPHmqg2zRyFzUKe2W7Zs1CC+Mpv DeJQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="a/dFTf/h"; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id a1e0cc1a2514c-856f79780a1si16511241.101.2024.11.15.13.02.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Nov 2024 13:02:07 -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="a/dFTf/h"; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tC3PC-0007Wc-8c; Fri, 15 Nov 2024 15:59:02 -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 1tC3P8-0007Vf-W5 for qemu-devel@nongnu.org; Fri, 15 Nov 2024 15:58:59 -0500 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tC3P7-0004NG-7h for qemu-devel@nongnu.org; Fri, 15 Nov 2024 15:58:58 -0500 Received: by mail-pj1-x1034.google.com with SMTP id 98e67ed59e1d1-2ea08667b23so1813523a91.2 for ; Fri, 15 Nov 2024 12:58:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1731704336; x=1732309136; 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=mQ2OtP14Y6YgrVCa1qLJ59lo8Li0ZXwEANDkZj5mi5k=; b=a/dFTf/hFe+csNMZdAvRLxuZY4xiI6QByn/LZEfp8Q4pp35EdeBV+K83Y5+INiW9d0 hvERvJBvzD3PHz+MGkimOPS6qiWkjBU6Hb4PhPoNd7XP+psC/sqJHKyko3CQebOHi2QA MYcDOgpKBgK6egxt/2u285LUE6PA7YRmsGFdzHpH7yjZK0AmeEOGX3S4Sosxh+8anaFB 90qDLFVRCWyyoBPTEx1js+NSJO4ZgPct5/e7Yf1lAFyV6+gmyInTX1NLKH0rkwcUp4qm pn+HMvV9TXpC8zYn4c303NWvlEVoRY8INK7ub5jHex141w/QL1ZmbjX7wsV2GLXk+UcC Gr7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731704336; x=1732309136; 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=mQ2OtP14Y6YgrVCa1qLJ59lo8Li0ZXwEANDkZj5mi5k=; b=DjkkD8YDSGqavlhGqRd/ube7SUtl+vKb80PCQ/OfPNe3Qtdq8cnD1puKqpOKBUqvpl lGbFL6Cg5FIt3yPNoTtiyah/TO3dEM8itOFyz6+uYuqpzb+nDbF/30OIDklM4iLz8qiZ 4yCunSVrB3rIlsATiMJcDYTguHgPJwF0i/ch9r194hYQAI+tamo2G2DU3BEGgLWHuRmE mqLXR9JslgHr6mPCttx0+8lNPSkEh08M1Eqxt5n6/4kQH8pG6sqsjDr4Jsfdpv3P2nf+ nZLefzY+kRk73tZLQFf7kmLly5M3TNnvA56jJ3DEiWy7bBvSGUkEls9Rk0l+0s9iLVYD N9aA== X-Gm-Message-State: AOJu0YwEM0MEKelv6AyeqHw2VVD2OXfGODaCHt9GhlyGCHpAAQOTN6oi 5Icoi5ZN2OQZaeNVYDCoM+0uNJBLlncQXWHffr0KnClyjIrJhenAVRt7peesAdrSz2bhKOr3zG8 w X-Received: by 2002:a17:90b:4c84:b0:2e2:a097:bb02 with SMTP id 98e67ed59e1d1-2ea154f5eabmr4577431a91.11.1731704335638; Fri, 15 Nov 2024 12:58:55 -0800 (PST) Received: from stoup.. ([71.212.136.242]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2ea024a49a8sm3362274a91.23.2024.11.15.12.58.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2024 12:58:54 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Ilya Leoshkevich Subject: [PULL 04/14] tests/tcg: Test that sigreturn() does not corrupt the signal mask Date: Fri, 15 Nov 2024 12:58:39 -0800 Message-ID: <20241115205849.266094-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241115205849.266094-1-richard.henderson@linaro.org> References: <20241115205849.266094-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1034; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1034.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 From: Ilya Leoshkevich Add a small test to prevent regressions. Signed-off-by: Ilya Leoshkevich Message-ID: <20241108145237.37377-2-iii@linux.ibm.com> Signed-off-by: Richard Henderson --- tests/tcg/multiarch/sigreturn-sigmask.c | 51 +++++++++++++++++++++++++ tests/tcg/multiarch/Makefile.target | 3 ++ 2 files changed, 54 insertions(+) create mode 100644 tests/tcg/multiarch/sigreturn-sigmask.c diff --git a/tests/tcg/multiarch/sigreturn-sigmask.c b/tests/tcg/multiarch/sigreturn-sigmask.c new file mode 100644 index 0000000000..e6cc904898 --- /dev/null +++ b/tests/tcg/multiarch/sigreturn-sigmask.c @@ -0,0 +1,51 @@ +/* + * Test that sigreturn() does not corrupt the signal mask. + * Block SIGUSR2 and handle SIGUSR1. + * Then sigwait() SIGUSR2, which relies on it remaining blocked. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ +#include +#include +#include +#include +#include + +int seen_sig = -1; + +static void signal_func(int sig) +{ + seen_sig = sig; +} + +static void *thread_func(void *arg) +{ + kill(getpid(), SIGUSR2); + return NULL; +} + +int main(void) +{ + struct sigaction act = { + .sa_handler = signal_func, + }; + pthread_t thread; + sigset_t set; + int sig; + + assert(sigaction(SIGUSR1, &act, NULL) == 0); + + assert(sigemptyset(&set) == 0); + assert(sigaddset(&set, SIGUSR2) == 0); + assert(sigprocmask(SIG_BLOCK, &set, NULL) == 0); + + kill(getpid(), SIGUSR1); + assert(seen_sig == SIGUSR1); + + assert(pthread_create(&thread, NULL, thread_func, NULL) == 0); + assert(sigwait(&set, &sig) == 0); + assert(sig == SIGUSR2); + assert(pthread_join(thread, NULL) == 0); + + return EXIT_SUCCESS; +} diff --git a/tests/tcg/multiarch/Makefile.target b/tests/tcg/multiarch/Makefile.target index 78b83d5575..18d3cf4ae0 100644 --- a/tests/tcg/multiarch/Makefile.target +++ b/tests/tcg/multiarch/Makefile.target @@ -42,6 +42,9 @@ munmap-pthread: LDFLAGS+=-pthread vma-pthread: CFLAGS+=-pthread vma-pthread: LDFLAGS+=-pthread +sigreturn-sigmask: CFLAGS+=-pthread +sigreturn-sigmask: LDFLAGS+=-pthread + # The vma-pthread seems very sensitive on gitlab and we currently # don't know if its exposing a real bug or the test is flaky. ifneq ($(GITLAB_CI),) From patchwork Fri Nov 15 20:58:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 843518 Delivered-To: patch@linaro.org Received: by 2002:adf:9bcc:0:b0:382:184f:390f with SMTP id e12csp1058407wrc; Fri, 15 Nov 2024 13:02:08 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCX8XpBIlGiSBEBEdSaaTnVPUlWAtiyoGd3R4UO1M9KpgHtca6TiMpWzH1vhVwy5snzcaGgJ5Q==@linaro.org X-Google-Smtp-Source: AGHT+IEgh7ydMsOoX9mZdclKI54vFL2aX1lXnFh5gDHKWHV6/EmgnLfxRupUA/R62d1FKPd+IywX X-Received: by 2002:a05:6000:18a7:b0:37e:d6b9:a398 with SMTP id ffacd0b85a97d-38213fff9dfmr7499004f8f.9.1731704528100; Fri, 15 Nov 2024 13:02:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1731704528; cv=none; d=google.com; s=arc-20240605; b=IVYzp7y2kyKC5Qk4+i0556QkmIAWPNcQ5Pjp3+RLKOm7Q+aFBe3wdYWbtHiWmjuuDw 2Ko5SKO2CBAFKsANetpThcgoSMbKP/nfdTfdgsoD5w3smAr8P8fvCip4c0ty1mZcatWH Xs4LdRFjmuP0Wwwka5BLemla817zgTQcxYKyGJEl2gaRqmXRZ2KOy6SYCNtXR2xEZ0Kk TtRRYMMORyqW/LF3l0ipEs5McFaB2kTT3JlHHevNcqL1UMVl8kcyKgXDTLhSq2YoG3OA cNnxSKznkBEgQ3upOAIiFnPY4Uy01lyr2NfxVwZFo59c6KJ8zLI4EGD/YxpLnW5Q634d lZug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=uCYl3p7NTkXg+Dt0eWVy+0t6Rq+HCybUm/IWs0g2j0w=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=e6MCkTcVGYExmet4MUbtWCpWJEOxhnRdLi6GE4rTqSB9ATJ0aDW2Tp4CIe8TKPOKlf lLif7ZjEWjhwr0YuwzvHIX9CvcgfXJ9g4ItlRLnNhZp2CCvD8wq2SuVqkjye8D6V97Si C4jwXa9oKBzZaf7fQZP5CDE8cm77G8FJL/NAGqMUJFg900HzvapemkK+5/3fT4R9DB1r dKbqOhwhqMGUwt1cM1cqfvNqSnTTrARtO2ekrtGraN9n1oZ8hzUFRNHYgqJccx1oydzx puBiBn2ZQNLgK24lVytHaK3c5Q3MlGtGOqM5V6Fyyaat0Op8UY1eGBnKzrvK21Wd0Xlk Y6vQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wfhPx2vT; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id ffacd0b85a97d-3821ae19f61si2692777f8f.351.2024.11.15.13.02.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Nov 2024 13:02:08 -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=wfhPx2vT; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tC3PC-0007XT-Al; Fri, 15 Nov 2024 15:59:02 -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 1tC3P9-0007Vw-Dd for qemu-devel@nongnu.org; Fri, 15 Nov 2024 15:58:59 -0500 Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tC3P7-0004Na-My for qemu-devel@nongnu.org; Fri, 15 Nov 2024 15:58:59 -0500 Received: by mail-pg1-x52a.google.com with SMTP id 41be03b00d2f7-7f8cc29aaf2so508937a12.3 for ; Fri, 15 Nov 2024 12:58:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1731704336; x=1732309136; 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=uCYl3p7NTkXg+Dt0eWVy+0t6Rq+HCybUm/IWs0g2j0w=; b=wfhPx2vTByQTb44lBMOctLqutMGfiuRzTnOzG4JdkqTPkSmcOaUQiBaq1luVmLsw7i ocjh3GF0vaGC+XrJIYRB2vu5dVCXkXFhDtLDHFlV9bYOHSYJZaqbOyXiQhAVk/6M8g9f An+ENYhj1W1Qip4QKKdcQ1KOYHB9nvy2Ud5auxAlECabPuG+o3auVaGMnosH6rxOOVev 6pS1aKEkMw66GCptMcHnmshqQV7D7GP5e0JFo2Bwsu+mcIcmQATjfdR6ELWenAqAOW85 YaanYLKM2KUZ85Ht0+CQ+bcB6Rgf8Bs/2G+y9ccVabneTouE2lusct/Y4dVq0Uoh4yhI xRgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731704336; x=1732309136; 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=uCYl3p7NTkXg+Dt0eWVy+0t6Rq+HCybUm/IWs0g2j0w=; b=nJENQXH4lpnPvICsPDWipPOsjoOq6Wjy2YJgwoBK02eaFEXf5RsHGzQ7PUxSAFcmoc Bviu53ADsHFQdhhed381FMkWbH57MKE2aX/ICspy4ZBImEpvpXdws+cRs5Bg94PKSuQX RlHdPLTkmwhw/UIoSVwVu554EczIeVkOTYBpfjBVcvziyiXMrPI+3kYpvlsOp0R9BY5R XX51F6AqjRgZTDlA/CqfnClzp6lT4G3T16XF+ZwPF/ldKlj6H/VIRylEKf22WZkf72CG +pmiEGnA3xXubrpizmMDeKKpKGJAm3OESBNxOEQuqlNQ4UpnVT8Kw7cjN94DRh3pdJpQ uqVQ== X-Gm-Message-State: AOJu0YxB96/O6ei9Z0v8sQoHqWnThuuEmH3y9ZIVT4exShWerT1lStHd dnq7yuvoTktBk0EVPW+/uB/BU1IyDBS5pCsz8h7Lu8sJ1VLps15IFLLKaLXImQOXWliOiACF6SI E X-Received: by 2002:a17:90b:4c52:b0:2e9:4717:97a8 with SMTP id 98e67ed59e1d1-2ea1559feb9mr4091044a91.36.1731704336337; Fri, 15 Nov 2024 12:58:56 -0800 (PST) Received: from stoup.. ([71.212.136.242]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2ea024a49a8sm3362274a91.23.2024.11.15.12.58.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2024 12:58:55 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 05/14] target/i386: fix hang when using slow path for ptw_setl Date: Fri, 15 Nov 2024 12:58:40 -0800 Message-ID: <20241115205849.266094-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241115205849.266094-1-richard.henderson@linaro.org> References: <20241115205849.266094-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52a; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52a.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 From: Pierrick Bouvier When instrumenting memory accesses for plugin, we force memory accesses to use the slow path for mmu [1]. This create a situation where we end up calling ptw_setl_slow. This was fixed recently in [2] but the issue still could appear out of plugins use case. Since this function gets called during a cpu_exec, start_exclusive then hangs. This exclusive section was introduced initially for security reasons [3]. I suspect this code path was never triggered, because ptw_setl_slow would always be called transitively from cpu_exec, resulting in a hang. [1] https://gitlab.com/qemu-project/qemu/-/commit/6d03226b42247b68ab2f0b3663e0f624335a4055 [2] https://gitlab.com/qemu-project/qemu/-/commit/115ade42d50144c15b74368d32dc734ea277d853 [3] https://gitlab.com/qemu-project/qemu/-/issues/279 Fixes: https://gitlab.com/qemu-project/qemu/-/issues/2566 Signed-off-by: Pierrick Bouvier Reviewed-by: Richard Henderson Message-ID: <20241025175857.2554252-2-pierrick.bouvier@linaro.org> Signed-off-by: Richard Henderson --- target/i386/tcg/sysemu/excp_helper.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/target/i386/tcg/sysemu/excp_helper.c b/target/i386/tcg/sysemu/excp_helper.c index 02d3486421..b1f40040f8 100644 --- a/target/i386/tcg/sysemu/excp_helper.c +++ b/target/i386/tcg/sysemu/excp_helper.c @@ -107,6 +107,10 @@ static bool ptw_setl_slow(const PTETranslate *in, uint32_t old, uint32_t new) { uint32_t cmp; + CPUState *cpu = env_cpu(in->env); + /* We are in cpu_exec, and start_exclusive can't be called directly.*/ + g_assert(cpu->running); + cpu_exec_end(cpu); /* Does x86 really perform a rmw cycle on mmio for ptw? */ start_exclusive(); cmp = cpu_ldl_mmuidx_ra(in->env, in->gaddr, in->ptw_idx, 0); @@ -114,6 +118,7 @@ static bool ptw_setl_slow(const PTETranslate *in, uint32_t old, uint32_t new) cpu_stl_mmuidx_ra(in->env, in->gaddr, new, in->ptw_idx, 0); } end_exclusive(); + cpu_exec_start(cpu); return cmp == old; } From patchwork Fri Nov 15 20:58:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 843511 Delivered-To: patch@linaro.org Received: by 2002:adf:9bcc:0:b0:382:184f:390f with SMTP id e12csp1056843wrc; Fri, 15 Nov 2024 12:59:39 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUPSS1mfpW0vmoYr3nmnzCHzahjRLwAwFkOpsttlxiXLTYYjxi5ctt3Uu+sSVmwyvu4A6ZpXA==@linaro.org X-Google-Smtp-Source: AGHT+IH6V4Yn2Atp7k/S3V95L8k+DTiq7+K1Oz4oOTdJX1seOePb6g+98BYK9iMG3Zmrars5BgCp X-Received: by 2002:a05:6214:2c0b:b0:6d3:6577:ab11 with SMTP id 6a1803df08f44-6d3fb88b4camr47018946d6.30.1731704379482; Fri, 15 Nov 2024 12:59:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1731704379; cv=none; d=google.com; s=arc-20240605; b=VRlvMqsAp34H5/xmf8EbgkckWBCXAuytUwnsgurWFNbk2FIjXN7yl87TFJp5BfVJ7L TMdhJ4GijWNajK1a1Tmg1RWWq8XHxVLQMv41nj96FJIwcaFhxyd+M2XDGocTgnYMVQmL uV83Lm+rmcDfderuvH8+27KTLpPqEGjmNR7x/iKxb3/wvuhzNclIlIPuAtsrZzQmPIJp SK7s7QnpPstSDmGrnBHg4CBE5CyU2kz+clr8frASBTHLSJWq1qaQ2GLfeVutgfRtpuVD hvE1caOfzh+NcwAPFU4ifNkT/u4ZZQBdQ1uvHap0FhdpXOpCFeRr0HV0atcsKOGo9zap y2cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=Frvdm/WDiTHhmyZ4u8I9chbK5/V3/lvbxAdiykuEOlI=; fh=6Iy23zC9AdgEjl8BT287tms7OsCTNhvcMTX6iUEgWw0=; b=HiuT5NjD9nwEa7Sv3aZUNEQkuTFxiV1il0Cq99YV00Ie988SSQSiKbdbw95h8JtPRX oS4RapiD5OvhDixeL7zJSHDSjryIq2Ri19vs+Jf79eZHrkn2DOtvFVkKmcuDjW7z4uCF vhUIjyM64xjtIdJO9A1K3nQt9Ma6eC1hUtGc21p8asM0ZUs0ZCla+81gbfD1V4K3kbnx 472w6NiEp8O+cGc4VuHbcZqLu6WvC4GCi/PUrOJ+Qm7ngVrd01CpOe32n3mA2mD8LlqV l8SJx3jfqZAGvSJ4bbGCKt8EglFvab9xt0W42SIzOXGoHB5P/FlA+7Vum6fQUC381+Wa KUGQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mLZRT+Av; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6d40dcbc984si1850606d6.383.2024.11.15.12.59.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Nov 2024 12:59:39 -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=mLZRT+Av; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tC3PH-0007Z2-CV; Fri, 15 Nov 2024 15:59:07 -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 1tC3P9-0007WA-SF for qemu-devel@nongnu.org; Fri, 15 Nov 2024 15:59:00 -0500 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tC3P8-0004Nk-Gc for qemu-devel@nongnu.org; Fri, 15 Nov 2024 15:58:59 -0500 Received: by mail-pj1-x102f.google.com with SMTP id 98e67ed59e1d1-2ea304ce809so49816a91.2 for ; Fri, 15 Nov 2024 12:58:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1731704337; x=1732309137; 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=Frvdm/WDiTHhmyZ4u8I9chbK5/V3/lvbxAdiykuEOlI=; b=mLZRT+AvDuNcrYjJpudvwvtTpwvlFIcHAZDVrpKUb+7qIjVbOl7JSemLTJOju/P9tN zSMj56h4YnOmGcx8HpYh7idJ3rf3fx8KOsVR3SH73Wh5Pgp/lmmQP+2oVM6a5i0z4aH/ nT5RZAa0IfM4AnVEvJOxIh9j3XdomLaXqYuJFidFgTtNIzXCtyxWsAMyZVnUjGdW8GBW ri+hjA86HfGm6Yea3Gk3zLKOnpBzU8fjl1lV8rBBqBrE9iF/HpVMirMX9RJS+8fNfY+n DVRQN9PL178WMOXjHgumA22LSxPG/FfY1TAKTPeovFZSp9Xu2xr6FUodGC9jmhxsuG7H xb4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731704337; x=1732309137; 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=Frvdm/WDiTHhmyZ4u8I9chbK5/V3/lvbxAdiykuEOlI=; b=dgVSGzpISYWZnI2Npbk9HokIhCOMA0TwipVppkAVrn4amA8BujEisPXFXisEkmm2EZ ehTBkrWH/1iplt5st2974fRfMJq05obavAhXUQWKCEqqbX1sNhcsfK2RV4mX4lpq9fqt Y0MBxc3N6rP5kL9KFvJnw+GYq0p+FMasp2gJi82launiUA9EI5+Ba+ZZcFGOSlXxq+ex lXRYiruM8hzdeBs6gDONMfcyNHFYUsvzf4cLaf8oHMyB/BcFzqMxvGTlU1K5WsCM9VfB GsFvD2cJnx5jwfuLvQqKUr5HAEFxdyucrG72Q24r8w8XRCLY7Iz4riIix/NIdLwOm7cH 3O1A== X-Gm-Message-State: AOJu0YyjumnoGr7lGMONBx+grUFPF3qqy30J/fI8I3vugUSHaoip2U1l wVSSTED6Bo1ua1uSpjbpZ985MGUMlY6SPsGew+Gs0l1gfSPM+4n4OkhN9hayW/GsRPM2P5R8SGw Y X-Received: by 2002:a17:90b:4f4b:b0:2e2:e159:8f7b with SMTP id 98e67ed59e1d1-2ea154b5732mr4978132a91.3.1731704337045; Fri, 15 Nov 2024 12:58:57 -0800 (PST) Received: from stoup.. ([71.212.136.242]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2ea024a49a8sm3362274a91.23.2024.11.15.12.58.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2024 12:58:56 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , =?utf-8?q?Philippe_Mathi?= =?utf-8?q?eu-Daud=C3=A9?= Subject: [PULL 06/14] cpu: ensure we don't call start_exclusive from cpu_exec Date: Fri, 15 Nov 2024 12:58:41 -0800 Message-ID: <20241115205849.266094-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241115205849.266094-1-richard.henderson@linaro.org> References: <20241115205849.266094-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102f; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102f.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 From: Pierrick Bouvier Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20241025175857.2554252-3-pierrick.bouvier@linaro.org> Signed-off-by: Richard Henderson --- cpu-common.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cpu-common.c b/cpu-common.c index 6b262233a3..0d607bbe49 100644 --- a/cpu-common.c +++ b/cpu-common.c @@ -194,6 +194,9 @@ void start_exclusive(void) CPUState *other_cpu; int running_cpus; + /* Ensure we are not running, or start_exclusive will be blocked. */ + g_assert(!current_cpu->running); + if (current_cpu->exclusive_context_count) { current_cpu->exclusive_context_count++; return; From patchwork Fri Nov 15 20:58:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 843515 Delivered-To: patch@linaro.org Received: by 2002:adf:9bcc:0:b0:382:184f:390f with SMTP id e12csp1057521wrc; Fri, 15 Nov 2024 13:00:45 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWHQo7XyPmlKaN7zxiCfti2t12J1l4RNf7vIABlbIw3wRTezeiJg/trPW+8nqHLLTzmPIMOWg==@linaro.org X-Google-Smtp-Source: AGHT+IHi6Z1akDxlxFJRIMXXw5u38uLLuMz1dbHhJcneotvvrLA0DijAV9Jc/LCk4KZK5r0r8PZY X-Received: by 2002:a05:6102:82d9:b0:4a3:dd83:c0bc with SMTP id ada2fe7eead31-4ad62bf94a3mr4166331137.15.1731704444751; Fri, 15 Nov 2024 13:00:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1731704444; cv=none; d=google.com; s=arc-20240605; b=byvEpB8R2dFOq1lvFW+tW7lTMeJpOdYsIcxXpMlX3Gn/IxTxgVCEhVDJ3jPjjD4YwU LcexNKyNyhKJcPUzkpEXeqfB5eE4QQbRb/dcT9juqCXNgVl2jVfkEdcWnEc5LAG0bEtg K58rZCn8cTuJkAh3rcGvs0TEtRUtuu0oB2S+KrujR4cFos4z2pV+HvZmiR4xwMRGs3Sx VsKd12BIdcJ5ZbocLbkMAlhkgJzC0H8xKk2faNJPusFmboYGirhi/DtLWKMZQzhUgD43 EcKn6CNdWfULOgL/krZ5QWlj8PFmQpFfu4tHJeCzOHKSsqJTvo79A3hRlVvXYpuLkf9h zWZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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:to:from :dkim-signature; bh=u0kRCYJEdfCPc7Ck3L3jOULPW0HIyB/R3/8bipse23E=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=jy2e1faaD5hJpXE21wbiVnAjmp1kWNLkEu3UNaLQC9+iRo/PMMkw/WI8avdlfq0QH4 laDpta1ycBVOaW+DQoMwnrPoydm1kebAcKaUbiC+RERpdFwc20SYaqbUzXHyxqP3gvf4 wbIykuTjxpaviV8rSDOrh3fujfkB9alkKaql46nRn+/MEaJb/+qslEz35N5Ey5xnaC+q 0oIuROXI6BKR8C4KxX7AJ9v8LquIMgMjQSOpwfc1wLZ24aB+aukSVKqDXh4g+StXcAm6 BcB/uxgo5tSSTBckxMlV0z0v+YZQ1yKaJ1SP+G+yRUuiKgHcikuwpRuwqDcpLHllfJwo Cdew==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jEGMkkjr; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id ada2fe7eead31-4ad646f771dsi858119137.18.2024.11.15.13.00.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Nov 2024 13:00:44 -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=jEGMkkjr; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tC3PQ-0007dB-F9; Fri, 15 Nov 2024 15:59:17 -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 1tC3PB-0007X3-6h for qemu-devel@nongnu.org; Fri, 15 Nov 2024 15:59:01 -0500 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tC3P9-0004Nq-DW for qemu-devel@nongnu.org; Fri, 15 Nov 2024 15:59:00 -0500 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-210e5369b7dso25392745ad.3 for ; Fri, 15 Nov 2024 12:58:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1731704338; x=1732309138; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=u0kRCYJEdfCPc7Ck3L3jOULPW0HIyB/R3/8bipse23E=; b=jEGMkkjrhn7xohr3eMKfbimOPF0cs30YzzmAVp5G+/zavuhvIxJT6g0d13cBXb2CaQ oYMXnCaGA+k/rsNjRQjZQSmSEflBmm35uVeOKnv0vIZA95O+r2u2zbcrpXUOZM5H47Qc 4OSiyXc5Mg/CJzPJ/NqcZ3OfGUQLiD16hluruHJ0VgCsQ0Q9lTvfkMx6q7gq7fUzbEJH mTDb35PlAYycEwryXhTzOgQJIwXBe6iQsoF2QZ5l+zzGFgD/eqXoXvG2KBUmi2xS9YKI sm8YPl9F0PambcJ1yp0shSENULxzm8jMEfFt6G9fED8jYaHZvs8JrBNpBU29NDkWvIVr riVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731704338; x=1732309138; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=u0kRCYJEdfCPc7Ck3L3jOULPW0HIyB/R3/8bipse23E=; b=bc6+aIqRGsAa2rRXQk0IOTT4qHMpaM+E6f+1PffmqjLezrGwffXUtTy9qad2OjAufV A12OAKgaHnArsO1lXk/oD6mf3Ps/NMH2NXs42BTKyudsCJJxJ7CHL753UN9jjrEwvhWg IveWyfb5C7i+WoRsNkDhB4qPQc88KjGL/AQk81n/p84+ZhI5y5SYPj0LzQr8abk2g8rD CroI51RSq0iGCHTGapfCsVzkKiRCZ06EU4K868iravkISGv7FyT/5SUBfmHROZOD1VcQ vnzhQg5cqyK/r2J5H/BhN1qbO1ku2PwTmf9BdmhRoy6rNbLs4jd130cDFaHO/SPcAxqM AhUw== X-Gm-Message-State: AOJu0Yz10KDW58Z54fvANTZ5kEZA+fzeCybyQtjsIuM0hGftZoV7BQWh CqiuGrFwMHypMstdu6etBIBodAoPec8gRWW2wpGiIuOd5XdeopTThSzL/X4ug6XR2b4EVs6X0F5 J X-Received: by 2002:a17:902:cecf:b0:1fa:1dd8:947a with SMTP id d9443c01a7336-211d0ebf182mr46472545ad.46.1731704338124; Fri, 15 Nov 2024 12:58:58 -0800 (PST) Received: from stoup.. ([71.212.136.242]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2ea024a49a8sm3362274a91.23.2024.11.15.12.58.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2024 12:58:57 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 07/14] linux-user: Honor elf alignment when placing images Date: Fri, 15 Nov 2024 12:58:42 -0800 Message-ID: <20241115205849.266094-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241115205849.266094-1-richard.henderson@linaro.org> References: <20241115205849.266094-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62f; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62f.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 Most binaries don't actually depend on more than page alignment, but any binary can request it. Not honoring this was a bug. This became obvious when gdb reported Failed to read a valid object file image from memory when examining some vdso which are marked as needing more than page alignment. Signed-off-by: Richard Henderson --- linux-user/elfload.c | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index d6ad77d27d..90e79a01b4 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -3179,7 +3179,8 @@ static void load_elf_image(const char *image_name, const ImageSource *src, char **pinterp_name) { g_autofree struct elf_phdr *phdr = NULL; - abi_ulong load_addr, load_bias, loaddr, hiaddr, error; + abi_ulong load_addr, load_bias, loaddr, hiaddr, error, align; + size_t reserve_size, align_size; int i, prot_exec; Error *err = NULL; @@ -3263,6 +3264,9 @@ static void load_elf_image(const char *image_name, const ImageSource *src, load_addr = loaddr; + align = pow2ceil(info->alignment); + info->alignment = align; + if (pinterp_name != NULL) { if (ehdr->e_type == ET_EXEC) { /* @@ -3271,8 +3275,6 @@ static void load_elf_image(const char *image_name, const ImageSource *src, */ probe_guest_base(image_name, loaddr, hiaddr); } else { - abi_ulong align; - /* * The binary is dynamic, but we still need to * select guest_base. In this case we pass a size. @@ -3290,10 +3292,7 @@ static void load_elf_image(const char *image_name, const ImageSource *src, * Since we do not have complete control over the guest * address space, we prefer the kernel to choose some address * rather than force the use of LOAD_ADDR via MAP_FIXED. - * But without MAP_FIXED we cannot guarantee alignment, - * only suggest it. */ - align = pow2ceil(info->alignment); if (align) { load_addr &= -align; } @@ -3317,13 +3316,35 @@ static void load_elf_image(const char *image_name, const ImageSource *src, * In both cases, we will overwrite pages in this range with mappings * from the executable. */ - load_addr = target_mmap(load_addr, (size_t)hiaddr - loaddr + 1, PROT_NONE, + reserve_size = (size_t)hiaddr - loaddr + 1; + align_size = reserve_size; + + if (ehdr->e_type != ET_EXEC && align > qemu_real_host_page_size()) { + align_size += align - 1; + } + + load_addr = target_mmap(load_addr, align_size, PROT_NONE, MAP_PRIVATE | MAP_ANON | MAP_NORESERVE | (ehdr->e_type == ET_EXEC ? MAP_FIXED_NOREPLACE : 0), -1, 0); if (load_addr == -1) { goto exit_mmap; } + + if (align_size != reserve_size) { + abi_ulong align_addr = ROUND_UP(load_addr, align); + abi_ulong align_end = align_addr + reserve_size; + abi_ulong load_end = load_addr + align_size; + + if (align_addr != load_addr) { + target_munmap(load_addr, align_addr - load_addr); + } + if (align_end != load_end) { + target_munmap(align_end, load_end - align_end); + } + load_addr = align_addr; + } + load_bias = load_addr - loaddr; if (elf_is_fdpic(ehdr)) { From patchwork Fri Nov 15 20:58:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 843516 Delivered-To: patch@linaro.org Received: by 2002:adf:9bcc:0:b0:382:184f:390f with SMTP id e12csp1057640wrc; Fri, 15 Nov 2024 13:00:56 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUEHrZ/dXOs3buBG/vDb7yPuyft19cJUL7dQDFEwmOKl31GAoyu61S9N4pq34wzuY3jgm6GCw==@linaro.org X-Google-Smtp-Source: AGHT+IGqakZ5S2Sa4TkUSNW9Ta2kmwnLd1fCjXLm9ahmqhrMGI6UY6oJJUUgL2KSClz7AWFDZpoK X-Received: by 2002:a05:6122:2027:b0:50a:ca33:b033 with SMTP id 71dfb90a1353d-5147854a8f2mr4544532e0c.4.1731704456003; Fri, 15 Nov 2024 13:00:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1731704455; cv=none; d=google.com; s=arc-20240605; b=hGmTd5U8JVsyhxBK9vDCNJiV9x4go5sG/S9wD1EbcKD9N668KBC+sZd7O/MpzleWR9 47xQ3TOA+H4fVZQWRO1BrJ2e+oDddbCbutRYbneGj+lrU3wpAE9h0fXh1Mfjl89Cb5JA C+T0o59AHCpNIDtFyR3KJu0sSEjS77J0EaF9vmruwFcjJdtMK74qOenuQKcmLgxDCdim iZBAi4S6VTi2ENHXYdGpuE7sfriZDu+d0hBuvompRz9J+9aHmdR5rB/3rJ85Xlg0Uh/V Iry4l8qG0hM7pIasQdipC0uj/3Kne4ObZ5VsSytCGHSdUcUKX+RDsmqcrfuHfByeU+2R xtng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=N8YgKFtlpType92XaAQCJX7PrwLQwlz6/nj0VnkynWY=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=ciPncjDj83I4js6NB3nP9VvqZHr/kHNiKh+nkl7t1wvyWFEf8DQBLrM42YV+b/23GJ Vby+6Tod8q3QIDPEY5xSEcj2eCTK/hnY/WaqIKNM6KovAWaZbGXB5wgs3FOu+K0plbU8 ISU+dd35DqCxQmzbw0c7F5UprimRhcZqQlAt6pVxbgVlL/2I4s5wszQYbq8+Hwm4SIwF HF1G83f15iCP36RghRpkIzu17gebdHZuTlPIfXSAgq9gqCwxyA8yC/y5Ha5AmGefCxdF b3qcV2cMS2bG2nqDTD6Zzks1ZbgnTVqLB4iuXRniT50T//VwhHT3VEDaspTodVGERUoT TqJw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EIyrJj0z; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 71dfb90a1353d-51479c53174si817739e0c.194.2024.11.15.13.00.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Nov 2024 13:00:55 -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=EIyrJj0z; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tC3PD-0007Y7-Uo; Fri, 15 Nov 2024 15:59:04 -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 1tC3PC-0007Xh-FO for qemu-devel@nongnu.org; Fri, 15 Nov 2024 15:59:02 -0500 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tC3PA-0004OC-VB for qemu-devel@nongnu.org; Fri, 15 Nov 2024 15:59:02 -0500 Received: by mail-pj1-x1033.google.com with SMTP id 98e67ed59e1d1-2e5a0177531so1839409a91.2 for ; Fri, 15 Nov 2024 12:59:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1731704339; x=1732309139; 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=N8YgKFtlpType92XaAQCJX7PrwLQwlz6/nj0VnkynWY=; b=EIyrJj0znoxU0nEE8Go29udHwTLMSN0hyjM6ogal7CgNNPhny7QuM0/Ulk7jLO7fu9 DMdamVnLore3WZjF0s2FfFT6DXmPj6DOp8HKGAQCq6wgAU3baXC0vCRi8RGB1j1bZBCL hDXB4TIXGKw1auoLEhQtNCX4rahPvET3jWae51QEFcFzgeZKu3j7deD+LhDT6vM6pZDG 9P24LcKZenRgepKHR4OWQGx+CvK49Jlvy3vVhuYzyW9pJOlGkwPUQwaUFy4LfecI34oG 5bEv6RCYlLAkVAfFeFlYtsu8ZdGUau9G/1cvqyJTgpH8OlP20Dn/EVux8H0Cduaq7QlL mdRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731704339; x=1732309139; 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=N8YgKFtlpType92XaAQCJX7PrwLQwlz6/nj0VnkynWY=; b=uB9Z9oopisP1J7/t56KoA4rqe4A/BN4CPdHx0aXYyl/2ayRQ50l2i5id/2r3ujxmrJ 0yR6q6OL4NbphKor3GokTapgnaQAdVI1h/TPNoNTsuLMsIvaVsAocqGp/5rqIVawRCmm VDUfZRNY9cYVaBp5+IC55n8gl2Oh1YY+ReKIOStQBojcBn8rImS5N2pPWnYq7A6oCxcN PBZC8atfLMbd4ZTYCTEG3ycxX7pOeWlB6how1eZU0iCkLLe1qM7QuyBn19Ck+NLKNKWM Y/cFzFtU7cs8Ddac5oT5ioNSLgM8olM8gEK96FZulj9dRlkTW/flG1JofzFaEM0pCELA dK4w== X-Gm-Message-State: AOJu0YwozdF9psnHZfiivc3sEO0ZDmXiwu//UiBvY1EwYI0Gu2hB+2fn RzZ1Uq429pXa4KpVFOvdYwDv6A/ED6gjNiwLvaKdzu1BbFjiOpAEHUd11SaPS3YFfct6ongoZSl y X-Received: by 2002:a17:90b:2b85:b0:2ea:2a8d:dd39 with SMTP id 98e67ed59e1d1-2ea2a8ded97mr1714013a91.26.1731704339437; Fri, 15 Nov 2024 12:58:59 -0800 (PST) Received: from stoup.. ([71.212.136.242]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2ea024a49a8sm3362274a91.23.2024.11.15.12.58.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2024 12:58:59 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 08/14] linux-user: Drop image_info.alignment Date: Fri, 15 Nov 2024 12:58:43 -0800 Message-ID: <20241115205849.266094-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241115205849.266094-1-richard.henderson@linaro.org> References: <20241115205849.266094-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1033; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1033.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 This field is write-only. Use only the function-local variable within load_elf_image. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/qemu.h | 1 - linux-user/elfload.c | 7 +++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/linux-user/qemu.h b/linux-user/qemu.h index 895bdd722a..67bc81b149 100644 --- a/linux-user/qemu.h +++ b/linux-user/qemu.h @@ -44,7 +44,6 @@ struct image_info { abi_ulong file_string; uint32_t elf_flags; int personality; - abi_ulong alignment; bool exec_stack; /* Generic semihosting knows about these pointers. */ diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 90e79a01b4..ef9cffbe4a 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -3220,7 +3220,7 @@ static void load_elf_image(const char *image_name, const ImageSource *src, * amount of memory to handle that. Locate the interpreter, if any. */ loaddr = -1, hiaddr = 0; - info->alignment = 0; + align = 0; info->exec_stack = EXSTACK_DEFAULT; for (i = 0; i < ehdr->e_phnum; ++i) { struct elf_phdr *eppnt = phdr + i; @@ -3234,7 +3234,7 @@ static void load_elf_image(const char *image_name, const ImageSource *src, hiaddr = a; } ++info->nsegs; - info->alignment |= eppnt->p_align; + align |= eppnt->p_align; } else if (eppnt->p_type == PT_INTERP && pinterp_name) { g_autofree char *interp_name = NULL; @@ -3264,8 +3264,7 @@ static void load_elf_image(const char *image_name, const ImageSource *src, load_addr = loaddr; - align = pow2ceil(info->alignment); - info->alignment = align; + align = pow2ceil(align); if (pinterp_name != NULL) { if (ehdr->e_type == ET_EXEC) { From patchwork Fri Nov 15 20:58:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 843520 Delivered-To: patch@linaro.org Received: by 2002:adf:9bcc:0:b0:382:184f:390f with SMTP id e12csp1058587wrc; Fri, 15 Nov 2024 13:02:26 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUs2kvED/63QsiOQbzfF9BZnBjaBwN9fbYy17LxuUlvs3qFuhsCnNFBr+pXAoXIV6+1Kb3kNg==@linaro.org X-Google-Smtp-Source: AGHT+IHHIb5kvAmZnIX4mNYLFJaZVlJZWGkLuySl0VYLslt08TQm9Lx9YeoqJC6ZzFn9GUXncrET X-Received: by 2002:a05:6102:3913:b0:4ad:5b5d:b76b with SMTP id ada2fe7eead31-4ad631b90cfmr4198672137.24.1731704546242; Fri, 15 Nov 2024 13:02:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1731704546; cv=none; d=google.com; s=arc-20240605; b=QrIIVp2KSP6MVOEKCBIoPpnzubwHbCala/TB7iFazfSTbXNjl8HMZtr6B6PgMXGAIF xfDK5wmCMJi/k1y57MnqVuUE3x+2WiQn9T1AOagnJzkuCILdmzTbkl6MOzPYJhosyWwY 3gTheI8uCo4128Ok15kWGUTXFxDF3vcGrO08I4/QZfr4gjp/taAxhXkugUzArtSQNDST 1+3ElQKJJMXkYN++VKcQkHFQjoIHO2pMKFwuygcOMfi0mr3Lj8RkKA3+0e/vD0o8g6eH OyJ+YOZzDDaCzRSODg0+vZy7zZa2/+XADF7e92XpTOwvY+xnAW3a76QtbUkqOwtyI82f vh4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=mmGOoAEdsZQwCIJ4omCZkOp7rOERWrd5RA0N/up0Nbg=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=V7ugHtaUpfvomAbMXNDQP5PCUmddg9pNZOWQEW0VlL8fxj20hkLxXP6Cs9dBaFzZMZ BlDrWyeBxDB39+ks+X7A7FzlsqH5+jxvJRLDi2P47dO9dqHRUnL2/vtQIg0PeROiaFwk nfOvAvTv+caDDUeCAHjgtT6R7T6fHYhnK3qVBtlwdqrhb5d2HX3eV/XOimyZ0fBrQp7p 40nQKLQryCED0KO8SCNVL555vA6QA4ICBznkgBVnDFaOPruQ2oMlcNJemyDvAGPHKPHv NVHyZH/1EgWVNfeJ5B6BsSYt3IluKhLbwBod3kAvBoRHcwiok7+4nwdH9EZCeddxfDXL dUuQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KjuQu91p; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id ada2fe7eead31-4ad648be634si766476137.398.2024.11.15.13.02.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Nov 2024 13:02:26 -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=KjuQu91p; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tC3PL-0007ZM-3D; Fri, 15 Nov 2024 15:59:12 -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 1tC3PE-0007Y8-04 for qemu-devel@nongnu.org; Fri, 15 Nov 2024 15:59:04 -0500 Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tC3PC-0004OS-BW for qemu-devel@nongnu.org; Fri, 15 Nov 2024 15:59:03 -0500 Received: by mail-pg1-x529.google.com with SMTP id 41be03b00d2f7-7eae96e6624so1697531a12.2 for ; Fri, 15 Nov 2024 12:59:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1731704341; x=1732309141; 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=mmGOoAEdsZQwCIJ4omCZkOp7rOERWrd5RA0N/up0Nbg=; b=KjuQu91pE9+iT3TO/+gTLWmnxagvuNxUmjcxd4ececHJcp796Au726Q2+SBHsF9sTB KkElzyq2wtqjtTTANlarIUn63v/8bRjKn2RahwzjbxqLXKxLHOaT+zG6x9PmEDsjwVA1 v0D6d1d7+uoaCNkabn5qESzXIvIcHEI9nMIquwWTnbpCOxRkvLiuaZuiK/8jD3JVD+k7 LkyDjL+nm5Jsyh7zh7PWO2R/FWr9X8m9FxsIoDrpWfYXpHPc8A6Xet9xfQlYyScH6NBd VfuZPhwPKdkVplEPaxNTardTHqqwj33FX0HI1htvB3cIdBLtkEjEAk/PETYOi7eQkIb/ n+mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731704341; x=1732309141; 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=mmGOoAEdsZQwCIJ4omCZkOp7rOERWrd5RA0N/up0Nbg=; b=PtNOZCVik/rM/ANFQDTFoz5Xk6oU5rreMAamIdu3zETy81v2TfU5tiQOTHPr2d1qOK kx+9r0vDwU98PMF6FGijaBgbStDsYMhY/nXIGRDRuBJ3lev7KClJ540ppleWUbrNxCu5 0cbRZJnw6vm36P8GFZxkUdidsWwSpmPR4nxjANYiAPHrPRc20/ZQSV08z2YXYLnelBbp 1zzkN4P9A7AoueuqqVCwGyx3ZlbBe4yNPBJMQA6GO69v6XbUrsRVWZLJU25cxcoU748e NA8RQBNs7v+EuuPMBOXRKZJMUh9q5MBDgeGLECXoyPLuQ/ExbmGpjnvWOO0n1eex2Otp Iu4w== X-Gm-Message-State: AOJu0YwxxOtiNWoVdePCb2djNx/sMkUSCQSo6C0wqKX8SMWn1lJeiPpm cAyR98vFJ/hEm31wlUNzP6yTuI4HbsZTOFaUd+17S+3s5IP2QexnswRnPlCjLk8gpPqbNBiJEme G X-Received: by 2002:a17:902:db11:b0:20c:7c09:b2ac with SMTP id d9443c01a7336-211d0ed2d5amr57445055ad.52.1731704340862; Fri, 15 Nov 2024 12:59:00 -0800 (PST) Received: from stoup.. ([71.212.136.242]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2ea024a49a8sm3362274a91.23.2024.11.15.12.58.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2024 12:59:00 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 09/14] linux-user/aarch64: Reduce vdso alignment to 4k Date: Fri, 15 Nov 2024 12:58:44 -0800 Message-ID: <20241115205849.266094-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241115205849.266094-1-richard.henderson@linaro.org> References: <20241115205849.266094-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::529; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x529.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 Reduce vdso alignment to minimum page size. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/aarch64/Makefile.vdso | 5 +++-- linux-user/aarch64/vdso-be.so | Bin 3224 -> 3224 bytes linux-user/aarch64/vdso-le.so | Bin 3224 -> 3224 bytes 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/linux-user/aarch64/vdso-be.so b/linux-user/aarch64/vdso-be.so index 808206ade824b09d786f6cc34f7cddf80b63130e..d43c3b19cdf6588757f2039f2308a8bce21aed9c 100755 GIT binary patch delta 50 zcmV-20L}lH8JHQ6tpWfLk+0bl4vUoZ1rE*XtsXbvz!6Y1qE4ha#lpM HaR(;_22&J+ delta 49 zcmV-10M7rI8JHQ6sR952k*nPl^~i=KtbcHFtl42<9TUsw2PpfHvz!6Y1qD@cX=ik^ HaR(;_8o3m& diff --git a/linux-user/aarch64/Makefile.vdso b/linux-user/aarch64/Makefile.vdso index 599958116b..c33a679c0f 100644 --- a/linux-user/aarch64/Makefile.vdso +++ b/linux-user/aarch64/Makefile.vdso @@ -5,8 +5,9 @@ VPATH += $(SUBDIR) all: $(SUBDIR)/vdso-be.so $(SUBDIR)/vdso-le.so -LDFLAGS = -nostdlib -shared -Wl,-h,linux-vdso.so.1 -Wl,--build-id=sha1 \ - -Wl,--hash-style=both -Wl,-T,$(SUBDIR)/vdso.ld +LDFLAGS = -nostdlib -shared -Wl,-h,linux-vdso.so.1 \ + -Wl,--build-id=sha1 -Wl,--hash-style=both \ + -Wl,-z,max-page-size=4096 -Wl,-T,$(SUBDIR)/vdso.ld $(SUBDIR)/vdso-be.so: vdso.S vdso.ld $(CC) -o $@ $(LDFLAGS) -mbig-endian $< From patchwork Fri Nov 15 20:58:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 843514 Delivered-To: patch@linaro.org Received: by 2002:adf:9bcc:0:b0:382:184f:390f with SMTP id e12csp1057159wrc; Fri, 15 Nov 2024 13:00:15 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUfFZt0VPNICOgduDYex4f/Ne53U3TWoC0XNQRK+rzsPmtXRFMi2kfGelhPbG4ydtGmDL2dog==@linaro.org X-Google-Smtp-Source: AGHT+IE0VHG8Fw7uYK9AzeMeQUvaEe0veCwns9OB1fEcr5DHmeudaEljZYNb+IAwXLre6l1XCc+8 X-Received: by 2002:a05:6102:947:b0:4ad:497a:268d with SMTP id ada2fe7eead31-4ad62c3b05dmr5069640137.19.1731704415297; Fri, 15 Nov 2024 13:00:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1731704415; cv=none; d=google.com; s=arc-20240605; b=hzGJ6TqcGubrf/9jWR4XKbkuXHSkirFVKDUghZ0TPwJ+on1J5j7xfgo4hnnwZGyIdA +v6bWgv3jt4CN4AhY7JP+54PfHXFseayntwCTEmE8pREocLcwACywwIV2IsOHo/ruhfu d6lIiewGhfCyXj09nILOSPlDLe9Xm/C1kVcR8O5ankVk/lfY2heO1oW+tr8l6PswzciD 4IdKWgSoi8nEOOQZAZmnpE2tUtdoWg2rb7IFjX955eL4Qj6s/pCJvVIOZ+G3mFfN0aeF t2h6SxNw+bHabn5nJ7JsY0iu9WO8UW7NvputTXgm3elbLu9AYbcNLXM5LO7z7RkQx5fw Gw3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=EYpw+FgnCnpLICJOkhi6wbCufDiGso6GG1nTzyOYRhg=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=i5IS2S9W0jxRl9ohUbxsPzJfS0mQQvcCqh0LICFODkYnmd+WrckVKVWetjuJeio5Vf eXzOyW8JgoYe5FhO4OetGH5GjTHtmXGGqAMOsd1LJBIlNMjKDStOpcMyHTE+xGuNbLdH P60odAc3OetxpOM6R+7xUnbVibD8Q9YUbN+oP9thQAYp7cBjuXcu0VWCpYnGj2pGUuD0 G5rqUiKm+KbwSVi8jCEp3xGaSz+C9HCRVnwuOeblji3BW2e/4eWFBVJ6BAsPANZGEKPW 6Gahtj/VbF+poSLQAkoDxgutke3Pr6ajUgsFH51JnKr6l0IK/CK0Q5kXz4CJfsPgetAX ht+g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=b496SyLI; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7b35ca28dcbsi429989585a.277.2024.11.15.13.00.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Nov 2024 13:00:15 -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=b496SyLI; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tC3PO-0007bs-Fo; Fri, 15 Nov 2024 15:59:14 -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 1tC3PF-0007Yg-3c for qemu-devel@nongnu.org; Fri, 15 Nov 2024 15:59:06 -0500 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tC3PD-0004Oc-3I for qemu-devel@nongnu.org; Fri, 15 Nov 2024 15:59:04 -0500 Received: by mail-pj1-x102c.google.com with SMTP id 98e67ed59e1d1-2e9b55b83d2so916247a91.3 for ; Fri, 15 Nov 2024 12:59:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1731704342; x=1732309142; 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=EYpw+FgnCnpLICJOkhi6wbCufDiGso6GG1nTzyOYRhg=; b=b496SyLI1lYwEL07pJpPBshlseVi4TApct7/WBrzC4iAwQY1S4XKdUEtU01JZvLLGL No5HOyeYM++s3fxEnh4T+/ku/M3fcW1FeAYPW/7hi3Cxj3fuUaRG74y8cEJ1vPs+nV06 UA0D2IArgnyUmzjD7khpiHI9fws8TupyU5UOhFaVYpzZaYV8vBa/7WN1dZnkcGA1hjTk 715E8Csyo+d/IKAMzAe90dX/9Gxu/rhTriT041EiLtlKnmJM45y8b3QJM/2b+L94qnzW IOSBhnNac7auwe4ViXZtSaX0xZgjLGKTNirj1UHSzCLuYzFYN5fQHzTdIVi+awx+QE37 qg2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731704342; x=1732309142; 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=EYpw+FgnCnpLICJOkhi6wbCufDiGso6GG1nTzyOYRhg=; b=w+v/TfSlP+cpL8ACbMHdgFsFqr2fj9AACM0+SSaKeID8QpGusbgDLO+WZGC/f1kDO6 1rjvXG2kphta2bS9wr4y4Dc8xJuhG3BkfG7+8/nKzIAzQHkS5KVmEY4eSkgVSiLyq/Lp 4RSM4LR8Idx0XvxWslDysx9amWBsPlf6Fs7SXRW/NTMBe27FHmWSQVX4DzR0wvOhVjad dDPDTDpBBQkINsfMr3lfyE0NKy3I7fCH7LE35kE395U2OfpBoadOpSz+skjWnP5ljznx tI/5smfFwI8XY8z8b5ReGr4Lr9aPXpezS29G8euK3x9SPKq9R8/LcMJUkjqbIhtrJmUb rVmA== X-Gm-Message-State: AOJu0Yynq129wqHVD19m3xx6Dkq7uJT4oaPgXwdwKjaAByJrOnqs9FWb GEDY/FCON51AQIsegrgDksQk//Ncey4ob2tiRsx6PROFOFG9A3qJv47ZHRzHarVmomFqDboOORz K X-Received: by 2002:a17:90b:4e:b0:2e0:a77e:82ff with SMTP id 98e67ed59e1d1-2ea1559bab1mr5308055a91.33.1731704341673; Fri, 15 Nov 2024 12:59:01 -0800 (PST) Received: from stoup.. ([71.212.136.242]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2ea024a49a8sm3362274a91.23.2024.11.15.12.59.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2024 12:59:01 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 10/14] linux-user/arm: Reduce vdso alignment to 4k Date: Fri, 15 Nov 2024 12:58:45 -0800 Message-ID: <20241115205849.266094-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241115205849.266094-1-richard.henderson@linaro.org> References: <20241115205849.266094-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102c; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102c.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 Reduce vdso alignment to minimum page size. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/arm/Makefile.vdso | 2 +- linux-user/arm/vdso-be.so | Bin 2648 -> 2648 bytes linux-user/arm/vdso-le.so | Bin 2648 -> 2648 bytes 3 files changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/arm/vdso-be.so b/linux-user/arm/vdso-be.so index 69cafbb956e283e2975bac59a10491c0cbafca57..bed02804a4bd367eb9fd8ca54d0c980103c02245 100755 GIT binary patch delta 49 zcmV-10M7r|6xbAyaRLAkk#lhrGQ`BrU>NUTo0WUr&~YvSTwestvG{WZ25D?qS41(h HaR%oD3DgvN delta 49 zcmV-10M7r|6xbAyaRLDVk#lhrweyTc_Z*p@&&2@VLR1?$m|vtIvG{WZ23l}Oc}8xt HaR%oD4;B=< diff --git a/linux-user/arm/vdso-le.so b/linux-user/arm/vdso-le.so index ad05a1251875ac0c76685e1f9190a7307a8444d1..38d3d51047372391b3125c3f9f6ea5401f04bba1 100755 GIT binary patch delta 49 zcmV-10M7r|6xbAyaRLwkk#lhr8{q*880U1i=t7z4dQ|b*DDU}VvG{WZ25CxDZDwh+ HaR%oD5d#(3 delta 49 zcmV-10M7r|6xbAyaRLAVk#lhrkUMV7Jk`NO!6O#urC$6IB@6+uvG{WZ26R_8MpaO= HaR%oD?$r}} diff --git a/linux-user/arm/Makefile.vdso b/linux-user/arm/Makefile.vdso index 2d098a5748..8a24b0e534 100644 --- a/linux-user/arm/Makefile.vdso +++ b/linux-user/arm/Makefile.vdso @@ -6,7 +6,7 @@ VPATH += $(SUBDIR) all: $(SUBDIR)/vdso-be.so $(SUBDIR)/vdso-le.so # Adding -use-blx disables unneeded interworking without actually using blx. -LDFLAGS = -nostdlib -shared -Wl,-use-blx \ +LDFLAGS = -nostdlib -shared -Wl,-use-blx -Wl,-z,max-page-size=4096 \ -Wl,-h,linux-vdso.so.1 -Wl,--build-id=sha1 \ -Wl,--hash-style=both -Wl,-T,$(SUBDIR)/vdso.ld From patchwork Fri Nov 15 20:58:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 843525 Delivered-To: patch@linaro.org Received: by 2002:adf:9bcc:0:b0:382:184f:390f with SMTP id e12csp1059223wrc; Fri, 15 Nov 2024 13:03:46 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV5j+mdNfYouV+89WCNUfh5RhvDQw3nn5Dsj8xVco8avsELUW9G1uPqJ9bLQlX0PYEyr0K/qw==@linaro.org X-Google-Smtp-Source: AGHT+IHdiOxANp5fB5uiyjLRVxr+Gxh8iHenmPZ/mkSIP58/NNpD4d+ZyHHIHfB7HD+pvUJdEA8P X-Received: by 2002:a05:6102:d8e:b0:4a5:b003:41bd with SMTP id ada2fe7eead31-4ad6318e901mr5401493137.22.1731704625878; Fri, 15 Nov 2024 13:03:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1731704625; cv=none; d=google.com; s=arc-20240605; b=LGCydkcM/F1sp4ABTGXWO+lpTzXaT36TzFM5Xqqxh6z75I4Yheuf+Yu0sgxJ6Zc4PY C+bNSS/aofvj+ALgo+asL5yEFHXmA3BVNkdkaaV91UYmKPQaQnXmixSIAMao1FUsOU5Z NxQlQH9IJqjb7MnvCilOMGWV1CXg8/WJQ0lMveEnoHkpfY098h0iz45tPH0X1HVwCDlI pi7plHKUhU/KwSlVwChJNneR84XRBOL3B8eC1XUhVEeuodJTTOnW6hSqQTACvrhFdmpQ JinXOYvWNh1y3Yysmf4nYt5G7jeZOUeyBL/6J4yh8rpfOA7JTwIBQlx2HyeGGskwfWDi QVGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=E9lS2qyjum1CwVNKmlpZ0oVrEa1u6fRFy77taSYsw0E=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=F8Fn4sPEZsFxwN7Q0iJ8B16ljPGuCmaJBPvhRtK2zJc/PjIu0yw2NJqG/SWbdtnS6u 2fSw8K6J1JTMzaHTnoj2RXVBi5Nwr3uTzNyUZglXOhJRksBm2gm7c/NJGSlMfMhGJwXi +H7zuBR2eP9m6uw6083KrQT1wfh4f7YPWFFvhAImJ6Zd4ZxxIzLeFLT1LkcorQ9mPw7k CIoLY1s9746txd6w4aqrdYLqPP29yemJEM77FH8Vc34cF59oIsIcwJMlujXB5bc449Km NxE5jeP6/3m9NYvX/M/o3V22ekBmHj6nnMZIWz1Q11HqU/8wCA/VTQos1gZwhPSDRCdX JjFw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=woWg9f7A; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id ada2fe7eead31-4ad64759644si874190137.175.2024.11.15.13.03.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Nov 2024 13:03:45 -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=woWg9f7A; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tC3PR-0007do-AF; Fri, 15 Nov 2024 15:59:17 -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 1tC3PF-0007Yh-6I for qemu-devel@nongnu.org; Fri, 15 Nov 2024 15:59:06 -0500 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tC3PD-0004Oj-Ph for qemu-devel@nongnu.org; Fri, 15 Nov 2024 15:59:04 -0500 Received: by mail-pj1-x1034.google.com with SMTP id 98e67ed59e1d1-2e5a0177531so1839431a91.2 for ; Fri, 15 Nov 2024 12:59:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1731704342; x=1732309142; 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=E9lS2qyjum1CwVNKmlpZ0oVrEa1u6fRFy77taSYsw0E=; b=woWg9f7A6tRaNajF1QAd9dwm+qngALBOUnpIhiJbVY11Tb0+oGb30da62Nf8QEJhCV aN7g2nyEQefWgM6SBM2YHkX6PXpaZGpxIBmwfJ2+SyGeov/7BXaT2GsAmIWHliGNcC+W biKcapLnkYW/5ov4tyWq9gcPsZzEda+E1Q7WjuCqy+rxrHOR8fU4b/X52ppD6fSuxig3 cRTjumGImDQMiBtk4jeE/siS7H4tWluy6DJadfMcaQ6xSURd+54tmhemHOFETpFG9XNE QT3J3MrW2yv4dsNK9A+WvXhYPnPNbK1a5LT6uGzyLtVa9m+6Jcfr9699a3iGAFawuE6S /pzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731704342; x=1732309142; 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=E9lS2qyjum1CwVNKmlpZ0oVrEa1u6fRFy77taSYsw0E=; b=J6KIlQOmXWnihqRFEtJDp5ytksrDIp6k9lvtVeYSugJL4+7qHfz2O0c4TQ0A8YXPUJ S5ptMP34Jj7uu6NOU1fEd+B+/LPRqtCsyLUISEfBAg1mt6DRGtgUC5yUSblAnnBtE/3B CB+CnMtBA5+Av2A3+Kqh8yKtoMX6jhNbumIpAS0aRo/sH973unupe3tox5vik2PAp9JQ iNSe0WWZbSxoeq1dHSw+4b88xA9mqj2aOs7FVQHRNeN/z0FTmdxsmOoP/Bfwwtd3SWYq dt2+nLPaHJeqRoJYC79/tNzWKpK24XEZX6c3u8MJxbTxh91Tic5rQVL58ZbpLfpohgT3 YMIg== X-Gm-Message-State: AOJu0YzFj6SqhhsGwpLliRRaddpdNdsl87lczbQRNZb4O0xPHnUM+16b Crg+mlh6izpbgGIXITLlvdNIcabLG3dfW4pFL/9nXr91joBV+YXfseYpmrY1qhf56SSEskk3qgp x X-Received: by 2002:a17:90b:4d88:b0:2e9:5360:22b2 with SMTP id 98e67ed59e1d1-2ea1551e46fmr5197504a91.20.1731704342371; Fri, 15 Nov 2024 12:59:02 -0800 (PST) Received: from stoup.. ([71.212.136.242]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2ea024a49a8sm3362274a91.23.2024.11.15.12.59.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2024 12:59:02 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 11/14] linux-user/loongarch64: Reduce vdso alignment to 4k Date: Fri, 15 Nov 2024 12:58:46 -0800 Message-ID: <20241115205849.266094-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241115205849.266094-1-richard.henderson@linaro.org> References: <20241115205849.266094-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1034; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1034.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 Reduce vdso alignment to minimum page size. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/loongarch64/Makefile.vdso | 3 ++- linux-user/loongarch64/vdso.so | Bin 3560 -> 3560 bytes 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/linux-user/loongarch64/vdso.so b/linux-user/loongarch64/vdso.so index bfaa26f2bfe1aaa01d9a349b8b030ef6323e1f8e..7c2de6c50e706164225e82f652d4becc04c71ff0 100755 GIT binary patch delta 37 tcmaDM{X%-eN=AW+tM-YA3hb&jk8@2 X-Patchwork-Id: 843524 Delivered-To: patch@linaro.org Received: by 2002:adf:9bcc:0:b0:382:184f:390f with SMTP id e12csp1059190wrc; Fri, 15 Nov 2024 13:03:43 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWPDAq9o3MMUA43gIUjkjy3+jyFEQAC03KhCWMtRcqrYEqPmVknkZOShuuZhbgIGPttm81DBQ==@linaro.org X-Google-Smtp-Source: AGHT+IFn8dacJDT+MZ0s54BSy6UI0lXbOXznx/cDl78A4x1m+Q0QTfwyPygzUt5DwAKWKEhaBDAS X-Received: by 2002:a05:620a:414b:b0:7b1:54bf:7185 with SMTP id af79cd13be357-7b362313799mr519707685a.38.1731704622765; Fri, 15 Nov 2024 13:03:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1731704622; cv=none; d=google.com; s=arc-20240605; b=jI0dkJCJrvvcSPUY0PfKUKzCkuDvChtLx8L6pxTz6Zkzb/+CVzxyEWZaG9aptsqWrl AF53yJSiamGi80V51k0DoiKb7jNR87vpO4gRLsmU+G4E4CYAeBknC/R3tX97Mi7WJS4f DbpAUmIwVwl6h1JcDM99Lw+G591VSZw7FhIrh3Npi45BkL/bRySEmUXvFolxtOh6j404 J811m4xOPdYkMetTEheXsWtU+kKvvBD/uVGawTBfNGk+TuAd5dvADTtGyXXS1rx1DToU 5tx7CdBu+i0vSBs/e59tePIA7rzAuwhhjz8Qiq20lqgxyEdAM8cdBTfyk3ULgF3L7xGg ENAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=QbNlBnAW9PFPyjzSTtQpE4/aMbCM3Oh1YovDgszQh+4=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=AMgu1D0NTjjTC6C6KIZq5XmQqF8f+Q7bSOexNfLTRZJcj1QtziU8Fs7Q3+/ly7IfJY cKqErXcj7tfumG/l5UDKZiHHezgVEhzGovjqbg3HVMePxJenZIUdUbJjW9LtqHdXH4ah NUkGx0ULueAczmLXrJQ56Mw17Kaqqrd7e2LgD4vFgyo1GF+n1ky3gryBrGaJhg/4NsRh UluMSFDqICCuu/BC1xBUpLs7agYMFqqOLCH1PBM+wSalJycy37nS44KnjtdYf4Pef8dl oxma1MFLyjSSN70BEPiKa045mOUW77zbq5HU3cRHs2I56s8P6KtOzZVoUjOjAWXmtPyU CVcA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JD9dYxu4; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7b35c9701f4si512974485a.2.2024.11.15.13.03.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Nov 2024 13:03:42 -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=JD9dYxu4; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tC3PR-0007df-7c; Fri, 15 Nov 2024 15:59:17 -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 1tC3PG-0007Yi-Cd for qemu-devel@nongnu.org; Fri, 15 Nov 2024 15:59:06 -0500 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tC3PE-0004Or-HB for qemu-devel@nongnu.org; Fri, 15 Nov 2024 15:59:06 -0500 Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-723db2798caso1979683b3a.0 for ; Fri, 15 Nov 2024 12:59:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1731704343; x=1732309143; 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=QbNlBnAW9PFPyjzSTtQpE4/aMbCM3Oh1YovDgszQh+4=; b=JD9dYxu4kxlxuJuTH7dV3v/Sg6JFZkQBW3UjV6ce6GQ2SyJ4kHhwjxUyirBPQbH6om FNq6gCsuZB9zr7rLndOglQf2qYmVNshm3aU0qJm6fJ78KH/YB9C37r7iIw1IZ5kersWb lvsOgTi0JJjxXXwRUEx0ZkjaQlWQ/8C5q/g4h+UEtH8Bn/Qx7LRfoBomZs5unMkmrDx1 r03QXmzYlc3YdPbD/2RcLzdy3axRyuce312boYvCnCYd5yNIqjv/sMhVPPKYm6cjXULn AItr3V9DQah/+BUvJfeHh79pcA1B8PcrbHyf6RNFMbx5Js22gyfypgG8snNxUpl8/tBo eOJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731704343; x=1732309143; 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=QbNlBnAW9PFPyjzSTtQpE4/aMbCM3Oh1YovDgszQh+4=; b=pSvCuxqmxQIk5OD5aGJ+txW7iRJvA1VlQ5lg053q0RQu54X7drkCPTMskNf1gXueqK tVgsJHX4hHvbMpV7CQSAaV2hZ8gIkTRijbGMyvB8+4ujJUM+pIzrsgCmnLbLMcHCOyKZ AloaU3ELqJ3akXsBmeJWYhOSli2IYbZ8lgsiUE+xhOEwNU1QVJjPx0S/M1yvvuEGjgzE yuTDrkx8wcyVfIMtCbEk0q6O+pCJqpFBf3h9+qlde2kHjHwclQwXCzwKItnxN8gXnXqc EGqIA0iRJO8gj786BixRotyFdBoKI5VwMO9UpR/JgcBUjiaIrwohBIczGePRPjrZDNM1 4ecA== X-Gm-Message-State: AOJu0Yy1KXz47yelbqtBYpneVeQ7S6Eu3TXEsT3Ir6rxgybgyj7ThM6r i25U9o3Zmpg40+/TWZGRGy4GaOOB/Q6EaExuTZQRUWkWAJgj82D+s2AjSFjPlny3I62Aa1TXZde V X-Received: by 2002:a17:90b:1e0d:b0:2ea:122c:ea18 with SMTP id 98e67ed59e1d1-2ea15528912mr4277796a91.21.1731704343140; Fri, 15 Nov 2024 12:59:03 -0800 (PST) Received: from stoup.. ([71.212.136.242]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2ea024a49a8sm3362274a91.23.2024.11.15.12.59.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2024 12:59:02 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 12/14] linux-user/ppc: Reduce vdso alignment to 4k Date: Fri, 15 Nov 2024 12:58:47 -0800 Message-ID: <20241115205849.266094-13-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241115205849.266094-1-richard.henderson@linaro.org> References: <20241115205849.266094-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42f; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42f.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 Reduce vdso alignment to minimum page size. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/ppc/Makefile.vdso | 6 ++++-- linux-user/ppc/vdso-32.so | Bin 3020 -> 3020 bytes linux-user/ppc/vdso-64.so | Bin 3896 -> 3896 bytes linux-user/ppc/vdso-64le.so | Bin 3896 -> 3896 bytes 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/linux-user/ppc/vdso-32.so b/linux-user/ppc/vdso-32.so index b19baafb0d38e15b4a24def5c44a6d684714be45..0dc55e0dddff618b954dbb939335e99956daf64a 100755 GIT binary patch delta 42 zcmV+_0M-A@7t9xsCINtvCrSbU5Rr3n6lq1YQP%3b&XBjV4sl%JXqmbIL$UbO3Tx34 A(f|Me delta 42 xcmX>jenxzP8Y9C*buT6$SzIX6c=(tjbAN``v6&a|RP{JtzgDQRW#f-4TmVmR5>WsE diff --git a/linux-user/ppc/vdso-64.so b/linux-user/ppc/vdso-64.so index 913c831b3819fc09912b9b31f7fbe9ee311ae12f..ac1ab2582e4675979ffca3ce90dce17df579ab2a 100755 GIT binary patch delta 38 wcmV+>0NMYz9=INmtpWfLk*~QFqejR%tq=sGFts+qF9Cf{%e>^#vwQ)(4KYR#WB>pF delta 38 wcmV+>0NMYz9=INmtpWi6k*~QF<@TF=qRS8+wHM`Qf0n_&>m=ZivwQ)(4PLhrs{jB1 diff --git a/linux-user/ppc/vdso-64le.so b/linux-user/ppc/vdso-64le.so index 258a03b807c4eca23547d978c16d1ad5ebd08bc5..424abb4290b7d3100e9dede2f3059483608ba703 100755 GIT binary patch delta 38 wcmV+>0NMYz9=INmsR9rHk*mEFj|Vri9^_Z(nV0Nw;)4VN>*aZovwQ)(4Mvj@kpKVy delta 38 wcmV+>0NMYz9=INmsR952k*mEF`$9%&`;)~jB!C2C?=itIoQ(CfvwQ)(4MbHDMgRZ+ diff --git a/linux-user/ppc/Makefile.vdso b/linux-user/ppc/Makefile.vdso index 3ca3c6b83e..e2b8facbb5 100644 --- a/linux-user/ppc/Makefile.vdso +++ b/linux-user/ppc/Makefile.vdso @@ -6,9 +6,11 @@ VPATH += $(SUBDIR) all: $(SUBDIR)/vdso-32.so $(SUBDIR)/vdso-64.so $(SUBDIR)/vdso-64le.so LDFLAGS32 = -nostdlib -shared -Wl,-T,$(SUBDIR)/vdso-32.ld \ - -Wl,-h,linux-vdso32.so.1 -Wl,--hash-style=both -Wl,--build-id=sha1 + -Wl,-h,linux-vdso32.so.1 -Wl,--hash-style=both \ + -Wl,--build-id=sha1 -Wl,-z,max-page-size=4096 LDFLAGS64 = -nostdlib -shared -Wl,-T,$(SUBDIR)/vdso-64.ld \ - -Wl,-h,linux-vdso64.so.1 -Wl,--hash-style=both -Wl,--build-id=sha1 + -Wl,-h,linux-vdso64.so.1 -Wl,--hash-style=both \ + -Wl,--build-id=sha1 -Wl,-z,max-page-size=4096 $(SUBDIR)/vdso-32.so: vdso.S vdso-32.ld vdso-asmoffset.h $(CC) -o $@ $(LDFLAGS32) -m32 $< From patchwork Fri Nov 15 20:58:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 843521 Delivered-To: patch@linaro.org Received: by 2002:adf:9bcc:0:b0:382:184f:390f with SMTP id e12csp1058632wrc; Fri, 15 Nov 2024 13:02:31 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUEPZYSUi6IVnRvWbs1el+gY1Qofsg2OiyIw5HF7zXyBN7SAR6/RrCtsYYOwxvyZX5UPF1o+w==@linaro.org X-Google-Smtp-Source: AGHT+IHJBhsrnBfxXRxRGo7Z6/qqxu1cvmKRTrQTtqNjnSclaXgEY1QrgzgzkmIwVqRagq7k0QrJ X-Received: by 2002:a05:620a:3954:b0:7b1:43c0:3de4 with SMTP id af79cd13be357-7b3622db79emr517033285a.31.1731704551033; Fri, 15 Nov 2024 13:02:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1731704551; cv=none; d=google.com; s=arc-20240605; b=CrbzzxqeOmuR3UYN4/mbr3H86QRTst+7uCGsyDZoMh1D2Hr7PHzyrychq5T2T1T1XT 4zkoTgam9qF0yd/A1PW3maCSQMAzvRVAJVLZs74aXE3Y9C28AiqpyFbQxqVSS+Ua1KfM g+ZwKd4014OTheYUG56p8HMclEqNc7tned8BCSmDJeBRCsHnBtK4FX6a+F7ioxZCwMOH AV6azwPWZRAfHRpXtafyibmiG9wkOFqocjsZmwrDkf1cNHeaOTK+aZF7SZbdu6zlP+il e8B3jWhyJ8wnNpkVKFsAPQstlG33/io9Hwm0WeH84Zoixwz2f9muYhKW8Rg2+eZxzUqn SgbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=4gpjVmy5LA7xUzPndNXc9AoGCh/Dtu/5wKj5XL/lUyA=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=HcgkmL0ltve5mP2veYtUd0P9dnDobYrP540CeSOCpaf4i5lFkilwhYRP/M+14GKq/i +IUQw3hkvu3f3QtX2fWMmYkxup5P3yB8sGjks0/YgwrjDEPg5OLYuuDGKiYQnxTGmCe2 PuUm3139zeRzpvNQjuwenWnNhVxNK269AHJxDjlrjTPiCS7tdnuF5QRxk/gCIqX0k0Y5 UseCKi50FvIGj5UCjOGiCA/hWP2AGu6uDgcGbKJuTLrNtIqDJSZdF+c/EfNTP2ZAMngq 0QtRGlrtHlgNTfl6FGMtqU+scebm8Hl4CvxjKy2Bht4sP2SvHT5/7qFC8RZnXD8W66we OGHQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hlc6Fmm+; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7b35c970086si453321985a.41.2024.11.15.13.02.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Nov 2024 13:02:31 -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=hlc6Fmm+; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tC3PS-0007en-5I; Fri, 15 Nov 2024 15:59:18 -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 1tC3PH-0007ZE-IU for qemu-devel@nongnu.org; Fri, 15 Nov 2024 15:59:09 -0500 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tC3PF-0004P2-I8 for qemu-devel@nongnu.org; Fri, 15 Nov 2024 15:59:07 -0500 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-20e6981ca77so12804185ad.2 for ; Fri, 15 Nov 2024 12:59:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1731704344; x=1732309144; 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=4gpjVmy5LA7xUzPndNXc9AoGCh/Dtu/5wKj5XL/lUyA=; b=hlc6Fmm+VnU4PHAW8jFvGtpPgndCnbm75PWyZpof9v54j3w1h+OHnZ/ugdz2/dodpr 4HYkn0nAC2rRurKCy0aGlwoJvGrofG/Sxx+Xs4P05NTqSQJDDFyjFsfFgle5mLa76H3f AXGHnxd5/+FMYfKzHV6FWGHFym/gbPkK1IQfPNzU+oUv/4vW8v0QC1i3U72oLxxm6DQP lFM9c73HGYUHPxE2uKIpIqcHHRMMBjOF+mGeYzrIbEMRrlTmZi5sJlLpRkXnH0ZrJoi4 yxt+Kr3sS3AV5M7iNn2702VBAt8hBTwR5YNdD920/TkTedNRtkeR9jXqjFXhmIN0mCUl ffLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731704344; x=1732309144; 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=4gpjVmy5LA7xUzPndNXc9AoGCh/Dtu/5wKj5XL/lUyA=; b=tZoYVzDqY4MZnhn3iBUwZGXkM5kh7j4XbomQO8tnAQQLQYMgsHpFrlvAq+CMK52khF E8RIAM4RfyyBMXKVGN8E8hWurp0+PQzZy8ZkU4otRp6/X+JTOxHDrbgCqtWJNv+JriZL un32CZCPPDcDtPrKPcgZZ1pewhpOHlvuSNpJw2wMBcp3YNzGsQADL7p1NTt5Cvc8E5cd Gsv6+WJQLnIjFYkwpHIudc+XcgaL6gQrHslzKdMzIuIUTd8j/KVnSDFPt/ZbkIANb926 HC2TcrtcEiDiPfMKS7G63hN7lWFQft7tkZFULeJyinTHBw0ESuITOmaauy0mgFmrhZ8G 18cw== X-Gm-Message-State: AOJu0Ywpy0sYS89/z4Ii/gbbVbuspLQYG98fWBI+UkvudoiJVVqLkmnv jzxPkQOK2qasLC8vUez6SC5lOCh0ZHOvMljqaVAAYXwkPfZJoXMtEFI09z+ogmIa++zjetsOGkD 9 X-Received: by 2002:a17:902:dacd:b0:20e:986a:6e72 with SMTP id d9443c01a7336-211d0d92195mr56282605ad.30.1731704343952; Fri, 15 Nov 2024 12:59:03 -0800 (PST) Received: from stoup.. ([71.212.136.242]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2ea024a49a8sm3362274a91.23.2024.11.15.12.59.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2024 12:59:03 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 13/14] linux-user/arm: Select vdso for be8 and be32 modes Date: Fri, 15 Nov 2024 12:58:48 -0800 Message-ID: <20241115205849.266094-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241115205849.266094-1-richard.henderson@linaro.org> References: <20241115205849.266094-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62d; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62d.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 In be8 mode, instructions are little-endian. In be32 mode, instructions are big-endian. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2333 Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/elfload.c | 31 +++++++++++++++++---- linux-user/arm/Makefile.vdso | 9 ++++-- linux-user/arm/meson.build | 13 +++++++-- linux-user/arm/vdso-be32.so | Bin 0 -> 2648 bytes linux-user/arm/{vdso-be.so => vdso-be8.so} | Bin 2648 -> 2648 bytes 5 files changed, 41 insertions(+), 12 deletions(-) create mode 100755 linux-user/arm/vdso-be32.so rename linux-user/arm/{vdso-be.so => vdso-be8.so} (95%) GIT binary patch delta 19 acmca1azkW8HXECHj$?pF(B?w6=ga^|Lk8ji delta 19 acmca1azkW8HXB=JPDHqi;pRfN=ga^~jt30@ diff --git a/linux-user/elfload.c b/linux-user/elfload.c index ef9cffbe4a..471a384b22 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -659,6 +659,23 @@ static const char *get_elf_platform(void) #undef END } +#if TARGET_BIG_ENDIAN +#include "elf.h" +#include "vdso-be8.c.inc" +#include "vdso-be32.c.inc" + +static const VdsoImageInfo *vdso_image_info(uint32_t elf_flags) +{ + return (EF_ARM_EABI_VERSION(elf_flags) >= EF_ARM_EABI_VER4 + && (elf_flags & EF_ARM_BE8) + ? &vdso_be8_image_info + : &vdso_be32_image_info); +} +#define vdso_image_info vdso_image_info +#else +# define VDSO_HEADER "vdso-le.c.inc" +#endif + #else /* 64 bit ARM definitions */ @@ -958,14 +975,14 @@ const char *elf_hwcap2_str(uint32_t bit) #undef GET_FEATURE_ID -#endif /* not TARGET_AARCH64 */ - #if TARGET_BIG_ENDIAN # define VDSO_HEADER "vdso-be.c.inc" #else # define VDSO_HEADER "vdso-le.c.inc" #endif +#endif /* not TARGET_AARCH64 */ + #endif /* TARGET_ARM */ #ifdef TARGET_SPARC @@ -3524,12 +3541,14 @@ static void load_elf_interp(const char *filename, struct image_info *info, load_elf_image(filename, &src, info, &ehdr, NULL); } +#ifndef vdso_image_info #ifdef VDSO_HEADER #include VDSO_HEADER -#define vdso_image_info() &vdso_image_info +#define vdso_image_info(flags) &vdso_image_info #else -#define vdso_image_info() NULL -#endif +#define vdso_image_info(flags) NULL +#endif /* VDSO_HEADER */ +#endif /* vdso_image_info */ static void load_elf_vdso(struct image_info *info, const VdsoImageInfo *vdso) { @@ -3860,7 +3879,7 @@ int load_elf_binary(struct linux_binprm *bprm, struct image_info *info) * Load a vdso if available, which will amongst other things contain the * signal trampolines. Otherwise, allocate a separate page for them. */ - const VdsoImageInfo *vdso = vdso_image_info(); + const VdsoImageInfo *vdso = vdso_image_info(info->elf_flags); if (vdso) { load_elf_vdso(&vdso_info, vdso); info->vdso = vdso_info.load_bias; diff --git a/linux-user/arm/Makefile.vdso b/linux-user/arm/Makefile.vdso index 8a24b0e534..ede489e236 100644 --- a/linux-user/arm/Makefile.vdso +++ b/linux-user/arm/Makefile.vdso @@ -3,15 +3,18 @@ include $(BUILD_DIR)/tests/tcg/arm-linux-user/config-target.mak SUBDIR = $(SRC_PATH)/linux-user/arm VPATH += $(SUBDIR) -all: $(SUBDIR)/vdso-be.so $(SUBDIR)/vdso-le.so +all: $(SUBDIR)/vdso-be8.so $(SUBDIR)/vdso-be32.so $(SUBDIR)/vdso-le.so # Adding -use-blx disables unneeded interworking without actually using blx. LDFLAGS = -nostdlib -shared -Wl,-use-blx -Wl,-z,max-page-size=4096 \ -Wl,-h,linux-vdso.so.1 -Wl,--build-id=sha1 \ -Wl,--hash-style=both -Wl,-T,$(SUBDIR)/vdso.ld -$(SUBDIR)/vdso-be.so: vdso.S vdso.ld vdso-asmoffset.h - $(CC) -o $@ $(LDFLAGS) -mbig-endian $< +$(SUBDIR)/vdso-be8.so: vdso.S vdso.ld vdso-asmoffset.h + $(CC) -o $@ $(LDFLAGS) -mbig-endian -mbe8 $< + +$(SUBDIR)/vdso-be32.so: vdso.S vdso.ld vdso-asmoffset.h + $(CC) -o $@ $(LDFLAGS) -mbig-endian -mbe32 $< $(SUBDIR)/vdso-le.so: vdso.S vdso.ld vdso-asmoffset.h $(CC) -o $@ $(LDFLAGS) -mlittle-endian $< diff --git a/linux-user/arm/meson.build b/linux-user/arm/meson.build index c4bb9af5b8..348ffb810d 100644 --- a/linux-user/arm/meson.build +++ b/linux-user/arm/meson.build @@ -10,10 +10,17 @@ syscall_nr_generators += { # is always true as far as source_set.apply() is concerned. Always build # both header files and include the right one via #if. -vdso_be_inc = gen_vdso.process('vdso-be.so', - extra_args: ['-s', 'sigreturn_codes']) +vdso_be8_inc = gen_vdso.process('vdso-be8.so', + extra_args: ['-s', 'sigreturn_codes', + '-p', 'vdso_be8']) + +vdso_be32_inc = gen_vdso.process('vdso-be32.so', + extra_args: ['-s', 'sigreturn_codes', + '-p', 'vdso_be32']) vdso_le_inc = gen_vdso.process('vdso-le.so', extra_args: ['-s', 'sigreturn_codes']) -linux_user_ss.add(when: 'TARGET_ARM', if_true: [vdso_be_inc, vdso_le_inc]) +linux_user_ss.add(when: 'TARGET_ARM', if_true: [ + vdso_be8_inc, vdso_be32_inc, vdso_le_inc +]) diff --git a/linux-user/arm/vdso-be32.so b/linux-user/arm/vdso-be32.so new file mode 100755 index 0000000000000000000000000000000000000000..b896d3d545ebf91942038831a9535b023137a86b GIT binary patch literal 2648 zcmbtVO-x)>6h3eM80atz#?V$w#FU7s?MrPY6@OwJ7zS#9;uIpr#K$o6U?zom&CCPA z_(K)jYPEI2#x#u>*BWAK(oG}X7}JGu(U>kYb%7gWj2bmA)bac7dzTK##(3a+=YHp$ zd+&Sqo^$4vzQK$UFl1ALazDn}kQ8ZH3rj#GDIF4quT>K8M*#RXv5GMf@}cL0QbMa9 zq(RhlE+~K0VF_bG%`dp$jfe!`*N`-Pg!23P2DC;e#zejUPViv=@REPVMjCuphrI44sC?HyR7jO@IUJ0uoNG_9y)7(0_pk zpnrn8jPd`K6kebEMDGxZK_3LSp__c(2L5av#~Fv7s^g4R(keB6AJ11y5Ch&BHHGIy z!MCcr=6z^k4DXK!hxdkb4CjQ`+OJFT(1mRCl`nhCy&vqo@3Z~q#IoiKRmaNDIQbLS zwC%d3S$jw0k>tP36}zf!{!C}8kXw|QQh9FSAlEhV|DX&W9UdFE4x2~t7C7+DKLhWH zzvdr5eIIt-`P~5TRezZg{AliXF#0I!oQ(G1qZmH{ASaD+Xuz0+J_$VoeHMBidKLO* zXxy{00z?7Y4#38I5#xod1YV3A?XhN3?z0Er`8P=_9z7E{&$Fcc5b*sD_5s+w-oZWr z+ZRBzZk;4J_dJeGTe#`OQsPw0tMS*Gmt(K*I^A@p@oe;shBqVU!f%D%4xSHO;N}qS z{}^x@Xp{cB6gDM(KY0%G>-$p$oVBF; z6Y^?Hf4T&IyFcagBjZl~;aSs>PFFe$Vx^xMP7NLHm1=3aV!LydvXyrVsvDqbTYUpo zCYu`Svj);xvHAy(^`r)^W0}nHzENv5)ic;<)wKk_0c~j@+nZ8dquJ7^cIZi}e~DRL zoON@P&~C-kMLjAzt}SL^v7DPN<<$VO&^b3J=5%?^Eas|3&+b+{%e-BwmYnhyVim-+ zi`G;nH)~tP0wOgN)3p~|F;m$gGv~UM(&U_rqxnyQ`&N0%+-F@7oq!fU=jC1)nBPb{ zl`qWMCBV;dq?4E5`=Oa7Gyy{nqnbxuFe zn6iBG_8EYNR`J*aXyF X-Patchwork-Id: 843523 Delivered-To: patch@linaro.org Received: by 2002:adf:9bcc:0:b0:382:184f:390f with SMTP id e12csp1059097wrc; Fri, 15 Nov 2024 13:03:31 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVRMtPb9YfVyaEGOt0DVUiuikZOj4CoI0gk/wwKzaSMOB2cRXB1ttoF40BA1HQeycolfuOMZw==@linaro.org X-Google-Smtp-Source: AGHT+IHTZQYNmRJKdj0KouWORAUbc6LvYcOPAC1RTVGZvnkWy3jG/QdjHLIpqLWGTurfxDklgJh5 X-Received: by 2002:a05:6102:151b:b0:4a3:a137:b9b with SMTP id ada2fe7eead31-4ad63053b51mr4904544137.11.1731704611066; Fri, 15 Nov 2024 13:03:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1731704611; cv=none; d=google.com; s=arc-20240605; b=MTYQXN7r+CTtOaviAszsnwhDZCQlxQRLaGr6D1MCOYi/TGScikdrHzOIvwFFvuCwWL 2c1Bs6E4yBwQMRIdRoFhhabBecY8rtMRCdGsGQ6QK9IiCjcK1IcpTaYR4ZcVTryYUlmm 4AS81LiSME+7uVZQKx1RKiBEq2exTL/gmhBxheyhR8GEDufBqcQSMpzRBARqLuFYK5tN +UxPqyheeszn4nhjHbYl96S2fwc4zEI90JqQrC7HLfyh5mMo7LrAmhEHJxU8FFNKOnFk 4KOtppUzltsDlf5hAyU2cQZI3hBA4JU3E4INjCSdvZtTwUcaXlJ0ZyD/I0hXVcmkHFtN 0sdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=fxcTZxhZywFRMG+M6n8lJ4VJTYPwmNxtcqO1U7kqV2E=; fh=pqxCZA/j2BCV4+qx6QHUtcC81c7HqPpC9e70d3NjSMU=; b=Xqn4gDn9n1qUjEkMneBr7FNcCHP3BwnK/ypfAzQqof5x0AVIefbheEBkmQmeV3nLDO RiP7C+CuU7PsNPRccXni13afUZXDG/wBhlg+vR/4w9h9hj5Jdo6Vf8AbVxUyawAocAtb Wc8O1XHuwWQiuDgPtONW0oexGyKrrmtkOxKHc1/Ysb0+T2FGwh5Nza3h83M2NnMHt1SU 82qpkXboL+X7AqF2xyJEsg7uZVDXn9vv8eFHxNq50bMGEl9jLjSHG3RWDNZSLvtcc6us grgQSr/UVl0VH4SxUNrHrTvjlTg8iQAVTlOqhH0yrlfYeMomFikl64ATCwymlbOSJpbY YBbA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="JZGPjQh/"; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id ada2fe7eead31-4ad648678e5si950410137.223.2024.11.15.13.03.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Nov 2024 13:03:31 -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="JZGPjQh/"; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tC3PS-0007er-56; Fri, 15 Nov 2024 15:59:18 -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 1tC3PH-0007ZF-N9 for qemu-devel@nongnu.org; Fri, 15 Nov 2024 15:59:09 -0500 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tC3PG-0004PU-2c for qemu-devel@nongnu.org; Fri, 15 Nov 2024 15:59:07 -0500 Received: by mail-pj1-x1033.google.com with SMTP id 98e67ed59e1d1-2e2ed59a35eso1932844a91.0 for ; Fri, 15 Nov 2024 12:59:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1731704345; x=1732309145; 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=fxcTZxhZywFRMG+M6n8lJ4VJTYPwmNxtcqO1U7kqV2E=; b=JZGPjQh/WxijMVtLaruEKpgbScUY/bHDVcuXezm6FowYobv3jJUEms2w3vf/S2CYNX +XZcj6ts05VeLZ002VboFKFlAvIJJSVqdWGPc/Y3ceVnrfGTiXyyimZRVPZCjQ51niAI B8LQwvBrcLjlpbFjnLTBnwKRAXlTViWQaEeuiwpuDkVYAFB8q2gDCEXwQ8JOKIXXE0fi IFX4T8uLf89WyWj22jfPSUBCRmAeIjVKaAXOXnkaYF6w2w48J/uYlEHu0lrwlRYmABdl BRUXaBClRoOfBYu762vJff7rUzBjskZq+CFChLc4agnY11gDcXB4H5ov3gBhCn2tzZfE GYkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731704345; x=1732309145; 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=fxcTZxhZywFRMG+M6n8lJ4VJTYPwmNxtcqO1U7kqV2E=; b=hGWnhlr5Vv/QkGM1El3DYxKoiXtRbgXM6QgU4QQ0UllRvyHdsbMQgnsfjyTq7brf5W FM5HnjevcGI1fN4E8flHArmJOmFtarVdOkIwnB/0a1nozPMsHv/jMJefNWoudm2R0fUv /ZHDoTBV6phz3/x74UB+scUvXptpoIQH/dpItw65PA5TJ//zAtdRBTG1CDeFrcuqOJGO oCtqDYuu/i/0KNJV4/wbPwclHkM4NQ38pNkY6L6O8aEqUsMMN2zjOZzKxjtZxzX/bREV 1NtWp1/zJyjHBsRYsGNbkOQQsxerXbeJopscRjdafV7Q9iwPMmjohaLysBzk89qKx1d9 DyTA== X-Gm-Message-State: AOJu0Yx5ZCJqKVwHHzqvs6F+n3mC2gvoCzVzuyV1dmKeO5E0+vfRLWGC GZ2CfE06xjbmGYM1iMmX7EjS8CzMbtGTBJs8oYqxe3+ovJc22lb8fEzu2/9LfZAnMErNlH+fzLU m X-Received: by 2002:a17:90b:17c2:b0:2e2:d74f:65b6 with SMTP id 98e67ed59e1d1-2ea154f3f7amr5092146a91.10.1731704344668; Fri, 15 Nov 2024 12:59:04 -0800 (PST) Received: from stoup.. ([71.212.136.242]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2ea024a49a8sm3362274a91.23.2024.11.15.12.59.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2024 12:59:04 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-stable@nongnu.org Subject: [PULL 14/14] tcg: Allow top bit of SIMD_DATA_BITS to be set in simd_desc() Date: Fri, 15 Nov 2024 12:58:49 -0800 Message-ID: <20241115205849.266094-15-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241115205849.266094-1-richard.henderson@linaro.org> References: <20241115205849.266094-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1033; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1033.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 From: Peter Maydell In simd_desc() we create a SIMD descriptor from various pieces including an arbitrary data value from the caller. We try to sanitize these to make sure everything will fit: the 'data' value needs to fit in the SIMD_DATA_BITS (== 22) sized field. However we do that sanitizing with: tcg_debug_assert(data == sextract32(data, 0, SIMD_DATA_BITS)); This works for the case where the data is supposed to be considered as a signed integer (which can then be returned via simd_data()). However, some callers want to treat the data value as unsigned. Specifically, for the Arm SVE operations, make_svemte_desc() assembles a data value as a collection of fields, and it needs to use all 22 bits. Currently if MTE is enabled then its MTEDESC SIZEM1 field may have the most significant bit set, and then it will trip this assertion. Loosen the assertion so that we only check that the data value will fit into the field in some way, either as a signed or as an unsigned value. This means we will fail to detect some kinds of bug in the callers, but we won't spuriously assert for intentional use of the data field as unsigned. Cc: qemu-stable@nongnu.org Fixes: db432672dc50e ("tcg: Add generic vector expanders") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2601 Signed-off-by: Peter Maydell Message-ID: <20241115172515.1229393-1-peter.maydell@linaro.org> Reviewed-by: Richard Henderson Signed-off-by: Richard Henderson --- tcg/tcg-op-gvec.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tcg/tcg-op-gvec.c b/tcg/tcg-op-gvec.c index 78ee1ced80..97e4df221a 100644 --- a/tcg/tcg-op-gvec.c +++ b/tcg/tcg-op-gvec.c @@ -88,7 +88,20 @@ uint32_t simd_desc(uint32_t oprsz, uint32_t maxsz, int32_t data) uint32_t desc = 0; check_size_align(oprsz, maxsz, 0); - tcg_debug_assert(data == sextract32(data, 0, SIMD_DATA_BITS)); + + /* + * We want to check that 'data' will fit into SIMD_DATA_BITS. + * However, some callers want to treat the data as a signed + * value (which they can later get back with simd_data()) + * and some want to treat it as an unsigned value. + * So here we assert only that the data will fit into the + * field in at least one way. This means that some invalid + * values from the caller will not be detected, e.g. if the + * caller wants to handle the value as a signed integer but + * incorrectly passes us 1 << (SIMD_DATA_BITS - 1). + */ + tcg_debug_assert(data == sextract32(data, 0, SIMD_DATA_BITS) || + data == extract32(data, 0, SIMD_DATA_BITS)); oprsz = (oprsz / 8) - 1; maxsz = (maxsz / 8) - 1;