All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Matthew Whitehead <tedheadster@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	luto@kernel.org, Sasha Levin <sashal@kernel.org>
Subject: [PATCH 5.0 58/93] x86/cpu/cyrix: Use correct macros for Cyrix calls on Geode processors
Date: Thu, 18 Apr 2019 19:57:36 +0200	[thread overview]
Message-ID: <20190418160443.388745788@linuxfoundation.org> (raw)
In-Reply-To: <20190418160436.781762249@linuxfoundation.org>

[ Upstream commit 18fb053f9b827bd98cfc64f2a35df8ab19745a1d ]

There are comments in processor-cyrix.h advising you to _not_ make calls
using the deprecated macros in this style:

  setCx86_old(CX86_CCR4, getCx86_old(CX86_CCR4) | 0x80);

This is because it expands the macro into a non-functioning calling
sequence. The calling order must be:

  outb(CX86_CCR2, 0x22);
  inb(0x23);

>From the comments:

 * When using the old macros a line like
 *   setCx86(CX86_CCR2, getCx86(CX86_CCR2) | 0x88);
 * gets expanded to:
 *  do {
 *    outb((CX86_CCR2), 0x22);
 *    outb((({
 *        outb((CX86_CCR2), 0x22);
 *        inb(0x23);
 *    }) | 0x88), 0x23);
 *  } while (0);

The new macros fix this problem, so use them instead. Tested on an
actual Geode processor.

Signed-off-by: Matthew Whitehead <tedheadster@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: luto@kernel.org
Link: https://lkml.kernel.org/r/1552596361-8967-2-git-send-email-tedheadster@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/x86/kernel/cpu/cyrix.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/x86/kernel/cpu/cyrix.c b/arch/x86/kernel/cpu/cyrix.c
index d12226f60168..1d9b8aaea06c 100644
--- a/arch/x86/kernel/cpu/cyrix.c
+++ b/arch/x86/kernel/cpu/cyrix.c
@@ -124,7 +124,7 @@ static void set_cx86_reorder(void)
 	setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10); /* enable MAPEN */
 
 	/* Load/Store Serialize to mem access disable (=reorder it) */
-	setCx86_old(CX86_PCR0, getCx86_old(CX86_PCR0) & ~0x80);
+	setCx86(CX86_PCR0, getCx86(CX86_PCR0) & ~0x80);
 	/* set load/store serialize from 1GB to 4GB */
 	ccr3 |= 0xe0;
 	setCx86(CX86_CCR3, ccr3);
@@ -135,11 +135,11 @@ static void set_cx86_memwb(void)
 	pr_info("Enable Memory-Write-back mode on Cyrix/NSC processor.\n");
 
 	/* CCR2 bit 2: unlock NW bit */
-	setCx86_old(CX86_CCR2, getCx86_old(CX86_CCR2) & ~0x04);
+	setCx86(CX86_CCR2, getCx86(CX86_CCR2) & ~0x04);
 	/* set 'Not Write-through' */
 	write_cr0(read_cr0() | X86_CR0_NW);
 	/* CCR2 bit 2: lock NW bit and set WT1 */
-	setCx86_old(CX86_CCR2, getCx86_old(CX86_CCR2) | 0x14);
+	setCx86(CX86_CCR2, getCx86(CX86_CCR2) | 0x14);
 }
 
 /*
@@ -153,14 +153,14 @@ static void geode_configure(void)
 	local_irq_save(flags);
 
 	/* Suspend on halt power saving and enable #SUSP pin */
-	setCx86_old(CX86_CCR2, getCx86_old(CX86_CCR2) | 0x88);
+	setCx86(CX86_CCR2, getCx86(CX86_CCR2) | 0x88);
 
 	ccr3 = getCx86(CX86_CCR3);
 	setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10);	/* enable MAPEN */
 
 
 	/* FPU fast, DTE cache, Mem bypass */
-	setCx86_old(CX86_CCR4, getCx86_old(CX86_CCR4) | 0x38);
+	setCx86(CX86_CCR4, getCx86(CX86_CCR4) | 0x38);
 	setCx86(CX86_CCR3, ccr3);			/* disable MAPEN */
 
 	set_cx86_memwb();
@@ -296,7 +296,7 @@ static void init_cyrix(struct cpuinfo_x86 *c)
 		/* GXm supports extended cpuid levels 'ala' AMD */
 		if (c->cpuid_level == 2) {
 			/* Enable cxMMX extensions (GX1 Datasheet 54) */
-			setCx86_old(CX86_CCR7, getCx86_old(CX86_CCR7) | 1);
+			setCx86(CX86_CCR7, getCx86(CX86_CCR7) | 1);
 
 			/*
 			 * GXm : 0x30 ... 0x5f GXm  datasheet 51
@@ -319,7 +319,7 @@ static void init_cyrix(struct cpuinfo_x86 *c)
 		if (dir1 > 7) {
 			dir0_msn++;  /* M II */
 			/* Enable MMX extensions (App note 108) */
-			setCx86_old(CX86_CCR7, getCx86_old(CX86_CCR7)|1);
+			setCx86(CX86_CCR7, getCx86(CX86_CCR7)|1);
 		} else {
 			/* A 6x86MX - it has the bug. */
 			set_cpu_bug(c, X86_BUG_COMA);
-- 
2.19.1




  parent reply	other threads:[~2019-04-18 18:11 UTC|newest]

Thread overview: 117+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-18 17:56 [PATCH 5.0 00/93] 5.0.9-stable review Greg Kroah-Hartman
2019-04-18 17:56 ` [PATCH 5.0 01/93] ARC: u-boot args: check that magic number is correct Greg Kroah-Hartman
2019-04-18 17:56 ` [PATCH 5.0 02/93] arc: hsdk_defconfig: Enable CONFIG_BLK_DEV_RAM Greg Kroah-Hartman
2019-04-18 17:56 ` [PATCH 5.0 03/93] inotify: Fix fsnotify_mark refcount leak in inotify_update_existing_watch() Greg Kroah-Hartman
2019-04-18 17:56 ` [PATCH 5.0 04/93] perf/core: Restore mmap record type correctly Greg Kroah-Hartman
2019-04-18 17:56 ` [PATCH 5.0 05/93] perf data: Dont store auxtrace index for directory data file Greg Kroah-Hartman
2019-04-18 19:28   ` Thomas Backlund
2019-04-19 13:25     ` Sasha Levin
2019-04-20  8:48       ` Jiri Olsa
2019-04-18 19:29   ` Dan Rue
2019-04-18 17:56 ` [PATCH 5.0 06/93] mips: bcm47xx: Enable USB power on Netgear WNDR3400v2 Greg Kroah-Hartman
2019-04-18 17:56 ` [PATCH 5.0 07/93] ext4: avoid panic during forced reboot Greg Kroah-Hartman
2019-04-18 17:56 ` [PATCH 5.0 08/93] ext4: add missing brelse() in add_new_gdb_meta_bg() Greg Kroah-Hartman
2019-04-18 17:56 ` [PATCH 5.0 09/93] ext4: report real fs size after failed resize Greg Kroah-Hartman
2019-04-18 17:56 ` [PATCH 5.0 10/93] ALSA: echoaudio: add a check for ioremap_nocache Greg Kroah-Hartman
2019-04-18 17:56 ` [PATCH 5.0 11/93] ALSA: sb8: add a check for request_region Greg Kroah-Hartman
2019-04-18 17:56 ` [PATCH 5.0 12/93] auxdisplay: hd44780: Fix memory leak on ->remove() Greg Kroah-Hartman
2019-04-18 17:56 ` [PATCH 5.0 13/93] drm/udl: use drm_gem_object_put_unlocked Greg Kroah-Hartman
2019-04-18 17:56 ` [PATCH 5.0 14/93] IB/mlx4: Fix race condition between catas error reset and aliasguid flows Greg Kroah-Hartman
2019-04-18 17:56 ` [PATCH 5.0 15/93] i40iw: Avoid panic when handling the inetdev event Greg Kroah-Hartman
2019-04-18 17:56 ` [PATCH 5.0 16/93] mmc: davinci: remove extraneous __init annotation Greg Kroah-Hartman
2019-04-18 17:56 ` [PATCH 5.0 17/93] ALSA: opl3: fix mismatch between snd_opl3_drum_switch definition and declaration Greg Kroah-Hartman
2019-04-18 17:56 ` [PATCH 5.0 18/93] paride/pf: cleanup queues when detection fails Greg Kroah-Hartman
2019-04-19  7:13   ` nobuhiro1.iwamatsu
2019-04-19 13:30     ` Sasha Levin
2019-04-18 17:56 ` [PATCH 5.0 19/93] paride/pcd: " Greg Kroah-Hartman
2019-04-19  7:13   ` nobuhiro1.iwamatsu
2019-04-19 13:32     ` Sasha Levin
2019-04-18 17:56 ` [PATCH 5.0 20/93] thermal/intel_powerclamp: fix __percpu declaration of worker_data Greg Kroah-Hartman
2019-04-18 17:56 ` [PATCH 5.0 21/93] thermal: samsung: Fix incorrect check after code merge Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 22/93] thermal: bcm2835: Fix crash in bcm2835_thermal_debugfs Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 23/93] thermal/int340x_thermal: Add additional UUIDs Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 24/93] thermal/int340x_thermal: fix mode setting Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 25/93] thermal/intel_powerclamp: fix truncated kthread name Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 26/93] scsi: iscsi: flush running unbind operations when removing a session Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 27/93] sched/cpufreq: Fix 32-bit math overflow Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 28/93] sched/core: Fix buffer overflow in cgroup2 property cpu.max Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 29/93] x86/mm: Dont leak kernel addresses Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 30/93] tools/power turbostat: return the exit status of a command Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 31/93] scsi: core: Also call destroy_rcu_head() for passthrough requests Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 32/93] scsi: qla2xxx: Fix NULL pointer crash due to stale CPUID Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 33/93] perf stat: Fix --no-scale Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 34/93] perf list: Dont forget to drop the reference to the allocated thread_map Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 35/93] perf tools: Fix errors under optimization level -Og Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 36/93] perf config: Fix an error in the config template documentation Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 37/93] perf config: Fix a memory leak in collect_config() Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 38/93] perf build-id: Fix memory leak in print_sdt_events() Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 39/93] perf top: Delete the evlist before perf_session, fixing heap-use-after-free issue Greg Kroah-Hartman
2019-04-18 19:31   ` Dan Rue
2019-04-19 13:35     ` Sasha Levin
2019-04-18 19:33   ` Thomas Backlund
2019-04-18 17:57 ` [PATCH 5.0 40/93] perf top: Fix error handling in cmd_top() Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 41/93] perf hist: Add missing map__put() in error case Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 42/93] perf map: Remove map from names tree in __maps__remove() Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 43/93] perf maps: Purge all maps from the names tree Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 44/93] perf top: Fix global-buffer-overflow issue Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 45/93] perf evsel: Free evsel->counts in perf_evsel__exit() Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 46/93] perf tests: Fix a memory leak of cpu_map object in the openat_syscall_event_on_all_cpus test Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 47/93] perf tests: Fix memory leak by expr__find_other() in test__expr() Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 48/93] perf tests: Fix a memory leak in test__perf_evsel__tp_sched_test() Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 49/93] ACPI / utils: Drop reference in test for device presence Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 50/93] PM / Domains: Avoid a potential deadlock Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 51/93] blk-iolatency: #include "blk.h" Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 52/93] drm/exynos/mixer: fix MIXER shadow registry synchronisation code Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 53/93] irqchip/stm32: Dont clear rising/falling config registers at init Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 54/93] irqchip/stm32: Dont set rising configuration " Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 55/93] irqchip/mbigen: Dont clear eventid when freeing an MSI Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 56/93] x86/hpet: Prevent potential NULL pointer dereference Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 57/93] x86/hyperv: " Greg Kroah-Hartman
2019-04-18 17:57 ` Greg Kroah-Hartman [this message]
2019-04-18 17:57 ` [PATCH 5.0 59/93] drm/nouveau/debugfs: Fix check of pm_runtime_get_sync failure Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 60/93] iommu/vt-d: Check capability before disabling protected memory Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 61/93] iommu/vt-d: Save the right domain ID used by hardware Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 62/93] x86/hw_breakpoints: Make default case in hw_breakpoint_arch_parse() return an error Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 63/93] cifs: fix that return -EINVAL when do dedupe operation Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 64/93] fix incorrect error code mapping for OBJECTID_NOT_FOUND Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 65/93] cifs: Fix slab-out-of-bounds when tracing SMB tcon Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 66/93] x86/gart: Exclude GART aperture from kcore Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 67/93] ext4: prohibit fstrim in norecovery mode Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 68/93] lkdtm: Print real addresses Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 69/93] lkdtm: Add tests for NULL pointer dereference Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 70/93] drm/amdgpu: psp_ring_destroy cause psp->km_ring.ring_mem NULL Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 71/93] drm/panel: panel-innolux: set display off in innolux_panel_unprepare Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 72/93] net: hns3: Fix NULL deref when unloading driver Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 73/93] crypto: axis - fix for recursive locking from bottom half Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 74/93] Revert "ACPI / EC: Remove old CLEAR_ON_RESUME quirk" Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 75/93] RDMA/hns: Fix the Oops during rmmod or insmod ko when reset occurs Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 76/93] coresight: cpu-debug: Support for CA73 CPUs Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 77/93] PCI: Blacklist power management of Gigabyte X299 DESIGNARE EX PCIe ports Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 78/93] PCI/ASPM: Save LTR Capability for suspend/resume Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 79/93] f2fs: sync filesystem after roll-forward recovery Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 80/93] drm/nouveau/volt/gf117: fix speedo readout register Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 81/93] platform/x86: intel_pmc_core: Quirk to ignore XTAL shutdown Greg Kroah-Hartman
2019-04-18 17:58 ` [PATCH 5.0 82/93] ARM: 8839/1: kprobe: make patch_lock a raw_spinlock_t Greg Kroah-Hartman
2019-04-18 17:58 ` [PATCH 5.0 83/93] drm/amdkfd: use init_mqd function to allocate object for hid_mqd (CI) Greg Kroah-Hartman
2019-04-18 17:58 ` [PATCH 5.0 84/93] appletalk: Fix use-after-free in atalk_proc_exit Greg Kroah-Hartman
2019-04-18 17:58 ` [PATCH 5.0 85/93] cifs: return -ENODATA when deleting an xattr that does not exist Greg Kroah-Hartman
2019-04-18 17:58 ` [PATCH 5.0 86/93] lib/div64.c: off by one in shift Greg Kroah-Hartman
2019-04-18 17:58 ` [PATCH 5.0 87/93] rxrpc: Fix client call connect/disconnect race Greg Kroah-Hartman
2019-04-18 17:58 ` [PATCH 5.0 88/93] f2fs: fix to dirty inode for i_mode recovery Greg Kroah-Hartman
2019-04-18 17:58 ` [PATCH 5.0 89/93] f2fs: fix to use kvfree instead of kzfree Greg Kroah-Hartman
2019-04-18 17:58 ` [PATCH 5.0 90/93] f2fs: fix to add refcount once page is tagged PG_private Greg Kroah-Hartman
2019-04-18 17:58 ` [PATCH 5.0 91/93] include/linux/swap.h: use offsetof() instead of custom __swapoffset macro Greg Kroah-Hartman
2019-04-18 17:58 ` [PATCH 5.0 92/93] bpf: fix use after free in bpf_evict_inode Greg Kroah-Hartman
2019-04-18 17:58 ` [PATCH 5.0 93/93] IB/hfi1: Failed to drain send queue when QP is put into error state Greg Kroah-Hartman
2019-04-19 10:08 ` [PATCH 5.0 00/93] 5.0.9-stable review Jon Hunter
2019-04-19 10:08   ` Jon Hunter
2019-04-20 14:40   ` Greg Kroah-Hartman
2019-04-19 14:24 ` shuah
2019-04-20  7:05   ` Greg Kroah-Hartman
2019-04-19 19:41 ` Guenter Roeck
2019-04-19 21:00   ` Guenter Roeck
2019-04-20  7:05     ` Greg Kroah-Hartman
2019-04-20  4:52 ` Naresh Kamboju
2019-04-20 14:41   ` Greg Kroah-Hartman
2019-04-20 12:28 ` Bharath Vedartham
2019-04-20 14:41   ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190418160443.388745788@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=sashal@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tedheadster@gmail.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.