mirror of
https://github.com/LuckfoxTECH/luckfox-pico.git
synced 2026-01-18 11:38:31 +01:00
project:build.sh: Added fastboot support; custom modifications to U-Boot and kernel implemented using patches.
project:cfg:BoardConfig_IPC: Added fastboot BoardConfig file and firmware post-scripts, distinguishing between the BoardConfigs for Luckfox Pico Pro and Luckfox Pico Max. project:app: Added fastboot_client and rk_smart_door for quick boot applications; updated rkipc app to adapt to the latest media library. media:samples: Added more usage examples. media:rockit: Fixed bugs; removed support for retrieving data frames from VPSS. media:isp: Updated rkaiq library and related tools to support connection to RKISP_Tuner. sysdrv:Makefile: Added support for compiling drv_ko on Luckfox Pico Ultra W using Ubuntu; added support for custom root filesystem. sysdrv:tools:board: Updated Buildroot optional mirror sources, updated some software versions, and stored device tree files and configuration files that undergo multiple modifications for U-Boot and kernel separately. sysdrv:source:mcu: Used RISC-V MCU SDK with RT-Thread system, mainly for initializing camera AE during quick boot. sysdrv:source:uboot: Added support for fastboot; added high baud rate DDR bin for serial firmware upgrades. sysdrv:source:kernel: Upgraded to version 5.10.160; increased NPU frequency for RV1106G3; added support for fastboot. Signed-off-by: luckfox-eng29 <eng29@luckfox.com>
This commit is contained in:
@@ -159,6 +159,10 @@ __weak void kvm_arch_mmu_notifier_invalidate_range(struct kvm *kvm,
|
||||
{
|
||||
}
|
||||
|
||||
__weak void kvm_arch_guest_memory_reclaimed(struct kvm *kvm)
|
||||
{
|
||||
}
|
||||
|
||||
bool kvm_is_zone_device_pfn(kvm_pfn_t pfn)
|
||||
{
|
||||
/*
|
||||
@@ -340,6 +344,12 @@ void kvm_reload_remote_mmus(struct kvm *kvm)
|
||||
kvm_make_all_cpus_request(kvm, KVM_REQ_MMU_RELOAD);
|
||||
}
|
||||
|
||||
static void kvm_flush_shadow_all(struct kvm *kvm)
|
||||
{
|
||||
kvm_arch_flush_shadow_all(kvm);
|
||||
kvm_arch_guest_memory_reclaimed(kvm);
|
||||
}
|
||||
|
||||
#ifdef KVM_ARCH_NR_OBJS_PER_MEMORY_CACHE
|
||||
static inline void *mmu_memory_cache_alloc_obj(struct kvm_mmu_memory_cache *mc,
|
||||
gfp_t gfp_flags)
|
||||
@@ -489,6 +499,7 @@ static int kvm_mmu_notifier_invalidate_range_start(struct mmu_notifier *mn,
|
||||
kvm_flush_remote_tlbs(kvm);
|
||||
|
||||
spin_unlock(&kvm->mmu_lock);
|
||||
kvm_arch_guest_memory_reclaimed(kvm);
|
||||
srcu_read_unlock(&kvm->srcu, idx);
|
||||
|
||||
return 0;
|
||||
@@ -592,7 +603,7 @@ static void kvm_mmu_notifier_release(struct mmu_notifier *mn,
|
||||
int idx;
|
||||
|
||||
idx = srcu_read_lock(&kvm->srcu);
|
||||
kvm_arch_flush_shadow_all(kvm);
|
||||
kvm_flush_shadow_all(kvm);
|
||||
srcu_read_unlock(&kvm->srcu, idx);
|
||||
}
|
||||
|
||||
@@ -896,7 +907,7 @@ static void kvm_destroy_vm(struct kvm *kvm)
|
||||
#if defined(CONFIG_MMU_NOTIFIER) && defined(KVM_ARCH_WANT_MMU_NOTIFIER)
|
||||
mmu_notifier_unregister(&kvm->mmu_notifier, kvm->mm);
|
||||
#else
|
||||
kvm_arch_flush_shadow_all(kvm);
|
||||
kvm_flush_shadow_all(kvm);
|
||||
#endif
|
||||
kvm_arch_destroy_vm(kvm);
|
||||
kvm_destroy_devices(kvm);
|
||||
@@ -1238,6 +1249,7 @@ static int kvm_set_memslot(struct kvm *kvm,
|
||||
* - kvm_is_visible_gfn (mmu_check_root)
|
||||
*/
|
||||
kvm_arch_flush_shadow_memslot(kvm, slot);
|
||||
kvm_arch_guest_memory_reclaimed(kvm);
|
||||
}
|
||||
|
||||
r = kvm_arch_prepare_memory_region(kvm, new, mem, change);
|
||||
@@ -2339,16 +2351,28 @@ void kvm_release_pfn_dirty(kvm_pfn_t pfn)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(kvm_release_pfn_dirty);
|
||||
|
||||
static bool kvm_is_ad_tracked_pfn(kvm_pfn_t pfn)
|
||||
{
|
||||
if (!pfn_valid(pfn))
|
||||
return false;
|
||||
|
||||
/*
|
||||
* Per page-flags.h, pages tagged PG_reserved "should in general not be
|
||||
* touched (e.g. set dirty) except by its owner".
|
||||
*/
|
||||
return !PageReserved(pfn_to_page(pfn));
|
||||
}
|
||||
|
||||
void kvm_set_pfn_dirty(kvm_pfn_t pfn)
|
||||
{
|
||||
if (!kvm_is_reserved_pfn(pfn) && !kvm_is_zone_device_pfn(pfn))
|
||||
if (kvm_is_ad_tracked_pfn(pfn))
|
||||
SetPageDirty(pfn_to_page(pfn));
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(kvm_set_pfn_dirty);
|
||||
|
||||
void kvm_set_pfn_accessed(kvm_pfn_t pfn)
|
||||
{
|
||||
if (!kvm_is_reserved_pfn(pfn) && !kvm_is_zone_device_pfn(pfn))
|
||||
if (kvm_is_ad_tracked_pfn(pfn))
|
||||
mark_page_accessed(pfn_to_page(pfn));
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(kvm_set_pfn_accessed);
|
||||
@@ -3252,7 +3276,7 @@ static long kvm_vcpu_ioctl(struct file *filp,
|
||||
struct kvm_fpu *fpu = NULL;
|
||||
struct kvm_sregs *kvm_sregs = NULL;
|
||||
|
||||
if (vcpu->kvm->mm != current->mm)
|
||||
if (vcpu->kvm->mm != current->mm || vcpu->kvm->vm_bugged)
|
||||
return -EIO;
|
||||
|
||||
if (unlikely(_IOC_TYPE(ioctl) != KVMIO))
|
||||
@@ -3458,7 +3482,7 @@ static long kvm_vcpu_compat_ioctl(struct file *filp,
|
||||
void __user *argp = compat_ptr(arg);
|
||||
int r;
|
||||
|
||||
if (vcpu->kvm->mm != current->mm)
|
||||
if (vcpu->kvm->mm != current->mm || vcpu->kvm->vm_bugged)
|
||||
return -EIO;
|
||||
|
||||
switch (ioctl) {
|
||||
@@ -3524,7 +3548,7 @@ static long kvm_device_ioctl(struct file *filp, unsigned int ioctl,
|
||||
{
|
||||
struct kvm_device *dev = filp->private_data;
|
||||
|
||||
if (dev->kvm->mm != current->mm)
|
||||
if (dev->kvm->mm != current->mm || dev->kvm->vm_bugged)
|
||||
return -EIO;
|
||||
|
||||
switch (ioctl) {
|
||||
@@ -3644,8 +3668,11 @@ static int kvm_ioctl_create_device(struct kvm *kvm,
|
||||
kvm_put_kvm_no_destroy(kvm);
|
||||
mutex_lock(&kvm->lock);
|
||||
list_del(&dev->vm_node);
|
||||
if (ops->release)
|
||||
ops->release(dev);
|
||||
mutex_unlock(&kvm->lock);
|
||||
ops->destroy(dev);
|
||||
if (ops->destroy)
|
||||
ops->destroy(dev);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -3740,7 +3767,7 @@ static long kvm_vm_ioctl(struct file *filp,
|
||||
void __user *argp = (void __user *)arg;
|
||||
int r;
|
||||
|
||||
if (kvm->mm != current->mm)
|
||||
if (kvm->mm != current->mm || kvm->vm_bugged)
|
||||
return -EIO;
|
||||
switch (ioctl) {
|
||||
case KVM_CREATE_VCPU:
|
||||
@@ -3939,14 +3966,25 @@ struct compat_kvm_clear_dirty_log {
|
||||
};
|
||||
};
|
||||
|
||||
long __weak kvm_arch_vm_compat_ioctl(struct file *filp, unsigned int ioctl,
|
||||
unsigned long arg)
|
||||
{
|
||||
return -ENOTTY;
|
||||
}
|
||||
|
||||
static long kvm_vm_compat_ioctl(struct file *filp,
|
||||
unsigned int ioctl, unsigned long arg)
|
||||
{
|
||||
struct kvm *kvm = filp->private_data;
|
||||
int r;
|
||||
|
||||
if (kvm->mm != current->mm)
|
||||
if (kvm->mm != current->mm || kvm->vm_bugged)
|
||||
return -EIO;
|
||||
|
||||
r = kvm_arch_vm_compat_ioctl(filp, ioctl, arg);
|
||||
if (r != -ENOTTY)
|
||||
return r;
|
||||
|
||||
switch (ioctl) {
|
||||
#ifdef CONFIG_KVM_GENERIC_DIRTYLOG_READ_PROTECT
|
||||
case KVM_CLEAR_DIRTY_LOG: {
|
||||
|
||||
Reference in New Issue
Block a user