From nobody Thu Dec 18 22:25:38 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1591117677; cv=none; d=zohomail.com; s=zohoarc; b=B96CcgwYfdVS3b6mpiVD4a7lXGYMpKaR8+e+s+Bskfd+m+FhvqEp5NL+HUn3wmAvibwRbcwCHbXf59wIirLm6/6DrcUhB82FA5u34wAIOEHYXy4BPWhdtSZEQ06xDzmWPNzS/q3C2ZAAH8+X/lc4x7Kmc1TR5n8FJVq7bTyO25k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591117677; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=v9PYVllY3D8WNVt+/GwKgHsq/9t/7VocWb4hJT0OXq8=; b=Flzmg2WAnbhh8HIURXFc3l+hcgOUh17D5hU0g7k8l/e/OHN0kwsIaQdRvA6DvZnZ4cKaelqbk9pJRjfa72CEhbeFxRQKXUX0CY8pVN9VoDbDuLLE6zjGaCXc2+XvQoyykxDcY/QMgK2tFQOj2NmOMTOn6PWzvQVHLeUO6PM/8fU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1591117677160429.2817924978659; Tue, 2 Jun 2020 10:07:57 -0700 (PDT) Received: from localhost ([::1]:39988 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jgAOH-00005j-VQ for importer@patchew.org; Tue, 02 Jun 2020 13:07:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39832) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jgAIl-00060q-U6 for qemu-devel@nongnu.org; Tue, 02 Jun 2020 13:02:11 -0400 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]:46880) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jgAIk-0007R9-UV for qemu-devel@nongnu.org; Tue, 02 Jun 2020 13:02:11 -0400 Received: by mail-pg1-x542.google.com with SMTP id p21so5331777pgm.13 for ; Tue, 02 Jun 2020 10:02:10 -0700 (PDT) Received: from localhost.localdomain (174-21-143-238.tukw.qwest.net. [174.21.143.238]) by smtp.gmail.com with ESMTPSA id h11sm2723630pjk.20.2020.06.02.10.02.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2020 10:02:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=v9PYVllY3D8WNVt+/GwKgHsq/9t/7VocWb4hJT0OXq8=; b=DUdqWApC0mD3QNG3NHWDAoEp6AeMLviM5Ltzd//uViT8ztuR4zhDiIqWpXr8/67See DBbv3ps0XeHWqfy5gDGJKoSe3w0SkUw6rBUX/HcbMMA1UuYVlqL0YPjmsYT1Ygp0SZ/i gicj2s4i7z9llKYQXZtGzUiSRxHLHoGsxZAJTt8+Kb5td8eV2pscyBNwTfW05KMG5uxq iCMwW9APn96zQABSKcKQrd9xiEdjX8J1Djh5/Qd7bGE27yGlQhX2Zm3Z7yN6T7UiB/xX fLp3MljyRaQDUs6opaP3wuWiJUnsyg2l0rpuZx26hMTpLTHNGAMu0RlRM+g/EsWXhSWs gmFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=v9PYVllY3D8WNVt+/GwKgHsq/9t/7VocWb4hJT0OXq8=; b=adnptLaXCCpg3TrKqa90JRjmlCJrH5PtgwxD3RxDxcWExqRTv+BTkEar6tDybZZs0k 2P9IhhFQ9SgEs1GMdY1mtZwjvn9Pb9QmtLXqKlebhNzVAUCZnxbn2+3NmlnGuZqu+4cy JMNfha9NFaT3tvtPqReNAtqrL/OOnujankwG9rNAxUhvLvwW11ylqfscehYhC7puWRtM X23UECNUZtM9gfayG3/3fFbZwtQvBu++4fpa2yzkqy4LWjLwgKrQZPOHaBw88J5nPUEM C2i0Jx99Oc9fSfRe+V+xmvj1C2Rfa1t/MiA6R9a9Sa4qMogJIEIE0fDJsMcfeJuNbWYi 04ew== X-Gm-Message-State: AOAM533yVJRc7WBYXYhp091KzKPsLNRFcCsHsdD0A0ZR9zw2atarrK6i ukvczWTgGTXYucd50KQYMK/fJrISv2A= X-Google-Smtp-Source: ABdhPJxoPtaqaA0Y5mlpcLKtnsmfYi2cp5VbxYGp+2HlAU6LEsWJ3NWxdThCpMZSdrSE2iiuNHGFlQ== X-Received: by 2002:a63:724a:: with SMTP id c10mr24670392pgn.130.1591117328540; Tue, 02 Jun 2020 10:02:08 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 11/12] accel/tcg: Adjust cpu_signal_handler for NetBSD/arm Date: Tue, 2 Jun 2020 10:01:50 -0700 Message-Id: <20200602170151.321389-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200602170151.321389-1-richard.henderson@linaro.org> References: <20200602170151.321389-1-richard.henderson@linaro.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::542; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x542.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nick Hudson , peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Nick Hudson Fix building on NetBSD/arm by extracting the FSR value from the correct siginfo_t field. Reviewed-by: Richard Henderson Signed-off-by: Nick Hudson Message-Id: <20200516154147.24842-1-skrll@netbsd.org> Signed-off-by: Richard Henderson --- accel/tcg/user-exec.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c index 52359949df..bc391eb454 100644 --- a/accel/tcg/user-exec.c +++ b/accel/tcg/user-exec.c @@ -517,6 +517,7 @@ int cpu_signal_handler(int host_signum, void *pinfo, =20 #if defined(__NetBSD__) #include +#include #endif =20 int cpu_signal_handler(int host_signum, void *pinfo, @@ -525,10 +526,12 @@ int cpu_signal_handler(int host_signum, void *pinfo, siginfo_t *info =3D pinfo; #if defined(__NetBSD__) ucontext_t *uc =3D puc; + siginfo_t *si =3D pinfo; #else ucontext_t *uc =3D puc; #endif unsigned long pc; + uint32_t fsr; int is_write; =20 #if defined(__NetBSD__) @@ -539,10 +542,17 @@ int cpu_signal_handler(int host_signum, void *pinfo, pc =3D uc->uc_mcontext.arm_pc; #endif =20 - /* error_code is the FSR value, in which bit 11 is WnR (assuming a v6 = or - * later processor; on v5 we will always report this as a read). +#ifdef __NetBSD__ + fsr =3D si->si_trap; +#else + fsr =3D uc->uc_mcontext.error_code; +#endif + /* + * In the FSR, bit 11 is WnR, assuming a v6 or + * later processor. On v5 we will always report + * this as a read, which will fail later. */ - is_write =3D extract32(uc->uc_mcontext.error_code, 11, 1); + is_write =3D extract32(fsr, 11, 1); return handle_cpu_signal(pc, info, is_write, &uc->uc_sigmask); } =20 --=20 2.25.1