]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
arm64/sve: ptrace: Fix SVE_PT_REGS_OFFSET definition
authorDave Martin <Dave.Martin@arm.com>
Fri, 4 Jan 2019 13:09:50 +0000 (13:09 +0000)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
BugLink: https://bugs.launchpad.net/bugs/1837664
[ Upstream commit ee1b465b303591d3a04d403122bbc0d7026520fb ]

SVE_PT_REGS_OFFSET is supposed to indicate the offset for skipping
over the ptrace NT_ARM_SVE header (struct user_sve_header) to the
start of the SVE register data proper.

However, currently SVE_PT_REGS_OFFSET is defined in terms of struct
sve_context, which is wrong: that structure describes the SVE
header in the signal frame, not in the ptrace regset.

This patch fixes the definition to use the ptrace header structure
struct user_sve_header instead.

By good fortune, the two structures are the same size anyway, so
there is no functional or ABI change.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
arch/arm64/include/uapi/asm/ptrace.h

index 98c4ce55d9c360518c2a527b26153403be5c5463..ad64d2c92ef53d8d8cf063c534e600c9a4f474d9 100644 (file)
@@ -130,7 +130,7 @@ struct user_sve_header {
 
 /* Offset from the start of struct user_sve_header to the register data */
 #define SVE_PT_REGS_OFFSET                                     \
-       ((sizeof(struct sve_context) + (SVE_VQ_BYTES - 1))      \
+       ((sizeof(struct user_sve_header) + (SVE_VQ_BYTES - 1))  \
                / SVE_VQ_BYTES * SVE_VQ_BYTES)
 
 /*