All of lore.kernel.org
 help / color / mirror / Atom feed
From: Huacai Chen <zltjiangshi@gmail.com>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Aleksandar Markovic" <aleksandar.qemu.devel@gmail.com>
Cc: Huacai Chen <chenhuacai@gmail.com>,
	Huacai Chen <chenhc@lemote.com>,
	Aleksandar Rikalo <aleksandar.rikalo@rt-rk.com>,
	qemu-devel@nongnu.org, Aurelien Jarno <aurelien@aurel32.net>
Subject: [PATCH for-5.1 V4 0/7] mips: Add Loongson-3 machine support (with KVM)
Date: Tue,  2 Jun 2020 10:39:13 +0800	[thread overview]
Message-ID: <1591065557-9174-1-git-send-email-chenhc@lemote.com> (raw)

Loongson-3 CPU family include Loongson-3A R1/R2/R3/R4 and Loongson-3B
R1/R2. Loongson-3A R1 is the oldest and its ISA is the smallest, while
Loongson-3A R4 is the newest and its ISA is almost the superset of all
others. To reduce complexity, in QEMU we just define two CPU types:

1, "Loongson-3A1000" CPU which is corresponding to Loongson-3A R1. It is
   suitable for TCG because Loongson-3A R1 has fewest ASE.
2, "Loongson-3A4000" CPU which is corresponding to Loongson-3A R4. It is
   suitable for KVM because Loongson-3A R4 has the VZ ASE.

Loongson-3 lacks English documents. I've tried to translated them with
translate.google.com, and the machine translated documents (together
with their original Chinese versions) are available here.

Loongson-3A R1 (Loongson-3A1000)
User Manual Part 1:
http://ftp.godson.ac.cn/lemote/3A1000_p1.pdf
http://ftp.godson.ac.cn/lemote/Loongson3A1000_processor_user_manual_P1.pdf (Chinese Version)
User Manual Part 2:
http://ftp.godson.ac.cn/lemote/3A1000_p2.pdf
http://ftp.godson.ac.cn/lemote/Loongson3A1000_processor_user_manual_P2.pdf (Chinese Version)

Loongson-3A R2 (Loongson-3A2000)
User Manual Part 1:
http://ftp.godson.ac.cn/lemote/3A2000_p1.pdf
http://ftp.godson.ac.cn/lemote/Loongson3A2000_user1.pdf (Chinese Version)
User Manual Part 2:
http://ftp.godson.ac.cn/lemote/3A2000_p2.pdf
http://ftp.godson.ac.cn/lemote/Loongson3A2000_user2.pdf (Chinese Version)

Loongson-3A R3 (Loongson-3A3000)
User Manual Part 1:
http://ftp.godson.ac.cn/lemote/3A3000_p1.pdf
http://ftp.godson.ac.cn/lemote/Loongson3A3000_3B3000usermanual1.pdf (Chinese Version)
User Manual Part 2:
http://ftp.godson.ac.cn/lemote/3A3000_p2.pdf
http://ftp.godson.ac.cn/lemote/Loongson3A3000_3B3000usermanual2.pdf (Chinese Version)

Loongson-3A R4 (Loongson-3A4000)
User Manual Part 1:
http://ftp.godson.ac.cn/lemote/3A4000_p1.pdf
http://ftp.godson.ac.cn/lemote/3A4000user.pdf (Chinese Version)
User Manual Part 2:
I'm sorry that it is unavailable now.

We are preparing to add QEMU's Loongson-3 support. MIPS VZ extension is
fully supported in Loongson-3A R4+, so we at first add QEMU/KVM support
in this series. And the next series will add QEMU/TCG support (it will
emulate Loongson-3A R1).

We already have a full functional Linux kernel (based on Linux-5.4.x LTS
but not upstream yet) here:

https://github.com/chenhuacai/linux

How to use QEMU/Loongson-3?
1, Download kernel source from the above URL;
2, Build a kernel with arch/mips/configs/loongson3_{def,hpc}config;
3, Boot a Loongson-3A4000 host with this kernel;
4, Build QEMU-5.0.0 with this patchset;
5, modprobe kvm;
6, Use QEMU with TCG (available in future):
       qemu-system-mips64el -M loongson3,accel=tcg -cpu Loongson-3A1000 -kernel <path_to_kernel> -append ... 
   Use QEMU with KVM (available at present): 
       qemu-system-mips64el -M loongson3,accel=kvm -cpu Loongson-3A4000 -kernel <path_to_kernel> -append ... 

   The "-cpu" parameter can be omitted here and QEMU will use the correct type for TCG/KVM automatically.

V1 -> V2:
1, Add a cover letter;
2, Improve CPU definitions;
3, Remove LS7A-related things (Use GPEX instead);
4, Add a description of how to run QEMU/Loongson-3.

V2 -> V3:
1, Fix all possible checkpatch.pl errors and warnings.

V3 -> V4:
1, Sync code with upstream;
2, Remove merged patches;
3, Fix build failure without CONFIG_KVM;
4, Add Reviewed-by: Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>.

Huacai Chen(4):
 hw/mips: Implement the kvm_type() hook in MachineClass
 target/mips: Add Loongson-3 CPU definition
 hw/mips: Add Loongson-3 machine support (with KVM)
 MAINTAINERS: Add myself as Loongson-3 maintainer

Signed-off-by: Huacai Chen <chenhc@lemote.com>
---
 MAINTAINERS                          |   5 +
 default-configs/mips64el-softmmu.mak |   1 +
 hw/core/Makefile.objs                |   2 +-
 hw/core/null-machine.c               |   4 +
 hw/mips/Kconfig                      |  10 +
 hw/mips/Makefile.objs                |   3 +-
 hw/mips/common.c                     |  42 ++
 hw/mips/loongson3.c                  | 901 +++++++++++++++++++++++++++++++++++
 include/hw/mips/mips.h               |   3 +
 target/mips/cpu.h                    |  28 ++
 target/mips/internal.h               |   2 +
 target/mips/mips-defs.h              |   7 +-
 target/mips/translate.c              |   2 +
 target/mips/translate_init.inc.c     |  86 ++++
 14 files changed, 1092 insertions(+), 4 deletions(-)
 create mode 100644 hw/mips/common.c
 create mode 100644 hw/mips/loongson3.c
--
2.7.0


             reply	other threads:[~2020-06-02  2:39 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-02  2:39 Huacai Chen [this message]
2020-06-02  2:39 ` [PATCH for-5.1 V4 1/4] hw/mips: Implement the kvm_type() hook in MachineClass Huacai Chen
2020-06-03 14:34   ` Aleksandar Markovic
2020-06-04  0:57     ` Huacai Chen
2020-06-04 10:04       ` Aleksandar Markovic
2020-06-14  8:07   ` Aleksandar Markovic
2020-06-15  0:52     ` Huacai Chen
2020-06-15  8:55       ` Thomas Huth
2020-06-15 19:44         ` Aleksandar Markovic
2020-06-16  6:11           ` Huacai Chen
2020-06-16 21:17             ` Aleksandar Markovic
2020-06-02  2:39 ` [PATCH for-5.1 V4 2/4] target/mips: Add Loongson-3 CPU definition Huacai Chen
2020-06-06  7:30   ` Aleksandar Markovic
2020-06-02  2:39 ` [PATCH for-5.1 V4 3/4] hw/mips: Add Loongson-3 machine support (with KVM) Huacai Chen
2020-06-06  7:32   ` Aleksandar Markovic
2020-06-06  8:01     ` Aleksandar Markovic
2020-06-07  1:12       ` chen huacai
2020-06-07 20:00         ` Aleksandar Markovic
2020-06-08  3:56           ` Huacai Chen
2020-06-11  5:58   ` Jiaxun Yang
2020-06-11  7:49     ` Huacai Chen
2020-06-11  8:12       ` Jiaxun Yang
2020-06-11  8:50         ` Aleksandar Markovic
2020-06-12  6:07           ` Huacai Chen
2020-06-14  7:51   ` Aleksandar Markovic
2020-06-15  0:55     ` Huacai Chen
2020-06-15  4:42       ` Aleksandar Markovic
2020-06-15  4:50       ` Aleksandar Markovic
2020-06-15  5:36         ` Huacai Chen
2020-06-15  5:58           ` Aleksandar Markovic
2020-06-15  6:04           ` Aleksandar Markovic
2020-06-15  6:29             ` Huacai Chen
2020-06-15  6:44               ` Aleksandar Markovic
2020-06-02  2:39 ` [PATCH for-5.1 V4 4/4] MAINTAINERS: Add myself as Loongson-3 maintainer Huacai Chen
2020-06-02  8:12   ` Philippe Mathieu-Daudé
2020-06-02 12:03     ` chen huacai
2020-06-05  8:38 ` [PATCH for-5.1 V4 0/7] mips: Add Loongson-3 machine support (with KVM) Aleksandar Markovic
2020-06-05  8:40   ` Aleksandar Markovic
2020-06-05  9:05   ` Jiaxun Yang
2020-06-05  9:21     ` Huacai Chen
2020-06-05  9:27     ` Aleksandar Markovic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1591065557-9174-1-git-send-email-chenhc@lemote.com \
    --to=zltjiangshi@gmail.com \
    --cc=aleksandar.qemu.devel@gmail.com \
    --cc=aleksandar.rikalo@rt-rk.com \
    --cc=aurelien@aurel32.net \
    --cc=chenhc@lemote.com \
    --cc=chenhuacai@gmail.com \
    --cc=f4bug@amsat.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.