mirror of
https://github.com/Qortal/Brooklyn.git
synced 2025-02-07 14:54:17 +00:00
* NVME, SATA NAND Security added * Qortal Core exception fetcher is now redone. * Update DT overlays for firmware * Fix for bvb clockj settings * Fix for no audio for sissy desktop porn watchers -_- ( thanks crowetic for watching gay porn and reporting me that bug asshat ) * Normalize the fetch() stream while doing a peer to peer handshake for nodes * Fix for RNG token editing error while performing a SHA256 encryption * Now under voltage errors will blink red led constantly for 5 minutes then go solid. * Improve kernel thread scaling for Qortal 2.0 core * HDMI circuit is now enabled at power up instead. * Added KMS * Added line replication instead of interpolation for VC4 GPU resulting in slightly better frame rates * Fix for long and doubles * Backplane clock is now set at standard rate * Capped HVEC clocks * Add support for Creative Cinema webcam for donkers who like sharing dick pics. *looks at crowetic* * More scanline XGA modes for people who have weird ass monitors of all sorts. * TX/RX flow control support is now 100% stable. No lags over 1Gbps ethernet. ( Hello Qortal 3.0 ) * Using flush cache instead of fetch for QC 2.0 resulting in performance gains * VC4 clock is now enforced for desktop oriented images. * Ondemand governor now waits for 2 seconds instead of 0.5ms to scale down to the lowest safest clock freq preventing lags to the core. * Timeout of OC set at 35ms from 90ms resulting in way better clocks and sync for Qortal 2.0 core
125 lines
2.8 KiB
C
125 lines
2.8 KiB
C
// SPDX-License-Identifier: GPL-2.0-only
|
|
/*
|
|
* Copyright (C) 2004 Benjamin Herrenschmidt, IBM Corp.
|
|
* <benh@kernel.crashing.org>
|
|
* Copyright (C) 2012 ARM Limited
|
|
* Copyright (C) 2015 Regents of the University of California
|
|
*/
|
|
|
|
#include <linux/elf.h>
|
|
#include <linux/mm.h>
|
|
#include <linux/slab.h>
|
|
#include <linux/binfmts.h>
|
|
#include <linux/err.h>
|
|
#include <asm/page.h>
|
|
#include <asm/vdso.h>
|
|
|
|
#ifdef CONFIG_GENERIC_TIME_VSYSCALL
|
|
#include <vdso/datapage.h>
|
|
#else
|
|
struct vdso_data {
|
|
};
|
|
#endif
|
|
|
|
extern char vdso_start[], vdso_end[];
|
|
|
|
enum vvar_pages {
|
|
VVAR_DATA_PAGE_OFFSET,
|
|
VVAR_NR_PAGES,
|
|
};
|
|
|
|
#define VVAR_SIZE (VVAR_NR_PAGES << PAGE_SHIFT)
|
|
|
|
static unsigned int vdso_pages __ro_after_init;
|
|
static struct page **vdso_pagelist __ro_after_init;
|
|
|
|
/*
|
|
* The vDSO data page.
|
|
*/
|
|
static union {
|
|
struct vdso_data data;
|
|
u8 page[PAGE_SIZE];
|
|
} vdso_data_store __page_aligned_data;
|
|
struct vdso_data *vdso_data = &vdso_data_store.data;
|
|
|
|
static int __init vdso_init(void)
|
|
{
|
|
unsigned int i;
|
|
|
|
vdso_pages = (vdso_end - vdso_start) >> PAGE_SHIFT;
|
|
vdso_pagelist =
|
|
kcalloc(vdso_pages + VVAR_NR_PAGES, sizeof(struct page *), GFP_KERNEL);
|
|
if (unlikely(vdso_pagelist == NULL)) {
|
|
pr_err("vdso: pagelist allocation failed\n");
|
|
return -ENOMEM;
|
|
}
|
|
|
|
for (i = 0; i < vdso_pages; i++) {
|
|
struct page *pg;
|
|
|
|
pg = virt_to_page(vdso_start + (i << PAGE_SHIFT));
|
|
vdso_pagelist[i] = pg;
|
|
}
|
|
vdso_pagelist[i] = virt_to_page(vdso_data);
|
|
|
|
return 0;
|
|
}
|
|
arch_initcall(vdso_init);
|
|
|
|
int arch_setup_additional_pages(struct linux_binprm *bprm,
|
|
int uses_interp)
|
|
{
|
|
struct mm_struct *mm = current->mm;
|
|
unsigned long vdso_base, vdso_len;
|
|
int ret;
|
|
|
|
BUILD_BUG_ON(VVAR_NR_PAGES != __VVAR_PAGES);
|
|
|
|
vdso_len = (vdso_pages + VVAR_NR_PAGES) << PAGE_SHIFT;
|
|
|
|
if (mmap_write_lock_killable(mm))
|
|
return -EINTR;
|
|
|
|
vdso_base = get_unmapped_area(NULL, 0, vdso_len, 0, 0);
|
|
if (IS_ERR_VALUE(vdso_base)) {
|
|
ret = vdso_base;
|
|
goto end;
|
|
}
|
|
|
|
mm->context.vdso = NULL;
|
|
ret = install_special_mapping(mm, vdso_base, VVAR_SIZE,
|
|
(VM_READ | VM_MAYREAD), &vdso_pagelist[vdso_pages]);
|
|
if (unlikely(ret))
|
|
goto end;
|
|
|
|
ret =
|
|
install_special_mapping(mm, vdso_base + VVAR_SIZE,
|
|
vdso_pages << PAGE_SHIFT,
|
|
(VM_READ | VM_EXEC | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC),
|
|
vdso_pagelist);
|
|
|
|
if (unlikely(ret))
|
|
goto end;
|
|
|
|
/*
|
|
* Put vDSO base into mm struct. We need to do this before calling
|
|
* install_special_mapping or the perf counter mmap tracking code
|
|
* will fail to recognise it as a vDSO (since arch_vma_name fails).
|
|
*/
|
|
mm->context.vdso = (void *)vdso_base + VVAR_SIZE;
|
|
|
|
end:
|
|
mmap_write_unlock(mm);
|
|
return ret;
|
|
}
|
|
|
|
const char *arch_vma_name(struct vm_area_struct *vma)
|
|
{
|
|
if (vma->vm_mm && (vma->vm_start == (long)vma->vm_mm->context.vdso))
|
|
return "[vdso]";
|
|
if (vma->vm_mm && (vma->vm_start ==
|
|
(long)vma->vm_mm->context.vdso - VVAR_SIZE))
|
|
return "[vdso_data]";
|
|
return NULL;
|
|
}
|