From patchwork Sat Mar 2 01:06:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 777456 Delivered-To: patch@linaro.org Received: by 2002:adf:e94d:0:b0:33d:f458:43ce with SMTP id m13csp1680295wrn; Fri, 1 Mar 2024 20:13:19 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXRilVJ4wTgczWpLXqsRWYI+zbitxyxRsUUAZHK8fSo/MC7Yt8Sf0G51JlHm2f8hdMHNL1pC97Kk+MiGn981WAB X-Google-Smtp-Source: AGHT+IFM7oQ+ZiVKmX+8wf850T6HahnWkWeoEJlpdtvuR3HicgIofRFC7zw1wWkElTrXs65fixPB X-Received: by 2002:a05:622a:144:b0:42c:5d43:7e77 with SMTP id v4-20020a05622a014400b0042c5d437e77mr3587411qtw.7.1709352798807; Fri, 01 Mar 2024 20:13:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709352798; cv=none; d=google.com; s=arc-20160816; b=iUuwDe45FcW+waqZrvRz5HIMbofRHNbwOXHP8m6ZuCxpp67JfkapWsW7WywCjYw2iD 3prqmUUpnLxbcRyrjTP5uy03eb+jA3MNr8M+5pVrRYsqszgcohd7JgJnzeCbPfuyRuk8 0/8sZAr42ZzEOQtevjvE8Q5pywYKxOQzx2e18PIJYPw6bIuDGq0pRDRzQN9vNueZJX/V ka0CvxkTuGbkN55KM5jsb582iQulNnPr3+LgrAUfkHsBsJ7J3pHVI8EWTnOztsxhdOYY b0K/PISb5iXOaCAAjIrj96/b6uNpG+/tbfody8FCbEphVcYYurWhjJtNa8HaXgQZdD/H L00g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=o8MXSoWfmAHZQ0rBmuR55Qzx+gnIMTEYTxvhSOOyEls=; fh=3mEp7FusppN5Drq2PN08R8D/9xXM9YdbtG5TkJxJBiE=; b=03yd1PeyRgab3BCe6bND9UCmNNCgAtPqdcGbYyK4u2XQkvBiXl1nR0kgGqXssHEJCK UDqrLvh9cf8+MsEPueZZvd5213tPLn4cyOwoTHXN7Y5hBnLWGa4S3dOTvoYKPvgj5r/I WAXQaRMHS/6G8t+JFDr3yWGoaYyBxVl28qrvFeSBYUnSLAdIHy6qNYGKqJr4Ay2WpjPD ozeMXyhZWSWcNfp+cTHnjvc6eqdEZ+wh5JWywtN6dPvzFH0U9COcHXnTitmHCodIrAHm 79uVXJAO/BQRciNfubQQf9WTJ0r3D/UaWclS724Kc2x3EtuDghee7w98xis0tH6DDijN CmqA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OQ8ujKQM; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id p4-20020a05620a112400b00787c76a65f0si5057950qkk.621.2024.03.01.20.13.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Mar 2024 20:13:18 -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=OQ8ujKQM; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rgGjF-0005KD-5K; Fri, 01 Mar 2024 23:12:05 -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 1rgDpj-0008IF-3A for qemu-devel@nongnu.org; Fri, 01 Mar 2024 20:06:36 -0500 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rgDph-0001px-Fa for qemu-devel@nongnu.org; Fri, 01 Mar 2024 20:06:34 -0500 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-6e5a50d91b4so2238958b3a.2 for ; Fri, 01 Mar 2024 17:06:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709341591; x=1709946391; 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=o8MXSoWfmAHZQ0rBmuR55Qzx+gnIMTEYTxvhSOOyEls=; b=OQ8ujKQML2VNSxjZfF4sqOw0RJ0to+fk7a3jbGACjLfUNtc9glLvqT/cORLgh9+4sH FaRNfmnrp0R+0RMO1inS4stzQCsyhujWDRdqmcDOLBdv7hU6QwGcReNaGopsrn2AV5AO 4OToHWtKIO/G90FbhX7h1B3me8zunAoHIp+KkFYM/NxJ7aKyaytBMlnA8tHP2gCzMZCN OZTz3m0D6HvqLCW38jBrZ9+7CrnAn8C6OLTNeiDGAqcrMfEHHumFbV3kfg5t5Pwdlsrq PGgIjJQ7sKzlTuP9lSSA9szADYp/8cnwDFpVw/2PNWSphmTOCPULi57SvIkg1Et7PxPk GYog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709341591; x=1709946391; 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=o8MXSoWfmAHZQ0rBmuR55Qzx+gnIMTEYTxvhSOOyEls=; b=CN4K+swo0h52/1ysJNO8nizENViRTQTl73E9bbc07oH0L/bA2KavNkOT/j63epUzFT XSV+IatOkAMfjsYkY7g55975TrGM/DO4upBtG5nM2WTIK+7qas7xhS6Yx5OkhqY/YY6D jFgbwJxByh5pDLcYGhcJIFJa+X8XtkAv5cbA76trWNoMiLGmnoyWQjbQ6rfrgzpvUU4J 4/LdV06ZZy4EPR5a67I7AppV7eHyAVQ4uC9gxpOCDUA0yI/6SrUKGWwH5fmwJc5jXAXc yRYnRU0tB6sxzverlcYoVwSvlyS9mpgquUWapFDS2oOHKXRGLh3E30TXh95mtlTrY6ZF j+MA== X-Gm-Message-State: AOJu0YxLwGg1dTE8cEt5M87Tw8c6WHFAzRGShSSFMQ5Nm1u8svaL765f jKKWedpm3gWm4ZMg9HFpHxus18AYsZ3sESOv7MNxO/4ZwjrKC4VtRxKizxKB33hudnFPDD/yJZA j X-Received: by 2002:a05:6a21:2d86:b0:1a1:44f9:cbf3 with SMTP id ty6-20020a056a212d8600b001a144f9cbf3mr1035651pzb.57.1709341591585; Fri, 01 Mar 2024 17:06:31 -0800 (PST) Received: from stoup.. (098-147-055-211.res.spectrum.com. [98.147.55.211]) by smtp.gmail.com with ESMTPSA id lo21-20020a056a003d1500b006e5acdb5c94sm2399881pfb.176.2024.03.01.17.06.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 17:06:31 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com Subject: [PATCH 1/3] linux-user: Implement PR_{GET,SET}_CHILD_SUBREAPER Date: Fri, 1 Mar 2024 15:06:25 -1000 Message-Id: <20240302010627.12998-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240302010627.12998-1-richard.henderson@linaro.org> References: <20240302010627.12998-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::432; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x432.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org The "set" prctl passes through integral values. The "get" prctl returns the value into a pointer. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1929 Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- linux-user/syscall.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index bc8c06522f..263b651cc5 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -6450,11 +6450,21 @@ static abi_long do_prctl(CPUArchState *env, abi_long option, abi_long arg2, case PR_SET_NO_NEW_PRIVS: case PR_GET_IO_FLUSHER: case PR_SET_IO_FLUSHER: + case PR_SET_CHILD_SUBREAPER: /* Some prctl options have no pointer arguments and we can pass on. */ return get_errno(prctl(option, arg2, arg3, arg4, arg5)); case PR_GET_CHILD_SUBREAPER: - case PR_SET_CHILD_SUBREAPER: + { + int val; + ret = get_errno(prctl(PR_GET_CHILD_SUBREAPER, &val, + arg3, arg4, arg5)); + if (!is_error(ret) && put_user_s32(val, arg2)) { + return -TARGET_EFAULT; + } + return ret; + } + case PR_GET_SPECULATION_CTRL: case PR_SET_SPECULATION_CTRL: case PR_GET_TID_ADDRESS: From patchwork Sat Mar 2 01:06:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 777464 Delivered-To: patch@linaro.org Received: by 2002:adf:e94d:0:b0:33d:f458:43ce with SMTP id m13csp1680614wrn; Fri, 1 Mar 2024 20:14:36 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWUiCojJY2bLtqfvAGnp520I9U6ozFzoe2Y2lOvj2f2Am7CPA+55vlk/oMTHoY5lf4+FnGdoaihK//qgeTo3WN/ X-Google-Smtp-Source: AGHT+IHTuqn5vIZ0wVPpisIbGR/vyZhJfBX9h0PYp7UzPSXunSvALTq+W1+YayP2xhmIr5pl07Gp X-Received: by 2002:a05:622a:315:b0:42e:9806:e48d with SMTP id q21-20020a05622a031500b0042e9806e48dmr3669915qtw.67.1709352876289; Fri, 01 Mar 2024 20:14:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709352876; cv=none; d=google.com; s=arc-20160816; b=P8GA5hNK8d8GearIv103N+UimvihgTlJ70bN1v4+6EzXRvTr3jy5Bq+3T9x9OT6zML En9q7XXzY2dB6viS06QK1krK5xy8QKUqg5VzESdUCKhGs/BWUfOaaj79qZlocQ3iKSfY Jh/Hekgdw/b2PMGb3bdYkiVX0LWP7YnNd1gvZQ8AEIfYc0owBtT96BANr92VqOiGMjan LZpMzOseAPAuSQjauzx0aSJ/dFtt3Km7JI/jvmKtKAUBE/qBuvCpyvtf2qU3Mx+5m7b1 pzUCy0RUXwbpDmKVKug17M15OPcmkaETLVBRyk4M5C9Iq6sRleI+DdhUpXPvh8BHdweb +8QA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=72XxUBIqz7vi+7Nek64Y5gomRVx4hdx3L9w0Ay29Drg=; fh=3mEp7FusppN5Drq2PN08R8D/9xXM9YdbtG5TkJxJBiE=; b=bzlC1yBlz5DFNm4BY4Q38ZguMNXvdu/DDROMEcm0vxreXboUdnAzoi1ffALgJy68xu wPVs1+Itn88LO51OcWL8bWEYLC+hKrQfbL4He9svFQKKaWwgItxlcFczhvN22VimGUXl GsCUp2Lva2i9kd1nKpbUgJcCLj1bJON16rp8sq2oxHFXd7u4XfFNcbwo6exhm47KPsbS quXhVhtxXjJ68LJ7gEca0aEHWzIWmK/oi/ulD2JF3/ASh6j0IKOtQwqRdrHtPrezzweb 661bPjN5OwJPewixGjHKQaCqh9K88uHg6Jz/GsKd95CQJ2BPE1wGJ/9AAJV9g4EdQ3tM 5fvA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TNocJI31; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id t37-20020a05622a182500b0042e8f1c894csi5206520qtc.666.2024.03.01.20.14.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Mar 2024 20:14:36 -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=TNocJI31; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rgGjH-0005M3-Qn; Fri, 01 Mar 2024 23:12: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 1rgDpj-0008II-C0 for qemu-devel@nongnu.org; Fri, 01 Mar 2024 20:06:36 -0500 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rgDph-0001q8-W6 for qemu-devel@nongnu.org; Fri, 01 Mar 2024 20:06:35 -0500 Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-6e5796d01c8so2080197b3a.0 for ; Fri, 01 Mar 2024 17:06:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709341593; x=1709946393; 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=72XxUBIqz7vi+7Nek64Y5gomRVx4hdx3L9w0Ay29Drg=; b=TNocJI31qs82FeT7bRUIq4DHZABCOz6Obnpm9tFjprjJTbxVqqUAqraUpijQ9N1iHy wkfifkHL45eUHZr3ijHgSYlOl0PI63JU5s5pWpA4+CjCxRuw37C7sjaMacbaVq3s/7yQ 1RBPg+QoF4fjJ9cWkKhuNxXQAhwQ2L9S6WoIQMyLbCqT3uO/G5rCJVy6aHUS70Fh4AJ1 t/zcueWFyemBua+e/T7uG/cNap2Hx65gJrmHiuq7kE0RAuJV4TboIU7m79BQ7NttwwG2 fPSZSG/TEAz9xnDPfT84+qJHB6g38LqYF0p+xEThPWECShAdV14Rj244CODP5xRvCdNU rVKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709341593; x=1709946393; 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=72XxUBIqz7vi+7Nek64Y5gomRVx4hdx3L9w0Ay29Drg=; b=H9dw3D/C1DWYalMGMgy8A4ayLYTzEKLY4td1GZckpGgiWPUU6/Rkw8K/puwwoHTvvp frjW4g+/h+0OO7n98SGwrcboNxMfGrRQYHqI2ONUaRAuxbMyWuT5+5LXYnSu4peQhOFU 3s8lxND7hXRX8x+C3rxRdQiJahckBkOFwdRzUDOXZg3qMEYtJFN2Ow3hf4KlOmGejUdo jxbPhSk4185rNStc78OhOs4HRmg7tUCZf66ml83TSL+N9txrRUk4esE2NGV1zWrH8VTo gClTNLf8LABKf1qhu4ysqF0LjOezqx1Oxd9OuO4xwx5QGxXFLjRU+RpN2tkz65jwkfoL 4dPg== X-Gm-Message-State: AOJu0YwFS+iL0iu3KplEpNRHAkBo23dHA4WTl32t5KYJjTUbSw2sp1FL IUCELF5WNEFJzW2aCIMOf/82ra5dCu4W1m6JVGnRlhAdosEAGGRJhe6UqfloLrtPJZu+GP6kFmJ 0 X-Received: by 2002:a05:6a00:2406:b0:6e4:9ba6:d153 with SMTP id z6-20020a056a00240600b006e49ba6d153mr2955645pfh.8.1709341592720; Fri, 01 Mar 2024 17:06:32 -0800 (PST) Received: from stoup.. (098-147-055-211.res.spectrum.com. [98.147.55.211]) by smtp.gmail.com with ESMTPSA id lo21-20020a056a003d1500b006e5acdb5c94sm2399881pfb.176.2024.03.01.17.06.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 17:06:32 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com Subject: [PATCH 2/3] linux-user: Implement PR_{GET,SET}_SPECULATION_CTRL Date: Fri, 1 Mar 2024 15:06:26 -1000 Message-Id: <20240302010627.12998-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240302010627.12998-1-richard.henderson@linaro.org> References: <20240302010627.12998-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42a; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Both of these only pass and return integral values. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- linux-user/syscall.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 263b651cc5..efa200878f 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -6451,6 +6451,8 @@ static abi_long do_prctl(CPUArchState *env, abi_long option, abi_long arg2, case PR_GET_IO_FLUSHER: case PR_SET_IO_FLUSHER: case PR_SET_CHILD_SUBREAPER: + case PR_GET_SPECULATION_CTRL: + case PR_SET_SPECULATION_CTRL: /* Some prctl options have no pointer arguments and we can pass on. */ return get_errno(prctl(option, arg2, arg3, arg4, arg5)); @@ -6465,8 +6467,6 @@ static abi_long do_prctl(CPUArchState *env, abi_long option, abi_long arg2, return ret; } - case PR_GET_SPECULATION_CTRL: - case PR_SET_SPECULATION_CTRL: case PR_GET_TID_ADDRESS: /* TODO */ return -TARGET_EINVAL; From patchwork Sat Mar 2 01:06:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 777461 Delivered-To: patch@linaro.org Received: by 2002:adf:e94d:0:b0:33d:f458:43ce with SMTP id m13csp1680362wrn; Fri, 1 Mar 2024 20:13:32 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVM0aw6Du3rmIJkSBVH/WH2mxWCVVoGlb6grP8LXpUcnycZ1/JelM/S3xteYE9MDQUNnx15Dzj5z0jzzzXr8htl X-Google-Smtp-Source: AGHT+IEKE3PVdnpTO+lc0oTpK+Wu0NUmY42dL6/ZTX30UOJA1Bh4ZIRuzAVhMtaZ3HrfjWwtiaYJ X-Received: by 2002:a05:622a:1a90:b0:42e:7a59:8041 with SMTP id s16-20020a05622a1a9000b0042e7a598041mr10520430qtc.4.1709352812612; Fri, 01 Mar 2024 20:13:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709352812; cv=none; d=google.com; s=arc-20160816; b=mS+gI2oVQ6YdQ1iiR6nAZr5BBAh/nzw9c2jP3Ry1bjYt+MYHAsAPxW383ftH23brXA cvxGNzomncLOrSZHnSHhE+4Pdb7NPSuhUoUXUJ5E+nRUDrfNH8Zwn65ge0KongePpXWt Ft99Zi0y+qn5bpOCvIo+AQIF1g+c3Xe1shA6OuPzMw5W0qztr22AGHIljszajSpeN+EO QzkxsIseqauvrETudOXOKTwkbIBIqrvN/UMsSXpS6xahj5hC5Ky89bV4X0YA6m78cIjr q5RYk8oPKbi39VLZ6zbQK6tdJPs/dRUWf1GA7yuLPADp47jWpc0hxw1Q7GB0BOhFX72y Vy8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=heWwhhZRXEytDL0SmdxoBBOuqoxj4iBtZd/7OGPBfBQ=; fh=3mEp7FusppN5Drq2PN08R8D/9xXM9YdbtG5TkJxJBiE=; b=hbN6nH6Fo8T2EHguId9psoGJ5KoHqDweVGGqGpMUaxeEbpjh1yq3BJdkxlA+giN3vC MI4mC52wcFcuXw0CnWzSz1LedYpV9QK+H7txgc2HMBTq8Z7gJp1oiZHFSbSg7Tqvv9mB g3Uub5PWpRyPpKE2PCnVNIrENjGdftgZZlF61kbvVenmvzdEP4kKeJuMXlpjXZ3MQznI CMZtutvy6HKO3G0xN6av2HiFZNuV6zlBPiZ126CgMIhyoqzK+vdayr8fCVN1sDruMvNi iIdG83bPCvd22NsUdmgBeVWImJyWEdBzXBAEQ/ucAe8qjLskKxEGkOdbiKuJ7u3veVOm HlmA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DEYHr8YN; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id u9-20020ac87509000000b0042ec938a4acsi2573995qtq.6.2024.03.01.20.13.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Mar 2024 20:13:32 -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=DEYHr8YN; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rgGjJ-0005No-7n; Fri, 01 Mar 2024 23:12:09 -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 1rgDpo-0008In-Am for qemu-devel@nongnu.org; Fri, 01 Mar 2024 20:06:41 -0500 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rgDpj-0001qH-4Y for qemu-devel@nongnu.org; Fri, 01 Mar 2024 20:06:38 -0500 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-6e5e4b1d1f1so241738b3a.1 for ; Fri, 01 Mar 2024 17:06:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709341594; x=1709946394; 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=heWwhhZRXEytDL0SmdxoBBOuqoxj4iBtZd/7OGPBfBQ=; b=DEYHr8YNykP4Tvn+YkyIDqsvjVWYkIr6Sm+r34N7YUvFYCCd2cFWdX2FPc1Z3PouKs HILLcreypPr3Ayfo6giUotyU+foj8mp49lPedanOngYNbYWmO8OtjpH1ylKSTwTyMjQ0 KZrqvIZ37c0cpcnIWQht4U6e7fmQWDMm9owEP1H2Pn6J7DRXwMBbSV3d3UihODpQzdg5 egFEgy9Trpb3JrcFsgAvsidQV00HjXxBsxFtWtvgKv4xnXXH6f/FdSKTDNzswwfhngiq J7+5elGpMdIlsDoc1ySQwKf8TnWooaAQzHvwqw9acvBxjkiIHGNCcIwTeztpxed7Vhi3 sSkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709341594; x=1709946394; 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=heWwhhZRXEytDL0SmdxoBBOuqoxj4iBtZd/7OGPBfBQ=; b=qJ0ooZy77CBfJ3ZRwsB0SGLuOwdzKoftpYgupx9uxMyQq2J4BbKKoeNn1/Lpcr8NBY GPlwSWbYBcoKY+0UH6Q7VvdAVdUSwopMaH3Ftq9cE6mMaUcCseRKblPxsDxKJcM7Htfp MwrrD40aZhwVUA9Jvsg6ObXC4Z54ZrnI4TtIIj2OK+ksHcgC+iJPBXpPS7q2919sqw3R fzNrlPP7Q3qFjeLLuRd6CqPkFde19j7lTXu6F185M1e3cltU2wqB3uCAZ6fIk5aOfSNc TTQkKnml6vdtgVFV3O6ekTbM5SXI6cOb47t1zsCY+3LODX58wA7xil5OexwSzS3qbVsp XTRw== X-Gm-Message-State: AOJu0Yy/gQUQJ9Haso7UtjTdGUnuKJwHgTIMuhYtedvLIjhoXMQ8yglK uUNrunxJsO/mTq8TxCZnzrb4PiASyEHhfiDgn/AaNW1Uhv2CFo/esvTxu5T/MnOPzJCy09+9i1L j X-Received: by 2002:a05:6a20:c706:b0:19e:a5ae:229b with SMTP id hi6-20020a056a20c70600b0019ea5ae229bmr7573638pzb.31.1709341593953; Fri, 01 Mar 2024 17:06:33 -0800 (PST) Received: from stoup.. (098-147-055-211.res.spectrum.com. [98.147.55.211]) by smtp.gmail.com with ESMTPSA id lo21-20020a056a003d1500b006e5acdb5c94sm2399881pfb.176.2024.03.01.17.06.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 17:06:33 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com Subject: [PATCH 3/3] linux-user: Implement PR_GET_TID_ADDRESS Date: Fri, 1 Mar 2024 15:06:27 -1000 Message-Id: <20240302010627.12998-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240302010627.12998-1-richard.henderson@linaro.org> References: <20240302010627.12998-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::432; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x432.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- linux-user/syscall.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index efa200878f..a50a18b008 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -6468,8 +6468,10 @@ static abi_long do_prctl(CPUArchState *env, abi_long option, abi_long arg2, } case PR_GET_TID_ADDRESS: - /* TODO */ - return -TARGET_EINVAL; + { + TaskState *ts = env_cpu(env)->opaque; + return put_user_ual(ts->child_tidptr, arg2); + } case PR_GET_FPEXC: case PR_SET_FPEXC: