RE: [PATCH] usb: gadget: f_fs: OS descriptors support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Michal Nazarewicz
...
> > Alternatively it shouldn't be 'packed', and a full audit of the
> > other structures done to determine which ones can ever be misaligned
> > and then determine whether that should actually be allowed.
> 
> All of the structures describe a wire protocol, whether we thing the
> structure can be allowed or not is inconsequential since that's what is
> being used.  All of those structures must be packed.

That just isn't true.
Just because a structure maps a protocol packet doesn't mean it has
to be 'packed'.
The TCP stack doesn't mark anything 'packed'.
It relies on the ethernet driver correctly aligning receive messages.

There is a significant cost is accessing a 32bit field from an aligned
offset in a packed structure on every cpu that can't itself perform
misaligned transfers, this is about everything except vax, x86 and
some very recent arm chips (windows was never doing to run on arm
without hardware support for misaligned transfers).

Not the least of the reasons for hardware not supporting misaligned
transfers is the difficulty with faults on writes that cross page
boundaries (or require software TLB lookups).

	David

��.n��������+%������w��{.n�����{���)��jg��������ݢj����G�������j:+v���w�m������w�������h�����٥





[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux