From: "Okamoto, Takayuki" <tokamoto@jp.fujitsu.com>
To: 'Dave Martin' <Dave.Martin@arm.com>
Cc: "linux-arch@vger.kernel.org" <linux-arch@vger.kernel.org>,
"libc-alpha@sourceware.org" <libc-alpha@sourceware.org>,
"Ard Biesheuvel" <ard.biesheuvel@linaro.org>,
"Szabolcs Nagy" <szabolcs.nagy@arm.com>,
"gdb@sourceware.org" <gdb@sourceware.org>,
"Yao Qi" <Yao.Qi@arm.com>, "Alan Hayward" <alan.hayward@arm.com>,
"Will Deacon" <will.deacon@arm.com>,
"Oleg Nesterov" <oleg@redhat.com>,
"Richard Sandiford" <richard.sandiford@arm.com>,
"Alexander Viro" <viro@zeniv.linux.org.uk>,
"Catalin Marinas" <catalin.marinas@arm.com>,
"Alex Bennée" <alex.bennee@linaro.org>,
"kvmarm@lists.cs.columbia.edu" <kvmarm@lists.cs.columbia.edu>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: RE: [PATCH v2 19/28] arm64/sve: ptrace and ELF coredump support
Date: Thu, 07 Sep 2017 05:11:00 -0000 [thread overview]
Message-ID: <5FA513F682BE7F4EAAB8EE035D5B08E44109EBDF@G01JPEXMBKW02> (raw)
In-Reply-To: <20170906181634.GF6321@e103592.cambridge.arm.com>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="gb2312", Size: 4743 bytes --]
Hi Dave,
Thank you for your reply.
> Your fix looks correct and seems to work. For stylistic reasons, I may
> write it like this instead, but the effect should be the same:
>
> header->max_vl = sve_max_vl;
> if (WARN_ON(!sve_vl_valid(sve_max_vl))
> header->max_vl = header->vl;
It is better than my fix.
Please, apply it at next version.
Best regards,
Takayuki Okamoto
> -----Original Message-----
> From: linux-arm-kernel
> [mailto:linux-arm-kernel-bounces@lists.infradead.org] On Behalf Of Dave
> Martin
> Sent: Thursday, September 7, 2017 3:17 AM
> To: Okamoto, Takayuki <tokamoto@jp.fujitsu.com>
> Cc: linux-arch@vger.kernel.org; libc-alpha@sourceware.org; Ard
> Biesheuvel <ard.biesheuvel@linaro.org>; Szabolcs Nagy
> <szabolcs.nagy@arm.com>; gdb@sourceware.org; Yao Qi <Yao.Qi@arm.com>;
> Alan Hayward <alan.hayward@arm.com>; Will Deacon <will.deacon@arm.com>;
> Oleg Nesterov <oleg@redhat.com>; Richard Sandiford
> <richard.sandiford@arm.com>; Alexander Viro <viro@zeniv.linux.org.uk>;
> Catalin Marinas <catalin.marinas@arm.com>; Alex Benn¨¦e
> <alex.bennee@linaro.org>; kvmarm@lists.cs.columbia.edu;
> linux-arm-kernel@lists.infradead.org
> Subject: Re: [PATCH v2 19/28] arm64/sve: ptrace and ELF coredump support
>
> On Wed, Sep 06, 2017 at 04:21:50PM +0000, Okamoto, Takayuki wrote:
> > Hi Dave,
> >
> > I am an engineer of the postK computer from Fujitsu.
> >
> > When I tried to read "max_vl" by ptrace with this patch on our local SVE
> > simulator, it was read as zero.
> > I think the cause of this incident is that "max_vl" is set as "header->vl"
> > only on warning case in sve_init_header_from_task().
> > "max_vl" should be set up also on normal case, like the following patch.
> >
> >
> > --- a/arch/arm64/kernel/ptrace.c
> > +++ b/arch/arm64/kernel/ptrace.c
> > @@ -755,6 +755,8 @@ static void sve_init_header_from_task(struct
> user_sve_header *header,
> >
> > if (WARN_ON(!sve_vl_valid(sve_max_vl)))
> > header->max_vl = header->vl;
> > + else
> > + header->max_vl = sve_max_vl;
> >
> > header->size = SVE_PT_SIZE(vq, header->flags);
> > header->max_size =
> SVE_PT_SIZE(sve_vq_from_vl(header->max_vl),
>
> Hi, thanks for reporting this.
>
> It looks like a refactoring mistake I made while removing BUG_ON()s,
> which I missed in my testing.
>
> Your fix looks correct and seems to work. For stylistic reasons, I may
> write it like this instead, but the effect should be the same:
>
> header->max_vl = sve_max_vl;
> if (WARN_ON(!sve_vl_valid(sve_max_vl))
> header->max_vl = header->vl;
>
> Cheers
> ---Dave
>
> >
> >
> > Best regards,
> > Takayuki Okamoto
> >
> > -----Original Message-----
> > From: gdb-owner@sourceware.org [mailto:gdb-owner@sourceware.org] On
> Behalf Of Dave Martin
> > Sent: Friday, September 1, 2017 2:01 AM
> > To: linux-arm-kernel@lists.infradead.org
> > Cc: Catalin Marinas <catalin.marinas@arm.com>; Will Deacon
> <will.deacon@arm.com>; Ard Biesheuvel <ard.biesheuvel@linaro.org>; Alex
> Benn¨¦e <alex.bennee@linaro.org>; Szabolcs Nagy <szabolcs.nagy@arm.com>;
> Richard Sandiford <richard.sandiford@arm.com>;
> kvmarm@lists.cs.columbia.edu; libc-alpha@sourceware.org;
> linux-arch@vger.kernel.org; gdb@sourceware.org; Alan Hayward
> <alan.hayward@arm.com>; Yao Qi <Yao.Qi@arm.com>; Oleg Nesterov
> <oleg@redhat.com>; Alexander Viro <viro@zeniv.linux.org.uk>
> > Subject: [PATCH v2 19/28] arm64/sve: ptrace and ELF coredump support
> >
>
> [...]
>
> > @@ -702,6 +737,210 @@ static int system_call_set(struct task_struct
> *target,
> > return ret;
> > }
> >
> > +#ifdef CONFIG_ARM64_SVE
> > +
> > +static void sve_init_header_from_task(struct user_sve_header *header,
> > + struct task_struct *target)
> > +{
> > + unsigned int vq;
> > +
> > + memset(header, 0, sizeof(*header));
> > +
> > + header->flags = test_tsk_thread_flag(target, TIF_SVE) ?
> > + SVE_PT_REGS_SVE : SVE_PT_REGS_FPSIMD;
> > + if (test_tsk_thread_flag(target, TIF_SVE_VL_INHERIT))
> > + header->flags |= SVE_PT_VL_INHERIT;
> > +
> > + header->vl = target->thread.sve_vl;
> > + vq = sve_vq_from_vl(header->vl);
> > +
> > + if (WARN_ON(!sve_vl_valid(sve_max_vl)))
> > + header->max_vl = header->vl;
> > +
> > + header->size = SVE_PT_SIZE(vq, header->flags);
> > + header->max_size = SVE_PT_SIZE(sve_vq_from_vl(header->max_vl),
> > + SVE_PT_REGS_SVE);
> > +}
>
> [...]
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
\x16º&ÖëzÛ«}ãYb²Ö«r\x18\x1d
next prev parent reply other threads:[~2017-09-07 5:11 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1504198860-12951-1-git-send-email-Dave.Martin@arm.com>
2017-08-31 17:01 ` [PATCH v2 09/28] arm64/sve: Signal frame and context structure definition Dave Martin
2017-09-13 13:36 ` Catalin Marinas
2017-09-13 21:33 ` Dave Martin
2017-08-31 17:02 ` [PATCH v2 19/28] arm64/sve: ptrace and ELF coredump support Dave Martin
2017-09-06 16:22 ` Okamoto, Takayuki
[not found] ` <20170906181634.GF6321@e103592.cambridge.arm.com>
2017-09-07 5:11 ` Okamoto, Takayuki [this message]
2017-09-08 13:11 ` Dave Martin
2017-09-14 12:57 ` Alex Bennée
2017-09-28 14:57 ` Dave Martin
2017-09-29 12:46 ` Dave Martin
2017-08-31 17:09 ` [PATCH v2 14/28] arm64/sve: Backend logic for setting the vector length Dave Martin
2017-09-13 17:29 ` Catalin Marinas
2017-09-13 19:06 ` Dave Martin
2017-09-13 22:11 ` Catalin Marinas
2017-10-05 16:42 ` Dave Martin
2017-10-05 16:53 ` Catalin Marinas
2017-10-05 17:04 ` Dave Martin
2017-09-20 11:00 ` Alan Hayward
[not found] ` <20170920110902.GG24231@e103592.cambridge.arm.com>
2017-09-20 18:08 ` Alan Hayward
2017-09-21 11:19 ` Dave Martin
2017-09-21 11:57 ` Alan Hayward
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5FA513F682BE7F4EAAB8EE035D5B08E44109EBDF@G01JPEXMBKW02 \
--to=tokamoto@jp.fujitsu.com \
--cc=Dave.Martin@arm.com \
--cc=Yao.Qi@arm.com \
--cc=alan.hayward@arm.com \
--cc=alex.bennee@linaro.org \
--cc=ard.biesheuvel@linaro.org \
--cc=catalin.marinas@arm.com \
--cc=gdb@sourceware.org \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=libc-alpha@sourceware.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=oleg@redhat.com \
--cc=richard.sandiford@arm.com \
--cc=szabolcs.nagy@arm.com \
--cc=viro@zeniv.linux.org.uk \
--cc=will.deacon@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox