linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Will Deacon <will@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 1/2] arm64: kernel: Convert to modern annotations for assembly functions
Date: Thu, 30 Apr 2020 19:12:07 +0100	[thread overview]
Message-ID: <20200430181207.GJ4633@sirena.org.uk> (raw)
In-Reply-To: <20200430171825.GI25258@willie-the-truck>


[-- Attachment #1.1: Type: text/plain, Size: 2946 bytes --]

On Thu, Apr 30, 2020 at 06:18:25PM +0100, Will Deacon wrote:
> On Tue, Apr 28, 2020 at 05:43:30PM +0100, Mark Brown wrote:

> > -work_pending:
> > +SYM_CODE_START_LOCAL(work_pending)
> >  	mov	x0, sp				// 'regs'
> >  	bl	do_notify_resume
> >  #ifdef CONFIG_TRACE_IRQFLAGS
> > @@ -738,10 +738,11 @@ work_pending:
> >  #endif
> >  	ldr	x1, [tsk, #TSK_TI_FLAGS]	// re-check for single-step
> >  	b	finish_ret_to_user
> > +SYM_CODE_END(work_pending)
> >  /*
> >   * "slow" syscall return path.
> >   */
> > -ret_to_user:
> > +SYM_CODE_START_LOCAL(ret_to_user)

> Would this be better off as a SYM_INNER_LABEL inside work_pending? Given
> that ret_to_user and work_pending both branch into each other, separating
> them doesn't feel quite right.

I remember looking at these when doing the conversion and thinking that
nothing looked quite right due to the cross calls :/  The number of
things that branch to ret_to_user made me think it should really be it's
own thing rather than just a label in the middle of another block but
then work_pending is really a subroutine of ret_to_user that uses a
branch rather than a call so how do you annotate that?

Possibly we could move work_pending after the kernel_exit in ret_to_user
and make work_pending the SYM_INNER_LABEL, doing things the opposite way
around to what you suggest?  I think that's more the intent.

> > +SYM_CODE_START_LOCAL(\label)
> >  	b \label
> > -ENDPROC(\label)
> > +SYM_CODE_END(\label)
> >  .endm

> Huh, this is the exact same macro as the one from the hibernate code. Maybe
> we should stick it in asm/asembler.h alongside ventry? Obviously a separate
> patch, though.

I agree.

> > -ENTRY(absolute_data64)
> > +SYM_CODE_START(absolute_data64)
> >  	ldr	x0, 0f
> >  	ret
> >  0:	.quad	sym64_abs
> > -ENDPROC(absolute_data64)
> > +SYM_CODE_END(absolute_data64)

> Hmm, but all the functions in here *are* actually just called from the C
> code in reloc_test_core.c afaict, so they should probably be using
> SYM_FUNC_*.

You're right I think - I remember thinking as I was going through that
since they were explicitly designed to test relocations it might be
important that they emit exactly the instructions that are written but
now I look again the functions are actually called rather than just
linked so we need to emit landing pads for them.

> > -ENTRY(cpu_resume)
> > +SYM_FUNC_START(cpu_resume)
> >  	bl	el2_setup		// if in EL2 drop to EL1 cleanly
> >  	mov	x0, #ARM64_CPU_RUNTIME
> >  	bl	__cpu_setup
> > @@ -107,11 +107,11 @@ ENTRY(cpu_resume)
> >  	bl	__enable_mmu
> >  	ldr	x8, =_cpu_resume
> >  	br	x8
> > -ENDPROC(cpu_resume)
> > +SYM_FUNC_END(cpu_resume)

> SYM_CODE_* here, as this is I think this is the entry point from the resume
> path?

It has a C prototype in asm/suspend.h and swsup_arch_suspend_exit in
hibernate-asm.S runs earlier but now I look again it jumps here by
issuing a ret rather than via a call so it's definitely not a normal C
function.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-04-30 18:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-28 16:43 [PATCH 0/2] arm64: Finish up assembler annotation modernisation Mark Brown
2020-04-28 16:43 ` [PATCH 1/2] arm64: kernel: Convert to modern annotations for assembly functions Mark Brown
2020-04-30 17:18   ` Will Deacon
2020-04-30 18:12     ` Mark Brown [this message]
2020-04-28 16:43 ` [PATCH 2/2] arm64: Disable old style assembly annotations Mark Brown

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=20200430181207.GJ4633@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=will@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).