Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1222360

Re: [PATCH] ARM: fix alignement of __bug_table section entries

From Russell King - ARM Linux <linux@arm.linux.org.uk>
Newsgroups linux.kernel
Subject Re: [PATCH] ARM: fix alignement of __bug_table section entries
Date 2015-09-10 21:20 +0200
Message-ID <q7fy2-2fT-11@gated-at.bofh.it> (permalink)
References (5 earlier) <q5S0N-5r9-9@gated-at.bofh.it> <q6uz8-26l-21@gated-at.bofh.it> <q6xnl-6ba-23@gated-at.bofh.it> <q6WOK-GC-9@gated-at.bofh.it> <q7fol-22E-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Sep 10, 2015 at 09:01:41PM +0200, Robert Jarzmik wrote:
> And I have the proof of gcc optimization, which I'll add to the commit message
> if you want :
> 00000728 <do_alignment>:
>      ...
>      770:	ee134f10 	mrc	15, 0, r4, cr3, cr0, {0}
>      ... no r4 or mrc/mcr usage
>      788:	e3842030 	orr	r2, r4, #48	; 0x30
>      ... no r2/r4 or mrc/mcr usage
>      794:	ee032f10 	mcr	15, 0, r2, cr3, cr0, {0}
>      798:	ee07cf95 	mcr	15, 0, ip, cr7, cr5, {4}
>      ... no r4 or mrc/mcr usage
>      7ac:	e3c4300c 	bic	r3, r4, #12
>      7b0:	e3833004 	orr	r3, r3, #4
>      7b4:	ee033f10 	mcr	15, 0, r3, cr3, cr0, {0}
>      ... no mrc/mcr usage
>      7cc:	ebfffffe 	bl	0 <arm_copy_from_user>
> 
> Here, we have in probe_kernel_address() in do_alignment():
>  - @770 : r4 = DACR
>  - @794 : DACR = r4 | 0x30
>  - @7b4 : DACR = (r4 & 0x0c) | 0x04 => the 0x30 is lost !!!
> 
> I'll send my patch to the mailing list tomorrow, as well as the other one to
> align the __bug_table session.

I've been wondering whether we can teach GCC that set_domain modifies
the value that get_domain returns, rather than throwing a volatile
onto the asm in get_domain.  The issue with a volatile there is that
even if the result is unused, but the code is reachable, gcc still has
to output the code to read the register.

We might be able to get away with a memory clobber on the set_domain,
and fake a memory read in get_domain, eg, by passing
	"m" (current_thread_info()->cpu_domain))
to the get_domain asm.

-- 
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH] ARM: fix alignement of __bug_table section entries Robert Jarzmik <robert.jarzmik@free.fr> - 2015-09-08 19:10 +0200
  Re: [PATCH] ARM: fix alignement of __bug_table section entries Russell King - ARM Linux <linux@arm.linux.org.uk> - 2015-09-08 22:10 +0200
    Re: [PATCH] ARM: fix alignement of __bug_table section entries Robert Jarzmik <robert.jarzmik@free.fr> - 2015-09-08 23:00 +0200
    Re: [PATCH] ARM: fix alignement of __bug_table section entries Robert Jarzmik <robert.jarzmik@free.fr> - 2015-09-10 01:20 +0200
      Re: [PATCH] ARM: fix alignement of __bug_table section entries Robert Jarzmik <robert.jarzmik@free.fr> - 2015-09-10 21:10 +0200
        Re: [PATCH] ARM: fix alignement of __bug_table section entries Russell King - ARM Linux <linux@arm.linux.org.uk> - 2015-09-10 21:20 +0200
          Re: [PATCH] ARM: fix alignement of __bug_table section entries Robert Jarzmik <robert.jarzmik@free.fr> - 2015-09-10 23:00 +0200
            Re: [PATCH] ARM: fix alignement of __bug_table section entries Russell King - ARM Linux <linux@arm.linux.org.uk> - 2015-09-11 12:00 +0200
              [PATCH 2/2] ARM: domains: add memory dependencies to  get_domain/set_domain Russell King <rmk+kernel@arm.linux.org.uk> - 2015-09-11 12:00 +0200
                Re: [PATCH 2/2] ARM: domains: add memory dependencies to get_domain/set_domain Robert Jarzmik <robert.jarzmik@free.fr> - 2015-09-11 17:10 +0200
                Re: [PATCH 2/2] ARM: domains: add memory dependencies to  get_domain/set_domain Russell King - ARM Linux <linux@arm.linux.org.uk> - 2015-09-11 17:20 +0200
                Re: [PATCH 2/2] ARM: domains: add memory dependencies to get_domain/set_domain Robert Jarzmik <robert.jarzmik@free.fr> - 2015-09-11 17:50 +0200
              [PATCH 1/2] ARM: domains: thread_info.h no longer needs asm/domains.h Russell King <rmk+kernel@arm.linux.org.uk> - 2015-09-11 12:00 +0200

csiph-web