From patchwork Sun Jul 3 08:59:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 586865 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:5036:0:0:0:0 with SMTP id e22csp2946319mab; Sun, 3 Jul 2022 02:42:21 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v1Gi9wNx4HweyyCjqHH9qGFRT4WIGsWAFwNB2niuaKCKuSA0+iZVGDc30YVzxh2RgtFbFb X-Received: by 2002:a81:b44:0:b0:31c:8a14:8c6e with SMTP id 65-20020a810b44000000b0031c8a148c6emr2303150ywl.40.1656841341740; Sun, 03 Jul 2022 02:42:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656841341; cv=none; d=google.com; s=arc-20160816; b=ekl/LM3PoBXNo7+4s5iFMNyUQvV3D4LwRTXuRtao5lUxoZm6ctd7nMRnEyDUFNvqPz hJ2900TyI+SOKeQZ3zTw62S7b1KcvwLdFLpXeDqNDgS59II/5uIQl0FddZ/04vwaRJ68 HFwewfKlBXY7GLoa9Jp69XwpIkuDZP/IXDtNOicl2lOitYvMm0+/gE6lQ9x+3XjhVPZ5 DMOCJ8c7gWFFfl20wD6rS+q0AqYBYnvHlyo7AtuJJ00lmpL6j+gZ5Hm8W0P0GsUHjUBJ Z5+hEps8Rb+RmJjjjWwl657PPWLndgG6N1dqZ+E01NOSvmqX7JQRxJTiaUErM4hrPdKW YNlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ZpM2xT691aOsaTZd6sDap5X966f+8/CDqP5hDIUEL28=; b=NKl/zquPdExHnLwf64jbSbpfMwjG9BGjEfbkl0qaQLGjp67SERTKgWcOCXDuWv6E8I jH3C05l0f6n3PMsrF3BA6aP4qHlCPHUc0Ij491XncH8QCQ+Jut+MnbnbwexXqTNYyWHu PoN2d4UDJle9rCmMi9YhBC8M8wM94LDq3NpdufE04ZkjVOypEn57TyYi26gp24ok1Slj 1A2VUaPuJ4Lz8naKaOfKzWIgs9GFMzdx3WevjUOAZ0czg87TnYct6qX7RaECjxdJ/5Xw wQhKng0wFecKwiebpAHffuonCLzwcEyamBd5sUXMXyZHYaRzmRNM2ocmYhg8B55A9Qg5 6G+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OoS95rA5; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id q191-20020a8199c8000000b0031c91d57b28si722030ywg.441.2022.07.03.02.42.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 03 Jul 2022 02:42:21 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OoS95rA5; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:46352 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o7w7R-0008Bm-8z for patch@linaro.org; Sun, 03 Jul 2022 05:42:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58838) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o7vSg-00059v-L0 for qemu-devel@nongnu.org; Sun, 03 Jul 2022 05:00:17 -0400 Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534]:42674) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o7vSU-0004D9-LM for qemu-devel@nongnu.org; Sun, 03 Jul 2022 05:00:04 -0400 Received: by mail-pg1-x534.google.com with SMTP id o18so5104204pgu.9 for ; Sun, 03 Jul 2022 02:00:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ZpM2xT691aOsaTZd6sDap5X966f+8/CDqP5hDIUEL28=; b=OoS95rA5srGalUbqm8NyXlImTqjx5VpxWF3D4I0WeXK/azsNCV9zxm+7CSWFVMvCjU 5fwIp96zM0pwmGRW02OcWXa3CEvo+cnN5ghiU+8FavtQv+diM/eba1iFP1ZWcJdUAQwO GhBWowrJDF6Z2QDemKTQwSSmysxmI+QR5wfyoxVB3n2PLrx1NTczbb7oSGRXH2Ma3ZyP CaiI/+Jj0GD1k2SE9vLN6ZamSWA4TStTHvoge+MDc4E96flwWSoarC4uSzYOjaYknn6v jHrWE6Q0H/tcSPevq9UPwoTlzF+cBvQZpmu6Z7XE0ydINo9h6spfn7eZ+c603SLyg8mX 7AEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ZpM2xT691aOsaTZd6sDap5X966f+8/CDqP5hDIUEL28=; b=aEqXWEoJnm4CKnGVL3lUQZyNnbYnu22g8Qs+iuRB5bXDHjq7EZxX5hKIVqeNygwkp1 ipitwGqkAuNgFMGgo/UYPpPTfUg6w8Tcne8tHzlsXYUKW43mA8HiHHgV9tcVGrZDe6La Inra5P5Rpy7vGB6un3l2C24xdlRUDy04CjUgNaxhTB1vHzP6rN57Q9iRBkIVBJWdRlR1 qlH7jz6PPM3B4BDjFM6h/EW+RCT2g+Rj/2Kcwapx5iy3wlJWLR7LxhibfPXyCSY/vE3J uufQYP9TYdqZYEMOOIMOnpcGmGZ3mtcdF0/bIykAC/Ini9HiGwTMq6iBv24SHOVTtt3A angQ== X-Gm-Message-State: AJIora9/5QrF7XHrTcq4ttuyOUNJKXwfRu9YqLD0kKULfAtArLT7Casn 4IiFLrF8ef/qxGXZrp7FAvd7VWCo3UIaPI4w X-Received: by 2002:a63:35c4:0:b0:40c:99f6:8889 with SMTP id c187-20020a6335c4000000b0040c99f68889mr19455689pga.387.1656838800274; Sun, 03 Jul 2022 02:00:00 -0700 (PDT) Received: from stoup.. ([122.255.60.245]) by smtp.gmail.com with ESMTPSA id cq16-20020a056a00331000b00518764d09cdsm18777593pfb.164.2022.07.03.01.59.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Jul 2022 01:59:59 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: laurent@vivier.eu, Song Gao , Xiaojuan Yang Subject: [PATCH v21 13/13] target/loongarch: Update README Date: Sun, 3 Jul 2022 14:29:13 +0530 Message-Id: <20220703085913.772936-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220703085913.772936-1-richard.henderson@linaro.org> References: <20220703085913.772936-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::534; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x534.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Song Gao Add linux-user emulation introduction Signed-off-by: Song Gao Signed-off-by: Xiaojuan Yang Reviewed-by: Richard Henderson Message-Id: <20220624031049.1716097-14-gaosong@loongson.cn> Signed-off-by: Richard Henderson --- target/loongarch/README | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/target/loongarch/README b/target/loongarch/README index 4dcd0f1682..9f5edd10c8 100644 --- a/target/loongarch/README +++ b/target/loongarch/README @@ -24,9 +24,9 @@ Download cross-tools. - wget https://github.com/loongson/build-tools/releases/latest/download/loongarch64-clfs-20211202-cross-tools.tar.xz + wget https://github.com/loongson/build-tools/releases/download/2022.05.29/loongarch64-clfs-5.0-cross-tools-gcc-full.tar.xz - tar -vxf loongarch64-clfs-20211202-cross-tools.tar.xz -C /opt + tar -vxf loongarch64-clfs-5.0-cross-tools-gcc-full.tar.xz -C /opt Config cross-tools env. @@ -60,5 +60,40 @@ ./build/qemu-system-loongarch64 -machine virt -m 4G -cpu Loongson-3A5000 -smp 1 -kernel build/tests/tcg/loongarch64-softmmu/hello -monitor none -display none -chardev file,path=hello.out,id=output -serial chardev:output +- Linux-user emulation + + We already support Linux user emulation. We can use LoongArch cross-tools to build LoongArch executables on X86 machines, + and We can also use qemu-loongarch64 to run LoongArch executables. + + 1. Config cross-tools env. + + see System emulation. + + 2. Test tests/tcg/multiarch. + + ./configure --static --prefix=/usr --disable-werror --target-list="loongarch64-linux-user" --enable-debug + + cd build + + make && make check-tcg + + 3. Run LoongArch system basic command with loongarch-clfs-system. + + - Config clfs env. + + wget https://github.com/loongson/build-tools/releases/download/2022.05.29/loongarch64-clfs-system-5.0.tar.bz2 + + tar -vxf loongarch64-clfs-system-5.0.tar.bz2 -C /opt/clfs + + cp /opt/clfs/lib64/ld-linux-loongarch-lp64d.so.1 /lib64 + + export LD_LIBRARY_PATH="/opt/clfs/lib64" + + - Run LoongArch system basic command. + + ./qemu-loongarch64 /opt/clfs/usr/bin/bash + ./qemu-loongarch64 /opt/clfs/usr/bin/ls + ./qemu-loongarch64 /opt/clfs/usr/bin/pwd + - Note. We can get the latest LoongArch documents or LoongArch tools at https://github.com/loongson/