lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AANLkTi=RSpXHRpoZJsGLhVgQ=E=tcNGm8GXYC9UPaDrA@mail.gmail.com>
Date:	Mon, 17 Jan 2011 09:56:50 +0000
From:	Catalin Marinas <catalin.marinas@....com>
To:	"Stanley.Miao" <stanley.miao@...driver.com>
Cc:	linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH 1/3] Support BE8 mode kernel modules relocation

On 17 January 2011 08:42, Stanley.Miao <stanley.miao@...driver.com> wrote:
> The code section in BE8 kernel modules is in little-endian while data
> section is in big-endian. When reading code from memory in the relocation
> procedure, these instructions are read according to big-endian, so they
> need to be inverted before writing to memory and after reading from memory.
[...]
> --- a/arch/arm/include/asm/io.h
> +++ b/arch/arm/include/asm/io.h
> @@ -233,6 +233,18 @@ extern void _memset_io(volatile void __iomem *, int, size_t);
>
>  #endif /* __mem_pci */
>
> +#ifdef CONFIG_CPU_ENDIAN_BE8
> +#define read_instr32(c)                        __swab32(*(u32 *)c)
> +#define read_instr16(c)                        __swab16(*(u16 *)c)
> +#define write_instr32(v,a)             (*(u32 *)(a) = __swab32((__force __u32)(v)))
> +#define write_instr16(v,a)             (*(u16 *)(a) = __swab16((__force __u16)(v)))
> +#else
> +#define read_instr32(c)                        (*(u32 *)c)
> +#define read_instr16(c)                        (*(u16 *)c)
> +#define write_instr32(v,a)             (*(u32 *)(a) = (v))
> +#define write_instr16(v,a)             (*(u16 *)(a) = (v))
> +#endif

Can we not use cpu_to_le32 etc in here (and as Russell said, they are
not really IO)?

-- 
Catalin
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ