From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) by mx.groups.io with SMTP id smtpd.web10.105576.1679672627427833635 for ; Fri, 24 Mar 2023 08:43:47 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@rivosinc-com.20210112.gappssmtp.com header.s=20210112 header.b=BztTWwLB; spf=pass (domain: rivosinc.com, ip: 209.85.214.174, mailfrom: dhaval@rivosinc.com) Received: by mail-pl1-f174.google.com with SMTP id bc12so2201027plb.0 for ; Fri, 24 Mar 2023 08:43:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20210112.gappssmtp.com; s=20210112; t=1679672626; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=uUht83wZI8PoiJjj2Usogb/8aJNJ30zqnfY+UaS5PUQ=; b=BztTWwLBdBcqL7mAvgxpwc07GZq9H3E92P2NHFTHmqzOpOrS8k493InkG+QQ0/4+YS ZYlRQd0o54nM6H2/7xg/u3SbAA2QoP9rVDsJ3MWa7ngqSknDVw0/pv1qiXRRd7tOhcP6 sJvRzuLnTxnX7p8+VbyGUtdpGpEk3f10IZFUIbxP6Q4kmaZDb+1sboZOKobMJ0Sm1nue eg4EqtqVya9Wuo7nKqwynB1EegJAuiaE9MKC5nNy7jefOXgvUNT28lO6iDI9Ti5DTCMu OxaVcUX9CSfSao8VZfLPzF0peHQt6d6/gr6/gQ1RNYBx0czxBbGSbp9CFMP3DF1RMjJT TEGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679672626; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=uUht83wZI8PoiJjj2Usogb/8aJNJ30zqnfY+UaS5PUQ=; b=qXqdVm/gfTh1lzlOWmcUZoTOuyBhewsrJY3QQs9Hy25VrY+hW/k+HHTVK+eygWOv7r tWteUefz7NNwf7ODucKCubbPTVeg+1McEV1X9sHKBeEC52U5gQaHyaMtRayTyxomt4vw u11L9aFLXyhi9ZnRLGVUOAyHuwuMQR7gip/26ZpPDbOxAaNhYx6tmu5BfihtxJqfurOJ 8jOWhB/4RTfSgmvGpUM7xZvsDeR1DMqUNTxaQnb6wkeuuXM5F8Ud3Qx1rcOA/B4gqH+2 8XiyDXwVv2DcXKtfiW5gBn3uPY9Hnx2L9isKBCs9M0Bz3nCnpzO6WRLQIvqvL2U39ISL fpqw== X-Gm-Message-State: AAQBX9dglrRHLU5WqgaInEGYj00TMDwOQTN4sflDJSRvlNvZzUVk/IQZ IIP4k+02tiw1DkIDkPyjXquX8NWjM51/XQS4bdQ= X-Google-Smtp-Source: AKy350YzCrZVClkP3tu7Dq+Bw2dcupckeMGUkATFDrf8Yma8dG5CHv4Eh2OgN/cQXFZ6amth8Z87mw== X-Received: by 2002:a17:902:e495:b0:1a0:422f:39d9 with SMTP id i21-20020a170902e49500b001a0422f39d9mr2267903ple.39.1679672626497; Fri, 24 Mar 2023 08:43:46 -0700 (PDT) Return-Path: Received: from dhaval.ba.rivosinc.com ([171.76.83.64]) by smtp.gmail.com with ESMTPSA id je19-20020a170903265300b0019f3e339fb4sm14365369plb.187.2023.03.24.08.43.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Mar 2023 08:43:46 -0700 (PDT) From: "Dhaval Sharma" To: devel@edk2.groups.io Subject: [PATCH v1 0/2] WIP: Enable CMO support for RiscV64 Date: Fri, 24 Mar 2023 21:13:40 +0530 Message-Id: <20230324154342.180062-1-dhaval@rivosinc.com> X-Mailer: git-send-email 2.40.0.rc0.57.g454dfcbddf MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Current implementation for cache management (instruction/data flush/invd) depends on ifence instruction. All RV platforms may not use the same method for cache management. Instead RV defines CMO Cache management operations specification which consits of cbo.x instructions for cache management. However it requires GCC12+ to enable the same. Need to decide how cbo based implementation coexists with ifence based implementation with GCC version dependency. This patchset is primarily to review the same and decide path forward. review branch: https://github.com/rivosinc/edk2/tree/dev_rv_cmo_v1 Dhaval Sharma (2): MdePkg/BaseCacheMaintenanceLib: Enable RISCV CMO OvmfPkg/RiscVVirt: Enable CMO support OvmfPkg/RiscVVirt/RiscVVirtQemu.dsc | 9 ++ MdePkg/Library/BaseLib/BaseLib.inf | 1 + MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c | 126 ++++++++++++++++++-- MdePkg/Library/BaseLib/RiscV64/RiscVCpuCache.S | 23 ++++ 4 files changed, 152 insertions(+), 7 deletions(-) create mode 100644 MdePkg/Library/BaseLib/RiscV64/RiscVCpuCache.S -- 2.40.0.rc0.57.g454dfcbddf