* Re: Possible regression by ab037dd87a2f (powerpc/vdso: Switch VDSO to generic C implementation.)
From: Paul Menzel @ 2021-07-28 12:53 UTC (permalink / raw)
To: Michael Ellerman, Benjamin Herrenschmidt, Paul Mackerras,
Christophe Leroy
Cc: Derek Parker, Dmitrii Okunev, murp, linuxppc-dev, laboger
In-Reply-To: <878s1q1udj.fsf@mpe.ellerman.id.au>
Dear Michael,
Am 28.07.21 um 14:43 schrieb Michael Ellerman:
> Paul Menzel <pmenzel@molgen.mpg.de> writes:
>> Am 28.07.21 um 01:14 schrieb Benjamin Herrenschmidt:
>>> On Tue, 2021-07-27 at 10:45 +0200, Paul Menzel wrote:
>>
>>>> On ppc64le Go 1.16.2 from Ubuntu 21.04 terminates with a segmentation
>>>> fault [1], and it might be related to *[release-branch.go1.16] runtime:
>>>> fix crash during VDSO calls on PowerPC* [2], conjecturing that commit
>>>> ab037dd87a2f (powerpc/vdso: Switch VDSO to generic C implementation.)
>>>> added in Linux 5.11 causes this.
>>>>
>>>> If this is indeed the case, this would be a regression in userspace. Is
>>>> there a generic fix or should the change be reverted?
>>>
>>> From the look at the links you posted, this appears to be completely
>>> broken assumptions by Go that some registers don't change while calling
>>> what essentially are external library functions *while inside those
>>> functions* (ie in this case from a signal handler).
>>>
>>> I suppose it would be possible to build the VDSO with gcc arguments to
>>> make it not use r30, but that's just gross...
>>
>> Thank you for looking into this. No idea, if it falls under Linux’ no
>> regression policy or not.
>
> Reluctantly yes, I think it does. Though it would have been good if it
> had been reported to us sooner.
>
> It looks like that Go fix is only committed to master, and neither of
> the latest Go 1.16 or 1.15 releases contain the fix? ie. there's no way
> for a user to get a working version of Go other than building master?
I heard it is going to be in Go 1.16.7, but I do not know much about Go.
Maybe the folks in Cc can chime in.
> I'll see if we can work around it in the kernel. Are you able to test a
> kernel patch if I send you one?
Yes, I could test a Linux kernel patch on ppc64le (POWER 8) running
Ubuntu 21.04.
Kind regards,
Paul
^ permalink raw reply
* Re: Possible regression by ab037dd87a2f (powerpc/vdso: Switch VDSO to generic C implementation.)
From: Michael Ellerman @ 2021-07-28 12:43 UTC (permalink / raw)
To: Paul Menzel, Benjamin Herrenschmidt, Paul Mackerras,
Christophe Leroy
Cc: Derek Parker, Dmitrii Okunev, murp, linuxppc-dev, laboger
In-Reply-To: <4f037af0-5066-ebb9-53a6-733b3bd8eeac@molgen.mpg.de>
Paul Menzel <pmenzel@molgen.mpg.de> writes:
> Am 28.07.21 um 01:14 schrieb Benjamin Herrenschmidt:
>> On Tue, 2021-07-27 at 10:45 +0200, Paul Menzel wrote:
>
>>> On ppc64le Go 1.16.2 from Ubuntu 21.04 terminates with a segmentation
>>> fault [1], and it might be related to *[release-branch.go1.16] runtime:
>>> fix crash during VDSO calls on PowerPC* [2], conjecturing that commit
>>> ab037dd87a2f (powerpc/vdso: Switch VDSO to generic C implementation.)
>>> added in Linux 5.11 causes this.
>>>
>>> If this is indeed the case, this would be a regression in userspace. Is
>>> there a generic fix or should the change be reverted?
>>
>> From the look at the links you posted, this appears to be completely
>> broken assumptions by Go that some registers don't change while calling
>> what essentially are external library functions *while inside those
>> functions* (ie in this case from a signal handler).
>>
>> I suppose it would be possible to build the VDSO with gcc arguments to
>> make it not use r30, but that's just gross...
>
> Thank you for looking into this. No idea, if it falls under Linux’ no
> regression policy or not.
Reluctantly yes, I think it does. Though it would have been good if it
had been reported to us sooner.
It looks like that Go fix is only committed to master, and neither of
the latest Go 1.16 or 1.15 releases contain the fix? ie. there's no way
for a user to get a working version of Go other than building master?
I'll see if we can work around it in the kernel. Are you able to test a
kernel patch if I send you one?
cheers
^ permalink raw reply
* [PATCH v2 0/1] cpufreq:powernv: Fix init_chip_info initialization in numa=off
From: Pratik R. Sampat @ 2021-07-28 12:04 UTC (permalink / raw)
To: mpe, rjw, linux-pm, linuxppc-dev, linux-kernel, stable, psampat,
pratik.r.sampat
v1: https://lkml.org/lkml/2021/7/26/1509
Changelog v1-->v2:
Based on comments from Gautham,
1. Included a #define for MAX_NR_CHIPS instead of hardcoding the
allocation.
Pratik R. Sampat (1):
cpufreq:powernv: Fix init_chip_info initialization in numa=off
drivers/cpufreq/powernv-cpufreq.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
--
2.31.1
^ permalink raw reply
* [PATCH v2 1/1] cpufreq:powernv: Fix init_chip_info initialization in numa=off
From: Pratik R. Sampat @ 2021-07-28 12:05 UTC (permalink / raw)
To: mpe, rjw, linux-pm, linuxppc-dev, linux-kernel, stable, psampat,
pratik.r.sampat
In-Reply-To: <20210728120500.87549-1-psampat@linux.ibm.com>
In the numa=off kernel command-line configuration init_chip_info() loops
around the number of chips and attempts to copy the cpumask of that node
which is NULL for all iterations after the first chip.
Hence, store the cpu mask for each chip instead of derving cpumask from
node while populating the "chips" struct array and copy that to the
chips[i].mask
Cc: stable@vger.kernel.org
Fixes: 053819e0bf84 ("cpufreq: powernv: Handle throttling due to Pmax capping at chip level")
Signed-off-by: Pratik R. Sampat <psampat@linux.ibm.com>
Reported-by: Shirisha Ganta <shirisha.ganta1@ibm.com>
Reviewed-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com>
---
drivers/cpufreq/powernv-cpufreq.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/drivers/cpufreq/powernv-cpufreq.c b/drivers/cpufreq/powernv-cpufreq.c
index 005600cef273..5f0e7c315e49 100644
--- a/drivers/cpufreq/powernv-cpufreq.c
+++ b/drivers/cpufreq/powernv-cpufreq.c
@@ -36,6 +36,7 @@
#define MAX_PSTATE_SHIFT 32
#define LPSTATE_SHIFT 48
#define GPSTATE_SHIFT 56
+#define MAX_NR_CHIPS 32
#define MAX_RAMP_DOWN_TIME 5120
/*
@@ -1046,12 +1047,20 @@ static int init_chip_info(void)
unsigned int *chip;
unsigned int cpu, i;
unsigned int prev_chip_id = UINT_MAX;
+ cpumask_t *chip_cpu_mask;
int ret = 0;
chip = kcalloc(num_possible_cpus(), sizeof(*chip), GFP_KERNEL);
if (!chip)
return -ENOMEM;
+ /* Allocate a chip cpu mask large enough to fit mask for all chips */
+ chip_cpu_mask = kcalloc(MAX_NR_CHIPS, sizeof(cpumask_t), GFP_KERNEL);
+ if (!chip_cpu_mask) {
+ ret = -ENOMEM;
+ goto free_and_return;
+ }
+
for_each_possible_cpu(cpu) {
unsigned int id = cpu_to_chip_id(cpu);
@@ -1059,22 +1068,25 @@ static int init_chip_info(void)
prev_chip_id = id;
chip[nr_chips++] = id;
}
+ cpumask_set_cpu(cpu, &chip_cpu_mask[nr_chips-1]);
}
chips = kcalloc(nr_chips, sizeof(struct chip), GFP_KERNEL);
if (!chips) {
ret = -ENOMEM;
- goto free_and_return;
+ goto out_chip_cpu_mask;
}
for (i = 0; i < nr_chips; i++) {
chips[i].id = chip[i];
- cpumask_copy(&chips[i].mask, cpumask_of_node(chip[i]));
+ cpumask_copy(&chips[i].mask, &chip_cpu_mask[i]);
INIT_WORK(&chips[i].throttle, powernv_cpufreq_work_fn);
for_each_cpu(cpu, &chips[i].mask)
per_cpu(chip_info, cpu) = &chips[i];
}
+out_chip_cpu_mask:
+ kfree(chip_cpu_mask);
free_and_return:
kfree(chip);
return ret;
--
2.31.1
^ permalink raw reply related
* Re: [PATCH 00/11] Implement generic prot_guest_has() helper function
From: Christian König @ 2021-07-28 11:50 UTC (permalink / raw)
To: Tom Lendacky, linux-kernel, x86, linuxppc-dev, linux-s390, iommu,
kvm, linux-efi, platform-driver-x86, linux-graphics-maintainer,
amd-gfx, dri-devel, kexec, linux-fsdevel
Cc: Sathyanarayanan Kuppuswamy, Brijesh Singh, David Airlie,
Dave Hansen, Paul Mackerras, Will Deacon, Ard Biesheuvel,
Andi Kleen, Baoquan He, Joerg Roedel, Christian Borntraeger,
Ingo Molnar, Dave Young, Tianyu Lan, Daniel Vetter, Vasily Gorbik,
Heiko Carstens, Maarten Lankhorst, Maxime Ripard, Borislav Petkov,
Andy Lutomirski, Thomas Gleixner, Peter Zijlstra,
Thomas Zimmermann
In-Reply-To: <cover.1627424773.git.thomas.lendacky@amd.com>
Am 28.07.21 um 00:26 schrieb Tom Lendacky:
> This patch series provides a generic helper function, prot_guest_has(),
> to replace the sme_active(), sev_active(), sev_es_active() and
> mem_encrypt_active() functions.
>
> It is expected that as new protected virtualization technologies are
> added to the kernel, they can all be covered by a single function call
> instead of a collection of specific function calls all called from the
> same locations.
>
> The powerpc and s390 patches have been compile tested only. Can the
> folks copied on this series verify that nothing breaks for them.
As GPU driver dev I'm only one end user of this, but at least from the
high level point of view that makes totally sense to me.
Feel free to add an Acked-by: Christian König <christian.koenig@amd.com>.
We could run that through the AMD GPU unit tests, but I fear we actually
don't test on a system with SEV/SME active.
Going to raise that on our team call today.
Regards,
Christian.
>
> Cc: Andi Kleen <ak@linux.intel.com>
> Cc: Andy Lutomirski <luto@kernel.org>
> Cc: Ard Biesheuvel <ardb@kernel.org>
> Cc: Baoquan He <bhe@redhat.com>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Borislav Petkov <bp@alien8.de>
> Cc: Christian Borntraeger <borntraeger@de.ibm.com>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Cc: Dave Hansen <dave.hansen@linux.intel.com>
> Cc: Dave Young <dyoung@redhat.com>
> Cc: David Airlie <airlied@linux.ie>
> Cc: Heiko Carstens <hca@linux.ibm.com>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: Joerg Roedel <joro@8bytes.org>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Maxime Ripard <mripard@kernel.org>
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: Vasily Gorbik <gor@linux.ibm.com>
> Cc: VMware Graphics <linux-graphics-maintainer@vmware.com>
> Cc: Will Deacon <will@kernel.org>
>
> ---
>
> Patches based on:
> https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git master
> commit 79e920060fa7 ("Merge branch 'WIP/fixes'")
>
> Tom Lendacky (11):
> mm: Introduce a function to check for virtualization protection
> features
> x86/sev: Add an x86 version of prot_guest_has()
> powerpc/pseries/svm: Add a powerpc version of prot_guest_has()
> x86/sme: Replace occurrences of sme_active() with prot_guest_has()
> x86/sev: Replace occurrences of sev_active() with prot_guest_has()
> x86/sev: Replace occurrences of sev_es_active() with prot_guest_has()
> treewide: Replace the use of mem_encrypt_active() with
> prot_guest_has()
> mm: Remove the now unused mem_encrypt_active() function
> x86/sev: Remove the now unused mem_encrypt_active() function
> powerpc/pseries/svm: Remove the now unused mem_encrypt_active()
> function
> s390/mm: Remove the now unused mem_encrypt_active() function
>
> arch/Kconfig | 3 ++
> arch/powerpc/include/asm/mem_encrypt.h | 5 --
> arch/powerpc/include/asm/protected_guest.h | 30 +++++++++++
> arch/powerpc/platforms/pseries/Kconfig | 1 +
> arch/s390/include/asm/mem_encrypt.h | 2 -
> arch/x86/Kconfig | 1 +
> arch/x86/include/asm/kexec.h | 2 +-
> arch/x86/include/asm/mem_encrypt.h | 13 +----
> arch/x86/include/asm/protected_guest.h | 27 ++++++++++
> arch/x86/kernel/crash_dump_64.c | 4 +-
> arch/x86/kernel/head64.c | 4 +-
> arch/x86/kernel/kvm.c | 3 +-
> arch/x86/kernel/kvmclock.c | 4 +-
> arch/x86/kernel/machine_kexec_64.c | 19 +++----
> arch/x86/kernel/pci-swiotlb.c | 9 ++--
> arch/x86/kernel/relocate_kernel_64.S | 2 +-
> arch/x86/kernel/sev.c | 6 +--
> arch/x86/kvm/svm/svm.c | 3 +-
> arch/x86/mm/ioremap.c | 16 +++---
> arch/x86/mm/mem_encrypt.c | 60 +++++++++++++++-------
> arch/x86/mm/mem_encrypt_identity.c | 3 +-
> arch/x86/mm/pat/set_memory.c | 3 +-
> arch/x86/platform/efi/efi_64.c | 9 ++--
> arch/x86/realmode/init.c | 8 +--
> drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 +-
> drivers/gpu/drm/drm_cache.c | 4 +-
> drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 4 +-
> drivers/gpu/drm/vmwgfx/vmwgfx_msg.c | 6 +--
> drivers/iommu/amd/init.c | 7 +--
> drivers/iommu/amd/iommu.c | 3 +-
> drivers/iommu/amd/iommu_v2.c | 3 +-
> drivers/iommu/iommu.c | 3 +-
> fs/proc/vmcore.c | 6 +--
> include/linux/mem_encrypt.h | 4 --
> include/linux/protected_guest.h | 37 +++++++++++++
> kernel/dma/swiotlb.c | 4 +-
> 36 files changed, 218 insertions(+), 104 deletions(-)
> create mode 100644 arch/powerpc/include/asm/protected_guest.h
> create mode 100644 arch/x86/include/asm/protected_guest.h
> create mode 100644 include/linux/protected_guest.h
>
^ permalink raw reply
* Re: [PATCH] virtio-console: avoid DMA from vmalloc area
From: Xianting Tian @ 2021-07-28 9:10 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Amit Shah, gregkh, Linux Kernel Mailing List,
open list:DRM DRIVER FOR QEMU'S CIRRUS DEVICE, linuxppc-dev,
Omar Sandoval
In-Reply-To: <CAK8P3a2Hde16rbUPAwvtY7t+uE7C4jM8_pQCqTLj=-d4=T2MSg@mail.gmail.com>
在 2021/7/28 下午5:01, Arnd Bergmann 写道:
> On Wed, Jul 28, 2021 at 10:28 AM Xianting Tian
> <xianting.tian@linux.alibaba.com> wrote:
>> 在 2021/7/28 下午3:25, Arnd Bergmann 写道:
>>
>> I checked several hvc backends, like drivers/tty/hvc/hvc_riscv_sbi.c,
>> drivers/tty/hvc/hvc_iucv.c, drivers/tty/hvc/hvc_rtas.c, they don't use dma.
>>
>> I not finished all hvc backends check yet. But I think even if all hvc
>> backends don't use dma currently, it is still possible that the hvc
>> backend using dma will be added in the furture.
>>
>> So I agree with you it should better be fixed in the hvc framework,
>> solve the issue in the first place.
> Ok, sounds good to me, no need to check more backends then.
> I see the hvc-console driver is listed as 'Odd Fixes' in the maintainer
> list, with nobody assigned other than the ppc kernel list (added to Cc).
>
> Once you come up with a fix in hvc_console.c, please send that to the
> tty maintainers, the ppc list and me, and I'll review it.
OK, thanks, I will submit the patch ASAP :)
>
> Arnd
^ permalink raw reply
* Re: [PATCH] virtio-console: avoid DMA from vmalloc area
From: Arnd Bergmann @ 2021-07-28 9:01 UTC (permalink / raw)
To: Xianting Tian
Cc: Arnd Bergmann, Amit Shah, gregkh, Linux Kernel Mailing List,
open list:DRM DRIVER FOR QEMU'S CIRRUS DEVICE, linuxppc-dev,
Omar Sandoval
In-Reply-To: <0d03a42b-b46c-408f-17a4-b6c094c0c29e@linux.alibaba.com>
On Wed, Jul 28, 2021 at 10:28 AM Xianting Tian
<xianting.tian@linux.alibaba.com> wrote:
> 在 2021/7/28 下午3:25, Arnd Bergmann 写道:
>
> I checked several hvc backends, like drivers/tty/hvc/hvc_riscv_sbi.c,
> drivers/tty/hvc/hvc_iucv.c, drivers/tty/hvc/hvc_rtas.c, they don't use dma.
>
> I not finished all hvc backends check yet. But I think even if all hvc
> backends don't use dma currently, it is still possible that the hvc
> backend using dma will be added in the furture.
>
> So I agree with you it should better be fixed in the hvc framework,
> solve the issue in the first place.
Ok, sounds good to me, no need to check more backends then.
I see the hvc-console driver is listed as 'Odd Fixes' in the maintainer
list, with nobody assigned other than the ppc kernel list (added to Cc).
Once you come up with a fix in hvc_console.c, please send that to the
tty maintainers, the ppc list and me, and I'll review it.
Arnd
^ permalink raw reply
* Re: Possible regression by ab037dd87a2f (powerpc/vdso: Switch VDSO to generic C implementation.)
From: Paul Menzel @ 2021-07-28 8:26 UTC (permalink / raw)
To: Benjamin Herrenschmidt, Michael Ellerman, Paul Mackerras,
Christophe Leroy
Cc: Derek Parker, Dmitrii Okunev, linuxppc-dev
In-Reply-To: <3661999754da1a5e5c810fa669654cc7db95b059.camel@kernel.crashing.org>
Dear Benjamin,
Am 28.07.21 um 01:14 schrieb Benjamin Herrenschmidt:
> On Tue, 2021-07-27 at 10:45 +0200, Paul Menzel wrote:
>> On ppc64le Go 1.16.2 from Ubuntu 21.04 terminates with a segmentation
>> fault [1], and it might be related to *[release-branch.go1.16] runtime:
>> fix crash during VDSO calls on PowerPC* [2], conjecturing that commit
>> ab037dd87a2f (powerpc/vdso: Switch VDSO to generic C implementation.)
>> added in Linux 5.11 causes this.
>>
>> If this is indeed the case, this would be a regression in userspace. Is
>> there a generic fix or should the change be reverted?
>
> From the look at the links you posted, this appears to be completely
> broken assumptions by Go that some registers don't change while calling
> what essentially are external library functions *while inside those
> functions* (ie in this case from a signal handler).
>
> I suppose it would be possible to build the VDSO with gcc arguments to
> make it not use r30, but that's just gross...
Thank you for looking into this. No idea, if it falls under Linux’ no
regression policy or not.
Kind regards,
Paul
^ permalink raw reply
* [PATCH] mm/pkeys: Remove unused parameter in arch_set_user_pkey_access
From: Jiashuo Liang @ 2021-07-28 6:47 UTC (permalink / raw)
To: Michael Ellerman, Benjamin Herrenschmidt, Paul Mackerras,
Thomas Gleixner, Ingo Molnar, Borislav Petkov, x86,
H. Peter Anvin, Dave Hansen, Andy Lutomirski, Peter Zijlstra,
Andrew Morton, Sandipan Das, Ram Pai, Aneesh Kumar K.V,
Fenghua Yu, Kan Liang
Cc: linux-mm, Jiashuo Liang, linuxppc-dev, linux-kernel
The arch_set_user_pkey_access function never uses its first parameter
(struct task_struct *tsk). It is only able to set the pkey permissions for
the current task as implemented, and existing kernel code only passes
"current" to arch_set_user_pkey_access. So remove the ambiguous parameter
to make the code clean.
Signed-off-by: Jiashuo Liang <liangjs@pku.edu.cn>
---
arch/powerpc/include/asm/pkeys.h | 8 +++-----
arch/powerpc/mm/book3s64/pkeys.c | 3 +--
arch/x86/include/asm/pkeys.h | 12 ++++--------
arch/x86/kernel/fpu/xstate.c | 3 +--
arch/x86/mm/pkeys.c | 3 +--
include/linux/pkeys.h | 3 +--
mm/mprotect.c | 2 +-
7 files changed, 12 insertions(+), 22 deletions(-)
diff --git a/arch/powerpc/include/asm/pkeys.h b/arch/powerpc/include/asm/pkeys.h
index 59a2c7dbc78f..e905b2ab31e2 100644
--- a/arch/powerpc/include/asm/pkeys.h
+++ b/arch/powerpc/include/asm/pkeys.h
@@ -143,10 +143,8 @@ static inline int arch_override_mprotect_pkey(struct vm_area_struct *vma,
return __arch_override_mprotect_pkey(vma, prot, pkey);
}
-extern int __arch_set_user_pkey_access(struct task_struct *tsk, int pkey,
- unsigned long init_val);
-static inline int arch_set_user_pkey_access(struct task_struct *tsk, int pkey,
- unsigned long init_val)
+extern int __arch_set_user_pkey_access(int pkey, unsigned long init_val);
+static inline int arch_set_user_pkey_access(int pkey, unsigned long init_val)
{
if (!mmu_has_feature(MMU_FTR_PKEY))
return -EINVAL;
@@ -160,7 +158,7 @@ static inline int arch_set_user_pkey_access(struct task_struct *tsk, int pkey,
if (pkey == 0)
return init_val ? -EINVAL : 0;
- return __arch_set_user_pkey_access(tsk, pkey, init_val);
+ return __arch_set_user_pkey_access(pkey, init_val);
}
static inline bool arch_pkeys_enabled(void)
diff --git a/arch/powerpc/mm/book3s64/pkeys.c b/arch/powerpc/mm/book3s64/pkeys.c
index a2d9ad138709..dc77c0a27291 100644
--- a/arch/powerpc/mm/book3s64/pkeys.c
+++ b/arch/powerpc/mm/book3s64/pkeys.c
@@ -333,8 +333,7 @@ static inline void init_iamr(int pkey, u8 init_bits)
* Set the access rights in AMR IAMR and UAMOR registers for @pkey to that
* specified in @init_val.
*/
-int __arch_set_user_pkey_access(struct task_struct *tsk, int pkey,
- unsigned long init_val)
+int __arch_set_user_pkey_access(int pkey, unsigned long init_val)
{
u64 new_amr_bits = 0x0ul;
u64 new_iamr_bits = 0x0ul;
diff --git a/arch/x86/include/asm/pkeys.h b/arch/x86/include/asm/pkeys.h
index 5c7bcaa79623..26d872bdee49 100644
--- a/arch/x86/include/asm/pkeys.h
+++ b/arch/x86/include/asm/pkeys.h
@@ -11,8 +11,7 @@
*/
#define arch_max_pkey() (cpu_feature_enabled(X86_FEATURE_OSPKE) ? 16 : 1)
-extern int arch_set_user_pkey_access(struct task_struct *tsk, int pkey,
- unsigned long init_val);
+extern int arch_set_user_pkey_access(int pkey, unsigned long init_val);
static inline bool arch_pkeys_enabled(void)
{
@@ -43,8 +42,7 @@ static inline int arch_override_mprotect_pkey(struct vm_area_struct *vma,
return __arch_override_mprotect_pkey(vma, prot, pkey);
}
-extern int __arch_set_user_pkey_access(struct task_struct *tsk, int pkey,
- unsigned long init_val);
+extern int __arch_set_user_pkey_access(int pkey, unsigned long init_val);
#define ARCH_VM_PKEY_FLAGS (VM_PKEY_BIT0 | VM_PKEY_BIT1 | VM_PKEY_BIT2 | VM_PKEY_BIT3)
@@ -120,10 +118,8 @@ int mm_pkey_free(struct mm_struct *mm, int pkey)
return 0;
}
-extern int arch_set_user_pkey_access(struct task_struct *tsk, int pkey,
- unsigned long init_val);
-extern int __arch_set_user_pkey_access(struct task_struct *tsk, int pkey,
- unsigned long init_val);
+extern int arch_set_user_pkey_access(int pkey, unsigned long init_val);
+extern int __arch_set_user_pkey_access(int pkey, unsigned long init_val);
static inline int vma_pkey(struct vm_area_struct *vma)
{
diff --git a/arch/x86/kernel/fpu/xstate.c b/arch/x86/kernel/fpu/xstate.c
index c8def1b7f8fb..565de4a49c0a 100644
--- a/arch/x86/kernel/fpu/xstate.c
+++ b/arch/x86/kernel/fpu/xstate.c
@@ -912,8 +912,7 @@ EXPORT_SYMBOL_GPL(get_xsave_addr);
* This will go out and modify PKRU register to set the access
* rights for @pkey to @init_val.
*/
-int arch_set_user_pkey_access(struct task_struct *tsk, int pkey,
- unsigned long init_val)
+int arch_set_user_pkey_access(int pkey, unsigned long init_val)
{
u32 old_pkru, new_pkru_bits = 0;
int pkey_shift;
diff --git a/arch/x86/mm/pkeys.c b/arch/x86/mm/pkeys.c
index e44e938885b7..fafc10ea7cf1 100644
--- a/arch/x86/mm/pkeys.c
+++ b/arch/x86/mm/pkeys.c
@@ -42,8 +42,7 @@ int __execute_only_pkey(struct mm_struct *mm)
* Set up PKRU so that it denies access for everything
* other than execution.
*/
- ret = arch_set_user_pkey_access(current, execute_only_pkey,
- PKEY_DISABLE_ACCESS);
+ ret = arch_set_user_pkey_access(execute_only_pkey, PKEY_DISABLE_ACCESS);
/*
* If the PKRU-set operation failed somehow, just return
* 0 and effectively disable execute-only support.
diff --git a/include/linux/pkeys.h b/include/linux/pkeys.h
index 6beb26b7151d..c8a5d96ab461 100644
--- a/include/linux/pkeys.h
+++ b/include/linux/pkeys.h
@@ -33,8 +33,7 @@ static inline int mm_pkey_free(struct mm_struct *mm, int pkey)
return -EINVAL;
}
-static inline int arch_set_user_pkey_access(struct task_struct *tsk, int pkey,
- unsigned long init_val)
+static inline int arch_set_user_pkey_access(int pkey, unsigned long init_val)
{
return 0;
}
diff --git a/mm/mprotect.c b/mm/mprotect.c
index 883e2cc85cad..fe2c4755d833 100644
--- a/mm/mprotect.c
+++ b/mm/mprotect.c
@@ -689,7 +689,7 @@ SYSCALL_DEFINE2(pkey_alloc, unsigned long, flags, unsigned long, init_val)
if (pkey == -1)
goto out;
- ret = arch_set_user_pkey_access(current, pkey, init_val);
+ ret = arch_set_user_pkey_access(pkey, init_val);
if (ret) {
mm_pkey_free(current->mm, pkey);
goto out;
--
2.32.0
^ permalink raw reply related
* [PATCH v2 6/7] sections: Add new is_kernel() and is_kernel_text()
From: Kefeng Wang @ 2021-07-28 8:13 UTC (permalink / raw)
To: arnd, linux-arch, linux-kernel, linuxppc-dev, rostedt, mingo,
davem, ast, ryabinin.a.a
Cc: Kefeng Wang, paulus
In-Reply-To: <20210728081320.20394-1-wangkefeng.wang@huawei.com>
The new is_kernel() check the kernel address ranges, and the
new is_kernel_text() check the kernel text section ranges.
Then use them to make some code clear.
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
include/asm-generic/sections.h | 27 +++++++++++++++++++++++++++
include/linux/kallsyms.h | 4 ++--
kernel/extable.c | 3 +--
mm/kasan/report.c | 2 +-
4 files changed, 31 insertions(+), 5 deletions(-)
diff --git a/include/asm-generic/sections.h b/include/asm-generic/sections.h
index 4f2f32aa2b7a..6b143637ab88 100644
--- a/include/asm-generic/sections.h
+++ b/include/asm-generic/sections.h
@@ -170,6 +170,20 @@ static inline bool is_kernel_rodata(unsigned long addr)
addr < (unsigned long)__end_rodata;
}
+/**
+ * is_kernel_text - checks if the pointer address is located in the
+ * .text section
+ *
+ * @addr: address to check
+ *
+ * Returns: true if the address is located in .text, false otherwise.
+ */
+static inline bool is_kernel_text(unsigned long addr)
+{
+ return addr >= (unsigned long)_stext &&
+ addr < (unsigned long)_etext;
+}
+
/**
* is_kernel_inittext - checks if the pointer address is located in the
* .init.text section
@@ -184,4 +198,17 @@ static inline bool is_kernel_inittext(unsigned long addr)
addr < (unsigned long)_einittext;
}
+/**
+ * is_kernel - checks if the pointer address is located in the kernel range
+ *
+ * @addr: address to check
+ *
+ * Returns: true if the address is located in kernel range, false otherwise.
+ */
+static inline bool is_kernel(unsigned long addr)
+{
+ return addr >= (unsigned long)_stext &&
+ addr < (unsigned long)_end;
+}
+
#endif /* _ASM_GENERIC_SECTIONS_H_ */
diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h
index 4f501ac9c2c2..897d5720884f 100644
--- a/include/linux/kallsyms.h
+++ b/include/linux/kallsyms.h
@@ -26,14 +26,14 @@ struct module;
static inline int is_kernel_text_or_gate_area(unsigned long addr)
{
- if ((addr >= (unsigned long)_stext && addr < (unsigned long)_etext))
+ if (is_kernel_text(addr))
return 1;
return in_gate_area_no_mm(addr);
}
static inline int is_kernel_or_gate_area(unsigned long addr)
{
- if (addr >= (unsigned long)_stext && addr < (unsigned long)_end)
+ if (is_kernel(addr))
return 1;
return in_gate_area_no_mm(addr);
}
diff --git a/kernel/extable.c b/kernel/extable.c
index 98ca627ac5ef..0ba383d850ff 100644
--- a/kernel/extable.c
+++ b/kernel/extable.c
@@ -64,8 +64,7 @@ const struct exception_table_entry *search_exception_tables(unsigned long addr)
int notrace core_kernel_text(unsigned long addr)
{
- if (addr >= (unsigned long)_stext &&
- addr < (unsigned long)_etext)
+ if (is_kernel_text(addr))
return 1;
if (system_state < SYSTEM_RUNNING &&
diff --git a/mm/kasan/report.c b/mm/kasan/report.c
index 884a950c7026..88f5b0c058b7 100644
--- a/mm/kasan/report.c
+++ b/mm/kasan/report.c
@@ -235,7 +235,7 @@ static void describe_object(struct kmem_cache *cache, void *object,
static inline bool kernel_or_module_addr(const void *addr)
{
- if (addr >= (void *)_stext && addr < (void *)_end)
+ if (is_kernel((unsigned long)addr))
return true;
if (is_module_address((unsigned long)addr))
return true;
--
2.26.2
^ permalink raw reply related
* [PATCH v2 3/7] sections: Move and rename core_kernel_data() to is_kernel_core_data()
From: Kefeng Wang @ 2021-07-28 8:13 UTC (permalink / raw)
To: arnd, linux-arch, linux-kernel, linuxppc-dev, rostedt, mingo,
davem, ast, ryabinin.a.a
Cc: Kefeng Wang, paulus
In-Reply-To: <20210728081320.20394-1-wangkefeng.wang@huawei.com>
Move core_kernel_data() into sections.h and rename it to
is_kernel_core_data(), also make it return bool value, then
update all the callers.
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
include/asm-generic/sections.h | 14 ++++++++++++++
include/linux/kernel.h | 1 -
kernel/extable.c | 18 ------------------
kernel/trace/ftrace.c | 2 +-
net/sysctl_net.c | 2 +-
5 files changed, 16 insertions(+), 21 deletions(-)
diff --git a/include/asm-generic/sections.h b/include/asm-generic/sections.h
index 817309e289db..26ed9fc9b4e3 100644
--- a/include/asm-generic/sections.h
+++ b/include/asm-generic/sections.h
@@ -142,6 +142,20 @@ static inline bool init_section_intersects(void *virt, size_t size)
return memory_intersects(__init_begin, __init_end, virt, size);
}
+/**
+ * is_kernel_core_data - checks if the pointer address is located in the
+ * .data section
+ *
+ * @addr: address to check
+ *
+ * Returns: true if the address is located in .data, false otherwise.
+ */
+static inline bool is_kernel_core_data(unsigned long addr)
+{
+ return addr >= (unsigned long)_sdata &&
+ addr < (unsigned long)_edata;
+}
+
/**
* is_kernel_rodata - checks if the pointer address is located in the
* .rodata section
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 1b2f0a7e00d6..0622418bafbc 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -230,7 +230,6 @@ extern char *next_arg(char *args, char **param, char **val);
extern int core_kernel_text(unsigned long addr);
extern int init_kernel_text(unsigned long addr);
-extern int core_kernel_data(unsigned long addr);
extern int __kernel_text_address(unsigned long addr);
extern int kernel_text_address(unsigned long addr);
extern int func_ptr_is_kernel_text(void *ptr);
diff --git a/kernel/extable.c b/kernel/extable.c
index b0ea5eb0c3b4..da26203841d4 100644
--- a/kernel/extable.c
+++ b/kernel/extable.c
@@ -82,24 +82,6 @@ int notrace core_kernel_text(unsigned long addr)
return 0;
}
-/**
- * core_kernel_data - tell if addr points to kernel data
- * @addr: address to test
- *
- * Returns true if @addr passed in is from the core kernel data
- * section.
- *
- * Note: On some archs it may return true for core RODATA, and false
- * for others. But will always be true for core RW data.
- */
-int core_kernel_data(unsigned long addr)
-{
- if (addr >= (unsigned long)_sdata &&
- addr < (unsigned long)_edata)
- return 1;
- return 0;
-}
-
int __kernel_text_address(unsigned long addr)
{
if (kernel_text_address(addr))
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index e6fb3e6e1ffc..d01ca1cb2d5f 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -323,7 +323,7 @@ int __register_ftrace_function(struct ftrace_ops *ops)
if (!ftrace_enabled && (ops->flags & FTRACE_OPS_FL_PERMANENT))
return -EBUSY;
- if (!core_kernel_data((unsigned long)ops))
+ if (!is_kernel_core_data((unsigned long)ops))
ops->flags |= FTRACE_OPS_FL_DYNAMIC;
add_ftrace_ops(&ftrace_ops_list, ops);
diff --git a/net/sysctl_net.c b/net/sysctl_net.c
index f6cb0d4d114c..4b45ed631eb8 100644
--- a/net/sysctl_net.c
+++ b/net/sysctl_net.c
@@ -144,7 +144,7 @@ static void ensure_safe_net_sysctl(struct net *net, const char *path,
addr = (unsigned long)ent->data;
if (is_module_address(addr))
where = "module";
- else if (core_kernel_data(addr))
+ else if (is_kernel_core_data(addr))
where = "kernel";
else
continue;
--
2.26.2
^ permalink raw reply related
* [PATCH v2 7/7] powerpc/mm: Use is_kernel_text() and is_kernel_inittext() helper
From: Kefeng Wang @ 2021-07-28 8:13 UTC (permalink / raw)
To: arnd, linux-arch, linux-kernel, linuxppc-dev, rostedt, mingo,
davem, ast, ryabinin.a.a
Cc: Kefeng Wang, paulus
In-Reply-To: <20210728081320.20394-1-wangkefeng.wang@huawei.com>
Use is_kernel_text() and is_kernel_inittext() helper to simplify code,
also drop etext, _stext, _sinittext, _einittext declaration which
already declared in section.h.
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
arch/powerpc/mm/pgtable_32.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/arch/powerpc/mm/pgtable_32.c b/arch/powerpc/mm/pgtable_32.c
index dcf5ecca19d9..13c798308c2e 100644
--- a/arch/powerpc/mm/pgtable_32.c
+++ b/arch/powerpc/mm/pgtable_32.c
@@ -33,8 +33,6 @@
#include <mm/mmu_decl.h>
-extern char etext[], _stext[], _sinittext[], _einittext[];
-
static u8 early_fixmap_pagetable[FIXMAP_PTE_SIZE] __page_aligned_data;
notrace void __init early_ioremap_init(void)
@@ -104,14 +102,13 @@ static void __init __mapin_ram_chunk(unsigned long offset, unsigned long top)
{
unsigned long v, s;
phys_addr_t p;
- int ktext;
+ bool ktext;
s = offset;
v = PAGE_OFFSET + s;
p = memstart_addr + s;
for (; s < top; s += PAGE_SIZE) {
- ktext = ((char *)v >= _stext && (char *)v < etext) ||
- ((char *)v >= _sinittext && (char *)v < _einittext);
+ ktext = (is_kernel_text(v) || is_kernel_inittext(v));
map_kernel_page(v, p, ktext ? PAGE_KERNEL_TEXT : PAGE_KERNEL);
v += PAGE_SIZE;
p += PAGE_SIZE;
--
2.26.2
^ permalink raw reply related
* [PATCH v2 4/7] sections: Move is_kernel_inittext() into sections.h
From: Kefeng Wang @ 2021-07-28 8:13 UTC (permalink / raw)
To: arnd, linux-arch, linux-kernel, linuxppc-dev, rostedt, mingo,
davem, ast, ryabinin.a.a
Cc: Kefeng Wang, x86, paulus, Thomas Gleixner
In-Reply-To: <20210728081320.20394-1-wangkefeng.wang@huawei.com>
The is_kernel_inittext() and init_kernel_text() are with same
functionality, let's just keep is_kernel_inittext() and move
it into sections.h, then update all the callers.
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: x86@kernel.org
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
arch/x86/kernel/unwind_orc.c | 2 +-
include/asm-generic/sections.h | 14 ++++++++++++++
include/linux/kallsyms.h | 8 --------
include/linux/kernel.h | 1 -
kernel/extable.c | 12 ++----------
5 files changed, 17 insertions(+), 20 deletions(-)
diff --git a/arch/x86/kernel/unwind_orc.c b/arch/x86/kernel/unwind_orc.c
index a1202536fc57..d92ec2ced059 100644
--- a/arch/x86/kernel/unwind_orc.c
+++ b/arch/x86/kernel/unwind_orc.c
@@ -175,7 +175,7 @@ static struct orc_entry *orc_find(unsigned long ip)
}
/* vmlinux .init slow lookup: */
- if (init_kernel_text(ip))
+ if (is_kernel_inittext(ip))
return __orc_find(__start_orc_unwind_ip, __start_orc_unwind,
__stop_orc_unwind_ip - __start_orc_unwind_ip, ip);
diff --git a/include/asm-generic/sections.h b/include/asm-generic/sections.h
index 26ed9fc9b4e3..4f2f32aa2b7a 100644
--- a/include/asm-generic/sections.h
+++ b/include/asm-generic/sections.h
@@ -170,4 +170,18 @@ static inline bool is_kernel_rodata(unsigned long addr)
addr < (unsigned long)__end_rodata;
}
+/**
+ * is_kernel_inittext - checks if the pointer address is located in the
+ * .init.text section
+ *
+ * @addr: address to check
+ *
+ * Returns: true if the address is located in .init.text, false otherwise.
+ */
+static inline bool is_kernel_inittext(unsigned long addr)
+{
+ return addr >= (unsigned long)_sinittext &&
+ addr < (unsigned long)_einittext;
+}
+
#endif /* _ASM_GENERIC_SECTIONS_H_ */
diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h
index b016c62f30a6..8a9d329c927c 100644
--- a/include/linux/kallsyms.h
+++ b/include/linux/kallsyms.h
@@ -24,14 +24,6 @@
struct cred;
struct module;
-static inline int is_kernel_inittext(unsigned long addr)
-{
- if (addr >= (unsigned long)_sinittext
- && addr < (unsigned long)_einittext)
- return 1;
- return 0;
-}
-
static inline int is_kernel_text(unsigned long addr)
{
if ((addr >= (unsigned long)_stext && addr < (unsigned long)_etext))
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 0622418bafbc..d4ba46cf4737 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -229,7 +229,6 @@ extern bool parse_option_str(const char *str, const char *option);
extern char *next_arg(char *args, char **param, char **val);
extern int core_kernel_text(unsigned long addr);
-extern int init_kernel_text(unsigned long addr);
extern int __kernel_text_address(unsigned long addr);
extern int kernel_text_address(unsigned long addr);
extern int func_ptr_is_kernel_text(void *ptr);
diff --git a/kernel/extable.c b/kernel/extable.c
index da26203841d4..98ca627ac5ef 100644
--- a/kernel/extable.c
+++ b/kernel/extable.c
@@ -62,14 +62,6 @@ const struct exception_table_entry *search_exception_tables(unsigned long addr)
return e;
}
-int init_kernel_text(unsigned long addr)
-{
- if (addr >= (unsigned long)_sinittext &&
- addr < (unsigned long)_einittext)
- return 1;
- return 0;
-}
-
int notrace core_kernel_text(unsigned long addr)
{
if (addr >= (unsigned long)_stext &&
@@ -77,7 +69,7 @@ int notrace core_kernel_text(unsigned long addr)
return 1;
if (system_state < SYSTEM_RUNNING &&
- init_kernel_text(addr))
+ is_kernel_inittext(addr))
return 1;
return 0;
}
@@ -94,7 +86,7 @@ int __kernel_text_address(unsigned long addr)
* Since we are after the module-symbols check, there's
* no danger of address overlap:
*/
- if (init_kernel_text(addr))
+ if (is_kernel_inittext(addr))
return 1;
return 0;
}
--
2.26.2
^ permalink raw reply related
* [PATCH v2 5/7] kallsyms: Rename is_kernel() and is_kernel_text()
From: Kefeng Wang @ 2021-07-28 8:13 UTC (permalink / raw)
To: arnd, linux-arch, linux-kernel, linuxppc-dev, rostedt, mingo,
davem, ast, ryabinin.a.a
Cc: Kefeng Wang, Daniel Borkmann, Nathan Chancellor, paulus,
Sami Tolvanen, bpf
In-Reply-To: <20210728081320.20394-1-wangkefeng.wang@huawei.com>
The is_kernel[_text]() function check the address whether or not
in kernel[_text] ranges, also they will check the address whether
or not in gate area, so use better name.
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Sami Tolvanen <samitolvanen@google.com>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: bpf@vger.kernel.org
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
arch/x86/net/bpf_jit_comp.c | 2 +-
include/linux/kallsyms.h | 8 ++++----
kernel/cfi.c | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c
index 333650b9372a..c87d0dd4370d 100644
--- a/arch/x86/net/bpf_jit_comp.c
+++ b/arch/x86/net/bpf_jit_comp.c
@@ -372,7 +372,7 @@ static int __bpf_arch_text_poke(void *ip, enum bpf_text_poke_type t,
int bpf_arch_text_poke(void *ip, enum bpf_text_poke_type t,
void *old_addr, void *new_addr)
{
- if (!is_kernel_text((long)ip) &&
+ if (!is_kernel_text_or_gate_area((long)ip) &&
!is_bpf_text_address((long)ip))
/* BPF poking in modules is not supported */
return -EINVAL;
diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h
index 8a9d329c927c..4f501ac9c2c2 100644
--- a/include/linux/kallsyms.h
+++ b/include/linux/kallsyms.h
@@ -24,14 +24,14 @@
struct cred;
struct module;
-static inline int is_kernel_text(unsigned long addr)
+static inline int is_kernel_text_or_gate_area(unsigned long addr)
{
if ((addr >= (unsigned long)_stext && addr < (unsigned long)_etext))
return 1;
return in_gate_area_no_mm(addr);
}
-static inline int is_kernel(unsigned long addr)
+static inline int is_kernel_or_gate_area(unsigned long addr)
{
if (addr >= (unsigned long)_stext && addr < (unsigned long)_end)
return 1;
@@ -41,9 +41,9 @@ static inline int is_kernel(unsigned long addr)
static inline int is_ksym_addr(unsigned long addr)
{
if (IS_ENABLED(CONFIG_KALLSYMS_ALL))
- return is_kernel(addr);
+ return is_kernel_or_gate_area(addr);
- return is_kernel_text(addr) || is_kernel_inittext(addr);
+ return is_kernel_text_or_gate_area(addr) || is_kernel_inittext(addr);
}
static inline void *dereference_symbol_descriptor(void *ptr)
diff --git a/kernel/cfi.c b/kernel/cfi.c
index e17a56639766..e7d90eff4382 100644
--- a/kernel/cfi.c
+++ b/kernel/cfi.c
@@ -282,7 +282,7 @@ static inline cfi_check_fn find_check_fn(unsigned long ptr)
{
cfi_check_fn fn = NULL;
- if (is_kernel_text(ptr))
+ if (is_kernel_text_or_gate_area(ptr))
return __cfi_check;
/*
--
2.26.2
^ permalink raw reply related
* [PATCH v2 2/7] kallsyms: Fix address-checks for kernel related range
From: Kefeng Wang @ 2021-07-28 8:13 UTC (permalink / raw)
To: arnd, linux-arch, linux-kernel, linuxppc-dev, rostedt, mingo,
davem, ast, ryabinin.a.a
Cc: Petr Mladek, Kefeng Wang, Sergey Senozhatsky, Sergey Senozhatsky,
paulus
In-Reply-To: <20210728081320.20394-1-wangkefeng.wang@huawei.com>
The is_kernel_inittext/is_kernel_text/is_kernel function should not
include the end address(the labels _einittext, _etext and _end) when
check the address range, the issue exists since Linux v2.6.12.
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Petr Mladek <pmladek@suse.com>
Acked-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
include/linux/kallsyms.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h
index 2a241e3f063f..b016c62f30a6 100644
--- a/include/linux/kallsyms.h
+++ b/include/linux/kallsyms.h
@@ -27,21 +27,21 @@ struct module;
static inline int is_kernel_inittext(unsigned long addr)
{
if (addr >= (unsigned long)_sinittext
- && addr <= (unsigned long)_einittext)
+ && addr < (unsigned long)_einittext)
return 1;
return 0;
}
static inline int is_kernel_text(unsigned long addr)
{
- if ((addr >= (unsigned long)_stext && addr <= (unsigned long)_etext))
+ if ((addr >= (unsigned long)_stext && addr < (unsigned long)_etext))
return 1;
return in_gate_area_no_mm(addr);
}
static inline int is_kernel(unsigned long addr)
{
- if (addr >= (unsigned long)_stext && addr <= (unsigned long)_end)
+ if (addr >= (unsigned long)_stext && addr < (unsigned long)_end)
return 1;
return in_gate_area_no_mm(addr);
}
--
2.26.2
^ permalink raw reply related
* [PATCH v2 1/7] kallsyms: Remove arch specific text and data check
From: Kefeng Wang @ 2021-07-28 8:13 UTC (permalink / raw)
To: arnd, linux-arch, linux-kernel, linuxppc-dev, rostedt, mingo,
davem, ast, ryabinin.a.a
Cc: Kefeng Wang, paulus
In-Reply-To: <20210728081320.20394-1-wangkefeng.wang@huawei.com>
After commit 4ba66a976072 ("arch: remove blackfin port"),
no need arch-specific text/data check.
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
include/asm-generic/sections.h | 16 ----------------
include/linux/kallsyms.h | 3 +--
kernel/locking/lockdep.c | 3 ---
3 files changed, 1 insertion(+), 21 deletions(-)
diff --git a/include/asm-generic/sections.h b/include/asm-generic/sections.h
index d16302d3eb59..817309e289db 100644
--- a/include/asm-generic/sections.h
+++ b/include/asm-generic/sections.h
@@ -64,22 +64,6 @@ extern __visible const void __nosave_begin, __nosave_end;
#define dereference_kernel_function_descriptor(p) ((void *)(p))
#endif
-/* random extra sections (if any). Override
- * in asm/sections.h */
-#ifndef arch_is_kernel_text
-static inline int arch_is_kernel_text(unsigned long addr)
-{
- return 0;
-}
-#endif
-
-#ifndef arch_is_kernel_data
-static inline int arch_is_kernel_data(unsigned long addr)
-{
- return 0;
-}
-#endif
-
/*
* Check if an address is part of freed initmem. This is needed on architectures
* with virt == phys kernel mapping, for code that wants to check if an address
diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h
index 6851c2313cad..2a241e3f063f 100644
--- a/include/linux/kallsyms.h
+++ b/include/linux/kallsyms.h
@@ -34,8 +34,7 @@ static inline int is_kernel_inittext(unsigned long addr)
static inline int is_kernel_text(unsigned long addr)
{
- if ((addr >= (unsigned long)_stext && addr <= (unsigned long)_etext) ||
- arch_is_kernel_text(addr))
+ if ((addr >= (unsigned long)_stext && addr <= (unsigned long)_etext))
return 1;
return in_gate_area_no_mm(addr);
}
diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
index bf1c00c881e4..64b17e995108 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -803,9 +803,6 @@ static int static_obj(const void *obj)
if ((addr >= start) && (addr < end))
return 1;
- if (arch_is_kernel_data(addr))
- return 1;
-
/*
* in-kernel percpu var?
*/
--
2.26.2
^ permalink raw reply related
* [PATCH v2 0/7] sections: Unify kernel sections range check and use
From: Kefeng Wang @ 2021-07-28 8:13 UTC (permalink / raw)
To: arnd, linux-arch, linux-kernel, linuxppc-dev, rostedt, mingo,
davem, ast, ryabinin.a.a
Cc: linux-s390, Kefeng Wang, iommu, paulus, bpf
There are three head files(kallsyms.h, kernel.h and sections.h) which
include the kernel sections range check, let's make some cleanup and
unify them.
1. cleanup arch specific text/data check and fix address boundary check
in kallsyms.h
2. make all the basic/core kernel range check function into sections.h
3. update all the callers, and use the helper in sections.h to simplify
the code
After this series, we have 5 APIs about kernel sections range check in
sections.h
* is_kernel_core_data() --- come from core_kernel_data() in kernel.h
* is_kernel_rodata() --- already in sections.h
* is_kernel_text() --- come from kallsyms.h
* is_kernel_inittext() --- come from kernel.h and kallsyms.h
* is_kernel() --- come from kallsyms.h
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-s390@vger.kernel.org
Cc: linux-arch@vger.kernel.org
Cc: iommu@lists.linux-foundation.org
Cc: bpf@vger.kernel.org
v2:
- add ACK/RW to patch2, and drop inappropriate fix tag
- keep 'core' to check kernel data, suggestted by Steven Rostedt
<rostedt@goodmis.org>, rename is_kernel_data() to is_kernel_core_data()
- drop patch8 which is merged
- drop patch9 which is resend independently
v1:
https://lore.kernel.org/linux-arch/20210626073439.150586-1-wangkefeng.wang@huawei.com
Kefeng Wang (7):
kallsyms: Remove arch specific text and data check
kallsyms: Fix address-checks for kernel related range
sections: Move and rename core_kernel_data() to is_kernel_core_data()
sections: Move is_kernel_inittext() into sections.h
kallsyms: Rename is_kernel() and is_kernel_text()
sections: Add new is_kernel() and is_kernel_text()
powerpc/mm: Use is_kernel_text() and is_kernel_inittext() helper
arch/powerpc/mm/pgtable_32.c | 7 +---
arch/x86/kernel/unwind_orc.c | 2 +-
arch/x86/net/bpf_jit_comp.c | 2 +-
include/asm-generic/sections.h | 71 ++++++++++++++++++++++++++--------
include/linux/kallsyms.h | 21 +++-------
include/linux/kernel.h | 2 -
kernel/cfi.c | 2 +-
kernel/extable.c | 33 ++--------------
kernel/locking/lockdep.c | 3 --
kernel/trace/ftrace.c | 2 +-
mm/kasan/report.c | 2 +-
net/sysctl_net.c | 2 +-
12 files changed, 72 insertions(+), 77 deletions(-)
--
2.26.2
^ permalink raw reply
* [powerpc][next-20210727] Boot failure - kernel BUG at arch/powerpc/kernel/interrupt.c:98!
From: Sachin Sant @ 2021-07-28 8:01 UTC (permalink / raw)
To: linuxppc-dev; +Cc: linux-next
[-- Attachment #1: Type: text/plain, Size: 3789 bytes --]
linux-next fails to boot on Power server (POWER8/POWER9). Following traces
are seen during boot
[ 0.010799] software IO TLB: tearing down default memory pool
[ 0.010805] ------------[ cut here ]------------
[ 0.010808] kernel BUG at arch/powerpc/kernel/interrupt.c:98!
[ 0.010812] Oops: Exception in kernel mode, sig: 5 [#1]
[ 0.010816] LE PAGE_SIZE=64K MMU=Hash SMP NR_CPUS=2048 NUMA pSeries
[ 0.010820] Modules linked in:
[ 0.010824] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 5.14.0-rc3-next-20210727 #1
[ 0.010830] NIP: c000000000032cfc LR: c00000000000c764 CTR: c00000000000c670
[ 0.010834] REGS: c000000003603b10 TRAP: 0700 Not tainted (5.14.0-rc3-next-20210727)
[ 0.010838] MSR: 8000000000029033 <SF,EE,ME,IR,DR,RI,LE> CR: 28000222 XER: 00000002
[ 0.010848] CFAR: c00000000000c760 IRQMASK: 3
[ 0.010848] GPR00: c00000000000c764 c000000003603db0 c0000000029bd000 0000000000000001
[ 0.010848] GPR04: 0000000000000a68 0000000000000400 c000000003603868 ffffffffffffffff
[ 0.010848] GPR08: 0000000000000000 0000000000000000 0000000000000000 0000000000000003
[ 0.010848] GPR12: ffffffffffffffff c00000001ec9ee80 c000000000012a28 0000000000000000
[ 0.010848] GPR16: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[ 0.010848] GPR20: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[ 0.010848] GPR24: 000000000000f134 0000000000000000 ffffffffffffffff c000000003603868
[ 0.010848] GPR28: 0000000000000400 0000000000000a68 c00000000202e9c0 c000000003603e80
[ 0.010896] NIP [c000000000032cfc] system_call_exception+0x8c/0x2e0
[ 0.010901] LR [c00000000000c764] system_call_common+0xf4/0x258
[ 0.010907] Call Trace:
[ 0.010909] [c000000003603db0] [c00000000016a6dc] calculate_sigpending+0x4c/0xe0 (unreliable)
[ 0.010915] [c000000003603e10] [c00000000000c764] system_call_common+0xf4/0x258
[ 0.010921] --- interrupt: c00 at kvm_template_end+0x4/0x8
[ 0.010926] NIP: c000000000092dec LR: c000000000114fc8 CTR: 0000000000000000
[ 0.010930] REGS: c000000003603e80 TRAP: 0c00 Not tainted (5.14.0-rc3-next-20210727)
[ 0.010934] MSR: 8000000000009033 <SF,EE,ME,IR,DR,RI,LE> CR: 28000222 XER: 00000000
[ 0.010943] IRQMASK: 0
[ 0.010943] GPR00: c00000000202e9c0 c000000003603b00 c0000000029bd000 000000000000f134
[ 0.010943] GPR04: 0000000000000a68 0000000000000400 c000000003603868 ffffffffffffffff
[ 0.010943] GPR08: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[ 0.010943] GPR12: 0000000000000000 c00000001ec9ee80 c000000000012a28 0000000000000000
[ 0.010943] GPR16: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[ 0.010943] GPR20: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[ 0.010943] GPR24: c0000000020033c4 c00000000110afc0 c000000002081950 c000000003277d40
[ 0.010943] GPR28: 0000000000000000 c00000000a680000 0000000004000000 00000000000d0000
[ 0.010989] NIP [c000000000092dec] kvm_template_end+0x4/0x8
[ 0.010993] LR [c000000000114fc8] set_memory_encrypted+0x38/0x60
[ 0.010999] --- interrupt: c00
[ 0.011001] [c000000003603b00] [c00000000000c764] system_call_common+0xf4/0x258 (unreliable)
[ 0.011008] Instruction dump:
[ 0.011011] 694a0003 312affff 7d495110 0b0a0000 60000000 60000000 e87f0108 68690002
[ 0.011019] 7929ffe2 0b090000 68634000 786397e2 <0b030000> e93f0138 792907e0 0b090000
[ 0.011029] ---[ end trace a20ad55589efcb10 ]---
[ 0.012297]
[ 1.012304] Kernel panic - not syncing: Fatal exception
next-20210723 was good. The boot failure seems to have been introduced with next-20210726.
I have attached the boot log.
Thanks
-Sachin
[-- Attachment #2: boot.txt --]
[-- Type: text/plain, Size: 16060 bytes --]
[ 0.000000] hash-mmu: Page sizes from device-tree:
[ 0.000000] hash-mmu: base_shift=12: shift=12, sllp=0x0000, avpnm=0x00000000, tlbiel=1, penc=0
[ 0.000000] hash-mmu: base_shift=12: shift=16, sllp=0x0000, avpnm=0x00000000, tlbiel=1, penc=7
[ 0.000000] hash-mmu: base_shift=12: shift=24, sllp=0x0000, avpnm=0x00000000, tlbiel=1, penc=56
[ 0.000000] hash-mmu: base_shift=16: shift=16, sllp=0x0110, avpnm=0x00000000, tlbiel=1, penc=1
[ 0.000000] hash-mmu: base_shift=16: shift=24, sllp=0x0110, avpnm=0x00000000, tlbiel=1, penc=8
[ 0.000000] hash-mmu: base_shift=24: shift=24, sllp=0x0100, avpnm=0x00000001, tlbiel=0, penc=0
[ 0.000000] hash-mmu: base_shift=34: shift=34, sllp=0x0120, avpnm=0x000007ff, tlbiel=0, penc=3
[ 0.000000] Enabling pkeys with max key count 31
[ 0.000000] Activating Kernel Userspace Execution Prevention
[ 0.000000] Activating Kernel Userspace Access Prevention
[ 0.000000] Using 1TB segments
[ 0.000000] hash-mmu: Initializing hash mmu with SLB
[ 0.000000] Linux version 5.14.0-rc3-next-20210727 (root@ltczz304-lp7.aus.stglabs.ibm.com) (gcc (GCC) 8.4.1 20200928 (Red Hat 8.4.1-1), GNU ld version 2.30-93.el8) #1 SMP Wed Jul 28 01:12:04 EDT 2021
[ 0.000000] Found initrd at 0xc000000005580000:0xc00000000a67e40b
[ 0.000000] Using pSeries machine description
[ 0.000000] printk: bootconsole [udbg0] enabled
[ 0.000000] Partition configured for 16 cpus.
[ 0.000000] CPU maps initialized for 8 threads per core
[ 0.000000] -----------------------------------------------------
[ 0.000000] phys_mem_size = 0x640000000
[ 0.000000] dcache_bsize = 0x80
[ 0.000000] icache_bsize = 0x80
[ 0.000000] cpu_features = 0x0001c07b8f5f9187
[ 0.000000] possible = 0x000ffbfbcf5fb187
[ 0.000000] always = 0x0000000380008181
[ 0.000000] cpu_user_features = 0xdc0065c2 0xeff00000
[ 0.000000] mmu_features = 0x7c006e01
[ 0.000000] firmware_features = 0x0000009fc45bfc57
[ 0.000000] vmalloc start = 0xc008000000000000
[ 0.000000] IO start = 0xc00a000000000000
[ 0.000000] vmemmap start = 0xc00c000000000000
[ 0.000000] hash-mmu: ppc64_pft_size = 0x1c
[ 0.000000] hash-mmu: htab_hash_mask = 0x1fffff
[ 0.000000] -----------------------------------------------------
[ 0.000000] numa: NODE_DATA [mem 0x63ff5ef80-0x63ff63fff]
[ 0.000000] rfi-flush: fallback displacement flush available
[ 0.000000] rfi-flush: mttrig type flush available
[ 0.000000] count-cache-flush: flush disabled.
[ 0.000000] link-stack-flush: software flush enabled.
[ 0.000000] stf-barrier: eieio barrier available
[ 0.000000] lpar: H_BLOCK_REMOVE supports base psize:0 psize:0 block size:8
[ 0.000000] lpar: H_BLOCK_REMOVE supports base psize:0 psize:2 block size:8
[ 0.000000] lpar: H_BLOCK_REMOVE supports base psize:0 psize:10 block size:8
[ 0.000000] lpar: H_BLOCK_REMOVE supports base psize:2 psize:2 block size:8
[ 0.000000] lpar: H_BLOCK_REMOVE supports base psize:2 psize:10 block size:8
[ 0.000000] PPC64 nvram contains 15360 bytes
[ 0.000000] barrier-nospec: using ORI speculation barrier
[ 0.000000] Zone ranges:
[ 0.000000] Normal [mem 0x0000000000000000-0x000000063fffffff]
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x0000000000000000-0x000000063fffffff]
[ 0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x000000063fffffff]
[ 0.000000] percpu: Embedded 10 pages/cpu s605976 r0 d49384 u1048576
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 409200
[ 0.000000] Policy zone: Normal
[ 0.000000] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-4.18.0-305.el8.ppc64le root=UUID=1d8cf2d2-972f-44c6-ad53-dfc23e7c0dc2 ro crashkernel=auto biosdevname=0
[ 0.000000] Unknown command line parameters: BOOT_IMAGE=/boot/vmlinuz-4.18.0-305.el8.ppc64le crashkernel=auto biosdevname=0
[ 0.000000] Dentry cache hash table entries: 4194304 (order: 9, 33554432 bytes, linear)
[ 0.000000] Inode-cache hash table entries: 2097152 (order: 8, 16777216 bytes, linear)
[ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[ 0.000000] Memory: 25904768K/26214400K available (13376K kernel code, 5440K rwdata, 4160K rodata, 4992K init, 2866K bss, 309632K reserved, 0K cma-reserved)
[ 0.000000] SLUB: HWalign=128, Order=0-3, MinObjects=0, CPUs=16, Nodes=2
[ 0.000000] ftrace: allocating 33320 entries in 13 pages
[ 0.000000] ftrace: allocated 13 pages with 3 groups
[ 0.000000] trace event string verifier disabled
[ 0.000000] rcu: Hierarchical RCU implementation.
[ 0.000000] rcu: RCU restricting CPUs from NR_CPUS=2048 to nr_cpu_ids=16.
[ 0.000000] Rude variant of Tasks RCU enabled.
[ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[ 0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=16
[ 0.000000] NR_IRQS: 512, nr_irqs: 512, preallocated irqs: 16
[ 0.000000] xive: Using IRQ range [400000-40000f]
[ 0.000000] xive: Interrupt handling initialized with spapr backend
[ 0.000000] xive: Using priority 7 for all interrupts
[ 0.000000] xive: Using 64kB queues
[ 0.000000] rcu: Offload RCU callbacks from CPUs: (none).
[ 0.000000] random: get_random_u64 called from start_kernel+0x9a8/0xc08 with crng_init=0
[ 0.000001] time_init: 56 bit decrementer (max: 7fffffffffffff)
[ 0.000031] clocksource: timebase: mask: 0xffffffffffffffff max_cycles: 0x761537d007, max_idle_ns: 440795202126 ns
[ 0.000082] clocksource: timebase mult[1f40000] shift[24] registered
[ 0.000161] Console: colour dummy device 80x25
[ 0.000188] printk: console [hvc0] enabled
[ 0.000188] printk: console [hvc0] enabled
[ 0.000211] printk: bootconsole [udbg0] disabled
[ 0.000211] printk: bootconsole [udbg0] disabled
[ 0.000257] pid_max: default: 32768 minimum: 301
[ 0.000298] LSM: Security Framework initializing
[ 0.000311] Yama: becoming mindful.
[ 0.000320] SELinux: Initializing.
[ 0.000396] Mount-cache hash table entries: 65536 (order: 3, 524288 bytes, linear)
[ 0.000433] Mountpoint-cache hash table entries: 65536 (order: 3, 524288 bytes, linear)
[ 0.000993] POWER9 performance monitor hardware support registered
[ 0.001023] rcu: Hierarchical SRCU implementation.
[ 0.002202] smp: Bringing up secondary CPUs ...
[ 0.005838] smp: Brought up 1 node, 16 CPUs
[ 0.005844] numa: Node 0 CPUs: 0-15
[ 0.005849] Big cores detected but using small core scheduling
[ 0.006221] devtmpfs: initialized
[ 0.007918] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.007925] futex hash table entries: 4096 (order: 3, 524288 bytes, linear)
[ 0.008076] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[ 0.008177] audit: initializing netlink subsys (disabled)
[ 0.008224] audit: type=2000 audit(1627450491.000:1): state=initialized audit_enabled=0 res=1
[ 0.008276] thermal_sys: Registered thermal governor 'fair_share'
[ 0.008277] thermal_sys: Registered thermal governor 'step_wise'
[ 0.008326] cpuidle: using governor menu
[ 0.008479] pstore: Registered nvram as persistent store backend
[ 0.009004] EEH: pSeries platform initialized
[ 0.010799] software IO TLB: tearing down default memory pool
[ 0.010805] ------------[ cut here ]------------
[ 0.010808] kernel BUG at arch/powerpc/kernel/interrupt.c:98!
[ 0.010812] Oops: Exception in kernel mode, sig: 5 [#1]
[ 0.010816] LE PAGE_SIZE=64K MMU=Hash SMP NR_CPUS=2048 NUMA pSeries
[ 0.010820] Modules linked in:
[ 0.010824] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 5.14.0-rc3-next-20210727 #1
[ 0.010830] NIP: c000000000032cfc LR: c00000000000c764 CTR: c00000000000c670
[ 0.010834] REGS: c000000003603b10 TRAP: 0700 Not tainted (5.14.0-rc3-next-20210727)
[ 0.010838] MSR: 8000000000029033 <SF,EE,ME,IR,DR,RI,LE> CR: 28000222 XER: 00000002
[ 0.010848] CFAR: c00000000000c760 IRQMASK: 3
[ 0.010848] GPR00: c00000000000c764 c000000003603db0 c0000000029bd000 0000000000000001
[ 0.010848] GPR04: 0000000000000a68 0000000000000400 c000000003603868 ffffffffffffffff
[ 0.010848] GPR08: 0000000000000000 0000000000000000 0000000000000000 0000000000000003
[ 0.010848] GPR12: ffffffffffffffff c00000001ec9ee80 c000000000012a28 0000000000000000
[ 0.010848] GPR16: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[ 0.010848] GPR20: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[ 0.010848] GPR24: 000000000000f134 0000000000000000 ffffffffffffffff c000000003603868
[ 0.010848] GPR28: 0000000000000400 0000000000000a68 c00000000202e9c0 c000000003603e80
[ 0.010896] NIP [c000000000032cfc] system_call_exception+0x8c/0x2e0
[ 0.010901] LR [c00000000000c764] system_call_common+0xf4/0x258
[ 0.010907] Call Trace:
[ 0.010909] [c000000003603db0] [c00000000016a6dc] calculate_sigpending+0x4c/0xe0 (unreliable)
[ 0.010915] [c000000003603e10] [c00000000000c764] system_call_common+0xf4/0x258
[ 0.010921] --- interrupt: c00 at kvm_template_end+0x4/0x8
[ 0.010926] NIP: c000000000092dec LR: c000000000114fc8 CTR: 0000000000000000
[ 0.010930] REGS: c000000003603e80 TRAP: 0c00 Not tainted (5.14.0-rc3-next-20210727)
[ 0.010934] MSR: 8000000000009033 <SF,EE,ME,IR,DR,RI,LE> CR: 28000222 XER: 00000000
[ 0.010943] IRQMASK: 0
[ 0.010943] GPR00: c00000000202e9c0 c000000003603b00 c0000000029bd000 000000000000f134
[ 0.010943] GPR04: 0000000000000a68 0000000000000400 c000000003603868 ffffffffffffffff
[ 0.010943] GPR08: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[ 0.010943] GPR12: 0000000000000000 c00000001ec9ee80 c000000000012a28 0000000000000000
[ 0.010943] GPR16: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[ 0.010943] GPR20: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[ 0.010943] GPR24: c0000000020033c4 c00000000110afc0 c000000002081950 c000000003277d40
[ 0.010943] GPR28: 0000000000000000 c00000000a680000 0000000004000000 00000000000d0000
[ 0.010989] NIP [c000000000092dec] kvm_template_end+0x4/0x8
[ 0.010993] LR [c000000000114fc8] set_memory_encrypted+0x38/0x60
[ 0.010999] --- interrupt: c00
[ 0.011001] [c000000003603b00] [c00000000000c764] system_call_common+0xf4/0x258 (unreliable)
[ 0.011008] Instruction dump:
[ 0.011011] 694a0003 312affff 7d495110 0b0a0000 60000000 60000000 e87f0108 68690002
[ 0.011019] 7929ffe2 0b090000 68634000 786397e2 <0b030000> e93f0138 792907e0 0b090000
[ 0.011029] ---[ end trace a20ad55589efcb10 ]---
[ 0.012297]
[ 1.012304] Kernel panic - not syncing: Fatal exception
[ 1.015990] ------------[ cut here ]------------
[ 1.015994] WARNING: CPU: 1 PID: 1 at drivers/tty/vt/vt.c:4394 do_unblank_screen+0x190/0x250
[ 1.016004] Modules linked in:
[ 1.016008] CPU: 1 PID: 1 Comm: swapper/0 Tainted: G D 5.14.0-rc3-next-20210727 #1
[ 1.016016] NIP: c0000000007fdd00 LR: c0000000007fdcec CTR: c00000000003de00
[ 1.016022] REGS: c000000003603660 TRAP: 0700 Tainted: G D (5.14.0-rc3-next-20210727)
[ 1.016028] MSR: 8000000000021033 <SF,ME,IR,DR,RI,LE> CR: 28002222 XER: 2004000c
[ 1.016043] CFAR: c0000000001ed078 IRQMASK: 3
[ 1.016043] GPR00: c0000000007fdcec c000000003603900 c0000000029bd000 0000000000000000
[ 1.016043] GPR04: 0000000000000003 0000000000000f75 c0000000036035e0 0000000000000000
[ 1.016043] GPR08: 0000000639fe0000 0000000000000000 0000000000000000 c0000000027b6ec8
[ 1.016043] GPR12: c00000000003de00 c00000001ec9ee80 c000000000012a28 0000000000000000
[ 1.016043] GPR16: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[ 1.016043] GPR20: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[ 1.016043] GPR24: 000000000000f134 0000000000000000 c0000000024eda70 c000000003603868
[ 1.016043] GPR28: c000000002a99a58 c000000002a99a90 0000000000000000 c000000002ba7e20
[ 1.016120] NIP [c0000000007fdd00] do_unblank_screen+0x190/0x250
[ 1.016127] LR [c0000000007fdcec] do_unblank_screen+0x17c/0x250
[ 1.016133] Call Trace:
[ 1.016136] [c000000003603900] [c0000000007fdd1c] do_unblank_screen+0x1ac/0x250 (unreliable)
[ 1.016145] [c000000003603980] [c000000000151a2c] panic+0x1e8/0x40c
[ 1.016153] [c000000003603a20] [c00000000002b2fc] oops_end+0x1fc/0x200
[ 1.016162] [c000000003603aa0] [c000000000009614] program_check_common_virt+0x2d4/0x320
[ 1.016170] --- interrupt: 700 at system_call_exception+0x8c/0x2e0
[ 1.016177] NIP: c000000000032cfc LR: c00000000000c764 CTR: c00000000000c670
[ 1.016183] REGS: c000000003603b10 TRAP: 0700 Tainted: G D (5.14.0-rc3-next-20210727)
[ 1.016189] MSR: 8000000000029033 <SF,EE,ME,IR,DR,RI,LE> CR: 28000222 XER: 00000002
[ 1.016205] CFAR: c00000000000c760 IRQMASK: 3
[ 1.016205] GPR00: c00000000000c764 c000000003603db0 c0000000029bd000 0000000000000001
[ 1.016205] GPR04: 0000000000000a68 0000000000000400 c000000003603868 ffffffffffffffff
[ 1.016205] GPR08: 0000000000000000 0000000000000000 0000000000000000 0000000000000003
[ 1.016205] GPR12: ffffffffffffffff c00000001ec9ee80 c000000000012a28 0000000000000000
[ 1.016205] GPR16: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[ 1.016205] GPR20: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[ 1.016205] GPR24: 000000000000f134 0000000000000000 ffffffffffffffff c000000003603868
[ 1.016205] GPR28: 0000000000000400 0000000000000a68 c00000000202e9c0 c000000003603e80
[ 1.016281] NIP [c000000000032cfc] system_call_exception+0x8c/0x2e0
[ 1.016287] LR [c00000000000c764] system_call_common+0xf4/0x258
[ 1.016294] --- interrupt: 700
[ 1.016298] [c000000003603db0] [c00000000016a6dc] calculate_sigpending+0x4c/0xe0 (unreliable)
[ 1.016307] [c000000003603e10] [c00000000000c764] system_call_common+0xf4/0x258
[ 1.016316] --- interrupt: c00 at kvm_template_end+0x4/0x8
[ 1.016322] NIP: c000000000092dec LR: c000000000114fc8 CTR: 0000000000000000
[ 1.016328] REGS: c000000003603e80 TRAP: 0c00 Tainted: G D (5.14.0-rc3-next-20210727)
[ 1.016334] MSR: 8000000000009033 <SF,EE,ME,IR,DR,RI,LE> CR: 28000222 XER: 00000000
[ 1.016350] IRQMASK: 0
[ 1.016350] GPR00: c00000000202e9c0 c000000003603b00 c0000000029bd000 000000000000f134
[ 1.016350] GPR04: 0000000000000a68 0000000000000400 c000000003603868 ffffffffffffffff
[ 1.016350] GPR08: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[ 1.016350] GPR12: 0000000000000000 c00000001ec9ee80 c000000000012a28 0000000000000000
[ 1.016350] GPR16: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[ 1.016350] GPR20: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[ 1.016350] GPR24: c0000000020033c4 c00000000110afc0 c000000002081950 c000000003277d40
[ 1.016350] GPR28: 0000000000000000 c00000000a680000 0000000004000000 00000000000d0000
[ 1.016423] NIP [c000000000092dec] kvm_template_end+0x4/0x8
[ 1.016430] LR [c000000000114fc8] set_memory_encrypted+0x38/0x60
[ 1.016437] --- interrupt: c00
[ 1.016440] [c000000003603b00] [c00000000000c764] system_call_common+0xf4/0x258 (unreliable)
[ 1.016450] Instruction dump:
[ 1.016454] 4e800020 60000000 60000000 60000000 7c0802a6 f8010090 4b9ef381 60000000
[ 1.016468] 813f0000 7d231b78 2f830000 409e0034 <0fe00000> e8010090 7c0803a6 4bfffeac
[ 1.016482] ---[ end trace a20ad55589efcb11 ]---
[ 1.016488] Rebooting in 10 seconds..
^ permalink raw reply
* [PATCH V2] powerpc/fadump: register for fadump as early as possible
From: Hari Bathini @ 2021-07-28 7:26 UTC (permalink / raw)
To: Michael Ellerman
Cc: Kairui Song, Petr Tesarik, Mahesh J Salgaonkar, Sourabh Jain,
linuxppc-dev, Michal Suchánek, Dave Young
Crash recovery (fadump) is setup in the userspace by some service.
This service rebuilds initrd with dump capture capability, if it is
not already dump capture capable before proceeding to register for
firmware assisted dump (echo 1 > /sys/kernel/fadump/registered). But
arming the kernel with crash recovery support does not have to wait
for userspace configuration. So, register for fadump while setting
it up itself. This can at worst lead to a scenario, where /proc/vmcore
is ready afer crash but the initrd does not know how/where to offload
it, which is always better than not having a /proc/vmcore at all due
to incomplete configuration in the userspace at the time of crash.
Commit 0823c68b054b ("powerpc/fadump: re-register firmware-assisted
dump if already registered") ensures this change does not break
userspace.
Signed-off-by: Hari Bathini <hbathini@linux.ibm.com>
---
Changes in V2:
* Updated the changelog with bit more explanation about userspace issue
with/without this change.
* Added a comment in the code for why setup_fadump function is changed
from subsys_init() to subsys_init_sync() call.
arch/powerpc/kernel/fadump.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c
index b990075285f5..2911aefdf594 100644
--- a/arch/powerpc/kernel/fadump.c
+++ b/arch/powerpc/kernel/fadump.c
@@ -1637,13 +1637,20 @@ int __init setup_fadump(void)
if (fw_dump.ops->fadump_process(&fw_dump) < 0)
fadump_invalidate_release_mem();
}
- /* Initialize the kernel dump memory structure for FAD registration. */
- else if (fw_dump.reserve_dump_area_size)
+ /* Initialize the kernel dump memory structure and register with f/w */
+ else if (fw_dump.reserve_dump_area_size) {
fw_dump.ops->fadump_init_mem_struct(&fw_dump);
+ register_fadump();
+ }
return 1;
}
-subsys_initcall(setup_fadump);
+/*
+ * Replace subsys_initcall() with subsys_initcall_sync() as there is dependency
+ * with crash_save_vmcoreinfo_init() to ensure vmcoreinfo initialization is done
+ * before regisering with f/w.
+ */
+subsys_initcall_sync(setup_fadump);
#else /* !CONFIG_PRESERVE_FA_DUMP */
/* Scan the Firmware Assisted dump configuration details. */
^ permalink raw reply related
* Re: [PATCH] powerpc/xmon: use ARRAY_SIZE
From: Michael Ellerman @ 2021-07-28 3:01 UTC (permalink / raw)
To: Jason Wang; +Cc: paulus, linuxppc-dev, Jason Wang, linux-kernel
In-Reply-To: <20210725150107.27865-1-wangborong@cdjrlc.com>
Jason Wang <wangborong@cdjrlc.com> writes:
> The ARRAY_SIZE is the macro definition of sizeof(a)/sizeof(a[0]) and
> it is more compact and formal to get a array size.
>
> Signed-off-by: Jason Wang <wangborong@cdjrlc.com>
> ---
> arch/powerpc/xmon/ppc-opc.c | 12 ++++--------
> 1 file changed, 4 insertions(+), 8 deletions(-)
This code is copied from binutils, please don't change it unnecessarily.
cheers
^ permalink raw reply
* Re: switch the block layer to use kmap_local_page v3
From: Jens Axboe @ 2021-07-28 1:31 UTC (permalink / raw)
To: Christoph Hellwig, Thomas Gleixner
Cc: linux-arch, linux-block, Thomas Bogendoerfer, Mike Snitzer,
Geoff Levand, linuxppc-dev, ceph-devel, linux-mips,
Dongsheng Yang, linux-kernel, James E.J. Bottomley, dm-devel,
Andrew Morton, Ira Weiny, Ilya Dryomov
In-Reply-To: <20210727055646.118787-1-hch@lst.de>
On 7/26/21 11:56 PM, Christoph Hellwig wrote:
> Hi all,
>
> this series switches the core block layer code and all users of the
> existing bvec kmap helpers to use kmap_local_page. Drivers that
> currently use open coded kmap_atomic calls will converted in a follow
> on series.
>
> To do so a new kunmap variant is added that calls
> flush_kernel_dcache_page. I'm not entirely sure where to call
> flush_dcache_page vs flush_kernel_dcache_page, so I've tried to follow
> the documentation here, but additional feedback would be welcome.
>
> Note that the ps3disk has a minir conflict with the
> flush_kernel_dcache_page removal in linux-next through the -mm tree.
> I had hoped that change would go into 5.14, but it seems like it is
> being held for 5.15.
Applied for 5.15, thanks.
--
Jens Axboe
^ permalink raw reply
* Re: Possible regression by ab037dd87a2f (powerpc/vdso: Switch VDSO to generic C implementation.)
From: Benjamin Herrenschmidt @ 2021-07-27 23:14 UTC (permalink / raw)
To: Paul Menzel, Michael Ellerman, Paul Mackerras, Christophe Leroy
Cc: Derek Parker, Dmitrii Okunev, linuxppc-dev
In-Reply-To: <a273c619-9258-e29a-24c3-ea47a13c4817@molgen.mpg.de>
On Tue, 2021-07-27 at 10:45 +0200, Paul Menzel wrote:
> Dear Christophe,
>
>
> On ppc64le Go 1.16.2 from Ubuntu 21.04 terminates with a segmentation
> fault [1], and it might be related to *[release-branch.go1.16] runtime:
> fix crash during VDSO calls on PowerPC* [2], conjecturing that commit
> ab037dd87a2f (powerpc/vdso: Switch VDSO to generic C implementation.)
> added in Linux 5.11 causes this.
>
> If this is indeed the case, this would be a regression in userspace. Is
> there a generic fix or should the change be reverted?
From the look at the links you posted, this appears to be completely
broken assumptions by Go that some registers don't change while calling
what essentially are external library functions *while inside those
functions* (ie in this case from a signal handler).
I suppose it would be possible to build the VDSO with gcc arguments to
make it not use r30, but that's just gross...
Cheers,
Ben.
^ permalink raw reply
* Re: [PATCH 00/11] Implement generic prot_guest_has() helper function
From: Tom Lendacky @ 2021-07-27 22:37 UTC (permalink / raw)
To: linux-kernel, x86, linuxppc-dev, linux-s390, iommu, kvm,
linux-efi, platform-driver-x86, linux-graphics-maintainer,
amd-gfx, dri-devel, kexec, linux-fsdevel
Cc: Sathyanarayanan Kuppuswamy, Brijesh Singh, David Airlie,
Dave Hansen, Paul Mackerras, Will Deacon, Ard Biesheuvel,
Andi Kleen, Baoquan He, Joerg Roedel, Christian Borntraeger,
Ingo Molnar, Dave Young, Tianyu Lan, Thomas Zimmermann,
Vasily Gorbik, Heiko Carstens, Maarten Lankhorst, Maxime Ripard,
Borislav Petkov, Andy Lutomirski, Thomas Gleixner, Peter Zijlstra,
Daniel Vetter
In-Reply-To: <cover.1627424773.git.thomas.lendacky@amd.com>
On 7/27/21 5:26 PM, Tom Lendacky wrote:
> This patch series provides a generic helper function, prot_guest_has(),
> to replace the sme_active(), sev_active(), sev_es_active() and
> mem_encrypt_active() functions.
>
> It is expected that as new protected virtualization technologies are
> added to the kernel, they can all be covered by a single function call
> instead of a collection of specific function calls all called from the
> same locations.
>
> The powerpc and s390 patches have been compile tested only. Can the
> folks copied on this series verify that nothing breaks for them.
I wanted to get this out before I head out on vacation at the end of the
week. I'll only be out for a week, but I won't be able to respond to any
feedback until I get back.
I'm still not a fan of the name prot_guest_has() because it is used for
some baremetal checks, but really haven't been able to come up with
anything better. So take it with a grain of salt where the sme_active()
calls are replaced by prot_guest_has().
Also, let me know if the treewide changes in patch #7 need to be further
split out by tree.
Thanks,
Tom
>
> Cc: Andi Kleen <ak@linux.intel.com>
> Cc: Andy Lutomirski <luto@kernel.org>
> Cc: Ard Biesheuvel <ardb@kernel.org>
> Cc: Baoquan He <bhe@redhat.com>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Borislav Petkov <bp@alien8.de>
> Cc: Christian Borntraeger <borntraeger@de.ibm.com>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Cc: Dave Hansen <dave.hansen@linux.intel.com>
> Cc: Dave Young <dyoung@redhat.com>
> Cc: David Airlie <airlied@linux.ie>
> Cc: Heiko Carstens <hca@linux.ibm.com>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: Joerg Roedel <joro@8bytes.org>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Maxime Ripard <mripard@kernel.org>
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: Vasily Gorbik <gor@linux.ibm.com>
> Cc: VMware Graphics <linux-graphics-maintainer@vmware.com>
> Cc: Will Deacon <will@kernel.org>
>
> ---
>
> Patches based on:
> https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git master
> commit 79e920060fa7 ("Merge branch 'WIP/fixes'")
>
> Tom Lendacky (11):
> mm: Introduce a function to check for virtualization protection
> features
> x86/sev: Add an x86 version of prot_guest_has()
> powerpc/pseries/svm: Add a powerpc version of prot_guest_has()
> x86/sme: Replace occurrences of sme_active() with prot_guest_has()
> x86/sev: Replace occurrences of sev_active() with prot_guest_has()
> x86/sev: Replace occurrences of sev_es_active() with prot_guest_has()
> treewide: Replace the use of mem_encrypt_active() with
> prot_guest_has()
> mm: Remove the now unused mem_encrypt_active() function
> x86/sev: Remove the now unused mem_encrypt_active() function
> powerpc/pseries/svm: Remove the now unused mem_encrypt_active()
> function
> s390/mm: Remove the now unused mem_encrypt_active() function
>
> arch/Kconfig | 3 ++
> arch/powerpc/include/asm/mem_encrypt.h | 5 --
> arch/powerpc/include/asm/protected_guest.h | 30 +++++++++++
> arch/powerpc/platforms/pseries/Kconfig | 1 +
> arch/s390/include/asm/mem_encrypt.h | 2 -
> arch/x86/Kconfig | 1 +
> arch/x86/include/asm/kexec.h | 2 +-
> arch/x86/include/asm/mem_encrypt.h | 13 +----
> arch/x86/include/asm/protected_guest.h | 27 ++++++++++
> arch/x86/kernel/crash_dump_64.c | 4 +-
> arch/x86/kernel/head64.c | 4 +-
> arch/x86/kernel/kvm.c | 3 +-
> arch/x86/kernel/kvmclock.c | 4 +-
> arch/x86/kernel/machine_kexec_64.c | 19 +++----
> arch/x86/kernel/pci-swiotlb.c | 9 ++--
> arch/x86/kernel/relocate_kernel_64.S | 2 +-
> arch/x86/kernel/sev.c | 6 +--
> arch/x86/kvm/svm/svm.c | 3 +-
> arch/x86/mm/ioremap.c | 16 +++---
> arch/x86/mm/mem_encrypt.c | 60 +++++++++++++++-------
> arch/x86/mm/mem_encrypt_identity.c | 3 +-
> arch/x86/mm/pat/set_memory.c | 3 +-
> arch/x86/platform/efi/efi_64.c | 9 ++--
> arch/x86/realmode/init.c | 8 +--
> drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 +-
> drivers/gpu/drm/drm_cache.c | 4 +-
> drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 4 +-
> drivers/gpu/drm/vmwgfx/vmwgfx_msg.c | 6 +--
> drivers/iommu/amd/init.c | 7 +--
> drivers/iommu/amd/iommu.c | 3 +-
> drivers/iommu/amd/iommu_v2.c | 3 +-
> drivers/iommu/iommu.c | 3 +-
> fs/proc/vmcore.c | 6 +--
> include/linux/mem_encrypt.h | 4 --
> include/linux/protected_guest.h | 37 +++++++++++++
> kernel/dma/swiotlb.c | 4 +-
> 36 files changed, 218 insertions(+), 104 deletions(-)
> create mode 100644 arch/powerpc/include/asm/protected_guest.h
> create mode 100644 arch/x86/include/asm/protected_guest.h
> create mode 100644 include/linux/protected_guest.h
>
^ permalink raw reply
* [PATCH 11/11] s390/mm: Remove the now unused mem_encrypt_active() function
From: Tom Lendacky @ 2021-07-27 22:26 UTC (permalink / raw)
To: linux-kernel, x86, linuxppc-dev, linux-s390, iommu, kvm,
linux-efi, platform-driver-x86, linux-graphics-maintainer,
amd-gfx, dri-devel, kexec, linux-fsdevel
Cc: Sathyanarayanan Kuppuswamy, Andi Kleen, Tianyu Lan, Vasily Gorbik,
Joerg Roedel, Christian Borntraeger, Borislav Petkov,
Brijesh Singh, Heiko Carstens
In-Reply-To: <cover.1627424773.git.thomas.lendacky@amd.com>
The mem_encrypt_active() function has been replaced by prot_guest_has(),
so remove the implementation. Since the default implementation of the
prot_guest_has() matches the s390 implementation of mem_encrypt_active(),
prot_guest_has() does not need to be implemented in s390 (the config
option ARCH_HAS_PROTECTED_GUEST is not set).
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
---
arch/s390/include/asm/mem_encrypt.h | 2 --
1 file changed, 2 deletions(-)
diff --git a/arch/s390/include/asm/mem_encrypt.h b/arch/s390/include/asm/mem_encrypt.h
index 2542cbf7e2d1..08a8b96606d7 100644
--- a/arch/s390/include/asm/mem_encrypt.h
+++ b/arch/s390/include/asm/mem_encrypt.h
@@ -4,8 +4,6 @@
#ifndef __ASSEMBLY__
-static inline bool mem_encrypt_active(void) { return false; }
-
int set_memory_encrypted(unsigned long addr, int numpages);
int set_memory_decrypted(unsigned long addr, int numpages);
--
2.32.0
^ permalink raw reply related
* [PATCH 10/11] powerpc/pseries/svm: Remove the now unused mem_encrypt_active() function
From: Tom Lendacky @ 2021-07-27 22:26 UTC (permalink / raw)
To: linux-kernel, x86, linuxppc-dev, linux-s390, iommu, kvm,
linux-efi, platform-driver-x86, linux-graphics-maintainer,
amd-gfx, dri-devel, kexec, linux-fsdevel
Cc: Sathyanarayanan Kuppuswamy, Andi Kleen, Tianyu Lan, Joerg Roedel,
Borislav Petkov, Brijesh Singh, Paul Mackerras
In-Reply-To: <cover.1627424773.git.thomas.lendacky@amd.com>
The mem_encrypt_active() function has been replaced by prot_guest_has(),
so remove the implementation.
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
---
arch/powerpc/include/asm/mem_encrypt.h | 5 -----
1 file changed, 5 deletions(-)
diff --git a/arch/powerpc/include/asm/mem_encrypt.h b/arch/powerpc/include/asm/mem_encrypt.h
index ba9dab07c1be..2f26b8fc8d29 100644
--- a/arch/powerpc/include/asm/mem_encrypt.h
+++ b/arch/powerpc/include/asm/mem_encrypt.h
@@ -10,11 +10,6 @@
#include <asm/svm.h>
-static inline bool mem_encrypt_active(void)
-{
- return is_secure_guest();
-}
-
static inline bool force_dma_unencrypted(struct device *dev)
{
return is_secure_guest();
--
2.32.0
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox