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>] [day] [month] [year] [list]
Message-ID: <AANLkTinA0X6Vb8=RL6x-H_A0HMF2xRfRvmSJHh1dJyE3@mail.gmail.com>
Date:	Wed, 29 Sep 2010 16:48:06 +0900
From:	Grant Likely <grant.likely@...retlab.ca>
To:	Michal Simek <monstr@...str.eu>
Cc:	linux-kernel@...r.kernel.org, john.williams@...alogix.com,
	edgar.iglesias@...il.com, duyl@...inx.com, linnj@...inx.com,
	microblaze-uclinux@...e.uq.edu.au
Subject: Re: [PATCH 7/7] microblaze: Add support for little-endian Microblaze

On Wed, Sep 29, 2010 at 4:31 PM, Michal Simek <monstr@...str.eu> wrote:
>
>
> 2010/9/29 Grant Likely <grant.likely@...retlab.ca>
>>
>> On Wed, Sep 29, 2010 at 03:52:18PM +1000, Michal Simek wrote:
>> > Microblaze little-endian toolchain exports __MICROBLAZEEL__
>> > which is used in the kernel to identify little/big endian.
>> >
>> > The most of the changes are in loading values from DTB which
>> > is always big endian.
>> >
>> > Little endian platforms are based on new AXI bus which has
>> > impact to early uartlite initialization.
>> >
>> > Signed-off-by: Michal Simek <monstr@...str.eu>
>>
>> Hi Michal,
>>
>> Looks pretty good, but a few comments below.
>>
>> > @@ -87,7 +88,7 @@ static int __init early_init_dt_scan_serial(unsigned
>> > long node,
>> >  /* this function is looking for early uartlite console - Microblaze
>> > specific */
>> >  int __init early_uartlite_console(void)
>> >  {
>> > -     return of_scan_flat_dt(early_init_dt_scan_serial, NULL);
>> > +     return be32_to_cpu(of_scan_flat_dt(early_init_dt_scan_serial,
>> > NULL));
>>
>> of_scan_flat_dt returns a rc that should already by in cpu endianess.
>> of_scan_flat_dt needs to be fixed instead.
>
> It is easy to do it. I will generate patch for it. It is in drivers/of/fdt.c

Oops, I told you the wrong thing.  the fix needs to be made in
early_init_dt_scan_serial().  of_scan_flat_dt() is just fine.

>> diff --git a/arch/microblaze/kernel/vmlinux.lds.S
>> b/arch/microblaze/kernel/vmlinux.lds.S
>> index 20b0552..96a88c3 100644
>> --- a/arch/microblaze/kernel/vmlinux.lds.S
>> +++ b/arch/microblaze/kernel/vmlinux.lds.S
>> @@ -15,7 +15,11 @@ ENTRY(microblaze_start)
>>  #include <asm-generic/vmlinux.lds.h>
>>  #include <asm/thread_info.h>
>>
>> +#ifdef __MICROBLAZEEL__
>> +jiffies = jiffies_64;
>> +#else
>>  jiffies = jiffies_64 + 4;
>> +#endif
>
>> I comment would go nicely hear to explain to reviewers what this is
>> about.
>
> 1. It is the same what ARM and MIPS (maybe other) have.
>
> 2. Look at this example
> Store 64 bit value ("0x12345678 90abcdef") on little and big endian.
>
> a) big endian
> it is just copying values to the memory.
> 0x0 = 0x12345678
> 0x4 = 0x90abcdef
>
> Address 0 is start of jiffies_64
> and you just want to point on the last (smallest) 32 bit which is on offset
> 0x4 - which is jiffies.
>
> b) little endian
> The same case for little endian
> 0x0 = 0xefcdab90
> 0x4 = 0x78563412
>
> Address 0 is start of jiffies_64
> and you just want to point on the last (smallest) 32 bit which is on offset
> 0x0 - which is jiffies.

Ah, okay.  jiffies_64 is a pointer (I couldn't be bothered to look at
the definition of jiffies it in context).

g.
--
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