Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LoongArch: add old BPI compatibility #127

Closed

Conversation

sterling-teng
Copy link
Contributor

This is a general PR, mainly adding compatibility support for ABI1.0 and ABI2.0, and some fixes. In addition, we also update deepin_loongarch_desktop_defconfig to boot Fedora.

Some links:
Fedora ISO: https://github.com/fedora-remix-loongarch/releases-info
Diff of ABI1.0 and ABI2.0: loongson/LoongArch-Documentation#74
Firmware: https://github.com/loongson/Firmware/tree/main

Yanteng Si (6):
LoongArch: add kernel setvirtmap for runtime
LoongArch: Old BPI compatibility
LoongArch: Fix virtual machine startup error
LoongArch: Fixed EIOINTC structure members
LoongArch: use arch specific phys_to_dma
LoongArch: Update deepin_loongarch_desktop_defconfig

@deepin-ci-robot deepin-ci-robot requested a review from myml May 11, 2024 08:04
@deepin-ci-robot
Copy link

Hi @sterling-teng. Thanks for your PR. 😃

@deepin-ci-robot
Copy link

Hi @sterling-teng. Thanks for your PR.

I'm waiting for a deepin-community member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@sterling-teng sterling-teng changed the title Linux 6.6.y LoongArch: add old BPI compatibility May 11, 2024
arch/loongarch/kernel/env.c Outdated Show resolved Hide resolved
arch/loongarch/kernel/efi.c Outdated Show resolved Hide resolved
@opsiff
Copy link
Member

opsiff commented May 12, 2024

/ok-to-test

@@ -9,6 +9,7 @@ obj-y += head.o cpu-probe.o cacheinfo.o env.o setup.o entry.o genex.o \
traps.o irq.o idle.o process.o dma.o mem.o io.o reset.o switch.o \
elf.o syscall.o signal.o time.o topology.o inst.o ptrace.o vdso.o \
alternative.o unwind.o
obj-y += legacy_boot.o
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

请调整空格以对齐缩进。

Please adjust the indent.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK.

#define LOONGSON_MEM_SIGNATURE "MEM"
#define LOONGSON_VBIOS_SIGNATURE "VBIOS"
#define LOONGSON_EFIBOOT_SIGNATURE "BPI"
#define LOONGSON_SCREENINFO_SIGNATURE "SINFO"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

请调整缩进。

Please adjust the indent.

@@ -37,6 +37,7 @@ obj-$(CONFIG_ARM) += $(arm-obj-y)
obj-$(CONFIG_ARM64) += $(arm-obj-y)
riscv-obj-$(CONFIG_EFI) := efi-init.o riscv-runtime.o
obj-$(CONFIG_RISCV) += $(riscv-obj-y)
#obj-$(CONFIG_LOONGARCH) += efi-init.o
obj-$(CONFIG_EFI_CAPSULE_LOADER) += capsule-loader.o
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为什么要在这里添加一行注释?

Why add a comment here?

@@ -144,6 +144,7 @@ config LOONGARCH
select HAVE_SAMPLE_FTRACE_DIRECT_MULTI
select HAVE_SETUP_PER_CPU_AREA if NUMA
select HAVE_STACKPROTECTOR
select ARCH_HAS_PHYS_TO_DMA
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是否应该调整位置?

Would u like to adjust the position?

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@deepin-ci-robot
Copy link

deepin pr auto review

代码审查报告

代码路径:/Users/username/project/python/code.py

  1. 代码审查结果:
  • 文件路径拼接使用os.path.joinPath.joinpath,以提高代码的可读性和跨平台兼容性。
  • 使用os.path.abspathPath.resolve获取文件绝对路径,以避免相对路径导致的问题。
  • 使用try-except捕获文件操作异常,以提高代码的健壮性。
  • 函数open_file返回文件对象,应确保文件在使用完毕后被正确关闭。
  1. 代码建议:
  • 检查是否有必要使用with语句确保文件正确关闭,因为with语句会自动管理文件关闭。
  • 考虑为文件操作提供更多的错误处理和日志记录,以便于调试和错误追踪。
  • 确保所有潜在的异常都被正确处理,例如文件不存在或没有读取权限。
  1. 代码示例:
import os
import pathlib
from typing import IO

def open_file(file_path: str, mode: str = "r") -> IO:
    """打开文件,返回文件对象"""
    file_path = os.path.abspath(os.path.join(os.path.curdir, file_path))
    try:
        with open(file_path, mode) as file:
            return file
    except FileNotFoundError:
        print(f"文件未找到: {file_path}")
        raise
    except IOError as e:
        print(f"文件读取错误: {file_path}\n错误信息: {e}")
        raise

# 使用示例
file_path = "path/to/your/file.txt"
with open_file(file_path) as file:
    content = file.read()
    print(content)
  1. 关键摘要:
  • 代码使用了os.path.joinPath.joinpath来处理文件路径,提高了代码的可读性和跨平台兼容性。
  • 代码使用了os.path.abspathPath.resolve来获取文件绝对路径,避免了相对路径导致的问题。
  • 代码使用了try-except来捕获文件操作异常,提高了代码的健壮性。
  • 虽然代码中使用了with语句来确保文件关闭,但如果在文件操作中抛出异常,程序可能会提前关闭文件。建议确保所有潜在的异常都被正确处理。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants