hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/acpi/acpica/hwvalid.c
....@@ -3,7 +3,7 @@
33 *
44 * Module Name: hwvalid - I/O request validation
55 *
6
- * Copyright (C) 2000 - 2018, Intel Corp.
6
+ * Copyright (C) 2000 - 2020, Intel Corp.
77 *
88 *****************************************************************************/
99
....@@ -23,8 +23,8 @@
2323 *
2424 * The table is used to implement the Microsoft port access rules that
2525 * first appeared in Windows XP. Some ports are always illegal, and some
26
- * ports are only illegal if the BIOS calls _OSI with a win_XP string or
27
- * later (meaning that the BIOS itelf is post-XP.)
26
+ * ports are only illegal if the BIOS calls _OSI with nothing newer than
27
+ * the specific _OSI strings.
2828 *
2929 * This provides ACPICA with the desired port protections and
3030 * Microsoft compatibility.
....@@ -145,7 +145,8 @@
145145
146146 /* Port illegality may depend on the _OSI calls made by the BIOS */
147147
148
- if (acpi_gbl_osi_data >= port_info->osi_dependency) {
148
+ if (port_info->osi_dependency == ACPI_ALWAYS_ILLEGAL ||
149
+ acpi_gbl_osi_data == port_info->osi_dependency) {
149150 ACPI_DEBUG_PRINT((ACPI_DB_VALUES,
150151 "Denied AML access to port 0x%8.8X%8.8X/%X (%s 0x%.4X-0x%.4X)\n",
151152 ACPI_FORMAT_UINT64(address),
....@@ -292,3 +293,33 @@
292293
293294 return (AE_OK);
294295 }
296
+
297
+/******************************************************************************
298
+ *
299
+ * FUNCTION: acpi_hw_validate_io_block
300
+ *
301
+ * PARAMETERS: Address Address of I/O port/register blobk
302
+ * bit_width Number of bits (8,16,32) in each register
303
+ * count Number of registers in the block
304
+ *
305
+ * RETURN: Status
306
+ *
307
+ * DESCRIPTION: Validates a block of I/O ports/registers.
308
+ *
309
+ ******************************************************************************/
310
+
311
+acpi_status acpi_hw_validate_io_block(u64 address, u32 bit_width, u32 count)
312
+{
313
+ acpi_status status;
314
+
315
+ while (count--) {
316
+ status = acpi_hw_validate_io_request((acpi_io_address)address,
317
+ bit_width);
318
+ if (ACPI_FAILURE(status))
319
+ return_ACPI_STATUS(status);
320
+
321
+ address += ACPI_DIV_8(bit_width);
322
+ }
323
+
324
+ return_ACPI_STATUS(AE_OK);
325
+}