|
|
a85e8e |
From d8b18f6b814a830dd1279669e10fb5f714e2138f Mon Sep 17 00:00:00 2001
|
|
|
a85e8e |
From: Vladimir Serbinenko <phcoder@gmail.com>
|
|
|
a85e8e |
Date: Wed, 29 Jan 2014 23:45:18 +0100
|
|
|
a85e8e |
Subject: [PATCH 052/260] * grub-core/disk/ahci.c: Allocate and clean space for
|
|
|
a85e8e |
all possible 32 slots to avoid pointing to uninited area.
|
|
|
a85e8e |
|
|
|
a85e8e |
---
|
|
|
a85e8e |
ChangeLog | 5 +++++
|
|
|
a85e8e |
grub-core/disk/ahci.c | 8 +++++++-
|
|
|
a85e8e |
2 files changed, 12 insertions(+), 1 deletion(-)
|
|
|
a85e8e |
|
|
|
a85e8e |
diff --git a/ChangeLog b/ChangeLog
|
|
|
a85e8e |
index 51eba95f3..9bb181777 100644
|
|
|
a85e8e |
--- a/ChangeLog
|
|
|
a85e8e |
+++ b/ChangeLog
|
|
|
a85e8e |
@@ -1,5 +1,10 @@
|
|
|
a85e8e |
2014-01-29 Vladimir Serbinenko <phcoder@gmail.com>
|
|
|
a85e8e |
|
|
|
a85e8e |
+ * grub-core/disk/ahci.c: Allocate and clean space for all possible 32
|
|
|
a85e8e |
+ slots to avoid pointing to uninited area.
|
|
|
a85e8e |
+
|
|
|
a85e8e |
+2014-01-29 Vladimir Serbinenko <phcoder@gmail.com>
|
|
|
a85e8e |
+
|
|
|
a85e8e |
* grub-core/disk/ahci.c: Do not enable I/O decoding and keep
|
|
|
a85e8e |
enabling busmaster for the end.
|
|
|
a85e8e |
|
|
|
a85e8e |
diff --git a/grub-core/disk/ahci.c b/grub-core/disk/ahci.c
|
|
|
a85e8e |
index 18c13270c..d63fd09fd 100644
|
|
|
a85e8e |
--- a/grub-core/disk/ahci.c
|
|
|
a85e8e |
+++ b/grub-core/disk/ahci.c
|
|
|
a85e8e |
@@ -358,7 +358,7 @@ grub_ahci_pciinit (grub_pci_device_t dev,
|
|
|
a85e8e |
grub_dprintf ("ahci", "err: %x\n",
|
|
|
a85e8e |
adevs[i]->hba->ports[adevs[i]->port].sata_error);
|
|
|
a85e8e |
|
|
|
a85e8e |
- adevs[i]->command_list_chunk = grub_memalign_dma32 (1024, sizeof (struct grub_ahci_cmd_head));
|
|
|
a85e8e |
+ adevs[i]->command_list_chunk = grub_memalign_dma32 (1024, sizeof (struct grub_ahci_cmd_head) * 32);
|
|
|
a85e8e |
if (!adevs[i]->command_list_chunk)
|
|
|
a85e8e |
{
|
|
|
a85e8e |
adevs[i] = 0;
|
|
|
a85e8e |
@@ -376,6 +376,12 @@ grub_ahci_pciinit (grub_pci_device_t dev,
|
|
|
a85e8e |
|
|
|
a85e8e |
adevs[i]->command_list = grub_dma_get_virt (adevs[i]->command_list_chunk);
|
|
|
a85e8e |
adevs[i]->command_table = grub_dma_get_virt (adevs[i]->command_table_chunk);
|
|
|
a85e8e |
+
|
|
|
a85e8e |
+ grub_memset ((void *) adevs[i]->command_list, 0,
|
|
|
a85e8e |
+ sizeof (struct grub_ahci_cmd_table));
|
|
|
a85e8e |
+ grub_memset ((void *) adevs[i]->command_table, 0,
|
|
|
a85e8e |
+ sizeof (struct grub_ahci_cmd_head) * 32);
|
|
|
a85e8e |
+
|
|
|
a85e8e |
adevs[i]->command_list->command_table_base
|
|
|
a85e8e |
= grub_dma_get_phys (adevs[i]->command_table_chunk);
|
|
|
a85e8e |
|
|
|
a85e8e |
--
|
|
|
a85e8e |
2.13.0
|
|
|
a85e8e |
|