[SeaBIOS] [PATCH 2/2] pvscsi: Use high memory for rings

Dana Rubin dana.rubin at oracle.com
Thu Aug 4 13:22:31 CEST 2016


From: Dana Rubin <dana.rubin at ravellosystems.com>

Avoid using the scarce ZoneLow memory.
This limits max number of pvscsi controllers.

As driver runs in 32bit mode, use ZoneHigh allocation instead.

Signed-off-by: Dana Rubin <dana.rubin at ravellosystems.com>
Signed-off-by: Shmulik Ladkani <shmulik.ladkani at ravellosystems.com>
---
 src/hw/pvscsi.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/hw/pvscsi.c b/src/hw/pvscsi.c
index 7535493..cd4046c 100644
--- a/src/hw/pvscsi.c
+++ b/src/hw/pvscsi.c
@@ -167,18 +167,18 @@ pvscsi_init_rings(void *iobase, struct pvscsi_ring_dsc_s **ring_dsc)
 {
     struct PVSCSICmdDescSetupRings cmd = {0,};
 
-    struct pvscsi_ring_dsc_s *dsc = memalign_low(PAGE_SIZE, sizeof(*dsc));
+    struct pvscsi_ring_dsc_s *dsc = memalign_high(PAGE_SIZE, sizeof(*dsc));
     if (!dsc) {
         warn_noalloc();
         return;
     }
 
     dsc->ring_state =
-        (struct PVSCSIRingsState *)memalign_low(PAGE_SIZE, PAGE_SIZE);
+        (struct PVSCSIRingsState *)memalign_high(PAGE_SIZE, PAGE_SIZE);
     dsc->ring_reqs =
-        (struct PVSCSIRingReqDesc *)memalign_low(PAGE_SIZE, PAGE_SIZE);
+        (struct PVSCSIRingReqDesc *)memalign_high(PAGE_SIZE, PAGE_SIZE);
     dsc->ring_cmps =
-        (struct PVSCSIRingCmpDesc *)memalign_low(PAGE_SIZE, PAGE_SIZE);
+        (struct PVSCSIRingCmpDesc *)memalign_high(PAGE_SIZE, PAGE_SIZE);
     if (!dsc->ring_state || !dsc->ring_reqs || !dsc->ring_cmps) {
         warn_noalloc();
         return;
-- 
1.9.1




More information about the SeaBIOS mailing list