From: "Eugene (jno) Dvurechenski" <address@hidden>
Use the virtio device's configuration to figure out the disk geometry
and use a sector size based upon the layout.
[CH: s/SECTOR_SIZE/MAX_SECTOR_SIZE/g]
Acked-by: Christian Borntraeger <address@hidden>
Signed-off-by: Eugene (jno) Dvurechenski <address@hidden>
Signed-off-by: Jens Freimann <address@hidden>
Signed-off-by: Cornelia Huck <address@hidden>
---
pc-bios/s390-ccw/bootmap.c | 12 +++---
pc-bios/s390-ccw/s390-ccw.h | 2 +-
pc-bios/s390-ccw/virtio.c | 96 ++++++++++++++++++++++++++++++++++++++++---
pc-bios/s390-ccw/virtio.h | 48 ++++++++++++++++++++++
4 files changed, 147 insertions(+), 11 deletions(-)
diff --git a/pc-bios/s390-ccw/bootmap.c b/pc-bios/s390-ccw/bootmap.c
index c216030..fa2ca26 100644
--- a/pc-bios/s390-ccw/bootmap.c
+++ b/pc-bios/s390-ccw/bootmap.c
@@ -10,6 +10,7 @@
#include "s390-ccw.h"
#include "bootmap.h"
+#include "virtio.h"
/* #define DEBUG_FALLBACK */
@@ -22,7 +23,8 @@
#endif
/* Scratch space */
-static uint8_t sec[SECTOR_SIZE] __attribute__((__aligned__(SECTOR_SIZE)));
+static uint8_t sec[MAX_SECTOR_SIZE]
+__attribute__((__aligned__(MAX_SECTOR_SIZE)));
typedef struct ResetInfo {
uint32_t ipl_mask;
@@ -99,7 +101,7 @@ static inline bool unused_space(const void *p, unsigned int
size)
static int zipl_load_segment(ComponentEntry *entry)
{
- const int max_entries = (SECTOR_SIZE / sizeof(ScsiBlockPtr));
+ const int max_entries = (MAX_SECTOR_SIZE / sizeof(ScsiBlockPtr));