From patchwork Fri Dec 1 16:27:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 81150 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 13854384DEDD for ; Fri, 1 Dec 2023 16:32:17 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 56AB2386184E for ; Fri, 1 Dec 2023 16:32:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 56AB2386184E Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=efficios.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=efficios.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 56AB2386184E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701448321; cv=none; b=bpGycAh5Un+GjSBqlb9c7ILiMtZBuujxMwfym9xwOeas/mwNelmPJmqJPixm7iJZK1dXe4PMrvB/PiDsKmMcVx1P0INwyOpQ6SmOm0msgLcAex4ZKUmK3+8MY4zMiHqCvUIACpJ09cY+7ZJzAFopqP1V1FWnkXsQB6+XGx+nciA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701448321; c=relaxed/simple; bh=4Foo7mPvNMENsXQkmUW1UZtUjDywn2d9aMWNReZPNfM=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=dGzF086jD3SS7BEgMoZzUh76D8AX3BuYSRKwVH9lLikvAhYPg0oe8K1bUo0luTAP7sSAUjfzZaWAXm6BWE1oWceNHojO0GEozIq8M3x/bKVmM0LYyvHSqfN3Xylo0uXvVnVidN8MCsgFwLIRmLRG6Jl/h3Kk2Y8tah87aapApMM= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from smarchi-efficios.internal.efficios.com (192-222-143-198.qc.cable.ebox.net [192.222.143.198]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 9297A1E11E; Fri, 1 Dec 2023 11:31:59 -0500 (EST) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Luis Machado , John Baldwin , "Aktemur, Tankut Baris" , Simon Marchi , John Baldwin Subject: [PATCH 20/24] gdb: add missing raw register read in aarch64_sme_pseudo_register_write Date: Fri, 1 Dec 2023 11:27:33 -0500 Message-ID: <20231201162751.741751-21-simon.marchi@efficios.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231201162751.741751-1-simon.marchi@efficios.com> References: <20231201162751.741751-1-simon.marchi@efficios.com> MIME-Version: 1.0 X-Spam-Status: No, score=-3496.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_NONE, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_SOFTFAIL, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org It seems like the intention here is to read the contents of the ZA register and only write part of it. However, there's no actual read of the ZA register, so it looks like we'll write uninitialized bytes to the target, for the portion of the raw register where we don't write the pseudo register. Add a call to raw_read to fix this. I don't know how to test this though. Change-Id: I7548240bd4324f6a3b729a1ebf7502fae5a46e9e Reviewed-By: John Baldwin Approved-by: Luis Machado --- gdb/aarch64-tdep.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c index 5c3b824ed0ad..e3658c2c8e10 100644 --- a/gdb/aarch64-tdep.c +++ b/gdb/aarch64-tdep.c @@ -3337,6 +3337,7 @@ aarch64_sme_pseudo_register_write (struct gdbarch *gdbarch, /* Fetch the contents of ZA. */ size_t svl = sve_vl_from_vq (tdep->sme_svq); gdb::byte_vector za (std::pow (svl, 2)); + regcache->raw_read (tdep->sme_za_regnum, za); /* Copy the requested data. */ for (int chunks = 0; chunks < offsets.chunks; chunks++)