mailweb.openeuler.org
Manage this list

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

Kernel

Threads by month
  • ----- 2025 -----
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2021 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2020 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2019 -----
  • December
kernel@openeuler.org

  • 33 participants
  • 18106 discussions
[PATCH OLK-5.10 v7 3/3] arm64: openeuler_defconfig: Enable ARM64_PMEM_LEGACY
by Zhuling 22 Jan '22

22 Jan '22
hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I4O31I Enable legacy pmem register feature for arm64. Signed-off-by: Zhuling <zhuling8(a)huawei.com> Reviewed-by: Kefeng Wang <wangkefeng.wang(a)huawei.com> --- arch/arm64/configs/openeuler_defconfig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm64/configs/openeuler_defconfig b/arch/arm64/configs/openeuler_defconfig index 771eb45..7745715 100644 --- a/arch/arm64/configs/openeuler_defconfig +++ b/arch/arm64/configs/openeuler_defconfig @@ -416,6 +416,8 @@ CONFIG_ARM64_CPU_PARK=y CONFIG_FORCE_MAX_ZONEORDER=11 CONFIG_UNMAP_KERNEL_AT_EL0=y CONFIG_RODATA_FULL_DEFAULT_ENABLED=y +CONFIG_ARM64_PMEM_RESERVE=y +CONFIG_ARM64_PMEM_LEGACY=m # CONFIG_ARM64_SW_TTBR0_PAN is not set CONFIG_ARM64_TAGGED_ADDR_ABI=y CONFIG_ARM64_ILP32=y @@ -6027,6 +6029,8 @@ CONFIG_USB4=m # end of Android CONFIG_LIBNVDIMM=m +CONFIG_PMEM_LEGACY=m +CONFIG_PMEM_LEGACY_DEVICE=y CONFIG_BLK_DEV_PMEM=m CONFIG_ND_BLK=m CONFIG_ND_CLAIM=y -- 2.9.5
1 0
0 0
[PATCH OLK-5.10 v7 1/3] x86: pmem: move persistent memory(legacy) code into nvdimm
by Zhuling 22 Jan '22

22 Jan '22
hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I4O31I Move x86's pmem.c into nvdimm, and rename X86_PMEM_LEGACY_DEVICE to PMEM_LEGACY_DEVICE, also add PMEM_LEGACY to control the built of nd_e820.o, then the code could be reused by other architectures. Note,this patch fixs the nd_e820.c build introduced by commit 2499317e408e ("arm64: Revert feature: Add memmap parameter and register pmem"). Signed-off-by: Zhuling <zhuling8(a)huawei.com> Reviewed-by: Kefeng Wang <wangkefeng.wang(a)huawei.com> --- arch/x86/Kconfig | 6 ++---- arch/x86/kernel/Makefile | 1 - drivers/nvdimm/Kconfig | 6 ++++++ drivers/nvdimm/Makefile | 2 ++ arch/x86/kernel/pmem.c => drivers/nvdimm/pmem_legacy_device.c | 0 tools/testing/nvdimm/Kbuild | 2 +- 6 files changed, 11 insertions(+), 6 deletions(-) rename arch/x86/kernel/pmem.c => drivers/nvdimm/pmem_legacy_device.c (100%) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index c77ef59..1d3176a 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -1667,14 +1667,12 @@ config ILLEGAL_POINTER_VALUE default 0 if X86_32 default 0xdead000000000000 if X86_64 -config X86_PMEM_LEGACY_DEVICE - bool - config X86_PMEM_LEGACY tristate "Support non-standard NVDIMMs and ADR protected memory" depends on PHYS_ADDR_T_64BIT depends on BLK_DEV - select X86_PMEM_LEGACY_DEVICE + select PMEM_LEGACY + select PMEM_LEGACY_DEVICE select NUMA_KEEP_MEMINFO if NUMA select LIBNVDIMM help diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile index f0606f8..1e12751 100644 --- a/arch/x86/kernel/Makefile +++ b/arch/x86/kernel/Makefile @@ -130,7 +130,6 @@ obj-$(CONFIG_KVM_GUEST) += kvm.o kvmclock.o obj-$(CONFIG_PARAVIRT) += paravirt.o paravirt_patch.o obj-$(CONFIG_PARAVIRT_SPINLOCKS)+= paravirt-spinlocks.o obj-$(CONFIG_PARAVIRT_CLOCK) += pvclock.o -obj-$(CONFIG_X86_PMEM_LEGACY_DEVICE) += pmem.o obj-$(CONFIG_JAILHOUSE_GUEST) += jailhouse.o diff --git a/drivers/nvdimm/Kconfig b/drivers/nvdimm/Kconfig index b7d1eb3..632b6ed 100644 --- a/drivers/nvdimm/Kconfig +++ b/drivers/nvdimm/Kconfig @@ -19,6 +19,12 @@ menuconfig LIBNVDIMM if LIBNVDIMM +config PMEM_LEGACY + tristate + +config PMEM_LEGACY_DEVICE + bool + config BLK_DEV_PMEM tristate "PMEM: Persistent memory block device support" default LIBNVDIMM diff --git a/drivers/nvdimm/Makefile b/drivers/nvdimm/Makefile index 0407753..2098221 100644 --- a/drivers/nvdimm/Makefile +++ b/drivers/nvdimm/Makefile @@ -3,6 +3,8 @@ obj-$(CONFIG_LIBNVDIMM) += libnvdimm.o obj-$(CONFIG_BLK_DEV_PMEM) += nd_pmem.o obj-$(CONFIG_ND_BTT) += nd_btt.o obj-$(CONFIG_ND_BLK) += nd_blk.o +obj-$(CONFIG_PMEM_LEGACY_DEVICE) += pmem_legacy_device.o +obj-$(CONFIG_PMEM_LEGACY) += nd_e820.o obj-$(CONFIG_OF_PMEM) += of_pmem.o obj-$(CONFIG_VIRTIO_PMEM) += virtio_pmem.o nd_virtio.o diff --git a/arch/x86/kernel/pmem.c b/drivers/nvdimm/pmem_legacy_device.c similarity index 100% rename from arch/x86/kernel/pmem.c rename to drivers/nvdimm/pmem_legacy_device.c diff --git a/tools/testing/nvdimm/Kbuild b/tools/testing/nvdimm/Kbuild index 47f9cc9..77aa117 100644 --- a/tools/testing/nvdimm/Kbuild +++ b/tools/testing/nvdimm/Kbuild @@ -28,7 +28,7 @@ obj-$(CONFIG_LIBNVDIMM) += libnvdimm.o obj-$(CONFIG_BLK_DEV_PMEM) += nd_pmem.o obj-$(CONFIG_ND_BTT) += nd_btt.o obj-$(CONFIG_ND_BLK) += nd_blk.o -obj-$(CONFIG_X86_PMEM_LEGACY) += nd_e820.o +obj-$(CONFIG_PMEM_LEGACY) += nd_e820.o obj-$(CONFIG_ACPI_NFIT) += nfit.o ifeq ($(CONFIG_DAX),m) obj-$(CONFIG_DAX) += dax.o -- 2.9.5
1 1
0 0
[PATCH OLK-5.10 v4 0/2] change arm64 and x86 configs
by Chao Liu 22 Jan '22

22 Jan '22
openEuler inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I4OFDI CVE: NA -------------------------------- Chao Liu (2): change arm64 configs change x86 configs arch/arm64/configs/openeuler_defconfig | 272 ++++++++----- arch/x86/configs/openeuler_defconfig | 540 +++++++++---------------- 2 files changed, 356 insertions(+), 456 deletions(-) -- 2.27.0
1 2
0 0
[PATCH openEuler-1.0-LTS V2] ipmi_si: Phytium S2500 workaround for MMIO-based IPMI
by Laibin Qiu 22 Jan '22

22 Jan '22
phytium inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I4RK58 CVE: NA -------------------------------- The system would hang up when the Phytium S2500 communicates with some BMCs after several rounds of transactions, unless we reset the controller timeout counter manually by calling firmware through SMC. Signed-off-by: Wang Yinfeng <wangyinfeng(a)phytium.com.cn> Signed-off-by: Chen Baozi <chenbaozi(a)phytium.com.cn> #openEuler_contributor Signed-off-by: Laibin Qiu <qiulaibin(a)huawei.com> --- drivers/char/ipmi/ipmi_si_mem_io.c | 72 ++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/drivers/char/ipmi/ipmi_si_mem_io.c b/drivers/char/ipmi/ipmi_si_mem_io.c index 75583612ab10..9403e35a1993 100644 --- a/drivers/char/ipmi/ipmi_si_mem_io.c +++ b/drivers/char/ipmi/ipmi_si_mem_io.c @@ -3,9 +3,75 @@ #include <linux/io.h> #include "ipmi_si.h" +#ifdef CONFIG_ARM_GIC_PHYTIUM_2500 +#include <linux/arm-smccc.h> + +#define CTL_RST_FUNC_ID 0xC2000011 + +static bool apply_phytium2500_workaround; + +struct ipmi_workaround_oem_info { + char oem_id[ACPI_OEM_ID_SIZE + 1]; +}; + +static struct ipmi_workaround_oem_info wa_info[] = { + { + .oem_id = "KPSVVJ", + } +}; + +static void ipmi_check_phytium_workaround(void) +{ +#ifdef CONFIG_ACPI + struct acpi_table_header tbl; + int i; + + if (ACPI_FAILURE(acpi_get_table_header(ACPI_SIG_DSDT, 0, &tbl))) + return; + + for (i = 0; i < ARRAY_SIZE(wa_info); i++) { + if (strncmp(wa_info[i].oem_id, tbl.oem_id, ACPI_OEM_ID_SIZE)) + continue; + + apply_phytium2500_workaround = true; + break; + } +#endif +} + +static void ctl_smc(unsigned long arg0, unsigned long arg1, + unsigned long arg2, unsigned long arg3) +{ + struct arm_smccc_res res; + + arm_smccc_smc(arg0, arg1, arg2, arg3, 0, 0, 0, 0, &res); + if (res.a0 != 0) + pr_err("Error: Firmware call SMC reset Failed: %d, addr: 0x%lx\n", + (int)res.a0, arg2); +} + +static void ctl_timeout_reset(void) +{ + ctl_smc(CTL_RST_FUNC_ID, 0x1, 0x28100208, 0x1); + ctl_smc(CTL_RST_FUNC_ID, 0x1, 0x2810020C, 0x1); +} + +static inline void ipmi_phytium_workaround(void) +{ + if (apply_phytium2500_workaround) + ctl_timeout_reset(); +} + +#else +static inline void ipmi_check_phytium_workaround(void) {} +static inline void ipmi_phytium_workaround(void) {} +#endif + static unsigned char intf_mem_inb(const struct si_sm_io *io, unsigned int offset) { + ipmi_phytium_workaround(); + return readb((io->addr)+(offset * io->regspacing)); } @@ -31,6 +97,8 @@ static void intf_mem_outw(const struct si_sm_io *io, unsigned int offset, static unsigned char intf_mem_inl(const struct si_sm_io *io, unsigned int offset) { + ipmi_phytium_workaround(); + return (readl((io->addr)+(offset * io->regspacing)) >> io->regshift) & 0xff; } @@ -44,6 +112,8 @@ static void intf_mem_outl(const struct si_sm_io *io, unsigned int offset, #ifdef readq static unsigned char mem_inq(const struct si_sm_io *io, unsigned int offset) { + ipmi_phytium_workaround(); + return (readq((io->addr)+(offset * io->regspacing)) >> io->regshift) & 0xff; } @@ -81,6 +151,8 @@ int ipmi_si_mem_setup(struct si_sm_io *io) if (!addr) return -ENODEV; + ipmi_check_phytium_workaround(); + /* * Figure out the actual readb/readw/readl/etc routine to use based * upon the register size. -- 2.22.0
1 0
0 0
Re: [PATCH V2] ipmi_si: Phytium S2500 workaround for MMIO-based IPMI
by Xie XiuQi 21 Jan '22

21 Jan '22
On 2022/1/21 18:06, Chen Baozi wrote: > phytium inclusion > category: bugfix > bugzilla: https://gitee.com/openeuler/kernel/issues/I4RK58 > CVE: NA > > --------------------------------- > > The system would hang up when the Phytium S2500 communicates with > some BMCs after several rounds of transactions, unless we reset > the controller timeout counter manually by calling firmware through > SMC. > > Signed-off-by: Wang Yinfeng <wangyinfeng(a)phytium.com.cn> > Signed-off-by: Chen Baozi <chenbaozi(a)phytium.com.cn> Looks good to me, Reviewed-by: Xie XiuQi <xiexiuqi(a)huawei.com> > --- > drivers/char/ipmi/ipmi_si_mem_io.c | 74 ++++++++++++++++++++++++++++++ > 1 file changed, 74 insertions(+) > > diff --git a/drivers/char/ipmi/ipmi_si_mem_io.c b/drivers/char/ipmi/ipmi_si_mem_io.c > index 75583612ab10..bb4ed90a1153 100644 > --- a/drivers/char/ipmi/ipmi_si_mem_io.c > +++ b/drivers/char/ipmi/ipmi_si_mem_io.c > @@ -3,9 +3,75 @@ > #include <linux/io.h> > #include "ipmi_si.h" > > +#ifdef CONFIG_ARM_GIC_PHYTIUM_2500 > +#include <linux/arm-smccc.h> > + > +#define CTL_RST_FUNC_ID 0xC2000011 > + > +static bool apply_phytium2500_workaround; > + > +struct ipmi_workaround_oem_info { > + char oem_id[ACPI_OEM_ID_SIZE + 1]; > +}; > + > +static struct ipmi_workaround_oem_info wa_info[] = { > + { > + .oem_id = "KPSVVJ", > + } > +}; > + > +static void ipmi_check_phytium_workaround(void) > +{ > +#ifdef CONFIG_ACPI > + struct acpi_table_header tbl; > + int i; > + > + if (ACPI_FAILURE(acpi_get_table_header(ACPI_SIG_DSDT, 0, &tbl))) > + return; > + > + for (i = 0; i < ARRAY_SIZE(wa_info); i++) { > + if (strncmp(wa_info[i].oem_id, tbl.oem_id, ACPI_OEM_ID_SIZE)) > + continue; > + > + apply_phytium2500_workaround = true; > + break; > + } > +#endif > +} > + > +static void ctl_smc(unsigned long arg0, unsigned long arg1, > + unsigned long arg2, unsigned long arg3) > +{ > + struct arm_smccc_res res; > + > + arm_smccc_smc(arg0, arg1, arg2, arg3, 0, 0, 0, 0, &res); > + if (res.a0 != 0) > + pr_err("Error: Firmware call SMC reset Failed: %d, addr: 0x%lx\n", > + (int)res.a0, arg2); > +} > + > +static void ctl_timeout_reset(void) > +{ > + ctl_smc(CTL_RST_FUNC_ID, 0x1, 0x28100208, 0x1); > + ctl_smc(CTL_RST_FUNC_ID, 0x1, 0x2810020C, 0x1); > +} > + > +static inline void ipmi_phytium_workaround(void) > +{ > + if (apply_phytium2500_workaround) > + ctl_timeout_reset(); > +} > + > +#else > +static inline void ipmi_check_phytium_workaround(void) {} > +static inline void ipmi_phytium_workaround(void) {} > +#endif > + > static unsigned char intf_mem_inb(const struct si_sm_io *io, > unsigned int offset) > { > + ipmi_phytium_workaround(); > + > return readb((io->addr)+(offset * io->regspacing)); > } > > @@ -18,6 +84,8 @@ static void intf_mem_outb(const struct si_sm_io *io, unsigned int offset, > static unsigned char intf_mem_inw(const struct si_sm_io *io, > unsigned int offset) > { > + ipmi_phytium_workaround(); > + > return (readw((io->addr)+(offset * io->regspacing)) >> io->regshift) > & 0xff; > } > @@ -31,6 +99,8 @@ static void intf_mem_outw(const struct si_sm_io *io, unsigned int offset, > static unsigned char intf_mem_inl(const struct si_sm_io *io, > unsigned int offset) > { > + ipmi_phytium_workaround(); > + > return (readl((io->addr)+(offset * io->regspacing)) >> io->regshift) > & 0xff; > } > @@ -44,6 +114,8 @@ static void intf_mem_outl(const struct si_sm_io *io, unsigned int offset, > #ifdef readq > static unsigned char mem_inq(const struct si_sm_io *io, unsigned int offset) > { > + ipmi_phytium_workaround(); > + > return (readq((io->addr)+(offset * io->regspacing)) >> io->regshift) > & 0xff; > } > @@ -81,6 +153,8 @@ int ipmi_si_mem_setup(struct si_sm_io *io) > if (!addr) > return -ENODEV; > > + ipmi_check_phytium_workaround(); > + > /* > * Figure out the actual readb/readw/readl/etc routine to use based > * upon the register size. >
1 0
0 0
Re: [PATCH] ipmi_si: Phytium S2500 workaround for MMIO-based IPMI
by Xie XiuQi 21 Jan '22

21 Jan '22
Hi, Thanks for your patch. There're some comments bellow. On 2022/1/19 14:57, Chen Baozi wrote: > The system would hang up when the Phytium S2500 communicates with > some BMCs after several rounds of transactions, unless we reset > the controller timeout counter manually by calling firmware through > SMC. > > Signed-off-by: Wang Yinfeng <wangyinfeng(a)phytium.com.cn> > Signed-off-by: Chen Baozi <chenbaozi(a)phytium.com.cn> > --- > drivers/char/ipmi/ipmi_si_mem_io.c | 117 ++++++++++++++++++++++++++++- > 1 file changed, 113 insertions(+), 4 deletions(-) > > diff --git a/drivers/char/ipmi/ipmi_si_mem_io.c b/drivers/char/ipmi/ipmi_si_mem_io.c > index 75583612ab10..73a3d6979eaa 100644 > --- a/drivers/char/ipmi/ipmi_si_mem_io.c > +++ b/drivers/char/ipmi/ipmi_si_mem_io.c > @@ -3,6 +3,105 @@ > #include <linux/io.h> > #include "ipmi_si.h" > > +#ifdef CONFIG_ARM_GIC_PHYTIUM_2500 > +#include <linux/arm-smccc.h> > + > +#define CTL_RST_FUNC_ID 0xC2000011 > + > +static void ctl_smc(unsigned long arg0, unsigned long arg1, > + unsigned long arg2, unsigned long arg3) > +{ > + struct arm_smccc_res res; > + > + arm_smccc_smc(arg0, arg1, arg2, arg3, 0, 0, 0, 0, &res); > + if (res.a0 != 0) > + pr_err("Error: Firmware call SMC reset Failed: %d, addr: 0x%lx\n", > + (int)res.a0, arg2); > +} > + > +static void ctl_timeout_reset(void) > +{ > + ctl_smc(CTL_RST_FUNC_ID, 0x1, 0x28100208, 0x1); > + ctl_smc(CTL_RST_FUNC_ID, 0x1, 0x2810020C, 0x1); > +} > + > +static unsigned char intf_mem_inb_2500(const struct si_sm_io *io, > + unsigned int offset) > +{ > + ctl_timeout_reset(); > + > + return readb((io->addr)+(offset * io->regspacing)); 与 intf_mem_inb() 代码重复,下同。 > +} > + > +static unsigned char intf_mem_inw_2500(const struct si_sm_io *io, > + unsigned int offset) > +{ > + ctl_timeout_reset(); > + > + return (readw((io->addr)+(offset * io->regspacing)) >> io->regshift) > + & 0xff; > +} > + > +static unsigned char intf_mem_inl_2500(const struct si_sm_io *io, > + unsigned int offset) > +{ > + ctl_timeout_reset(); > + > + return (readl((io->addr)+(offset * io->regspacing)) >> io->regshift) > + & 0xff; > +} > + > +static unsigned char mem_inq_2500(const struct si_sm_io *io, > + unsigned int offset) > +{ > + ctl_timeout_reset(); > + > + return (readq((io->addr)+(offset * io->regspacing)) >> io->regshift) > + & 0xff; > +} > +#else > +#define intf_mem_inb_2500 intf_mem_inb > +#define intf_mem_inw_2500 intf_mem_inw > +#define intf_mem_inl_2500 intf_mem_inl > +#define mem_inq_2500 mem_inq > +#endif > + > +static bool apply_phytium2500_workaround; 这个变量全局存在的,其实只在 phytium2500 平台上才有意义。 > + > +#ifdef CONFIG_ACPI > +struct ipmi_workaround_oem_info { > + char oem_id[ACPI_OEM_ID_SIZE + 1]; > +}; > + > +static struct ipmi_workaround_oem_info wa_info[] = { > + { > + .oem_id = "KPSVVJ", > + } > +}; > + > +static void ipmi_check_phytium_workaround(void) > +{ > + struct acpi_table_header tbl; > + int i; > + > + if (ACPI_FAILURE(acpi_get_table_header(ACPI_SIG_DSDT, 0, &tbl))) > + return; > + > + for (i = 0; i < ARRAY_SIZE(wa_info); i++) { > + if (strncmp(wa_info[i].oem_id, tbl.oem_id, ACPI_OEM_ID_SIZE)) > + continue; > + > + apply_phytium2500_workaround = true; > + break; > + } > +} 这个 CONFIG_ACPI 和 PHYTIUM 没有依赖,即便不是 PHYTIUM 平台,仍然会做这些没必要的检查。 而且在非 ARM64 架构上,这个 apply_phytium2500_workaround 仍然会全局存在。 是不是类似这样比较好: #ifdef CONFIG_ARM_GIC_PHYTIUM_2500 static bool apply_phytium2500_workaround; static void ipmi_check_phytium_workaround(void) { #ifdef CONFIG_ACPI ... #endif } ... static inline void ipmi_phytium2500_workaround(void) { if (apply_phytium2500_workaround) ctl_timeout_reset(); } static unsigned char intf_mem_inb(const struct si_sm_io *io, unsigned int offset) { + ipmi_phytium2500_workaround(); return readb((io->addr)+(offset * io->regspacing)); } static unsigned char intf_mem_inw(const struct si_sm_io *io, unsigned int offset) { + ipmi_phytium2500_workaround(); return (readw((io->addr)+(offset * io->regspacing)) >> io->regshift) & 0xff; } ... #else static inline void ipmi_phytium2500_workaround() {} static inline void ipmi_check_phytium_workaround(void) {} #endif > +#else > +static void ipmi_check_phytium_workaround(void) > +{ > + apply_phytium2500_workaround = false; > +} > +#endif > + > static unsigned char intf_mem_inb(const struct si_sm_io *io, > unsigned int offset) > { > @@ -81,26 +180,36 @@ int ipmi_si_mem_setup(struct si_sm_io *io) > if (!addr) > return -ENODEV; > > + ipmi_check_phytium_workaround(); > + > /* > * Figure out the actual readb/readw/readl/etc routine to use based > * upon the register size. > */ > switch (io->regsize) { > case 1: > - io->inputb = intf_mem_inb; > + io->inputb = apply_phytium2500_workaround ? > + intf_mem_inb_2500 : > + intf_mem_inb; > io->outputb = intf_mem_outb; > break; > case 2: > - io->inputb = intf_mem_inw; > + io->inputb = apply_phytium2500_workaround ? > + intf_mem_inw_2500 : > + intf_mem_inw; > io->outputb = intf_mem_outw; > break; > case 4: > - io->inputb = intf_mem_inl; > + io->inputb = apply_phytium2500_workaround ? > + intf_mem_inl_2500 : > + intf_mem_inl; > io->outputb = intf_mem_outl; > break; > #ifdef readq > case 8: > - io->inputb = mem_inq; > + io->inputb = apply_phytium2500_workaround ? > + mem_inq_2500 : > + mem_inq; > io->outputb = mem_outq; > break; > #endif >
1 0
0 0
[PATCH OLK-5.10 v6 1/3] x86: pmem: move persistent memory(legacy) code into nvdimm
by Zhuling 21 Jan '22

21 Jan '22
hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I4O31I Move x86's pmem.c into nvdimm, and rename X86_PMEM_LEGACY_DEVICE to PMEM_LEGACY_DEVICE, also add PMEM_LEGACY to control the built of nd_e820.o, then the code could be reused by other architectures. Note���this patch fixs the nd_e820.c build introduced by commit 2499317e408e ("arm64: Revert feature: Add memmap parameter and register pmem"). Signed-off-by: Zhuling <zhuling8(a)huawei.com> Reviewed-by: Kefeng Wang <wangkefeng.wang(a)huawei.com> --- arch/x86/Kconfig | 6 ++---- arch/x86/kernel/Makefile | 1 - drivers/nvdimm/Kconfig | 6 ++++++ drivers/nvdimm/Makefile | 2 ++ arch/x86/kernel/pmem.c => drivers/nvdimm/pmem_legacy_device.c | 0 tools/testing/nvdimm/Kbuild | 2 +- 6 files changed, 11 insertions(+), 6 deletions(-) rename arch/x86/kernel/pmem.c => drivers/nvdimm/pmem_legacy_device.c (100%) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index c77ef59..1d3176a 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -1667,14 +1667,12 @@ config ILLEGAL_POINTER_VALUE default 0 if X86_32 default 0xdead000000000000 if X86_64 -config X86_PMEM_LEGACY_DEVICE - bool - config X86_PMEM_LEGACY tristate "Support non-standard NVDIMMs and ADR protected memory" depends on PHYS_ADDR_T_64BIT depends on BLK_DEV - select X86_PMEM_LEGACY_DEVICE + select PMEM_LEGACY + select PMEM_LEGACY_DEVICE select NUMA_KEEP_MEMINFO if NUMA select LIBNVDIMM help diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile index f0606f8..1e12751 100644 --- a/arch/x86/kernel/Makefile +++ b/arch/x86/kernel/Makefile @@ -130,7 +130,6 @@ obj-$(CONFIG_KVM_GUEST) += kvm.o kvmclock.o obj-$(CONFIG_PARAVIRT) += paravirt.o paravirt_patch.o obj-$(CONFIG_PARAVIRT_SPINLOCKS)+= paravirt-spinlocks.o obj-$(CONFIG_PARAVIRT_CLOCK) += pvclock.o -obj-$(CONFIG_X86_PMEM_LEGACY_DEVICE) += pmem.o obj-$(CONFIG_JAILHOUSE_GUEST) += jailhouse.o diff --git a/drivers/nvdimm/Kconfig b/drivers/nvdimm/Kconfig index b7d1eb3..632b6ed 100644 --- a/drivers/nvdimm/Kconfig +++ b/drivers/nvdimm/Kconfig @@ -19,6 +19,12 @@ menuconfig LIBNVDIMM if LIBNVDIMM +config PMEM_LEGACY + tristate + +config PMEM_LEGACY_DEVICE + bool + config BLK_DEV_PMEM tristate "PMEM: Persistent memory block device support" default LIBNVDIMM diff --git a/drivers/nvdimm/Makefile b/drivers/nvdimm/Makefile index 0407753..2098221 100644 --- a/drivers/nvdimm/Makefile +++ b/drivers/nvdimm/Makefile @@ -3,6 +3,8 @@ obj-$(CONFIG_LIBNVDIMM) += libnvdimm.o obj-$(CONFIG_BLK_DEV_PMEM) += nd_pmem.o obj-$(CONFIG_ND_BTT) += nd_btt.o obj-$(CONFIG_ND_BLK) += nd_blk.o +obj-$(CONFIG_PMEM_LEGACY_DEVICE) += pmem_legacy_device.o +obj-$(CONFIG_PMEM_LEGACY) += nd_e820.o obj-$(CONFIG_OF_PMEM) += of_pmem.o obj-$(CONFIG_VIRTIO_PMEM) += virtio_pmem.o nd_virtio.o diff --git a/arch/x86/kernel/pmem.c b/drivers/nvdimm/pmem_legacy_device.c similarity index 100% rename from arch/x86/kernel/pmem.c rename to drivers/nvdimm/pmem_legacy_device.c diff --git a/tools/testing/nvdimm/Kbuild b/tools/testing/nvdimm/Kbuild index 47f9cc9..77aa117 100644 --- a/tools/testing/nvdimm/Kbuild +++ b/tools/testing/nvdimm/Kbuild @@ -28,7 +28,7 @@ obj-$(CONFIG_LIBNVDIMM) += libnvdimm.o obj-$(CONFIG_BLK_DEV_PMEM) += nd_pmem.o obj-$(CONFIG_ND_BTT) += nd_btt.o obj-$(CONFIG_ND_BLK) += nd_blk.o -obj-$(CONFIG_X86_PMEM_LEGACY) += nd_e820.o +obj-$(CONFIG_PMEM_LEGACY) += nd_e820.o obj-$(CONFIG_ACPI_NFIT) += nfit.o ifeq ($(CONFIG_DAX),m) obj-$(CONFIG_DAX) += dax.o -- 2.9.5
1 2
0 0
Re: [PATCH OLK-5.10 v5 1/3] x86: pmem: move persistent memory(legacy) code into nvdimm
by zhuling 21 Jan '22

21 Jan '22
On 2022/1/21 14:25, Kefeng Wang wrote: > Move x86's pmem.c into nvdimm, and rename it pmem_legacy_device.c, > also rename X86_PMEM_LEGACY_DEVICE to PMEM_LEGACY_DEVICE. > Meanwhile, add PMEM_LEGACY to control the built of nd_e820.o, then > the code could be reused by other architectures. > > Note,this patch fixs the nd_e820.c build introduced by commit 2499317e408e > ("arm64: Revert feature: Add memmap parameter and register pmem"). > > changelog改下; 好的,我加下 > > On 2022/1/21 11:20, Zhuling wrote: >> hulk inclusion >> category: feature >> bugzilla: https://gitee.com/openeuler/kernel/issues/I4O31I >> >> Move x86's pmem.c into nvdimm, and rename X86_PMEM_LEGACY_DEVICE to >> PMEM_LEGACY_DEVICE, also add PMEM_LEGACY to control the built of >> nd_e820.o, then the code could be reused by other architectures. >> >> Signed-off-by: Zhuling <zhuling8(a)huawei.com> >> --- >>   arch/x86/Kconfig                                              | 6 ++---- >>   arch/x86/kernel/Makefile                                      | 1 - >>   drivers/nvdimm/Kconfig                                        | 6 ++++++ >>   drivers/nvdimm/Makefile                                       | 2 ++ >>   arch/x86/kernel/pmem.c => drivers/nvdimm/pmem_legacy_device.c | 0 >>   tools/testing/nvdimm/Kbuild                                   | 2 +- >>   6 files changed, 11 insertions(+), 6 deletions(-) >>   rename arch/x86/kernel/pmem.c => drivers/nvdimm/pmem_legacy_device.c (100%) >> >> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig >> index c77ef59..1d3176a 100644 >> --- a/arch/x86/Kconfig >> +++ b/arch/x86/Kconfig >> @@ -1667,14 +1667,12 @@ config ILLEGAL_POINTER_VALUE >>       default 0 if X86_32 >>       default 0xdead000000000000 if X86_64 >>   -config X86_PMEM_LEGACY_DEVICE >> -    bool >> - >>   config X86_PMEM_LEGACY >>       tristate "Support non-standard NVDIMMs and ADR protected memory" >>       depends on PHYS_ADDR_T_64BIT >>       depends on BLK_DEV >> -    select X86_PMEM_LEGACY_DEVICE >> +    select PMEM_LEGACY >> +    select PMEM_LEGACY_DEVICE >>       select NUMA_KEEP_MEMINFO if NUMA >>       select LIBNVDIMM >>       help >> diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile >> index f0606f8..1e12751 100644 >> --- a/arch/x86/kernel/Makefile >> +++ b/arch/x86/kernel/Makefile >> @@ -130,7 +130,6 @@ obj-$(CONFIG_KVM_GUEST)        += kvm.o kvmclock.o >>   obj-$(CONFIG_PARAVIRT)        += paravirt.o paravirt_patch.o >>   obj-$(CONFIG_PARAVIRT_SPINLOCKS)+= paravirt-spinlocks.o >>   obj-$(CONFIG_PARAVIRT_CLOCK)    += pvclock.o >> -obj-$(CONFIG_X86_PMEM_LEGACY_DEVICE) += pmem.o >>     obj-$(CONFIG_JAILHOUSE_GUEST)    += jailhouse.o >>   diff --git a/drivers/nvdimm/Kconfig b/drivers/nvdimm/Kconfig >> index b7d1eb3..632b6ed 100644 >> --- a/drivers/nvdimm/Kconfig >> +++ b/drivers/nvdimm/Kconfig >> @@ -19,6 +19,12 @@ menuconfig LIBNVDIMM >>     if LIBNVDIMM >>   +config PMEM_LEGACY >> +    tristate >> + >> +config PMEM_LEGACY_DEVICE >> +    bool >> + >>   config BLK_DEV_PMEM >>       tristate "PMEM: Persistent memory block device support" >>       default LIBNVDIMM >> diff --git a/drivers/nvdimm/Makefile b/drivers/nvdimm/Makefile >> index 0407753..2098221 100644 >> --- a/drivers/nvdimm/Makefile >> +++ b/drivers/nvdimm/Makefile >> @@ -3,6 +3,8 @@ obj-$(CONFIG_LIBNVDIMM) += libnvdimm.o >>   obj-$(CONFIG_BLK_DEV_PMEM) += nd_pmem.o >>   obj-$(CONFIG_ND_BTT) += nd_btt.o >>   obj-$(CONFIG_ND_BLK) += nd_blk.o >> +obj-$(CONFIG_PMEM_LEGACY_DEVICE) += pmem_legacy_device.o >> +obj-$(CONFIG_PMEM_LEGACY) += nd_e820.o >>   obj-$(CONFIG_OF_PMEM) += of_pmem.o >>   obj-$(CONFIG_VIRTIO_PMEM) += virtio_pmem.o nd_virtio.o >>   diff --git a/arch/x86/kernel/pmem.c b/drivers/nvdimm/pmem_legacy_device.c >> similarity index 100% >> rename from arch/x86/kernel/pmem.c >> rename to drivers/nvdimm/pmem_legacy_device.c >> diff --git a/tools/testing/nvdimm/Kbuild b/tools/testing/nvdimm/Kbuild >> index 47f9cc9..77aa117 100644 >> --- a/tools/testing/nvdimm/Kbuild >> +++ b/tools/testing/nvdimm/Kbuild >> @@ -28,7 +28,7 @@ obj-$(CONFIG_LIBNVDIMM) += libnvdimm.o >>   obj-$(CONFIG_BLK_DEV_PMEM) += nd_pmem.o >>   obj-$(CONFIG_ND_BTT) += nd_btt.o >>   obj-$(CONFIG_ND_BLK) += nd_blk.o >> -obj-$(CONFIG_X86_PMEM_LEGACY) += nd_e820.o >> +obj-$(CONFIG_PMEM_LEGACY) += nd_e820.o >>   obj-$(CONFIG_ACPI_NFIT) += nfit.o >>   ifeq ($(CONFIG_DAX),m) >>   obj-$(CONFIG_DAX) += dax.o > .
1 0
0 0
[PATCH OLK-5.10 v5 1/3] x86: pmem: move persistent memory(legacy) code into nvdimm
by Zhuling 21 Jan '22

21 Jan '22
hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I4O31I Move x86's pmem.c into nvdimm, and rename X86_PMEM_LEGACY_DEVICE to PMEM_LEGACY_DEVICE, also add PMEM_LEGACY to control the built of nd_e820.o, then the code could be reused by other architectures. Signed-off-by: Zhuling <zhuling8(a)huawei.com> --- arch/x86/Kconfig | 6 ++---- arch/x86/kernel/Makefile | 1 - drivers/nvdimm/Kconfig | 6 ++++++ drivers/nvdimm/Makefile | 2 ++ arch/x86/kernel/pmem.c => drivers/nvdimm/pmem_legacy_device.c | 0 tools/testing/nvdimm/Kbuild | 2 +- 6 files changed, 11 insertions(+), 6 deletions(-) rename arch/x86/kernel/pmem.c => drivers/nvdimm/pmem_legacy_device.c (100%) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index c77ef59..1d3176a 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -1667,14 +1667,12 @@ config ILLEGAL_POINTER_VALUE default 0 if X86_32 default 0xdead000000000000 if X86_64 -config X86_PMEM_LEGACY_DEVICE - bool - config X86_PMEM_LEGACY tristate "Support non-standard NVDIMMs and ADR protected memory" depends on PHYS_ADDR_T_64BIT depends on BLK_DEV - select X86_PMEM_LEGACY_DEVICE + select PMEM_LEGACY + select PMEM_LEGACY_DEVICE select NUMA_KEEP_MEMINFO if NUMA select LIBNVDIMM help diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile index f0606f8..1e12751 100644 --- a/arch/x86/kernel/Makefile +++ b/arch/x86/kernel/Makefile @@ -130,7 +130,6 @@ obj-$(CONFIG_KVM_GUEST) += kvm.o kvmclock.o obj-$(CONFIG_PARAVIRT) += paravirt.o paravirt_patch.o obj-$(CONFIG_PARAVIRT_SPINLOCKS)+= paravirt-spinlocks.o obj-$(CONFIG_PARAVIRT_CLOCK) += pvclock.o -obj-$(CONFIG_X86_PMEM_LEGACY_DEVICE) += pmem.o obj-$(CONFIG_JAILHOUSE_GUEST) += jailhouse.o diff --git a/drivers/nvdimm/Kconfig b/drivers/nvdimm/Kconfig index b7d1eb3..632b6ed 100644 --- a/drivers/nvdimm/Kconfig +++ b/drivers/nvdimm/Kconfig @@ -19,6 +19,12 @@ menuconfig LIBNVDIMM if LIBNVDIMM +config PMEM_LEGACY + tristate + +config PMEM_LEGACY_DEVICE + bool + config BLK_DEV_PMEM tristate "PMEM: Persistent memory block device support" default LIBNVDIMM diff --git a/drivers/nvdimm/Makefile b/drivers/nvdimm/Makefile index 0407753..2098221 100644 --- a/drivers/nvdimm/Makefile +++ b/drivers/nvdimm/Makefile @@ -3,6 +3,8 @@ obj-$(CONFIG_LIBNVDIMM) += libnvdimm.o obj-$(CONFIG_BLK_DEV_PMEM) += nd_pmem.o obj-$(CONFIG_ND_BTT) += nd_btt.o obj-$(CONFIG_ND_BLK) += nd_blk.o +obj-$(CONFIG_PMEM_LEGACY_DEVICE) += pmem_legacy_device.o +obj-$(CONFIG_PMEM_LEGACY) += nd_e820.o obj-$(CONFIG_OF_PMEM) += of_pmem.o obj-$(CONFIG_VIRTIO_PMEM) += virtio_pmem.o nd_virtio.o diff --git a/arch/x86/kernel/pmem.c b/drivers/nvdimm/pmem_legacy_device.c similarity index 100% rename from arch/x86/kernel/pmem.c rename to drivers/nvdimm/pmem_legacy_device.c diff --git a/tools/testing/nvdimm/Kbuild b/tools/testing/nvdimm/Kbuild index 47f9cc9..77aa117 100644 --- a/tools/testing/nvdimm/Kbuild +++ b/tools/testing/nvdimm/Kbuild @@ -28,7 +28,7 @@ obj-$(CONFIG_LIBNVDIMM) += libnvdimm.o obj-$(CONFIG_BLK_DEV_PMEM) += nd_pmem.o obj-$(CONFIG_ND_BTT) += nd_btt.o obj-$(CONFIG_ND_BLK) += nd_blk.o -obj-$(CONFIG_X86_PMEM_LEGACY) += nd_e820.o +obj-$(CONFIG_PMEM_LEGACY) += nd_e820.o obj-$(CONFIG_ACPI_NFIT) += nfit.o ifeq ($(CONFIG_DAX),m) obj-$(CONFIG_DAX) += dax.o -- 2.9.5
1 2
0 0
[PATCH openEuler-1.0-LTS] ipmi_si: Phytium S2500 workaround for MMIO-based IPMI
by Laibin Qiu 20 Jan '22

20 Jan '22
phytium inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I4RK58 CVE: NA -------------------------------- The system would hang up when the Phytium S2500 communicates with some BMCs after several rounds of transactions, unless we reset the controller timeout counter manually by calling firmware through SMC. Signed-off-by: Wang Yinfeng <wangyinfeng(a)phytium.com.cn> Signed-off-by: Chen Baozi <chenbaozi(a)phytium.com.cn> #openEuler_contributor Signed-off-by: Laibin Qiu <qiulaibin(a)huawei.com> --- drivers/char/ipmi/ipmi_si_mem_io.c | 117 ++++++++++++++++++++++++++++- 1 file changed, 113 insertions(+), 4 deletions(-) diff --git a/drivers/char/ipmi/ipmi_si_mem_io.c b/drivers/char/ipmi/ipmi_si_mem_io.c index 75583612ab10..73a3d6979eaa 100644 --- a/drivers/char/ipmi/ipmi_si_mem_io.c +++ b/drivers/char/ipmi/ipmi_si_mem_io.c @@ -3,6 +3,105 @@ #include <linux/io.h> #include "ipmi_si.h" +#ifdef CONFIG_ARM_GIC_PHYTIUM_2500 +#include <linux/arm-smccc.h> + +#define CTL_RST_FUNC_ID 0xC2000011 + +static void ctl_smc(unsigned long arg0, unsigned long arg1, + unsigned long arg2, unsigned long arg3) +{ + struct arm_smccc_res res; + + arm_smccc_smc(arg0, arg1, arg2, arg3, 0, 0, 0, 0, &res); + if (res.a0 != 0) + pr_err("Error: Firmware call SMC reset Failed: %d, addr: 0x%lx\n", + (int)res.a0, arg2); +} + +static void ctl_timeout_reset(void) +{ + ctl_smc(CTL_RST_FUNC_ID, 0x1, 0x28100208, 0x1); + ctl_smc(CTL_RST_FUNC_ID, 0x1, 0x2810020C, 0x1); +} + +static unsigned char intf_mem_inb_2500(const struct si_sm_io *io, + unsigned int offset) +{ + ctl_timeout_reset(); + + return readb((io->addr)+(offset * io->regspacing)); +} + +static unsigned char intf_mem_inw_2500(const struct si_sm_io *io, + unsigned int offset) +{ + ctl_timeout_reset(); + + return (readw((io->addr)+(offset * io->regspacing)) >> io->regshift) + & 0xff; +} + +static unsigned char intf_mem_inl_2500(const struct si_sm_io *io, + unsigned int offset) +{ + ctl_timeout_reset(); + + return (readl((io->addr)+(offset * io->regspacing)) >> io->regshift) + & 0xff; +} + +static unsigned char mem_inq_2500(const struct si_sm_io *io, + unsigned int offset) +{ + ctl_timeout_reset(); + + return (readq((io->addr)+(offset * io->regspacing)) >> io->regshift) + & 0xff; +} +#else +#define intf_mem_inb_2500 intf_mem_inb +#define intf_mem_inw_2500 intf_mem_inw +#define intf_mem_inl_2500 intf_mem_inl +#define mem_inq_2500 mem_inq +#endif + +static bool apply_phytium2500_workaround; + +#ifdef CONFIG_ACPI +struct ipmi_workaround_oem_info { + char oem_id[ACPI_OEM_ID_SIZE + 1]; +}; + +static struct ipmi_workaround_oem_info wa_info[] = { + { + .oem_id = "KPSVVJ", + } +}; + +static void ipmi_check_phytium_workaround(void) +{ + struct acpi_table_header tbl; + int i; + + if (ACPI_FAILURE(acpi_get_table_header(ACPI_SIG_DSDT, 0, &tbl))) + return; + + for (i = 0; i < ARRAY_SIZE(wa_info); i++) { + if (strncmp(wa_info[i].oem_id, tbl.oem_id, ACPI_OEM_ID_SIZE)) + continue; + + apply_phytium2500_workaround = true; + break; + } +} +#else +static void ipmi_check_phytium_workaround(void) +{ + apply_phytium2500_workaround = false; +} +#endif + static unsigned char intf_mem_inb(const struct si_sm_io *io, unsigned int offset) { @@ -81,26 +180,36 @@ int ipmi_si_mem_setup(struct si_sm_io *io) if (!addr) return -ENODEV; + ipmi_check_phytium_workaround(); + /* * Figure out the actual readb/readw/readl/etc routine to use based * upon the register size. */ switch (io->regsize) { case 1: - io->inputb = intf_mem_inb; + io->inputb = apply_phytium2500_workaround ? + intf_mem_inb_2500 : + intf_mem_inb; io->outputb = intf_mem_outb; break; case 2: - io->inputb = intf_mem_inw; + io->inputb = apply_phytium2500_workaround ? + intf_mem_inw_2500 : + intf_mem_inw; io->outputb = intf_mem_outw; break; case 4: - io->inputb = intf_mem_inl; + io->inputb = apply_phytium2500_workaround ? + intf_mem_inl_2500 : + intf_mem_inl; io->outputb = intf_mem_outl; break; #ifdef readq case 8: - io->inputb = mem_inq; + io->inputb = apply_phytium2500_workaround ? + mem_inq_2500 : + mem_inq; io->outputb = mem_outq; break; #endif -- 2.22.0
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 1618
  • 1619
  • 1620
  • 1621
  • 1622
  • 1623
  • 1624
  • ...
  • 1811
  • Older →

HyperKitty Powered by HyperKitty