OSDN Git Service

pcm: dmix: assembly: fix the interface for safety
authorFrédéric Recoules <frederic.recoules@orange.fr>
Wed, 6 May 2020 17:19:21 +0000 (19:19 +0200)
committerTakashi Iwai <tiwai@suse.de>
Wed, 6 May 2020 20:25:15 +0000 (22:25 +0200)
commit01d8a6e03a4c1055e5c0ef6d5b6cfdadce545007
tree288c08fce841e92aacaf273df0bf09320cdffe5a
parentb315f21bf765b35a637b380f7eb0abb26ce2241b
pcm: dmix: assembly: fix the interface for safety

- move 'size' and 'old_ebx' in the output section
  since they are clobbered;
- add the "memory" clobber since input pointers
  are accessed;
- (minor) add the "cc" clobber since flags are
  clobbered.

  The compiler is missing some dataflow information
  about the execution of the assembly chunks.
  For instance, it assumes that 'size' remains unchanged
  and that no input pointer is accessed.
  The compiler optimizer may take advantage of these
  assumption and produce a wrong code.

Note: currently produces the same binary output.

Signed-off-by: Frédéric Recoules <frederic.recoules@orange.fr>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
src/pcm/pcm_dmix_i386.h
src/pcm/pcm_dmix_x86_64.h