All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] x86 cleanups of leftover code
@ 2020-07-24 11:44 Ingo Molnar
  2020-07-24 11:44 ` [PATCH 1/3] x86/ioapic: Remove unused "IOAPIC_AUTO" define Ingo Molnar
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Ingo Molnar @ 2020-07-24 11:44 UTC (permalink / raw)
  To: linux-kernel; +Cc: Thomas Gleixner, Peter Zijlstra, Borislav Petkov

Remove a couple of stray defines I noticed, with a bit of Git history
archeology to make sure they won't be used in the future either.

Ingo Molnar (3):
  x86/ioapic: Remove unused "IOAPIC_AUTO" define
  x86/tsc: Remove unused "US_SCALE" and "NS_SCALE" leftover macros
  x86/mm: Remove the unused mk_kernel_pgd() #define

 arch/x86/include/asm/io_apic.h    |  1 -
 arch/x86/include/asm/pgtable_64.h | 11 ++++-------
 arch/x86/include/asm/tsc.h        |  3 ---
 3 files changed, 4 insertions(+), 11 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/3] x86/ioapic: Remove unused "IOAPIC_AUTO" define
  2020-07-24 11:44 [PATCH 0/3] x86 cleanups of leftover code Ingo Molnar
@ 2020-07-24 11:44 ` Ingo Molnar
  2020-07-25 10:13   ` [tip: x86/cleanups] " tip-bot2 for Ingo Molnar
  2020-07-24 11:44 ` [PATCH 2/3] x86/tsc: Remove unused "US_SCALE" and "NS_SCALE" leftover macros Ingo Molnar
  2020-07-24 11:44 ` [PATCH 3/3] x86/mm: Remove the unused mk_kernel_pgd() #define Ingo Molnar
  2 siblings, 1 reply; 7+ messages in thread
From: Ingo Molnar @ 2020-07-24 11:44 UTC (permalink / raw)
  To: linux-kernel; +Cc: Thomas Gleixner, Peter Zijlstra, Borislav Petkov

Last use was removed more than 5 years ago, in:

   5ad274d41c1b: ("x86/irq: Remove unused old IOAPIC irqdomain interfaces")

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
---
 arch/x86/include/asm/io_apic.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/x86/include/asm/io_apic.h b/arch/x86/include/asm/io_apic.h
index fd20a2334885..a1a26f6d3aa4 100644
--- a/arch/x86/include/asm/io_apic.h
+++ b/arch/x86/include/asm/io_apic.h
@@ -99,7 +99,6 @@ struct IR_IO_APIC_route_entry {
 struct irq_alloc_info;
 struct ioapic_domain_cfg;
 
-#define IOAPIC_AUTO			-1
 #define IOAPIC_EDGE			0
 #define IOAPIC_LEVEL			1
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/3] x86/tsc: Remove unused "US_SCALE" and "NS_SCALE" leftover macros
  2020-07-24 11:44 [PATCH 0/3] x86 cleanups of leftover code Ingo Molnar
  2020-07-24 11:44 ` [PATCH 1/3] x86/ioapic: Remove unused "IOAPIC_AUTO" define Ingo Molnar
@ 2020-07-24 11:44 ` Ingo Molnar
  2020-07-25 10:13   ` [tip: x86/cleanups] " tip-bot2 for Ingo Molnar
  2020-07-24 11:44 ` [PATCH 3/3] x86/mm: Remove the unused mk_kernel_pgd() #define Ingo Molnar
  2 siblings, 1 reply; 7+ messages in thread
From: Ingo Molnar @ 2020-07-24 11:44 UTC (permalink / raw)
  To: linux-kernel; +Cc: Thomas Gleixner, Peter Zijlstra, Borislav Petkov

Last use of them was removed 13 years ago, when the code was converted
to use CYC2NS_SCALE_FACTOR:

  53d517cdbaac: ("x86: scale cyc_2_nsec according to CPU frequency")

The current TSC code uses the 'struct cyc2ns_data' scaling abstraction,
the old fixed scaling approach is long gone.

This cleanup also removes the 'arbitralrily' typo from the comment,
so win-win. ;-)

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
---
 arch/x86/include/asm/tsc.h | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/arch/x86/include/asm/tsc.h b/arch/x86/include/asm/tsc.h
index 8a0c25c6bf09..b7b2624fba86 100644
--- a/arch/x86/include/asm/tsc.h
+++ b/arch/x86/include/asm/tsc.h
@@ -7,9 +7,6 @@
 
 #include <asm/processor.h>
 
-#define NS_SCALE	10 /* 2^10, carefully chosen */
-#define US_SCALE	32 /* 2^32, arbitralrily chosen */
-
 /*
  * Standard way to access the cycle counter.
  */
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/3] x86/mm: Remove the unused mk_kernel_pgd() #define
  2020-07-24 11:44 [PATCH 0/3] x86 cleanups of leftover code Ingo Molnar
  2020-07-24 11:44 ` [PATCH 1/3] x86/ioapic: Remove unused "IOAPIC_AUTO" define Ingo Molnar
  2020-07-24 11:44 ` [PATCH 2/3] x86/tsc: Remove unused "US_SCALE" and "NS_SCALE" leftover macros Ingo Molnar
@ 2020-07-24 11:44 ` Ingo Molnar
  2020-07-25 10:13   ` [tip: x86/cleanups] " tip-bot2 for Ingo Molnar
  2 siblings, 1 reply; 7+ messages in thread
From: Ingo Molnar @ 2020-07-24 11:44 UTC (permalink / raw)
  To: linux-kernel; +Cc: Thomas Gleixner, Peter Zijlstra, Borislav Petkov

AFAICS the last uses of directly 'making' kernel PGDs was removed 7 years ago:

  8b78c21d72d9: ("x86, 64bit, mm: hibernate use generic mapping_init")

Where the explicit PGD walking loop was replaced with kernel_ident_mapping_init()
calls. This was then (unnecessarily) carried over through the 5-level paging conversion.

Also clean up the 'level' comments a bit, to convey the original, meanwhile somewhat
bit-rotten notion, that these are empty comment blocks with no methods to handle any
of the levels except the PTE level.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rik van Riel <riel@surriel.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
---
 arch/x86/include/asm/pgtable_64.h | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/arch/x86/include/asm/pgtable_64.h b/arch/x86/include/asm/pgtable_64.h
index 1b68d24dc6a0..d2af8c48ba50 100644
--- a/arch/x86/include/asm/pgtable_64.h
+++ b/arch/x86/include/asm/pgtable_64.h
@@ -175,16 +175,13 @@ extern void sync_global_pgds(unsigned long start, unsigned long end);
  * and a page entry and page directory to the page they refer to.
  */
 
-/*
- * Level 4 access.
- */
-#define mk_kernel_pgd(address) __pgd((address) | _KERNPG_TABLE)
+/* PGD - Level 4 access */
 
-/* PUD - Level3 access */
+/* PUD - Level 3 access */
 
-/* PMD  - Level 2 access */
+/* PMD - Level 2 access */
 
-/* PTE - Level 1 access. */
+/* PTE - Level 1 access */
 
 /*
  * Encode and de-code a swap entry
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [tip: x86/cleanups] x86/mm: Remove the unused mk_kernel_pgd() #define
  2020-07-24 11:44 ` [PATCH 3/3] x86/mm: Remove the unused mk_kernel_pgd() #define Ingo Molnar
@ 2020-07-25 10:13   ` tip-bot2 for Ingo Molnar
  0 siblings, 0 replies; 7+ messages in thread
From: tip-bot2 for Ingo Molnar @ 2020-07-25 10:13 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: Ingo Molnar, x86, LKML

The following commit has been merged into the x86/cleanups branch of tip:

Commit-ID:     4b8e0328e56e177663645a96ea4c5c0401ecd78f
Gitweb:        https://git.kernel.org/tip/4b8e0328e56e177663645a96ea4c5c0401ecd78f
Author:        Ingo Molnar <mingo@kernel.org>
AuthorDate:    Fri, 24 Jul 2020 13:44:18 +02:00
Committer:     Ingo Molnar <mingo@kernel.org>
CommitterDate: Sat, 25 Jul 2020 12:00:57 +02:00

x86/mm: Remove the unused mk_kernel_pgd() #define

AFAICS the last uses of directly 'making' kernel PGDs was removed 7 years ago:

  8b78c21d72d9: ("x86, 64bit, mm: hibernate use generic mapping_init")

Where the explicit PGD walking loop was replaced with kernel_ident_mapping_init()
calls. This was then (unnecessarily) carried over through the 5-level paging conversion.

Also clean up the 'level' comments a bit, to convey the original, meanwhile somewhat
bit-rotten notion, that these are empty comment blocks with no methods to handle any
of the levels except the PTE level.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20200724114418.629021-4-mingo@kernel.org
---
 arch/x86/include/asm/pgtable_64.h | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/arch/x86/include/asm/pgtable_64.h b/arch/x86/include/asm/pgtable_64.h
index 1b68d24..d2af8c4 100644
--- a/arch/x86/include/asm/pgtable_64.h
+++ b/arch/x86/include/asm/pgtable_64.h
@@ -175,16 +175,13 @@ extern void sync_global_pgds(unsigned long start, unsigned long end);
  * and a page entry and page directory to the page they refer to.
  */
 
-/*
- * Level 4 access.
- */
-#define mk_kernel_pgd(address) __pgd((address) | _KERNPG_TABLE)
+/* PGD - Level 4 access */
 
-/* PUD - Level3 access */
+/* PUD - Level 3 access */
 
-/* PMD  - Level 2 access */
+/* PMD - Level 2 access */
 
-/* PTE - Level 1 access. */
+/* PTE - Level 1 access */
 
 /*
  * Encode and de-code a swap entry

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [tip: x86/cleanups] x86/ioapic: Remove unused "IOAPIC_AUTO" define
  2020-07-24 11:44 ` [PATCH 1/3] x86/ioapic: Remove unused "IOAPIC_AUTO" define Ingo Molnar
@ 2020-07-25 10:13   ` tip-bot2 for Ingo Molnar
  0 siblings, 0 replies; 7+ messages in thread
From: tip-bot2 for Ingo Molnar @ 2020-07-25 10:13 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: Ingo Molnar, x86, LKML

The following commit has been merged into the x86/cleanups branch of tip:

Commit-ID:     8cd591aeb1d650f79a49d8704c35a78bf18f5de9
Gitweb:        https://git.kernel.org/tip/8cd591aeb1d650f79a49d8704c35a78bf18f5de9
Author:        Ingo Molnar <mingo@kernel.org>
AuthorDate:    Fri, 24 Jul 2020 13:44:16 +02:00
Committer:     Ingo Molnar <mingo@kernel.org>
CommitterDate: Sat, 25 Jul 2020 12:00:56 +02:00

x86/ioapic: Remove unused "IOAPIC_AUTO" define

Last use was removed more than 5 years ago, in:

   5ad274d41c1b: ("x86/irq: Remove unused old IOAPIC irqdomain interfaces")

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20200724114418.629021-2-mingo@kernel.org
---
 arch/x86/include/asm/io_apic.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/x86/include/asm/io_apic.h b/arch/x86/include/asm/io_apic.h
index fd20a23..a1a26f6 100644
--- a/arch/x86/include/asm/io_apic.h
+++ b/arch/x86/include/asm/io_apic.h
@@ -99,7 +99,6 @@ struct IR_IO_APIC_route_entry {
 struct irq_alloc_info;
 struct ioapic_domain_cfg;
 
-#define IOAPIC_AUTO			-1
 #define IOAPIC_EDGE			0
 #define IOAPIC_LEVEL			1
 

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [tip: x86/cleanups] x86/tsc: Remove unused "US_SCALE" and "NS_SCALE" leftover macros
  2020-07-24 11:44 ` [PATCH 2/3] x86/tsc: Remove unused "US_SCALE" and "NS_SCALE" leftover macros Ingo Molnar
@ 2020-07-25 10:13   ` tip-bot2 for Ingo Molnar
  0 siblings, 0 replies; 7+ messages in thread
From: tip-bot2 for Ingo Molnar @ 2020-07-25 10:13 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: Ingo Molnar, x86, LKML

The following commit has been merged into the x86/cleanups branch of tip:

Commit-ID:     161449bad5053d66f2310744ba8498158ab12c89
Gitweb:        https://git.kernel.org/tip/161449bad5053d66f2310744ba8498158ab12c89
Author:        Ingo Molnar <mingo@kernel.org>
AuthorDate:    Fri, 24 Jul 2020 13:44:17 +02:00
Committer:     Ingo Molnar <mingo@kernel.org>
CommitterDate: Sat, 25 Jul 2020 12:00:57 +02:00

x86/tsc: Remove unused "US_SCALE" and "NS_SCALE" leftover macros

Last use of them was removed 13 years ago, when the code was converted
to use CYC2NS_SCALE_FACTOR:

  53d517cdbaac: ("x86: scale cyc_2_nsec according to CPU frequency")

The current TSC code uses the 'struct cyc2ns_data' scaling abstraction,
the old fixed scaling approach is long gone.

This cleanup also removes the 'arbitralrily' typo from the comment,
so win-win. ;-)

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20200724114418.629021-3-mingo@kernel.org
---
 arch/x86/include/asm/tsc.h | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/arch/x86/include/asm/tsc.h b/arch/x86/include/asm/tsc.h
index 8a0c25c..b7b2624 100644
--- a/arch/x86/include/asm/tsc.h
+++ b/arch/x86/include/asm/tsc.h
@@ -7,9 +7,6 @@
 
 #include <asm/processor.h>
 
-#define NS_SCALE	10 /* 2^10, carefully chosen */
-#define US_SCALE	32 /* 2^32, arbitralrily chosen */
-
 /*
  * Standard way to access the cycle counter.
  */

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-07-25 10:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-24 11:44 [PATCH 0/3] x86 cleanups of leftover code Ingo Molnar
2020-07-24 11:44 ` [PATCH 1/3] x86/ioapic: Remove unused "IOAPIC_AUTO" define Ingo Molnar
2020-07-25 10:13   ` [tip: x86/cleanups] " tip-bot2 for Ingo Molnar
2020-07-24 11:44 ` [PATCH 2/3] x86/tsc: Remove unused "US_SCALE" and "NS_SCALE" leftover macros Ingo Molnar
2020-07-25 10:13   ` [tip: x86/cleanups] " tip-bot2 for Ingo Molnar
2020-07-24 11:44 ` [PATCH 3/3] x86/mm: Remove the unused mk_kernel_pgd() #define Ingo Molnar
2020-07-25 10:13   ` [tip: x86/cleanups] " tip-bot2 for Ingo Molnar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.