From patchwork Tue May 19 02:53:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 186913 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp3448181ilb; Mon, 18 May 2020 19:58:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1OKG3LU1udMERh/FFrQUs2eMQBiZKWekjRf7Ik1zAA3981ROjTBR+wARzqPxAG0RDb6jt X-Received: by 2002:a0c:aa4c:: with SMTP id e12mr6478190qvb.12.1589857119435; Mon, 18 May 2020 19:58:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589857119; cv=none; d=google.com; s=arc-20160816; b=KW+0XtKUq4ROzbXjY0kOKQy5IKH5hZcUCcCQutS7tU8RrKfN7EXA5rzuAdcGe2KXwG onA2zcWNkPpqerIXjeKJ4dsxMR0PdoVUV1O+0l5YP8Ar5RSUAHKEX6zhuVlDnQQApgAe PD5LpQhlOts5ASV6wkFpS1psRuPc+xP4BWYK7Uk3Hiho0ndxHAdwA9KQlHJJ04Bcq6Gv 5y6DxLofvwtmfQlFEyr5TScp9HLqJ+CkpR9lBJFMC6YMhsccVpd+QDRWZ4l1YBtdXCKX eOQ9ZukjP1QM8CzY1SXV/j9Vb6+jNdaNtf6uZDE/9+iZ9q6ilT49HsP/7Hvbp4B0Cf8t znQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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=ilYiYwfPbx2qQQFy7b/Ot3fVz/Ep7kBx5xS7fCDZud0=; b=ev3dszGKo7WjD2TnV33aQ64PLJ0iivc1G4pamRNhBgTYd1ZNMNf5eyHzHfZiZcko1+ 8dgK+gvlX6d+EaD28aZ9CFJdgtGFR9xmf+56Zh0+EnxIdxzAovbvPSvGmQNqzp7C5VqW 3o55z5qxFiqaeiRVtISRDBHgGuCHlvA86Jj1bO9ZeR+17G5MuDEUXv2ovt3WdtK+jky5 xS1arz4yhdUrZxJ9gFlK6H2ZklkzLZzfPhadxynb28aPOxZRB1P2ETSD8HDqRbs1C6bI NA914+lciV62sovd/kBTLvjHy3QHkd2WfJYNcMB1VEB2gwk2v76qkxlztgyxNvXmy+D7 wGjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XNRpgroy; 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 h22si6724653qtq.95.2020.05.18.19.58.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 18 May 2020 19:58:39 -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=XNRpgroy; 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]:51192 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jasSk-0006u0-VW for patch@linaro.org; Mon, 18 May 2020 22:58:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46912) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jasOa-0005eY-JB for qemu-devel@nongnu.org; Mon, 18 May 2020 22:54:20 -0400 Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]:36789) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jasOZ-0002W4-J0 for qemu-devel@nongnu.org; Mon, 18 May 2020 22:54:20 -0400 Received: by mail-pg1-x52e.google.com with SMTP id c75so4728850pga.3 for ; Mon, 18 May 2020 19:54:18 -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=ilYiYwfPbx2qQQFy7b/Ot3fVz/Ep7kBx5xS7fCDZud0=; b=XNRpgroyCQAQtseX2XqU1SxiCNiUdWkvLOClEGW2w2byClMHpPILQjbm3tAkZ6YQ0g SfGgG8p3EXxa0Wd3tk2nxhJ4crqtL0NEH9KxFD9R9noOnsPwWK0OpNijQjWN90xq5TAx 0dXwoyx83BTY3sTmExGR8HoefpZCyhTvWg/sV1Et2PfoZXVDtmVNfuDE6f2UY0xD51uz aGL/FSFwobTo6zP/aNGzBQ8Yen/pt++uzgG4zLrascyU7XGbQ4fKiJyR6UnGwNRWELKM znAmUibRLqCoV66szH5xxZ3I9pLEvAdhsWyw5aEVjSmDj9vpu0OKVwsPR5Vo1IWcRu6y cWdQ== 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=ilYiYwfPbx2qQQFy7b/Ot3fVz/Ep7kBx5xS7fCDZud0=; b=cdnJd0ctj3DJdDE+8raOL21BxgHt1xzebRgbqppXwRShlJ7kOV6f6WLFddaGCKzmS1 OT4VbFHGIVTdb1mM/2qpiN5B11p78MawE7JMfculAJsAItgMo5DLOAUUIe8oUV1wtVwL lmSh5qRztiiQ4qAhjAJ+ODr3K4xHmpNaeAyS8U+4zs1HAcsqW+GgDDdGhEfMcHMAEd7L f0OMmQBC2QXQeMGRVwrY9fWcHUfTXelgmD4gygPVKQdl4j9vtuNx8RowKzXY3U2D1bY0 KvF7r/sdaTxaAFNEWmuzLCn17QL0TKQdfxvvk9SrL/8Ng+M45EO/17JVCf6tCaqF4BHE ioyw== X-Gm-Message-State: AOAM531UJz2FIeXD+6Xbb6k2uALvWq3BWl2+zXrxN5IiUrHijVmhki6I i8jKsfXDo2gQdaBhNOREbRVrIkUAdMY= X-Received: by 2002:a63:5114:: with SMTP id f20mr11932150pgb.148.1589856857419; Mon, 18 May 2020 19:54:17 -0700 (PDT) Received: from localhost.localdomain (174-21-143-238.tukw.qwest.net. [174.21.143.238]) by smtp.gmail.com with ESMTPSA id a2sm8772418pgh.57.2020.05.18.19.54.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 May 2020 19:54:16 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [RISU v2 15/17] Compute reginfo_size based on the reginfo Date: Mon, 18 May 2020 19:53:53 -0700 Message-Id: <20200519025355.4420-16-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200519025355.4420-1-richard.henderson@linaro.org> References: <20200519025355.4420-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52e; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52e.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: peter.maydell@linaro.org, alex.bennee@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This will allow dumping of SVE frames without having to know the SVE vector length beforehand. Signed-off-by: Richard Henderson --- risu.h | 2 +- reginfo.c | 6 +++--- risu_reginfo_aarch64.c | 4 ++-- risu_reginfo_arm.c | 2 +- risu_reginfo_i386.c | 2 +- risu_reginfo_m68k.c | 2 +- risu_reginfo_ppc64.c | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) -- 2.20.1 Reviewed-by: Alex Bennée diff --git a/risu.h b/risu.h index eeb6775..054cef7 100644 --- a/risu.h +++ b/risu.h @@ -155,6 +155,6 @@ int reginfo_dump(struct reginfo *ri, FILE * f); int reginfo_dump_mismatch(struct reginfo *m, struct reginfo *a, FILE *f); /* return size of reginfo */ -const int reginfo_size(void); +int reginfo_size(struct reginfo *ri); #endif /* RISU_H */ diff --git a/reginfo.c b/reginfo.c index f187d9c..411c2a6 100644 --- a/reginfo.c +++ b/reginfo.c @@ -38,7 +38,7 @@ RisuResult send_register_info(void *uc) case OP_TESTEND: case OP_COMPARE: case OP_SIGILL: - header.size = reginfo_size(); + header.size = reginfo_size(&ri); extra = &ri; break; @@ -109,7 +109,7 @@ RisuResult recv_and_compare_register_info(void *uc) case OP_TESTEND: case OP_COMPARE: case OP_SIGILL: - extra_size = reginfo_size(); + extra_size = reginfo_size(&master_ri); break; case OP_SETMEMBLOCK: case OP_GETMEMBLOCK: @@ -217,7 +217,7 @@ void report_mismatch_header(void) case OP_COMPARE: case OP_SIGILL: kind = "reginfo"; - a_sz = reginfo_size(); + a_sz = reginfo_size(&apprentice_ri); break; case OP_SETMEMBLOCK: case OP_GETMEMBLOCK: diff --git a/risu_reginfo_aarch64.c b/risu_reginfo_aarch64.c index 028c690..7044648 100644 --- a/risu_reginfo_aarch64.c +++ b/risu_reginfo_aarch64.c @@ -69,7 +69,7 @@ void process_arch_opt(int opt, const char *arg) #endif } -const int reginfo_size(void) +int reginfo_size(struct reginfo *ri) { int size = offsetof(struct reginfo, simd.end); #ifdef SVE_MAGIC @@ -194,7 +194,7 @@ void reginfo_init(struct reginfo *ri, ucontext_t *uc) /* reginfo_is_eq: compare the reginfo structs, returns nonzero if equal */ int reginfo_is_eq(struct reginfo *r1, struct reginfo *r2) { - return memcmp(r1, r2, reginfo_size()) == 0; + return memcmp(r1, r2, reginfo_size(r1)) == 0; } #ifdef SVE_MAGIC diff --git a/risu_reginfo_arm.c b/risu_reginfo_arm.c index 3662f12..3832e27 100644 --- a/risu_reginfo_arm.c +++ b/risu_reginfo_arm.c @@ -36,7 +36,7 @@ void process_arch_opt(int opt, const char *arg) abort(); } -const int reginfo_size(void) +int reginfo_size(struct reginfo *ri) { return sizeof(struct reginfo); } diff --git a/risu_reginfo_i386.c b/risu_reginfo_i386.c index 60fc239..902d33e 100644 --- a/risu_reginfo_i386.c +++ b/risu_reginfo_i386.c @@ -74,7 +74,7 @@ void process_arch_opt(int opt, const char *arg) } } -const int reginfo_size(void) +int reginfo_size(struct reginfo *ri) { return sizeof(struct reginfo); } diff --git a/risu_reginfo_m68k.c b/risu_reginfo_m68k.c index 32b28c8..361f172 100644 --- a/risu_reginfo_m68k.c +++ b/risu_reginfo_m68k.c @@ -23,7 +23,7 @@ void process_arch_opt(int opt, const char *arg) abort(); } -const int reginfo_size(void) +int reginfo_size(struct reginfo *ri) { return sizeof(struct reginfo); } diff --git a/risu_reginfo_ppc64.c b/risu_reginfo_ppc64.c index 071c951..c86313c 100644 --- a/risu_reginfo_ppc64.c +++ b/risu_reginfo_ppc64.c @@ -32,7 +32,7 @@ void process_arch_opt(int opt, const char *arg) abort(); } -const int reginfo_size(void) +int reginfo_size(struct reginfo *ri) { return sizeof(struct reginfo); }