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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-9e16e4933e48819a259b8967e72e5765349953b1@git.kernel.org>
Date:   Thu, 27 Jun 2019 16:47:35 -0700
From:   tip-bot for Thomas Gleixner <tipbot@...or.com>
To:     linux-tip-commits@...r.kernel.org
Cc:     ricardo.neri-calderon@...ux.intel.com,
        linux-kernel@...r.kernel.org, peterz@...radead.org,
        ashok.raj@...el.com, hpa@...or.com, mingo@...nel.org,
        ravi.v.shankar@...el.com, eranian@...gle.com, andi.kleen@...el.com,
        tglx@...utronix.de, Suravee.Suthikulpanit@....com
Subject: [tip:x86/timers] x86/hpet: Add mode information to struct
 hpet_channel

Commit-ID:  9e16e4933e48819a259b8967e72e5765349953b1
Gitweb:     https://git.kernel.org/tip/9e16e4933e48819a259b8967e72e5765349953b1
Author:     Thomas Gleixner <tglx@...utronix.de>
AuthorDate: Sun, 23 Jun 2019 15:24:00 +0200
Committer:  Thomas Gleixner <tglx@...utronix.de>
CommitDate: Fri, 28 Jun 2019 00:57:23 +0200

x86/hpet: Add mode information to struct hpet_channel

The usage of the individual HPET channels is not tracked in a central
place. The information is scattered in different data structures. Also the
HPET reservation in the HPET character device is split out into several
places which makes the code hard to follow.

Assigning a mode to the channel allows to consolidate the reservation code
and paves the way for further simplifications.

As a first step set the mode of the legacy channels when the HPET is in
legacy mode.

Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Reviewed-by: Ingo Molnar <mingo@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Ricardo Neri <ricardo.neri-calderon@...ux.intel.com>
Cc: Ashok Raj <ashok.raj@...el.com>
Cc: Andi Kleen <andi.kleen@...el.com>
Cc: Suravee Suthikulpanit <Suravee.Suthikulpanit@....com>
Cc: Stephane Eranian <eranian@...gle.com>
Cc: Ravi Shankar <ravi.v.shankar@...el.com>
Link: https://lkml.kernel.org/r/20190623132435.911652981@linutronix.de

---
 arch/x86/kernel/hpet.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
index 8711f1fdef8f..3a8ec363d569 100644
--- a/arch/x86/kernel/hpet.c
+++ b/arch/x86/kernel/hpet.c
@@ -22,9 +22,17 @@ struct hpet_dev {
 	char				name[10];
 };
 
+enum hpet_mode {
+	HPET_MODE_UNUSED,
+	HPET_MODE_LEGACY,
+	HPET_MODE_CLOCKEVT,
+	HPET_MODE_DEVICE,
+};
+
 struct hpet_channel {
 	unsigned int			num;
 	unsigned int			irq;
+	enum hpet_mode			mode;
 	unsigned int			boot_cfg;
 };
 
@@ -947,6 +955,9 @@ int __init hpet_enable(void)
 
 	if (id & HPET_ID_LEGSUP) {
 		hpet_legacy_clockevent_register();
+		hpet_base.channels[0].mode = HPET_MODE_LEGACY;
+		if (IS_ENABLED(CONFIG_HPET_EMULATE_RTC))
+			hpet_base.channels[1].mode = HPET_MODE_LEGACY;
 		return 1;
 	}
 	return 0;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ