From patchwork Mon Jul 4 09:33:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 587121 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:1ec:0:0:0:0 with SMTP id 12csp653004map; Mon, 4 Jul 2022 02:48:51 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sSV1mYfyikbDUn/H8t67VfpJ+DQavib99smQ9xMNHAOg6ySTRUtR5rOlp5R+d8JCsAN7rJ X-Received: by 2002:a81:6384:0:b0:317:e066:caf4 with SMTP id x126-20020a816384000000b00317e066caf4mr31793888ywb.180.1656928131582; Mon, 04 Jul 2022 02:48:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656928131; cv=none; d=google.com; s=arc-20160816; b=fb7XKi0TpvuOgHGaUMBdGBmk/GswZDPnFr7GtiBcVr7KkXvHCsFIc+rnp/QGl44GlW XWCvOeWmAP2muZ+V7ohG5O+8Uty6Bx1ruKydRloD0QQfNFUVaYe5fRZGzh522TewtEsv WATTBYWaTPqFAIsCaAwFEMgBaL537gqy33AT31voP891AfCwomSlcWLQjqgzYH/z2ltI l9WIn/O6vBYqbHRx9fdbaDc0K/IGn1nF+JoyDP+/QksvSiMU4yMsEXEa0dChuVAsp0mt erEbICdTwCPHY8xY9s/kXqGqSJIm8jg6KM1YKHFeG+aQBh8ISzZCxuIS6+gzpZLQnpm1 wK0Q== 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=zPQF7qAxMsUGSMMj7i5GhZQSwuAyR+rQDBqDPa2DHGMsgyuUW3RXE2ETmAbsmeXx4v nKRkaMvRWhSIFVLpX6DqoyuQ34obIc/HrOJs2Ua6I8EQWiB84qydwBMVmXfZnZkEIM/q IfyuNtRXSTtfkJGpF9dGF3mMC1Xq8VRERHsXKZ448gbLJEKbCXyLrENFxlQ8HVXGAUDR kFGE8iYCCanLabRZAf0mBMpqSVesnteWXS3QTBF3FQaO2GjqDRxfM/X+8iLS5W9Da2bb dWuuuz5nmSurBGfDMTBJktVtAJDLO/zIThIlSI7gFSLCoRaKPRMPg/Ka7wteQVPFk8/v otKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iWuCx4Vp; 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 130-20020a251688000000b0065ce3a59b0bsi34343829ybw.359.2022.07.04.02.48.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 04 Jul 2022 02:48:51 -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=iWuCx4Vp; 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]:33096 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o8IhH-0006Kf-21 for patch@linaro.org; Mon, 04 Jul 2022 05:48:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43086) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o8ITf-0000rf-V1 for qemu-devel@nongnu.org; Mon, 04 Jul 2022 05:34:47 -0400 Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]:39526) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o8ITa-0004ys-Fa for qemu-devel@nongnu.org; Mon, 04 Jul 2022 05:34:47 -0400 Received: by mail-pg1-x529.google.com with SMTP id q82so1268027pgq.6 for ; Mon, 04 Jul 2022 02:34:41 -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=iWuCx4VpqAeKD5SFKHBUshW6V0ZF2Cfbp2smIhfW/cvO6S+SfPXGOq2EsQQF6t/5yk I3rPwBtOKgkcJmiY1pXEYWZIpjL4zEVOByuc+nFG11RP2hs2EqZsvcuooLFvI1dOBKPM Fq6r6twd4jyx0+nzc0SJ7f/9FnUxaqLFQwn6/ug0OR6XAfTINCmfaorstsFL85s059FR PgkqkOEYC5XdVx4rbgdNI6IJ1IabRh/IASoQdX1pHEXnwr1X59L6HprbG12lfJsh2UOL QJv5pRI63c4tWZP/RywvnH7ZJpYGKlsP0M361pIS5Xf53itGLgmZV5v2lzGrsyRynvlW YLpA== 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=hZdA9i5Efd8gpxEC/Z+6brs/20DT5paxKp+gBNhKyFGRxVSiCbkekhTQuckHyzPfuD 1XrOMTWEcx5RVlfiz2DhHsMKJU0xPupo//SD+NtpR5/5pvi/bB8D9G/peI+sl23R5oHN rcRqgnzxi1odDN9Esg4J4VIfNTxJikMcf9FkqmrYNJQzi9w0c7NnM6gAwnX0GFUwQ0BC /5QXuRcdDGBKpjK+5fsmAuLzaOZvyidCrs8k1wMi3ikPq0XZ9M00oOGLbswbBsv8fR/Y WcK3EjdqgiHVzT9xtgt15ekPkp5xowNBfoxjhjAF7yWJiifxyxc4TOPh6RKVYLXM1Tfn ARgg== X-Gm-Message-State: AJIora++uCrihRntgTm+EK/Nj8XAWkp1FZiL+gQ9tKXbPBM3+tup97tr afqSa30UmaBDs+UBkap4bAESbm/kpiVhVM/L X-Received: by 2002:a63:f70c:0:b0:412:1877:7e1c with SMTP id x12-20020a63f70c000000b0041218777e1cmr8859077pgh.621.1656927280233; Mon, 04 Jul 2022 02:34:40 -0700 (PDT) Received: from stoup.. ([122.255.60.245]) by smtp.gmail.com with ESMTPSA id z5-20020aa79e45000000b00525b7f3e906sm15353355pfq.27.2022.07.04.02.34.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Jul 2022 02:34:39 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Song Gao , Xiaojuan Yang Subject: [PULL 13/23] target/loongarch: Update README Date: Mon, 4 Jul 2022 15:03:47 +0530 Message-Id: <20220704093357.983255-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220704093357.983255-1-richard.henderson@linaro.org> References: <20220704093357.983255-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::529; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x529.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/