mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kamal Mostafa <kamal@canonical.com>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	kernel-team@lists.ubuntu.com
Cc: Lv Zheng <lv.zheng@intel.com>, Bob Moore <robert.moore@intel.com>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	Kamal Mostafa <kamal@canonical.com>
Subject: [PATCH 3.13.y-ckt 61/95] ACPICA: Utilities: split IO address types from data type models.
Date: Wed, 27 May 2015 12:00:09 -0700	[thread overview]
Message-ID: <1432753243-16151-62-git-send-email-kamal@canonical.com> (raw)
In-Reply-To: <1432753243-16151-1-git-send-email-kamal@canonical.com>

3.13.11-ckt21 -stable review patch.  If anyone has any objections, please let me know.

------------------

From: Lv Zheng <lv.zheng@intel.com>

commit 2b8760100e1de69b6ff004c986328a82947db4ad upstream.

ACPICA commit aacf863cfffd46338e268b7415f7435cae93b451

It is reported that on a physically 64-bit addressed machine, 32-bit kernel
can trigger crashes in accessing the memory regions that are beyond the
32-bit boundary. The region field's start address should still be 32-bit
compliant, but after a calculation (adding some offsets), it may exceed the
32-bit boundary. This case is rare and buggy, but there are real BIOSes
leaked with such issues (see References below).

This patch fixes this gap by always defining IO addresses as 64-bit, and
allows OSPMs to optimize it for a real 32-bit machine to reduce the size of
the internal objects.

Internal acpi_physical_address usages in the structures that can be fixed
by this change include:
 1. struct acpi_object_region:
    acpi_physical_address		address;
 2. struct acpi_address_range:
    acpi_physical_address		start_address;
    acpi_physical_address		end_address;
 3. struct acpi_mem_space_context;
    acpi_physical_address		address;
 4. struct acpi_table_desc
    acpi_physical_address		address;
See known issues 1 for other usages.

Note that acpi_io_address which is used for ACPI_PROCESSOR may also suffer
from same problem, so this patch changes it accordingly.

For iasl, it will enforce acpi_physical_address as 32-bit to generate
32-bit OSPM compatible tables on 32-bit platforms, we need to define
ACPI_32BIT_PHYSICAL_ADDRESS for it in acenv.h.

Known issues:
 1. Cleanup of mapped virtual address
   In struct acpi_mem_space_context, acpi_physical_address is used as a virtual
   address:
    acpi_physical_address                   mapped_physical_address;
   It is better to introduce acpi_virtual_address or use acpi_size instead.
   This patch doesn't make such a change. Because this should be done along
   with a change to acpi_os_map_memory()/acpi_os_unmap_memory().
   There should be no functional problem to leave this unchanged except
   that only this structure is enlarged unexpectedly.

Link: https://github.com/acpica/acpica/commit/aacf863c
Reference: https://bugzilla.kernel.org/show_bug.cgi?id=87971
Reference: https://bugzilla.kernel.org/show_bug.cgi?id=79501
Reported-and-tested-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reported-and-tested-by: Sial Nije <sialnije@gmail.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 include/acpi/actypes.h        | 20 ++++++++++++++++++++
 include/acpi/platform/acenv.h |  1 +
 2 files changed, 21 insertions(+)

diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index 809b1a0..32fb16a 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -198,9 +198,29 @@ typedef int INT32;
 typedef s32 acpi_native_int;
 
 typedef u32 acpi_size;
+
+#ifdef ACPI_32BIT_PHYSICAL_ADDRESS
+
+/*
+ * OSPMs can define this to shrink the size of the structures for 32-bit
+ * none PAE environment. ASL compiler may always define this to generate
+ * 32-bit OSPM compliant tables.
+ */
 typedef u32 acpi_io_address;
 typedef u32 acpi_physical_address;
 
+#else				/* ACPI_32BIT_PHYSICAL_ADDRESS */
+
+/*
+ * It is reported that, after some calculations, the physical addresses can
+ * wrap over the 32-bit boundary on 32-bit PAE environment.
+ * https://bugzilla.kernel.org/show_bug.cgi?id=87971
+ */
+typedef u64 acpi_io_address;
+typedef u64 acpi_physical_address;
+
+#endif				/* ACPI_32BIT_PHYSICAL_ADDRESS */
+
 #define ACPI_MAX_PTR                    ACPI_UINT32_MAX
 #define ACPI_SIZE_MAX                   ACPI_UINT32_MAX
 
diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h
index 974d3ef..739b1ac 100644
--- a/include/acpi/platform/acenv.h
+++ b/include/acpi/platform/acenv.h
@@ -76,6 +76,7 @@
 #define ACPI_LARGE_NAMESPACE_NODE
 #define ACPI_DATA_TABLE_DISASSEMBLY
 #define ACPI_SINGLE_THREADED
+#define ACPI_32BIT_PHYSICAL_ADDRESS
 #endif
 
 /* acpi_exec configuration. Multithreaded with full AML debugger */
-- 
1.9.1


  parent reply	other threads:[~2015-05-27 19:13 UTC|newest]

Thread overview: 96+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-27 18:59 [3.13.y-ckt stable] Linux 3.13.11-ckt21 stable review Kamal Mostafa
2015-05-27 18:59 ` [PATCH 3.13.y-ckt 01/95] [3.13-stable only] Revert "gianfar: Carefully free skbs in functions called by netpoll." Kamal Mostafa
2015-05-27 18:59 ` [PATCH 3.13.y-ckt 02/95] Bluetooth: ath3k: Add support Atheros AR5B195 combo Mini PCIe card Kamal Mostafa
2015-05-27 18:59 ` [PATCH 3.13.y-ckt 03/95] power_supply: twl4030_madc: Check return value of power_supply_register Kamal Mostafa
2015-05-27 18:59 ` [PATCH 3.13.y-ckt 04/95] power_supply: lp8788-charger: Fix leaked power supply on probe fail Kamal Mostafa
2015-05-27 18:59 ` [PATCH 3.13.y-ckt 05/95] ARM: dts: dove: Fix uart[23] reg property Kamal Mostafa
2015-05-27 18:59 ` [PATCH 3.13.y-ckt 06/95] xtensa: xtfpga: fix hardware lockup caused by LCD driver Kamal Mostafa
2015-05-27 18:59 ` [PATCH 3.13.y-ckt 07/95] Drivers: hv: vmbus: Fix a bug in the error path in vmbus_open() Kamal Mostafa
2015-05-27 18:59 ` [PATCH 3.13.y-ckt 08/95] xtensa: provide __NR_sync_file_range2 instead of __NR_sync_file_range Kamal Mostafa
2015-05-27 18:59 ` [PATCH 3.13.y-ckt 09/95] KVM: s390: Zero out current VMDB of STSI before including level3 data Kamal Mostafa
2015-05-27 18:59 ` [PATCH 3.13.y-ckt 10/95] usb: musb: core: fix TX/RX endpoint order Kamal Mostafa
2015-05-27 18:59 ` [PATCH 3.13.y-ckt 11/95] drm/radeon: fix doublescan modes (v2) Kamal Mostafa
2015-05-27 18:59 ` [PATCH 3.13.y-ckt 12/95] usb: phy: Find the right match in devm_usb_phy_match Kamal Mostafa
2015-05-27 18:59 ` [PATCH 3.13.y-ckt 13/95] x86: kvm: Revert "remove sched notifier for cross-cpu migrations" Kamal Mostafa
2015-05-27 18:59 ` [PATCH 3.13.y-ckt 14/95] tools lib traceevent kbuffer: Remove extra update to data pointer in PADDING Kamal Mostafa
2015-05-27 18:59 ` [PATCH 3.13.y-ckt 15/95] ring-buffer: Replace this_cpu_*() with __this_cpu_*() Kamal Mostafa
2015-05-27 18:59 ` [PATCH 3.13.y-ckt 16/95] ASoC: wm8741: Fix rates constraints values Kamal Mostafa
2015-05-27 18:59 ` [PATCH 3.13.y-ckt 17/95] cdc-wdm: fix endianness bug in debug statements Kamal Mostafa
2015-05-27 18:59 ` [PATCH 3.13.y-ckt 18/95] staging: panel: fix lcd type Kamal Mostafa
2015-05-27 18:59 ` [PATCH 3.13.y-ckt 19/95] UBI: account for bitflips in both the VID header and data Kamal Mostafa
2015-05-27 18:59 ` [PATCH 3.13.y-ckt 20/95] UBI: fix out of bounds write Kamal Mostafa
2015-05-27 18:59 ` [PATCH 3.13.y-ckt 21/95] UBI: initialize LEB number variable Kamal Mostafa
2015-05-27 18:59 ` [PATCH 3.13.y-ckt 22/95] UBI: fix check for "too many bytes" Kamal Mostafa
2015-05-27 18:59 ` [PATCH 3.13.y-ckt 23/95] ARM: S3C64XX: Use fixed IRQ bases to avoid conflicts on Cragganmore Kamal Mostafa
2015-05-27 18:59 ` [PATCH 3.13.y-ckt 24/95] ASoC: davinci-evm: drop un-necessary remove function Kamal Mostafa
2015-05-27 18:59 ` [PATCH 3.13.y-ckt 25/95] iscsi-target: Convert iscsi_thread_set usage to kthread.h Kamal Mostafa
2015-05-27 18:59 ` [PATCH 3.13.y-ckt 26/95] Drivers: hv: vmbus: Don't wait after requesting offers Kamal Mostafa
2015-05-27 18:59 ` [PATCH 3.13.y-ckt 27/95] Btrfs: fix log tree corruption when fs mounted with -o discard Kamal Mostafa
2015-05-27 18:59 ` [PATCH 3.13.y-ckt 28/95] btrfs: don't accept bare namespace as a valid xattr Kamal Mostafa
2015-05-27 18:59 ` [PATCH 3.13.y-ckt 29/95] ARM: 8320/1: fix integer overflow in ELF_ET_DYN_BASE Kamal Mostafa
2015-05-27 18:59 ` [PATCH 3.13.y-ckt 30/95] rtlwifi: rtl8192cu: Add new USB ID Kamal Mostafa
2015-05-27 18:59 ` [PATCH 3.13.y-ckt 31/95] MIPS: Hibernate: flush TLB entries earlier Kamal Mostafa
2015-05-27 18:59 ` [PATCH 3.13.y-ckt 32/95] ASoC: cs4271: Increase delay time after reset Kamal Mostafa
2015-05-27 18:59 ` [PATCH 3.13.y-ckt 33/95] [media] stk1160: Make sure current buffer is released Kamal Mostafa
2015-05-27 18:59 ` [PATCH 3.13.y-ckt 34/95] mnt: Improve the umount_tree flags Kamal Mostafa
2015-05-27 18:59 ` [PATCH 3.13.y-ckt 35/95] ext4: make fsync to sync parent dir in no-journal for real this time Kamal Mostafa
2015-05-27 18:59 ` [PATCH 3.13.y-ckt 36/95] Input: elantech - fix absolute mode setting on some ASUS laptops Kamal Mostafa
2015-05-27 18:59 ` [PATCH 3.13.y-ckt 37/95] usb: define a generic USB_RESUME_TIMEOUT macro Kamal Mostafa
2015-05-27 18:59 ` [PATCH 3.13.y-ckt 38/95] usb: host: xhci: use new USB_RESUME_TIMEOUT Kamal Mostafa
2015-05-27 18:59 ` [PATCH 3.13.y-ckt 39/95] usb: host: ehci: " Kamal Mostafa
2015-05-27 18:59 ` [PATCH 3.13.y-ckt 40/95] usb: host: uhci: " Kamal Mostafa
2015-05-27 18:59 ` [PATCH 3.13.y-ckt 41/95] usb: musb: " Kamal Mostafa
2015-05-27 18:59 ` [PATCH 3.13.y-ckt 42/95] usb: host: isp116x: " Kamal Mostafa
2015-05-27 18:59 ` [PATCH 3.13.y-ckt 43/95] usb: host: fotg210: " Kamal Mostafa
2015-05-27 18:59 ` [PATCH 3.13.y-ckt 44/95] usb: host: fusbh200: " Kamal Mostafa
2015-05-27 18:59 ` [PATCH 3.13.y-ckt 45/95] usb: host: oxu210hp: " Kamal Mostafa
2015-05-27 18:59 ` [PATCH 3.13.y-ckt 46/95] usb: host: r8a66597: " Kamal Mostafa
2015-05-27 18:59 ` [PATCH 3.13.y-ckt 47/95] usb: host: sl811: " Kamal Mostafa
2015-05-27 18:59 ` [PATCH 3.13.y-ckt 48/95] usb: dwc2: hcd: " Kamal Mostafa
2015-05-27 18:59 ` [PATCH 3.13.y-ckt 49/95] usb: isp1760: " Kamal Mostafa
2015-05-27 18:59 ` [PATCH 3.13.y-ckt 50/95] usb: core: hub: " Kamal Mostafa
2015-05-27 18:59 ` [PATCH 3.13.y-ckt 51/95] iser-target: Fix possible deadlock in RDMA_CM connection error Kamal Mostafa
2015-05-27 19:00 ` [PATCH 3.13.y-ckt 52/95] x86: vdso: fix pvclock races with task migration Kamal Mostafa
2015-05-27 19:00 ` [PATCH 3.13.y-ckt 53/95] gpio: mvebu: Fix mask/unmask managment per irq chip type Kamal Mostafa
2015-05-27 19:00 ` [PATCH 3.13.y-ckt 54/95] scsi: storvsc: Fix a bug in copy_from_bounce_buffer() Kamal Mostafa
2015-05-27 19:00 ` [PATCH 3.13.y-ckt 55/95] ALSA: emu10k1: don't deadlock in proc-functions Kamal Mostafa
2015-05-27 19:00 ` [PATCH 3.13.y-ckt 56/95] xtensa: ISS: fix locking in TAP network adapter Kamal Mostafa
2015-05-27 19:00 ` [PATCH 3.13.y-ckt 57/95] s390/hibernate: fix save and restore of kernel text section Kamal Mostafa
2015-05-27 19:00 ` [PATCH 3.13.y-ckt 58/95] Btrfs: fix inode eviction infinite loop after extent_same ioctl Kamal Mostafa
2015-05-27 19:00 ` [PATCH 3.13.y-ckt 59/95] Btrfs: fix inode eviction infinite loop after cloning into it Kamal Mostafa
2015-05-27 19:00 ` [PATCH 3.13.y-ckt 60/95] powerpc/perf: Cap 64bit userspace backtraces to PERF_MAX_STACK_DEPTH Kamal Mostafa
2015-05-27 19:00 ` Kamal Mostafa [this message]
2015-05-27 19:00 ` [PATCH 3.13.y-ckt 62/95] drm/i915: Dont enable CS_PARSER_ERROR interrupts at all Kamal Mostafa
2015-05-27 19:00 ` [PATCH 3.13.y-ckt 63/95] target: Fix COMPARE_AND_WRITE with SG_TO_MEM_NOALLOC handling Kamal Mostafa
2015-05-27 19:00 ` [PATCH 3.13.y-ckt 64/95] mm/hugetlb: use pmd_page() in follow_huge_pmd() Kamal Mostafa
2015-05-27 19:00 ` [PATCH 3.13.y-ckt 65/95] fs/binfmt_elf.c: fix bug in loading of PIE binaries Kamal Mostafa
2015-05-27 19:00 ` [PATCH 3.13.y-ckt 66/95] IB/core: disallow registering 0-sized memory region Kamal Mostafa
2015-05-27 19:00 ` [PATCH 3.13.y-ckt 67/95] IB/core: don't disallow registering region starting at 0x0 Kamal Mostafa
2015-05-27 19:00 ` [PATCH 3.13.y-ckt 68/95] ptrace: fix race between ptrace_resume() and wait_task_stopped() Kamal Mostafa
2015-05-27 19:00 ` [PATCH 3.13.y-ckt 69/95] mvsas: fix panic on expander attached SATA devices Kamal Mostafa
2015-05-27 19:00 ` [PATCH 3.13.y-ckt 70/95] drm/i915: cope with large i2c transfers Kamal Mostafa
2015-05-27 19:00 ` [PATCH 3.13.y-ckt 71/95] RCU pathwalk breakage when running into a symlink overmounting something Kamal Mostafa
2015-05-27 19:00 ` [PATCH 3.13.y-ckt 72/95] compal-laptop: Check return value of power_supply_register Kamal Mostafa
2015-05-27 19:00 ` [PATCH 3.13.y-ckt 73/95] sched/idle/x86: Restore mwait_idle() to fix boot hangs, to improve power savings and to improve performance Kamal Mostafa
2015-05-27 19:00 ` [PATCH 3.13.y-ckt 74/95] nfs: don't call blocking operations while !TASK_RUNNING Kamal Mostafa
2015-05-27 19:00 ` [PATCH 3.13.y-ckt 75/95] nfs: fix high load average due to callback thread sleeping Kamal Mostafa
2015-05-27 19:00 ` [PATCH 3.13.y-ckt 76/95] e1000: add dummy allocator to fix race condition between mtu change and netpoll Kamal Mostafa
2015-05-27 19:00 ` [PATCH 3.13.y-ckt 77/95] wl18xx: show rx_frames_per_rates as an array as it really is Kamal Mostafa
2015-05-27 19:00 ` [PATCH 3.13.y-ckt 78/95] lib: memzero_explicit: use barrier instead of OPTIMIZER_HIDE_VAR Kamal Mostafa
2015-05-27 19:00 ` [PATCH 3.13.y-ckt 79/95] driver core: bus: Goto appropriate labels on failure in bus_add_device Kamal Mostafa
2015-05-27 19:00 ` [PATCH 3.13.y-ckt 80/95] C6x: time: Ensure consistency in __init Kamal Mostafa
2015-05-27 19:00 ` [PATCH 3.13.y-ckt 81/95] crypto: omap-aes - Fix support for unequal lengths Kamal Mostafa
2015-05-27 19:00 ` [PATCH 3.13.y-ckt 82/95] jhash: Update jhash_[321]words functions to use correct initval Kamal Mostafa
2015-05-27 19:00 ` [PATCH 3.13.y-ckt 83/95] KVM: use slowpath for cross page cached accesses Kamal Mostafa
2015-05-27 19:00 ` [PATCH 3.13.y-ckt 84/95] powerpc: Fix missing L2 cache size in /sys/devices/system/cpu Kamal Mostafa
2015-05-27 19:00 ` [PATCH 3.13.y-ckt 85/95] NFS: fix BUG() crash in notify_change() with patch to chown_common() Kamal Mostafa
2015-05-27 19:00 ` [PATCH 3.13.y-ckt 86/95] i2c: core: Export bus recovery functions Kamal Mostafa
2015-05-27 19:00 ` [PATCH 3.13.y-ckt 87/95] IB/mlx4: Fix WQE LSO segment calculation Kamal Mostafa
2015-05-27 19:00 ` [PATCH 3.13.y-ckt 88/95] mlx5_core: Fix PowerPC support Kamal Mostafa
2015-05-27 19:00 ` [PATCH 3.13.y-ckt 89/95] mlx5: wrong page mask if CONFIG_ARCH_DMA_ADDR_T_64BIT enabled for 32Bit architectures Kamal Mostafa
2015-05-27 19:00 ` [PATCH 3.13.y-ckt 90/95] skbuff: Do not scrub skb mark within the same name space Kamal Mostafa
2015-05-27 19:00 ` [PATCH 3.13.y-ckt 91/95] firmware/ihex2fw.c: restore missing default in switch statement Kamal Mostafa
2015-05-27 19:00 ` [PATCH 3.13.y-ckt 92/95] memstick: mspro_block: add missing curly braces Kamal Mostafa
2015-05-27 19:00 ` [PATCH 3.13.y-ckt 93/95] tools/power turbostat: Use $(CURDIR) instead of $(PWD) and add support for O= option in Makefile Kamal Mostafa
2015-05-27 19:00 ` [PATCH 3.13.y-ckt 94/95] ext4: fix data corruption caused by unwritten and delayed extents Kamal Mostafa
2015-05-27 19:00 ` [PATCH 3.13.y-ckt 95/95] powerpc: Add vr save/restore functions Kamal Mostafa

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=1432753243-16151-62-git-send-email-kamal@canonical.com \
    --to=kamal@canonical.com \
    --cc=kernel-team@lists.ubuntu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lv.zheng@intel.com \
    --cc=rafael.j.wysocki@intel.com \
    --cc=robert.moore@intel.com \
    --cc=stable@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®