]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
s390/maccess: reduce stnsm instructions
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Fri, 12 Feb 2016 11:40:31 +0000 (12:40 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Wed, 17 Feb 2016 08:05:04 +0000 (09:05 +0100)
When fixing the DAT off bug ("s390: fix DAT off memory access, e.g.
on kdump") both Christian and I missed that we can save an additional
stnsm instruction.

This saves us a couple of cycles which could improve the speed of
memcpy_real.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/mm/maccess.c

index 350b0acd7f5257036ba12c6fbb5b9733274e3d9f..792f9c63fbca5b97e03d1251bfff1facc987f9c4 100644 (file)
@@ -93,15 +93,17 @@ static int __memcpy_real(void *dest, void *src, size_t count)
  */
 int memcpy_real(void *dest, void *src, size_t count)
 {
+       int irqs_disabled, rc;
        unsigned long flags;
-       int rc;
 
        if (!count)
                return 0;
-       local_irq_save(flags);
-       __arch_local_irq_stnsm(0xfbUL);
+       flags = __arch_local_irq_stnsm(0xf8UL);
+       irqs_disabled = arch_irqs_disabled_flags(flags);
+       if (!irqs_disabled)
+               trace_hardirqs_off();
        rc = __memcpy_real(dest, src, count);
-       if (!arch_irqs_disabled_flags(flags))
+       if (!irqs_disabled)
                trace_hardirqs_on();
        __arch_local_irq_ssm(flags);
        return rc;