mirror of
https://github.com/a52xq-dev/kernel.git
synced 2026-10-18 21:58:11 +07:00
Merge branch 'linus' into locking/core, to resolve conflicts
Conflicts:
include/linux/mm_types.h
mm/huge_memory.c
I removed the smp_mb__before_spinlock() like the following commit does:
8b1b436dd1 ("mm, locking: Rework {set,clear,mm}_tlb_flush_pending()")
and fixed up the affected commits.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
commit
040cca3ab2
81 changed files with 678 additions and 362 deletions
|
|
@ -14004,6 +14004,7 @@ F: drivers/block/virtio_blk.c
|
|||
F: include/linux/virtio*.h
|
||||
F: include/uapi/linux/virtio_*.h
|
||||
F: drivers/crypto/virtio/
|
||||
F: mm/balloon_compaction.c
|
||||
|
||||
VIRTIO CRYPTO DRIVER
|
||||
M: Gonglei <arei.gonglei@huawei.com>
|
||||
|
|
|
|||
|
|
@ -148,7 +148,8 @@ static inline void tlb_flush_mmu(struct mmu_gather *tlb)
|
|||
}
|
||||
|
||||
static inline void
|
||||
tlb_gather_mmu(struct mmu_gather *tlb, struct mm_struct *mm, unsigned long start, unsigned long end)
|
||||
arch_tlb_gather_mmu(struct mmu_gather *tlb, struct mm_struct *mm,
|
||||
unsigned long start, unsigned long end)
|
||||
{
|
||||
tlb->mm = mm;
|
||||
tlb->fullmm = !(start | (end+1));
|
||||
|
|
@ -166,8 +167,14 @@ tlb_gather_mmu(struct mmu_gather *tlb, struct mm_struct *mm, unsigned long start
|
|||
}
|
||||
|
||||
static inline void
|
||||
tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end)
|
||||
arch_tlb_finish_mmu(struct mmu_gather *tlb,
|
||||
unsigned long start, unsigned long end, bool force)
|
||||
{
|
||||
if (force) {
|
||||
tlb->range_start = start;
|
||||
tlb->range_end = end;
|
||||
}
|
||||
|
||||
tlb_flush_mmu(tlb);
|
||||
|
||||
/* keep the page table cache within bounds */
|
||||
|
|
|
|||
|
|
@ -168,7 +168,8 @@ static inline void __tlb_alloc_page(struct mmu_gather *tlb)
|
|||
|
||||
|
||||
static inline void
|
||||
tlb_gather_mmu(struct mmu_gather *tlb, struct mm_struct *mm, unsigned long start, unsigned long end)
|
||||
arch_tlb_gather_mmu(struct mmu_gather *tlb, struct mm_struct *mm,
|
||||
unsigned long start, unsigned long end)
|
||||
{
|
||||
tlb->mm = mm;
|
||||
tlb->max = ARRAY_SIZE(tlb->local);
|
||||
|
|
@ -185,8 +186,11 @@ tlb_gather_mmu(struct mmu_gather *tlb, struct mm_struct *mm, unsigned long start
|
|||
* collected.
|
||||
*/
|
||||
static inline void
|
||||
tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end)
|
||||
arch_tlb_finish_mmu(struct mmu_gather *tlb,
|
||||
unsigned long start, unsigned long end, bool force)
|
||||
{
|
||||
if (force)
|
||||
tlb->need_flush = 1;
|
||||
/*
|
||||
* Note: tlb->nr may be 0 at this point, so we can't rely on tlb->start_addr and
|
||||
* tlb->end_addr.
|
||||
|
|
|
|||
|
|
@ -47,10 +47,9 @@ struct mmu_table_batch {
|
|||
extern void tlb_table_flush(struct mmu_gather *tlb);
|
||||
extern void tlb_remove_table(struct mmu_gather *tlb, void *table);
|
||||
|
||||
static inline void tlb_gather_mmu(struct mmu_gather *tlb,
|
||||
struct mm_struct *mm,
|
||||
unsigned long start,
|
||||
unsigned long end)
|
||||
static inline void
|
||||
arch_tlb_gather_mmu(struct mmu_gather *tlb, struct mm_struct *mm,
|
||||
unsigned long start, unsigned long end)
|
||||
{
|
||||
tlb->mm = mm;
|
||||
tlb->start = start;
|
||||
|
|
@ -76,9 +75,15 @@ static inline void tlb_flush_mmu(struct mmu_gather *tlb)
|
|||
tlb_flush_mmu_free(tlb);
|
||||
}
|
||||
|
||||
static inline void tlb_finish_mmu(struct mmu_gather *tlb,
|
||||
unsigned long start, unsigned long end)
|
||||
static inline void
|
||||
arch_tlb_finish_mmu(struct mmu_gather *tlb,
|
||||
unsigned long start, unsigned long end, bool force)
|
||||
{
|
||||
if (force) {
|
||||
tlb->start = start;
|
||||
tlb->end = end;
|
||||
}
|
||||
|
||||
tlb_flush_mmu(tlb);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -36,7 +36,8 @@ static inline void init_tlb_gather(struct mmu_gather *tlb)
|
|||
}
|
||||
|
||||
static inline void
|
||||
tlb_gather_mmu(struct mmu_gather *tlb, struct mm_struct *mm, unsigned long start, unsigned long end)
|
||||
arch_tlb_gather_mmu(struct mmu_gather *tlb, struct mm_struct *mm,
|
||||
unsigned long start, unsigned long end)
|
||||
{
|
||||
tlb->mm = mm;
|
||||
tlb->start = start;
|
||||
|
|
@ -47,9 +48,10 @@ tlb_gather_mmu(struct mmu_gather *tlb, struct mm_struct *mm, unsigned long start
|
|||
}
|
||||
|
||||
static inline void
|
||||
tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end)
|
||||
arch_tlb_finish_mmu(struct mmu_gather *tlb,
|
||||
unsigned long start, unsigned long end, bool force)
|
||||
{
|
||||
if (tlb->fullmm)
|
||||
if (tlb->fullmm || force)
|
||||
flush_tlb_mm(tlb->mm);
|
||||
|
||||
/* keep the page table cache within bounds */
|
||||
|
|
|
|||
|
|
@ -47,10 +47,26 @@
|
|||
#define SUN4V_CHIP_NIAGARA5 0x05
|
||||
#define SUN4V_CHIP_SPARC_M6 0x06
|
||||
#define SUN4V_CHIP_SPARC_M7 0x07
|
||||
#define SUN4V_CHIP_SPARC_M8 0x08
|
||||
#define SUN4V_CHIP_SPARC64X 0x8a
|
||||
#define SUN4V_CHIP_SPARC_SN 0x8b
|
||||
#define SUN4V_CHIP_UNKNOWN 0xff
|
||||
|
||||
/*
|
||||
* The following CPU_ID_xxx constants are used
|
||||
* to identify the CPU type in the setup phase
|
||||
* (see head_64.S)
|
||||
*/
|
||||
#define CPU_ID_NIAGARA1 ('1')
|
||||
#define CPU_ID_NIAGARA2 ('2')
|
||||
#define CPU_ID_NIAGARA3 ('3')
|
||||
#define CPU_ID_NIAGARA4 ('4')
|
||||
#define CPU_ID_NIAGARA5 ('5')
|
||||
#define CPU_ID_M6 ('6')
|
||||
#define CPU_ID_M7 ('7')
|
||||
#define CPU_ID_M8 ('8')
|
||||
#define CPU_ID_SONOMA1 ('N')
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
enum ultra_tlb_layout {
|
||||
|
|
|
|||
|
|
@ -506,6 +506,12 @@ static void __init sun4v_cpu_probe(void)
|
|||
sparc_pmu_type = "sparc-m7";
|
||||
break;
|
||||
|
||||
case SUN4V_CHIP_SPARC_M8:
|
||||
sparc_cpu_type = "SPARC-M8";
|
||||
sparc_fpu_type = "SPARC-M8 integrated FPU";
|
||||
sparc_pmu_type = "sparc-m8";
|
||||
break;
|
||||
|
||||
case SUN4V_CHIP_SPARC_SN:
|
||||
sparc_cpu_type = "SPARC-SN";
|
||||
sparc_fpu_type = "SPARC-SN integrated FPU";
|
||||
|
|
|
|||
|
|
@ -328,6 +328,7 @@ static int iterate_cpu(struct cpuinfo_tree *t, unsigned int root_index)
|
|||
case SUN4V_CHIP_NIAGARA5:
|
||||
case SUN4V_CHIP_SPARC_M6:
|
||||
case SUN4V_CHIP_SPARC_M7:
|
||||
case SUN4V_CHIP_SPARC_M8:
|
||||
case SUN4V_CHIP_SPARC_SN:
|
||||
case SUN4V_CHIP_SPARC64X:
|
||||
rover_inc_table = niagara_iterate_method;
|
||||
|
|
|
|||
|
|
@ -424,22 +424,25 @@ EXPORT_SYMBOL(sun4v_chip_type)
|
|||
nop
|
||||
|
||||
70: ldub [%g1 + 7], %g2
|
||||
cmp %g2, '3'
|
||||
cmp %g2, CPU_ID_NIAGARA3
|
||||
be,pt %xcc, 5f
|
||||
mov SUN4V_CHIP_NIAGARA3, %g4
|
||||
cmp %g2, '4'
|
||||
cmp %g2, CPU_ID_NIAGARA4
|
||||
be,pt %xcc, 5f
|
||||
mov SUN4V_CHIP_NIAGARA4, %g4
|
||||
cmp %g2, '5'
|
||||
cmp %g2, CPU_ID_NIAGARA5
|
||||
be,pt %xcc, 5f
|
||||
mov SUN4V_CHIP_NIAGARA5, %g4
|
||||
cmp %g2, '6'
|
||||
cmp %g2, CPU_ID_M6
|
||||
be,pt %xcc, 5f
|
||||
mov SUN4V_CHIP_SPARC_M6, %g4
|
||||
cmp %g2, '7'
|
||||
cmp %g2, CPU_ID_M7
|
||||
be,pt %xcc, 5f
|
||||
mov SUN4V_CHIP_SPARC_M7, %g4
|
||||
cmp %g2, 'N'
|
||||
cmp %g2, CPU_ID_M8
|
||||
be,pt %xcc, 5f
|
||||
mov SUN4V_CHIP_SPARC_M8, %g4
|
||||
cmp %g2, CPU_ID_SONOMA1
|
||||
be,pt %xcc, 5f
|
||||
mov SUN4V_CHIP_SPARC_SN, %g4
|
||||
ba,pt %xcc, 49f
|
||||
|
|
@ -448,10 +451,10 @@ EXPORT_SYMBOL(sun4v_chip_type)
|
|||
91: sethi %hi(prom_cpu_compatible), %g1
|
||||
or %g1, %lo(prom_cpu_compatible), %g1
|
||||
ldub [%g1 + 17], %g2
|
||||
cmp %g2, '1'
|
||||
cmp %g2, CPU_ID_NIAGARA1
|
||||
be,pt %xcc, 5f
|
||||
mov SUN4V_CHIP_NIAGARA1, %g4
|
||||
cmp %g2, '2'
|
||||
cmp %g2, CPU_ID_NIAGARA2
|
||||
be,pt %xcc, 5f
|
||||
mov SUN4V_CHIP_NIAGARA2, %g4
|
||||
|
||||
|
|
@ -600,6 +603,9 @@ niagara_tlb_fixup:
|
|||
be,pt %xcc, niagara4_patch
|
||||
nop
|
||||
cmp %g1, SUN4V_CHIP_SPARC_M7
|
||||
be,pt %xcc, niagara4_patch
|
||||
nop
|
||||
cmp %g1, SUN4V_CHIP_SPARC_M8
|
||||
be,pt %xcc, niagara4_patch
|
||||
nop
|
||||
cmp %g1, SUN4V_CHIP_SPARC_SN
|
||||
|
|
|
|||
|
|
@ -288,10 +288,17 @@ static void __init sun4v_patch(void)
|
|||
|
||||
sun4v_patch_2insn_range(&__sun4v_2insn_patch,
|
||||
&__sun4v_2insn_patch_end);
|
||||
if (sun4v_chip_type == SUN4V_CHIP_SPARC_M7 ||
|
||||
sun4v_chip_type == SUN4V_CHIP_SPARC_SN)
|
||||
|
||||
switch (sun4v_chip_type) {
|
||||
case SUN4V_CHIP_SPARC_M7:
|
||||
case SUN4V_CHIP_SPARC_M8:
|
||||
case SUN4V_CHIP_SPARC_SN:
|
||||
sun_m7_patch_2insn_range(&__sun_m7_2insn_patch,
|
||||
&__sun_m7_2insn_patch_end);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
sun4v_hvapi_init();
|
||||
}
|
||||
|
|
@ -529,6 +536,7 @@ static void __init init_sparc64_elf_hwcap(void)
|
|||
sun4v_chip_type == SUN4V_CHIP_NIAGARA5 ||
|
||||
sun4v_chip_type == SUN4V_CHIP_SPARC_M6 ||
|
||||
sun4v_chip_type == SUN4V_CHIP_SPARC_M7 ||
|
||||
sun4v_chip_type == SUN4V_CHIP_SPARC_M8 ||
|
||||
sun4v_chip_type == SUN4V_CHIP_SPARC_SN ||
|
||||
sun4v_chip_type == SUN4V_CHIP_SPARC64X)
|
||||
cap |= HWCAP_SPARC_BLKINIT;
|
||||
|
|
@ -538,6 +546,7 @@ static void __init init_sparc64_elf_hwcap(void)
|
|||
sun4v_chip_type == SUN4V_CHIP_NIAGARA5 ||
|
||||
sun4v_chip_type == SUN4V_CHIP_SPARC_M6 ||
|
||||
sun4v_chip_type == SUN4V_CHIP_SPARC_M7 ||
|
||||
sun4v_chip_type == SUN4V_CHIP_SPARC_M8 ||
|
||||
sun4v_chip_type == SUN4V_CHIP_SPARC_SN ||
|
||||
sun4v_chip_type == SUN4V_CHIP_SPARC64X)
|
||||
cap |= HWCAP_SPARC_N2;
|
||||
|
|
@ -568,6 +577,7 @@ static void __init init_sparc64_elf_hwcap(void)
|
|||
sun4v_chip_type == SUN4V_CHIP_NIAGARA5 ||
|
||||
sun4v_chip_type == SUN4V_CHIP_SPARC_M6 ||
|
||||
sun4v_chip_type == SUN4V_CHIP_SPARC_M7 ||
|
||||
sun4v_chip_type == SUN4V_CHIP_SPARC_M8 ||
|
||||
sun4v_chip_type == SUN4V_CHIP_SPARC_SN ||
|
||||
sun4v_chip_type == SUN4V_CHIP_SPARC64X)
|
||||
cap |= (AV_SPARC_VIS | AV_SPARC_VIS2 |
|
||||
|
|
@ -578,6 +588,7 @@ static void __init init_sparc64_elf_hwcap(void)
|
|||
sun4v_chip_type == SUN4V_CHIP_NIAGARA5 ||
|
||||
sun4v_chip_type == SUN4V_CHIP_SPARC_M6 ||
|
||||
sun4v_chip_type == SUN4V_CHIP_SPARC_M7 ||
|
||||
sun4v_chip_type == SUN4V_CHIP_SPARC_M8 ||
|
||||
sun4v_chip_type == SUN4V_CHIP_SPARC_SN ||
|
||||
sun4v_chip_type == SUN4V_CHIP_SPARC64X)
|
||||
cap |= (AV_SPARC_VIS3 | AV_SPARC_HPC |
|
||||
|
|
|
|||
|
|
@ -1944,12 +1944,22 @@ static void __init setup_page_offset(void)
|
|||
break;
|
||||
case SUN4V_CHIP_SPARC_M7:
|
||||
case SUN4V_CHIP_SPARC_SN:
|
||||
default:
|
||||
/* M7 and later support 52-bit virtual addresses. */
|
||||
sparc64_va_hole_top = 0xfff8000000000000UL;
|
||||
sparc64_va_hole_bottom = 0x0008000000000000UL;
|
||||
max_phys_bits = 49;
|
||||
break;
|
||||
case SUN4V_CHIP_SPARC_M8:
|
||||
default:
|
||||
/* M8 and later support 54-bit virtual addresses.
|
||||
* However, restricting M8 and above VA bits to 53
|
||||
* as 4-level page table cannot support more than
|
||||
* 53 VA bits.
|
||||
*/
|
||||
sparc64_va_hole_top = 0xfff0000000000000UL;
|
||||
sparc64_va_hole_bottom = 0x0010000000000000UL;
|
||||
max_phys_bits = 51;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2161,6 +2171,7 @@ static void __init sun4v_linear_pte_xor_finalize(void)
|
|||
*/
|
||||
switch (sun4v_chip_type) {
|
||||
case SUN4V_CHIP_SPARC_M7:
|
||||
case SUN4V_CHIP_SPARC_M8:
|
||||
case SUN4V_CHIP_SPARC_SN:
|
||||
pagecv_flag = 0x00;
|
||||
break;
|
||||
|
|
@ -2313,6 +2324,7 @@ void __init paging_init(void)
|
|||
*/
|
||||
switch (sun4v_chip_type) {
|
||||
case SUN4V_CHIP_SPARC_M7:
|
||||
case SUN4V_CHIP_SPARC_M8:
|
||||
case SUN4V_CHIP_SPARC_SN:
|
||||
page_cache4v_flag = _PAGE_CP_4V;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -45,7 +45,8 @@ static inline void init_tlb_gather(struct mmu_gather *tlb)
|
|||
}
|
||||
|
||||
static inline void
|
||||
tlb_gather_mmu(struct mmu_gather *tlb, struct mm_struct *mm, unsigned long start, unsigned long end)
|
||||
arch_tlb_gather_mmu(struct mmu_gather *tlb, struct mm_struct *mm,
|
||||
unsigned long start, unsigned long end)
|
||||
{
|
||||
tlb->mm = mm;
|
||||
tlb->start = start;
|
||||
|
|
@ -80,13 +81,19 @@ tlb_flush_mmu(struct mmu_gather *tlb)
|
|||
tlb_flush_mmu_free(tlb);
|
||||
}
|
||||
|
||||
/* tlb_finish_mmu
|
||||
/* arch_tlb_finish_mmu
|
||||
* Called at the end of the shootdown operation to free up any resources
|
||||
* that were required.
|
||||
*/
|
||||
static inline void
|
||||
tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end)
|
||||
arch_tlb_finish_mmu(struct mmu_gather *tlb,
|
||||
unsigned long start, unsigned long end, bool force)
|
||||
{
|
||||
if (force) {
|
||||
tlb->start = start;
|
||||
tlb->end = end;
|
||||
tlb->need_flush = 1;
|
||||
}
|
||||
tlb_flush_mmu(tlb);
|
||||
|
||||
/* keep the page table cache within bounds */
|
||||
|
|
|
|||
|
|
@ -875,6 +875,56 @@ static void print_version(void)
|
|||
printk(KERN_INFO "%s", version);
|
||||
}
|
||||
|
||||
struct vdc_check_port_data {
|
||||
int dev_no;
|
||||
char *type;
|
||||
};
|
||||
|
||||
static int vdc_device_probed(struct device *dev, void *arg)
|
||||
{
|
||||
struct vio_dev *vdev = to_vio_dev(dev);
|
||||
struct vdc_check_port_data *port_data;
|
||||
|
||||
port_data = (struct vdc_check_port_data *)arg;
|
||||
|
||||
if ((vdev->dev_no == port_data->dev_no) &&
|
||||
(!(strcmp((char *)&vdev->type, port_data->type))) &&
|
||||
dev_get_drvdata(dev)) {
|
||||
/* This device has already been configured
|
||||
* by vdc_port_probe()
|
||||
*/
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Determine whether the VIO device is part of an mpgroup
|
||||
* by locating all the virtual-device-port nodes associated
|
||||
* with the parent virtual-device node for the VIO device
|
||||
* and checking whether any of these nodes are vdc-ports
|
||||
* which have already been configured.
|
||||
*
|
||||
* Returns true if this device is part of an mpgroup and has
|
||||
* already been probed.
|
||||
*/
|
||||
static bool vdc_port_mpgroup_check(struct vio_dev *vdev)
|
||||
{
|
||||
struct vdc_check_port_data port_data;
|
||||
struct device *dev;
|
||||
|
||||
port_data.dev_no = vdev->dev_no;
|
||||
port_data.type = (char *)&vdev->type;
|
||||
|
||||
dev = device_find_child(vdev->dev.parent, &port_data,
|
||||
vdc_device_probed);
|
||||
|
||||
if (dev)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static int vdc_port_probe(struct vio_dev *vdev, const struct vio_device_id *id)
|
||||
{
|
||||
struct mdesc_handle *hp;
|
||||
|
|
@ -893,6 +943,14 @@ static int vdc_port_probe(struct vio_dev *vdev, const struct vio_device_id *id)
|
|||
goto err_out_release_mdesc;
|
||||
}
|
||||
|
||||
/* Check if this device is part of an mpgroup */
|
||||
if (vdc_port_mpgroup_check(vdev)) {
|
||||
printk(KERN_WARNING
|
||||
"VIO: Ignoring extra vdisk port %s",
|
||||
dev_name(&vdev->dev));
|
||||
goto err_out_release_mdesc;
|
||||
}
|
||||
|
||||
port = kzalloc(sizeof(*port), GFP_KERNEL);
|
||||
err = -ENOMEM;
|
||||
if (!port) {
|
||||
|
|
@ -943,6 +1001,9 @@ static int vdc_port_probe(struct vio_dev *vdev, const struct vio_device_id *id)
|
|||
if (err)
|
||||
goto err_out_free_tx_ring;
|
||||
|
||||
/* Note that the device driver_data is used to determine
|
||||
* whether the port has been probed.
|
||||
*/
|
||||
dev_set_drvdata(&vdev->dev, port);
|
||||
|
||||
mdesc_release(hp);
|
||||
|
|
|
|||
|
|
@ -308,7 +308,7 @@ static ssize_t comp_algorithm_store(struct device *dev,
|
|||
struct device_attribute *attr, const char *buf, size_t len)
|
||||
{
|
||||
struct zram *zram = dev_to_zram(dev);
|
||||
char compressor[CRYPTO_MAX_ALG_NAME];
|
||||
char compressor[ARRAY_SIZE(zram->compressor)];
|
||||
size_t sz;
|
||||
|
||||
strlcpy(compressor, buf, sizeof(compressor));
|
||||
|
|
@ -327,7 +327,7 @@ static ssize_t comp_algorithm_store(struct device *dev,
|
|||
return -EBUSY;
|
||||
}
|
||||
|
||||
strlcpy(zram->compressor, compressor, sizeof(compressor));
|
||||
strcpy(zram->compressor, compressor);
|
||||
up_write(&zram->init_lock);
|
||||
return len;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -304,7 +304,7 @@ static int sync_file_release(struct inode *inode, struct file *file)
|
|||
{
|
||||
struct sync_file *sync_file = file->private_data;
|
||||
|
||||
if (test_bit(POLL_ENABLED, &sync_file->fence->flags))
|
||||
if (test_bit(POLL_ENABLED, &sync_file->flags))
|
||||
dma_fence_remove_callback(sync_file->fence, &sync_file->cb);
|
||||
dma_fence_put(sync_file->fence);
|
||||
kfree(sync_file);
|
||||
|
|
@ -318,7 +318,8 @@ static unsigned int sync_file_poll(struct file *file, poll_table *wait)
|
|||
|
||||
poll_wait(file, &sync_file->wq, wait);
|
||||
|
||||
if (!test_and_set_bit(POLL_ENABLED, &sync_file->fence->flags)) {
|
||||
if (list_empty(&sync_file->cb.node) &&
|
||||
!test_and_set_bit(POLL_ENABLED, &sync_file->flags)) {
|
||||
if (dma_fence_add_callback(sync_file->fence, &sync_file->cb,
|
||||
fence_check_cb_func) < 0)
|
||||
wake_up_all(&sync_file->wq);
|
||||
|
|
|
|||
|
|
@ -1255,7 +1255,7 @@ static int tc_probe(struct i2c_client *client, const struct i2c_device_id *id)
|
|||
|
||||
/* port@2 is the output port */
|
||||
ret = drm_of_find_panel_or_bridge(dev->of_node, 2, 0, &tc->panel, NULL);
|
||||
if (ret)
|
||||
if (ret && ret != -ENODEV)
|
||||
return ret;
|
||||
|
||||
/* Shut down GPIO is optional */
|
||||
|
|
|
|||
|
|
@ -270,8 +270,8 @@ static int submit_reloc(struct etnaviv_gem_submit *submit, void *stream,
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (r->reloc_offset >= bo->obj->base.size - sizeof(*ptr)) {
|
||||
DRM_ERROR("relocation %u outside object", i);
|
||||
if (r->reloc_offset > bo->obj->base.size - sizeof(*ptr)) {
|
||||
DRM_ERROR("relocation %u outside object\n", i);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -145,13 +145,19 @@ static struct drm_framebuffer *
|
|||
exynos_user_fb_create(struct drm_device *dev, struct drm_file *file_priv,
|
||||
const struct drm_mode_fb_cmd2 *mode_cmd)
|
||||
{
|
||||
const struct drm_format_info *info = drm_get_format_info(dev, mode_cmd);
|
||||
struct exynos_drm_gem *exynos_gem[MAX_FB_BUFFER];
|
||||
struct drm_gem_object *obj;
|
||||
struct drm_framebuffer *fb;
|
||||
int i;
|
||||
int ret;
|
||||
|
||||
for (i = 0; i < drm_format_num_planes(mode_cmd->pixel_format); i++) {
|
||||
for (i = 0; i < info->num_planes; i++) {
|
||||
unsigned int height = (i == 0) ? mode_cmd->height :
|
||||
DIV_ROUND_UP(mode_cmd->height, info->vsub);
|
||||
unsigned long size = height * mode_cmd->pitches[i] +
|
||||
mode_cmd->offsets[i];
|
||||
|
||||
obj = drm_gem_object_lookup(file_priv, mode_cmd->handles[i]);
|
||||
if (!obj) {
|
||||
DRM_ERROR("failed to lookup gem object\n");
|
||||
|
|
@ -160,6 +166,12 @@ exynos_user_fb_create(struct drm_device *dev, struct drm_file *file_priv,
|
|||
}
|
||||
|
||||
exynos_gem[i] = to_exynos_gem(obj);
|
||||
|
||||
if (size > exynos_gem[i]->size) {
|
||||
i++;
|
||||
ret = -EINVAL;
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
|
||||
fb = exynos_drm_framebuffer_init(dev, mode_cmd, exynos_gem, i);
|
||||
|
|
|
|||
|
|
@ -46,6 +46,8 @@
|
|||
#define same_context(a, b) (((a)->context_id == (b)->context_id) && \
|
||||
((a)->lrca == (b)->lrca))
|
||||
|
||||
static void clean_workloads(struct intel_vgpu *vgpu, unsigned long engine_mask);
|
||||
|
||||
static int context_switch_events[] = {
|
||||
[RCS] = RCS_AS_CONTEXT_SWITCH,
|
||||
[BCS] = BCS_AS_CONTEXT_SWITCH,
|
||||
|
|
@ -499,10 +501,10 @@ static void release_shadow_wa_ctx(struct intel_shadow_wa_ctx *wa_ctx)
|
|||
static int complete_execlist_workload(struct intel_vgpu_workload *workload)
|
||||
{
|
||||
struct intel_vgpu *vgpu = workload->vgpu;
|
||||
struct intel_vgpu_execlist *execlist =
|
||||
&vgpu->execlist[workload->ring_id];
|
||||
int ring_id = workload->ring_id;
|
||||
struct intel_vgpu_execlist *execlist = &vgpu->execlist[ring_id];
|
||||
struct intel_vgpu_workload *next_workload;
|
||||
struct list_head *next = workload_q_head(vgpu, workload->ring_id)->next;
|
||||
struct list_head *next = workload_q_head(vgpu, ring_id)->next;
|
||||
bool lite_restore = false;
|
||||
int ret;
|
||||
|
||||
|
|
@ -512,10 +514,25 @@ static int complete_execlist_workload(struct intel_vgpu_workload *workload)
|
|||
release_shadow_batch_buffer(workload);
|
||||
release_shadow_wa_ctx(&workload->wa_ctx);
|
||||
|
||||
if (workload->status || vgpu->resetting)
|
||||
if (workload->status || (vgpu->resetting_eng & ENGINE_MASK(ring_id))) {
|
||||
/* if workload->status is not successful means HW GPU
|
||||
* has occurred GPU hang or something wrong with i915/GVT,
|
||||
* and GVT won't inject context switch interrupt to guest.
|
||||
* So this error is a vGPU hang actually to the guest.
|
||||
* According to this we should emunlate a vGPU hang. If
|
||||
* there are pending workloads which are already submitted
|
||||
* from guest, we should clean them up like HW GPU does.
|
||||
*
|
||||
* if it is in middle of engine resetting, the pending
|
||||
* workloads won't be submitted to HW GPU and will be
|
||||
* cleaned up during the resetting process later, so doing
|
||||
* the workload clean up here doesn't have any impact.
|
||||
**/
|
||||
clean_workloads(vgpu, ENGINE_MASK(ring_id));
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (!list_empty(workload_q_head(vgpu, workload->ring_id))) {
|
||||
if (!list_empty(workload_q_head(vgpu, ring_id))) {
|
||||
struct execlist_ctx_descriptor_format *this_desc, *next_desc;
|
||||
|
||||
next_workload = container_of(next,
|
||||
|
|
|
|||
|
|
@ -72,11 +72,13 @@ static int expose_firmware_sysfs(struct intel_gvt *gvt)
|
|||
struct intel_gvt_device_info *info = &gvt->device_info;
|
||||
struct pci_dev *pdev = gvt->dev_priv->drm.pdev;
|
||||
struct intel_gvt_mmio_info *e;
|
||||
struct gvt_mmio_block *block = gvt->mmio.mmio_block;
|
||||
int num = gvt->mmio.num_mmio_block;
|
||||
struct gvt_firmware_header *h;
|
||||
void *firmware;
|
||||
void *p;
|
||||
unsigned long size, crc32_start;
|
||||
int i;
|
||||
int i, j;
|
||||
int ret;
|
||||
|
||||
size = sizeof(*h) + info->mmio_size + info->cfg_space_size;
|
||||
|
|
@ -105,6 +107,13 @@ static int expose_firmware_sysfs(struct intel_gvt *gvt)
|
|||
hash_for_each(gvt->mmio.mmio_info_table, i, e, node)
|
||||
*(u32 *)(p + e->offset) = I915_READ_NOTRACE(_MMIO(e->offset));
|
||||
|
||||
for (i = 0; i < num; i++, block++) {
|
||||
for (j = 0; j < block->size; j += 4)
|
||||
*(u32 *)(p + INTEL_GVT_MMIO_OFFSET(block->offset) + j) =
|
||||
I915_READ_NOTRACE(_MMIO(INTEL_GVT_MMIO_OFFSET(
|
||||
block->offset) + j));
|
||||
}
|
||||
|
||||
memcpy(gvt->firmware.mmio, p, info->mmio_size);
|
||||
|
||||
crc32_start = offsetof(struct gvt_firmware_header, crc32) + 4;
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue