git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Lars Schneider <larsxschneider@gmail.com>
Cc: "Andreas Schwab" <schwab@suse.de>,
	git@vger.kernel.org, "Marc Stevens" <marc@marc-stevens.nl>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: Re: Unaligned accesses in sha1dc
Date: Thu, 01 Jun 2017 18:53:56 +0900	[thread overview]
Message-ID: <xmqqwp8w3uff.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <5100A096-EBAC-4B01-A94D-69D31093148D@gmail.com> (Lars Schneider's message of "Thu, 1 Jun 2017 11:21:31 +0200")

Lars Schneider <larsxschneider@gmail.com> writes:

>> On 01 Jun 2017, at 10:28, Andreas Schwab <schwab@suse.de> wrote:
>> 
>> The sh1dc implementation is making unaligned accesses, which will crash
>> on some architectures, others have to emulate them in software.
>
> Is SPARC an architecture that would run into this problem? I think
> there was a thread a few days ago about this...
>
> What architectures are affected by this? I think I read somewhere
> that ARM requires aligned accesses, too, right?
>
> I wonder if it makes sense to emulate SPARC/ARM/... with QEMU on TravisCI [1].
> Is this what you had in mind with "emulate" or do you see a better way?

I think Andreas's "emulate" is that on these architectures often the
kernel catches the hardware trap and makes the unaligned access
appear to "just work" to the userland software, just like in very
old days, i386 and i486 without 387/487 used software floating point
"emulation" to give illusion to the userland softare that the co
processor was available.

Having to trap and emulate of course costs cycles, and if the
userland is written in such a way not to do an unaligned access in
the first place.

Depending on the model of "ARM" (or "SPARC") emulated with QEMU, and
depending on the OS that runs on such an "ARM" or "SPARC", we may
not see this---if the emulated OS has the "software unaligned-access
emulation" our userland may not see a SIGBUS.

  reply	other threads:[~2017-06-01  9:54 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-01  8:28 Unaligned accesses in sha1dc Andreas Schwab
     [not found] ` <CDB32E2C-48AF-4636-B921-4C45B614FD35@marc-stevens.nl>
2017-06-01  9:05   ` Andreas Schwab
2017-06-01  9:15 ` Junio C Hamano
2017-06-01  9:15   ` Andreas Schwab
2017-06-01  9:34     ` Junio C Hamano
2017-06-01  9:18 ` brian m. carlson
2017-06-01  9:32   ` Andreas Schwab
2017-06-01  9:21 ` Lars Schneider
2017-06-01  9:53   ` Junio C Hamano [this message]
2017-06-01 10:08     ` Andreas Schwab
2017-06-01 10:26       ` Martin Ågren
2017-06-01 10:33         ` Ævar Arnfjörð Bjarmason
2017-06-01 11:53           ` Martin Ågren
2017-06-01 15:57             ` Martin Ågren
2017-06-02  0:15               ` Junio C Hamano
2017-06-02  8:51                 ` Ævar Arnfjörð Bjarmason
2017-06-02  9:49                   ` Martin Ågren
2017-06-02 19:32                     ` Ævar Arnfjörð Bjarmason
2017-06-02 20:11                       ` Martin Ågren
2017-06-02 20:14                         ` Ævar Arnfjörð Bjarmason
2017-06-02 20:25                           ` demerphq
2017-06-02 20:17                       ` demerphq
2017-06-02 20:38                         ` Ævar Arnfjörð Bjarmason
2017-06-02 21:53                         ` Linus Torvalds
2017-06-03  0:13                           ` Junio C Hamano
2017-06-02 14:46                   ` Liam R. Howlett
2017-06-02 16:53                     ` Ævar Arnfjörð Bjarmason
2017-06-03  0:15                       ` Junio C Hamano

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=xmqqwp8w3uff.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=larsxschneider@gmail.com \
    --cc=marc@marc-stevens.nl \
    --cc=schwab@suse.de \
    /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).