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>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGZ+4_+TMdbmy6_x4sondGFgcOc=9XXSMTaixcyKasd3LMDMbQ@mail.gmail.com>
Date:   Sat, 5 Jan 2019 16:29:13 +0100
From:   Philipp K <philipp97kl@...il.com>
To:     unlisted-recipients:; (no To-header on input)
Cc:     Lukas Bulwahn <lukas.bulwahn@...il.com>, x86@...nel.org,
        Philipp Klocke <philipp97kl@...il.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        "H. Peter Anvin" <hpa@...or.com>, linux-kernel@...r.kernel.org
Subject: [RESEND] x86: Refactor __cmpxchg to cmpxchg in lock_cmos

It is unusual to reference __cmpxchg() from other files than cmpxchg.h and
similar.
Instead, cmpxchg() is used, which expands to __cmpxchg() and derives the
'size' parameter automatically with sizeof(*(ptr)).

So clean up the lock_cmos() function by using cmpxchg(), without changing
the generated code.

Signed-off-by: Philipp Klocke <philipp97kl@...il.com>
---

This patch was acked by Ingo, so I would expect it to be added to pit.

 arch/x86/include/asm/mc146818rtc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/mc146818rtc.h
b/arch/x86/include/asm/mc146818rtc.h
index 97198001e567..b72e3bbba0a2 100644
--- a/arch/x86/include/asm/mc146818rtc.h
+++ b/arch/x86/include/asm/mc146818rtc.h
@@ -47,7 +47,7 @@ static inline void lock_cmos(unsigned char reg)
  cpu_relax();
  continue;
  }
- if (__cmpxchg(&cmos_lock, 0, new, sizeof(cmos_lock)) == 0)
+ if (cmpxchg(&cmos_lock, 0, new) == 0)
  return;
  }
 }
-- 
2.19.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ