From patchwork Mon Jul 29 17:53:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepak Gupta X-Patchwork-Id: 13745566 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A8B84C3DA7F for ; Mon, 29 Jul 2024 17:57:31 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sYUZX-0006qK-Rd; Mon, 29 Jul 2024 13:54:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sYUZQ-0006Hd-8r for qemu-devel@nongnu.org; Mon, 29 Jul 2024 13:54:04 -0400 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sYUZM-0000PV-NQ for qemu-devel@nongnu.org; Mon, 29 Jul 2024 13:54:04 -0400 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-70d1d818c42so2115940b3a.1 for ; Mon, 29 Jul 2024 10:54:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1722275639; x=1722880439; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=hLdx4AZXHbpEMxw/S18/9QimvuhK4hPq7UuREWO1i7w=; b=AxcNr6CTMWlI+Cs7fVd2dxcaQojw/0Yh4V/nkrvHm3c++QIcR8hbtub1MPgujKX7/O XLyYdGsMNDMRLTdqjRIbIOken5p5YW7kjWUrbONF+gx+ANpWBdRsmli15CRx0QWjIcol 3C2Ty4Kr3k0+G9yOzB/ctVIX70cuvu8+lHqCv4pELK0Ngl9ZQMEKB6DBmYXEi/hDmKaf Pbndl0rTQadfbIA7mdoFH9bBLMJ/etG84elMYlpdM+jBxRFcbF1bQF/bd/h3IQ0zkTjd QVY2awcI4Q/6LAVCyuAlnLljeEHM04zwDNCzSmHvtkE4Q1/LYtqa5UqPwSr27Q6Kyx65 9Xyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722275639; x=1722880439; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hLdx4AZXHbpEMxw/S18/9QimvuhK4hPq7UuREWO1i7w=; b=cWDNNAJuiNqSK6s8rbyDjzkJ2yjPFROvGL1bhHBLZlKeKnOfy8YWXQ6JmgBgaG5BTT 6npTWoRMoWNBcb6WZj4grDtGdeQohkK89z9kCS/V4qd6zi6nEbW7dGnVqMx22Kxysrvx Es8EAWte5wPN0ygCq4/qyeSKXEzyYAQnbPVoWMOeb9Mxzg2OEnU0HLoLg55cRhcYWlhT Vi7CsHc5t4GO1gKIPIgVoyn8s9E3aPJM8SUoYdTezsgRWWkYckE1e5Lyqzvb/ViCYA00 H+fpjk0jaXmYHeNOmcuxjvuqw27Ju+B8QD6DEuxbCgcU/rf+h8IDVBamGRM7K//FU0dc 6kYw== X-Forwarded-Encrypted: i=1; AJvYcCUB/OWkFdbBT0iLJMU7oTtq9wY2kRHrp403EHZ5fPvM4+NEYMJRxgz1leTE15G6I9HmLCxLT/svpG06kgSAh6bYsa1z9Ws= X-Gm-Message-State: AOJu0YxSUl8GD05WZC2+NMJlD0Dy3BqRdzOahP6/ucvCtNZo8J54pME2 /CgQQehjhRqnrhbcthJk+pvTFos90PSm0P+Wbxb+rg1WZ/i4rVLGr9325075MUI= X-Google-Smtp-Source: AGHT+IHeHWKLJYpABBBI9IQcd/WVDBlP3mFmzx1JskVZ4SD0srql6HA5QQVPGd6UEK4LTE1RVzAvew== X-Received: by 2002:a05:6a20:3d88:b0:1c3:aec6:7663 with SMTP id adf61e73a8af0-1c4a13afd68mr7286492637.39.1722275638861; Mon, 29 Jul 2024 10:53:58 -0700 (PDT) Received: from debug.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7a9f7c71b15sm6303141a12.18.2024.07.29.10.53.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jul 2024 10:53:58 -0700 (PDT) From: Deepak Gupta To: qemu-riscv@nongnu.org, qemu-devel@nongnu.org, jim.shu@sifive.com, andy.chiu@sifive.com, jesse.huang@sifive.com, kito.cheng@sifive.com Cc: palmer@dabbelt.com, Alistair.Francis@wdc.com, laurent@vivier.eu, bmeng.cn@gmail.com, liwei1518@gmail.com, dbarboza@ventanamicro.com, zhiwei_liu@linux.alibaba.com, Deepak Gupta Subject: [PATCH v2 23/24] linux-user: Add RISC-V zicfilp support in VDSO Date: Mon, 29 Jul 2024 10:53:25 -0700 Message-ID: <20240729175327.73705-24-debug@rivosinc.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240729175327.73705-1-debug@rivosinc.com> References: <20240729175327.73705-1-debug@rivosinc.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::432; envelope-from=debug@rivosinc.com; helo=mail-pf1-x432.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, LOTS_OF_MONEY=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Add zicfilp support in VDSO. VDSO functions need lpad instruction so that userspace could call this function when landing pad extension is enabled. This solution only works when toolchain always use landing pad label 1. Otherwise, If extension is not enabled, lpad instructions will be lui instructions with rd=x0 (which is nop). Prebuilt VDSO is still compatible with RISC-V core w/o zicfilp extension. Signed-off-by: Jim Shu Signed-off-by: Deepak Gupta --- linux-user/riscv/vdso-64.so | Bin 3944 -> 4128 bytes linux-user/riscv/vdso.S | 50 ++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/linux-user/riscv/vdso-64.so b/linux-user/riscv/vdso-64.so index ae49f5b043b5941b9d304a056c2b50c185f413b0..cd7f2fa7bdb811af6be2dcc3fb9601b66e3d1c81 100755 GIT binary patch delta 1345 zcmah}O=uHA6rRa8*`3W#v-vSWgUvy(QL#}%mV&j76iPuQBHAj2(ng|zmM)E!P>`g> ziy+eQP!K%yD2kv2Jb7q5_;(V#2zrPIp$E0T*_|nLFFu%g^L_K)%k2BfxBcts zwSKzU%uIMvDl|QN=xp4}g4*$}@d(n<~qepB*LP!3)Siz)SSu5ui{`}Ri4l{qVG z<))V_rE;ZO#UoHP&Zd{==Wom%v$EK`eUMXAv;*hV1Wm$<8dtCYs1tO{Mm~~-=ZGxa zjpj-e9%`|fX?zbQKeuJaBedlj?wn7H+zXnl z+6N3On@wEY6ZY=Tcmf7X)L-B&?+M^(KWxa1Nj(DZ`~!MYOa>phK%U8T zbfFM1nH*fK8zMQjS!g4|p|!;V8Z`BtS@y!IU|yFKn)JeIFwbQ2i_i|5tR_lP0~#_7 pnM$drU_4|p`G+?Pw?igvKsz+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