From nobody Mon Nov 25 02:36:31 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1718651011; cv=none; d=zohomail.com; s=zohoarc; b=QFtoUUgxtLWzaEggLT6CA8vLQXJLcPkwtSnE26EhIoFOc5GU2IZ4sTuJrdPNLhCW8cEEH4RMSq+cB+8MIGIqAfTKcwGmfMH1uPFtzYzG5bRMHAQF2y3NBjsb7A3G4dVWjAV8JLbcJW/OnVqO7k3e01NClF2/Kuo3RMN2Nxxu8Es= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1718651011; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ZCkbHRdTwhc461NzNM6M57ey0Qv/rYSZmL7pQTY6Emk=; b=d9zTITGHt2pWCNS3sajUHNBmtcVFkKV0HD17AkF7AMvamBNqp3aLpFlEdpOytQjz25jBYXFlAy/fHm90Bun8JMSBxWg10acRcnX+cjFFSZvUfQIrRTu9ykreIq8Zp9BnjKVp2lsbaSaV1aF92TsS1JSg+UHPtZACJAbfiC6iMpM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 171865101139121.765929229091398; Mon, 17 Jun 2024 12:03:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sJHZR-0007c4-2a; Mon, 17 Jun 2024 14:59:13 -0400 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 1sJHZP-0007Oc-Kt for qemu-devel@nongnu.org; Mon, 17 Jun 2024 14:59:11 -0400 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sJHZO-00053U-55 for qemu-devel@nongnu.org; Mon, 17 Jun 2024 14:59:11 -0400 Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-705cffc5bcfso4140877b3a.3 for ; Mon, 17 Jun 2024 11:59:09 -0700 (PDT) Received: from localhost.localdomain ([106.222.222.115]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-705ccb4aa4fsm7660637b3a.131.2024.06.17.11.59.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 11:59:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718650748; x=1719255548; 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=ZCkbHRdTwhc461NzNM6M57ey0Qv/rYSZmL7pQTY6Emk=; b=CRSuF4lX3V+2w0F6WQiY7PInPi0BvdzWLSS9u5t3lRFYCGkheWw6BVnEFUsmxz6MHZ 4W4XdcHsWtRWqD+ZVJxCvJu4qb3wmHaj/vHK9NQGPBAXIxUuMV3u+GHC2ObrLC3LqoOz YA8cTnjf/UU++fAksTWuL1TvPE3Sc9pUJF8d8lfeDgMiaPxTkScrx5ru+vtRmUl7wB8S 8sAmyUbqtxMKZNA7trBQ18A8bHpVwyRhKhQ+AyUmfXpFw/9mRfJfWMu1xc5UbG7T0Ile 8v5ew8iDtidjAfJf0HNIbNxrCtIOH/kYscNSDcsrBiJYz78q5ruco69+F1Z+Pth+S27r B+Pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718650748; x=1719255548; 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=ZCkbHRdTwhc461NzNM6M57ey0Qv/rYSZmL7pQTY6Emk=; b=Vqa/LmH9JFj4ytMivSPYhyf223QOdVJsxx1gSnFvsMWSPE/zjPvU8kDbv0zuZJc/VU 3hcqiDc6nwqi1It3JmCb1O3gYYPLbi/zCWo/qVJGn159OpU1Lc5dhukA4mKuucTZ+O/c ZuF0BIYCCPCSAj/p0PxhFaB9lJt+0bSst88Zj5opUx1xyi4ZfORNFIeeijzGSu4cbaRc 0B5BLzMKIi7xZh5lLUJqTqzv7H0JoyMtOPMs3Yx+tVmeHhQYZEcCw5NMotMEdkXrgb/q 0cgRR21NUhzyghItlUxNXokZUexV92KRo7wbmVEQ9jrwxvSMTUV8YtKgjXrn56OK5V86 +vGQ== X-Gm-Message-State: AOJu0YwAJ+Us+ZnaqbtUnA/BQI2Jdwjncvl4bcMy77Ae/aCVW38pjGqt rVvweU+KO21UUpiU6i7djQJeQOO9XJRPcvnSthdGZkZUsM5W2TxxoNbZJmVrk7E= X-Google-Smtp-Source: AGHT+IFKZJvGXHGMopQTrmrydALK/e3vBu0P0zekshvTkWMZHZtxIxb6W2RUDjeoLBQa7uoU5gN1DQ== X-Received: by 2002:a05:6a20:1595:b0:1af:f514:6d96 with SMTP id adf61e73a8af0-1bae7ddafe4mr14498289637.16.1718650748527; Mon, 17 Jun 2024 11:59:08 -0700 (PDT) From: Ajeet Singh X-Google-Original-From: Ajeet Singh To: qemu-devel@nongnu.org Cc: Warner Losh , Ajeet Singh , Stacey Son , Ajeet Singh Subject: [PATCH 23/23] Add get_ucontext_sigreturn function Date: Tue, 18 Jun 2024 00:28:04 +0530 Message-Id: <20240617185804.25075-24-itachis@FreeBSD.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240617185804.25075-1-itachis@FreeBSD.org> References: <20240617185804.25075-1-itachis@FreeBSD.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::429; envelope-from=itachis6234@gmail.com; helo=mail-pf1-x429.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1718651013806100003 Content-Type: text/plain; charset="utf-8" From: Stacey Son Function checks the processor state to ensure that the current execution mode is EL0 and no flags indicating interrupts or exceptions are set Signed-off-by: Stacey Son Signed-off-by: Ajeet Singh --- bsd-user/aarch64/signal.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/bsd-user/aarch64/signal.c b/bsd-user/aarch64/signal.c index 13faac8ce6..ad81531ec5 100644 --- a/bsd-user/aarch64/signal.c +++ b/bsd-user/aarch64/signal.c @@ -117,3 +117,21 @@ abi_long set_mcontext(CPUARMState *regs, target_mconte= xt_t *mcp, int srflag) =20 return err; } + +/* Compare to sys_sigreturn() in arm64/arm64/machdep.c */ +abi_long get_ucontext_sigreturn(CPUARMState *regs, abi_ulong target_sf, + abi_ulong *target_uc) +{ + uint32_t pstate =3D pstate_read(regs); + + *target_uc =3D 0; + + if ((pstate & PSTATE_M) !=3D PSTATE_MODE_EL0t || + (pstate & (PSTATE_F | PSTATE_I | PSTATE_A | PSTATE_D)) !=3D 0) { + return -TARGET_EINVAL; + } + + *target_uc =3D target_sf; + + return 0; +} --=20 2.34.1