From patchwork Tue Apr 9 05:02:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 787190 Delivered-To: patch@linaro.org Received: by 2002:adf:fdd2:0:b0:346:15ad:a2a with SMTP id i18csp57945wrs; Mon, 8 Apr 2024 22:07:13 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWKmA7vSjt5w+Q+Q2NbfsJZCvm3N94E2lyA5gcRAmXuIS08DwSp/hHB8iZJXvItZn4B1WxY4rruPA+iyt3F6OOZ X-Google-Smtp-Source: AGHT+IHjouiqANQUWbq/npVAOCf0v3N4cOy/w/Lt109mcI6uEM6qTZtSTo02M03dSKH0SpdiFIYi X-Received: by 2002:a25:6648:0:b0:dc2:232d:7fde with SMTP id z8-20020a256648000000b00dc2232d7fdemr9681709ybm.13.1712639233036; Mon, 08 Apr 2024 22:07:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1712639233; cv=none; d=google.com; s=arc-20160816; b=cWmSqYOEMRRD0fMoh4TSEWBWW09PKh3r1cBBashuQQdyo/7xtKdevHp/VKmj6OnN28 PT8mgPYZ1/NoInKwO8XOCG7+OylGzcOxiGOLZZecJq2GwAGcxNjO+SHAjXnNM7aUHcGx qzMeEaTdPwjPMb3yWE+d5QPHGccs5hk76JLKqvY+nxDjgVLhLYUe07ixG2mbwm2i8ij0 sfcIYp4TQlDCg7Ea2ImSuWzEyjS6SGk908Y8uSB/tkejBuHIbkNiU18XWCmUPamHHkyg p5EQygrOiqjIsTtDg6lRNeLCNEkTJ0/INOLkz+kft14kCi+uXSF5tqR/zQtHe4gEBbeB to/w== 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:to:from :dkim-signature; bh=HlBd919hOWRpacVU0kzMPBm6pP4Z5Z1zQwF3gBDERhU=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=qthOz3B6fzPYXxT8rzavCK1KGNzFktChj5MA50YxWvtPSDBkNNY9A05CXzHf0CZLKw x+SHg88Uu9LEo1TkDfOpq1DqwmTjpsNlylYjuSmm9DWSUuy5fhEborE1x0GA13r/NQyc +Xayni9E0/jXdD1YzXO1QKZMJAjFmNrVS9w51LGfIi2jbSzMZKxWnYtPImCZBukoJKDh EsJWZ6Epae2JDifs24FkvssC9N3uWeJ487t2zQGrQa3Xkx0iqiCXLD10LawXAY9F0aVQ 8AIxzhy4VLyKrXLdi23mbNszGRes5YuTL7BjcOCKqtYRwtqjhG70SX31P2qQt4320bf0 gBLA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IaOGd88u; 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 h9-20020ac85849000000b00434e572c598si178383qth.455.2024.04.08.22.07.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 08 Apr 2024 22:07:13 -0700 (PDT) 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=IaOGd88u; 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 1ru3dv-0003Dq-4M; Tue, 09 Apr 2024 01:03:35 -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 1ru3du-0003DJ-3k for qemu-devel@nongnu.org; Tue, 09 Apr 2024 01:03:34 -0400 Received: from mail-oa1-x35.google.com ([2001:4860:4864:20::35]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ru3ds-0005M8-8b for qemu-devel@nongnu.org; Tue, 09 Apr 2024 01:03:33 -0400 Received: by mail-oa1-x35.google.com with SMTP id 586e51a60fabf-22f01274622so1543947fac.1 for ; Mon, 08 Apr 2024 22:03:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712639011; x=1713243811; 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=HlBd919hOWRpacVU0kzMPBm6pP4Z5Z1zQwF3gBDERhU=; b=IaOGd88uwSlx2AXSmDSochmWr+CSxz7bTPXoeShfh4H8VooUz2uRzF+h4F86Pqs3E7 B2YI4h3XN72Jxr9fI0QuXi/GEX0I5UCD7ZhJC/MwSMYWImbcvWkn26O/T2Qyj+CWhp6n HJPm5TeyDBy1IQ40umBhLdrN6wi5oSIGyt5+kbHqQzFz5OneViO41qYPpZIcKGOpSh5s w41AaQitDXx1G3qlfAwqhrkaXC88Nb5+1ZOMzmJ+76npyZ3b3NZCxyVVat5yjNQpMn9d o3xKV7mdSfEnAlzz4ib1+mCqiOTQBF/OljWm7wiQk2fs2p0vq+khbF4f+cdKS0Kvqodz oEuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712639011; x=1713243811; 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=HlBd919hOWRpacVU0kzMPBm6pP4Z5Z1zQwF3gBDERhU=; b=qdsFslyv5TjIXy4uuIG0XQcE4F+2HgBm4JZGZ9v8LUp+Tfs7P96cUVf7HQKNYuzKGs DM334Ewl7JbpMyoXRCmY0TrGd6ijkU3ozSHn7aOOSL6a77x+9cMtaOg0HzacVgZNmr8F QiOoAKJ86QjrUPSU5jhCcY6c1M8BHE9fIkwp0XsB+5NUesINCmCJHnjt+B8ygODLI4Md OIvRqGgxfY+towvmGWjqNxqu9iyeoQ0L12EQDMUhfILUwwu8OqRSvK7GwhvRBJ0JebPX c6tS1/dFnIkNf8iJHyUiR3dd7CY3QOZSJovsdeV3rIEyswCvLTN9CoBp3Q41qVsGWxGr A8JQ== X-Gm-Message-State: AOJu0YxwPhi+97YXTK2CHrCqL+xvpzxWkv9ddfXAYFJ4aX6EYdmJhxoN /NOkcNEcv9/0ZYzulNE6AbVmqDhHuT2AUJEWTICA/1mvR088LmE16agQSkLEFi2Wn5TubRiBODi k X-Received: by 2002:a05:6871:88a:b0:22e:dfbc:4d90 with SMTP id r10-20020a056871088a00b0022edfbc4d90mr11912206oaq.5.1712639011107; Mon, 08 Apr 2024 22:03:31 -0700 (PDT) Received: from stoup.. (098-147-007-212.res.spectrum.com. [98.147.7.212]) by smtp.gmail.com with ESMTPSA id z26-20020aa785da000000b006e64ddfa71asm7654894pfn.170.2024.04.08.22.03.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Apr 2024 22:03:30 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 21/28] linux-user/i386: Return boolean success from xrstor_sigcontext Date: Mon, 8 Apr 2024 19:02:55 -1000 Message-Id: <20240409050302.1523277-22-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240409050302.1523277-1-richard.henderson@linaro.org> References: <20240409050302.1523277-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2001:4860:4864:20::35; envelope-from=richard.henderson@linaro.org; helo=mail-oa1-x35.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 Invert the sense of the return value and use bool. Signed-off-by: Richard Henderson --- linux-user/i386/signal.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/linux-user/i386/signal.c b/linux-user/i386/signal.c index 1571ff8553..d600a4355b 100644 --- a/linux-user/i386/signal.c +++ b/linux-user/i386/signal.c @@ -529,8 +529,8 @@ give_sigsegv: force_sigsegv(sig); } -static int xrstor_sigcontext(CPUX86State *env, X86LegacyXSaveArea *fxsave, - abi_ulong fxsave_addr) +static bool xrstor_sigcontext(CPUX86State *env, X86LegacyXSaveArea *fxsave, + abi_ulong fxsave_addr) { struct target_fpx_sw_bytes *sw = (void *)&fxsave->sw_reserved; @@ -548,19 +548,19 @@ static int xrstor_sigcontext(CPUX86State *env, X86LegacyXSaveArea *fxsave, && extended_size >= minimum_size) { if (!access_ok(env_cpu(env), VERIFY_READ, fxsave_addr, extended_size - TARGET_FPSTATE_FXSAVE_OFFSET)) { - return 1; + return false; } magic2 = tswapl(*(uint32_t *)((void *)fxsave + xstate_size)); if (magic2 == TARGET_FP_XSTATE_MAGIC2) { cpu_x86_xrstor(env, fxsave_addr, -1); - return 0; + return true; } } /* fall through to fxrstor */ } cpu_x86_fxrstor(env, fxsave_addr); - return 0; + return true; } static bool restore_sigcontext(CPUX86State *env, struct target_sigcontext *sc) @@ -628,11 +628,11 @@ static bool restore_sigcontext(CPUX86State *env, struct target_sigcontext *sc) cpu_x86_frstor(env, fpstate_addr, 1); ok = true; } else { - ok = !xrstor_sigcontext(env, &fpstate->fxstate, - fpstate_addr + TARGET_FPSTATE_FXSAVE_OFFSET); + ok = xrstor_sigcontext(env, &fpstate->fxstate, + fpstate_addr + TARGET_FPSTATE_FXSAVE_OFFSET); } #else - ok = !xrstor_sigcontext(env, fpstate, fpstate_addr); + ok = xrstor_sigcontext(env, fpstate, fpstate_addr); #endif unlock_user_struct(fpstate, fpstate_addr, 0);