From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) by mx.groups.io with SMTP id smtpd.web11.3206.1677033424567462272 for ; Tue, 21 Feb 2023 18:37:04 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@ventanamicro.com header.s=google header.b=AvpOsh07; spf=pass (domain: ventanamicro.com, ip: 209.85.216.48, mailfrom: sunilvl@ventanamicro.com) Received: by mail-pj1-f48.google.com with SMTP id u10so7267557pjc.5 for ; Tue, 21 Feb 2023 18:37:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=1fQydnHcbve75xgErZekEt3e8Yc/unMls3qAymXJPy4=; b=AvpOsh07q4TWZdFfYAIZTRsV/NYvrEVvcW0vwvfA/bAimrPgc/42QWWIh5Tr+ZgYGE cCO9ZiU/IcoZJCSqvaHjASoDTr1v7MGx4QyWDZn1KrWdu7tiN6r5Otjvqd8/jBBKkhk1 A4hD95uHU4DWvLaWSs1Q0WydySZLUYLabqFzLqp0gyShhHrTqu37z6d/u/aep3yYdNNc i5OelTeHMa+gY8l3nuzqBhEJaWjUH37yH7O+TNe0Xai148pqZU00Ji2i+uruOiPAmGNu PY+89ZqHrYx0yeFd0vkxpO05aW9RKx3cB1peZhiLCbctVGwatG//nqZCln5/ibt76wPJ 9pxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=1fQydnHcbve75xgErZekEt3e8Yc/unMls3qAymXJPy4=; b=7Ct8LwCZjMcdq0KhOJSKYTdWWBlCn0+FCqYedYiBkpuW6cWO30XA2NTR0IDrPk6EH8 jCHsVH9cjmSEJ+Kb7lbjLQT72wIQuoJtl+znqPBRGi2/E605bZO6bucG4oDiw4uTwMPT ndr3K9Y7IPXCAa9l40uncECnRIFAxi+LqPYOsmMtTJlkJhH2+XU/J10aq+wsxl5s8JRj 5oUwlFFXQ+1MNnYqRzszMBjeb8mxzHy+iAsYTBd/VSt0gQKYsRYtR5N8U0vsTdBUZQIU fPf28slsbzy22N/UmK506nwe/5DhJX/WvfE5az4R220vKgX9emiqnG9vPBBcP2QNuJL1 lkFQ== X-Gm-Message-State: AO0yUKWXmccMkb3tdt9N8IDt0QguBwRxjOLlMo0jPsBUKiGHwB3gFpOn YiiykHUqyISFSUZ5Tkic+gDngUBF97VadbhC X-Google-Smtp-Source: AK7set8Zoa7uNqQtKLMqtXMheVLp2DCydBtIIXui+E7qTYfTt09SzKpgwGctKHB5el6CEGlYiaqz/w== X-Received: by 2002:a17:90a:4b:b0:233:fdfd:710c with SMTP id 11-20020a17090a004b00b00233fdfd710cmr8765207pjb.37.1677033423837; Tue, 21 Feb 2023 18:37:03 -0800 (PST) Return-Path: Received: from kerodi.Dlink ([49.206.14.226]) by smtp.gmail.com with ESMTPSA id v6-20020a17090a7c0600b00233567a978csm3915649pjf.42.2023.02.21.18.37.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Feb 2023 18:37:03 -0800 (PST) From: "Sunil V L" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Jiewen Yao , Jordan Justen , Gerd Hoffmann , Andrei Warkentin , Heinrich Schuchardt Subject: [PATCH V2 1/1] OvmfPkg/RiscVVirt: Fix SCT memory allocation test case failure Date: Wed, 22 Feb 2023 08:06:59 +0530 Message-Id: <20230222023659.2316602-1-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Fix the UEFI memory range calculation by including the correct stack memory range. Without this fix, SCT hangs in MemoryAllocation test cases which call AllocateAddress(). Cc: Ard Biesheuvel Cc: Jiewen Yao Cc: Jordan Justen Cc: Gerd Hoffmann Cc: Andrei Warkentin Reported-by: Heinrich Schuchardt Signed-off-by: Sunil V L --- Changes since V1: 1) Fixed the inaccurate description regarding stack growth (Thanks Andrei!) 2) Simplified the fix. OvmfPkg/RiscVVirt/Sec/SecMain.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/OvmfPkg/RiscVVirt/Sec/SecMain.c b/OvmfPkg/RiscVVirt/Sec/SecMain.c index 054e49ef0c1e..73b9b21a67ba 100644 --- a/OvmfPkg/RiscVVirt/Sec/SecMain.c +++ b/OvmfPkg/RiscVVirt/Sec/SecMain.c @@ -71,8 +71,9 @@ SecStartup ( FirmwareContext.FlattenedDeviceTree = (UINT64)DeviceTreeAddress; SetFirmwareContextPointer (&FirmwareContext); - StackBase = (UINT64)FixedPcdGet32 (PcdOvmfSecPeiTempRamBase); - UefiMemoryBase = StackBase + FixedPcdGet32 (PcdOvmfSecPeiTempRamSize) - SIZE_32MB; + StackBase = (UINT64)FixedPcdGet32 (PcdOvmfSecPeiTempRamBase) + + FixedPcdGet32 (PcdOvmfSecPeiTempRamSize); + UefiMemoryBase = StackBase - SIZE_32MB; // Declare the PI/UEFI memory region HobList = HobConstructor ( -- 2.34.1