update to PKT lts-v4.19.8-base-190111T195245Z

Signed-off-by: Alek Du <alek.du@intel.com>
This commit is contained in:
Alek Du 2019-01-12 04:03:11 +00:00
parent 80162ddd5f
commit db8c93314c
13 changed files with 818 additions and 4 deletions

View File

@ -0,0 +1,106 @@
From ca8c4e5382adc24e983e5d584f214519e295e311 Mon Sep 17 00:00:00 2001
From: Zhou Furong <furong.zhou@intel.com>
Date: Fri, 4 Jan 2019 08:42:57 +0800
Subject: [PATCH 01/11] Security: improvement for depressing compile warning
Pepressing compile warnings by update print format,
remove not used label and not used static function,
move variable definition to beginning.
Change-Id: I97cbfb23be76ada5c0b7bc3e737387f0d30d99c3
Tracked-On: PKT-1639
Signed-off-by: Zhou Furong <furong.zhou@intel.com>
---
security/keystore/api_dal.c | 29 +++++++++--------------------
1 file changed, 9 insertions(+), 20 deletions(-)
diff --git a/security/keystore/api_dal.c b/security/keystore/api_dal.c
index d4f083a24cd3..31c351e18456 100644
--- a/security/keystore/api_dal.c
+++ b/security/keystore/api_dal.c
@@ -119,13 +119,12 @@ static int dal_keystore_register_client(enum keystore_seed_type seed_type,
pack_int_to_buf(seed_type, input + index);
index += 2;
-cmd_retry:
res = send_and_receive(commandId, input, index,
&out_buf, &output_len, &response_code);
res = handle_command_response(res, response_code, &retry, NULL, NULL);
if (res) {
- ks_info(KBUILD_MODNAME ": %s Error in send_and_receive: command id = %d %d %d\n",
+ ks_info(KBUILD_MODNAME ": %s Error in send_and_receive: command id = %d %d %lu\n",
__func__, commandId, res,
response_code);
@@ -366,15 +365,6 @@ static int get_cached_wrapped_key_size(void)
return -EFAULT;
}
-static int get_cached_key_size(void)
-{
- if (key_info.keyspec != KEYSPEC_INVALID) {
- if (key_info.key_size != 0)
- return key_info.key_size;
- }
- return -EFAULT;
-}
-
static void cache_wrapped_key_size(enum keystore_key_spec keyspec,
uint32_t wrap_key_size)
{
@@ -556,7 +546,7 @@ int dal_keystore_wrap_key(const uint8_t *client_ticket,
}
if (res) {
- ks_err(KBUILD_MODNAME ": %s Error in send_and_receive: command id = %d %d %d\n",
+ ks_err(KBUILD_MODNAME ": %s Error in send_and_receive: command id = %d %d %lu\n",
__func__, commandId, res, response_code);
goto exit;
@@ -645,6 +635,9 @@ int dal_keystore_load_key(const uint8_t *client_ticket,
uint8_t *out_buf = NULL;
int retry = 0;
size_t index = 0;
+ uint8_t input[KEYSTORE_MAX_CLIENT_ID_SIZE
+ + KEYSTORE_CLIENT_TICKET_SIZE
+ + wrapped_key_size];
FUNC_BEGIN;
@@ -658,10 +651,6 @@ int dal_keystore_load_key(const uint8_t *client_ticket,
return -EINVAL;
}
- uint8_t input[KEYSTORE_MAX_CLIENT_ID_SIZE
- + KEYSTORE_CLIENT_TICKET_SIZE
- + wrapped_key_size];
-
res = dal_calc_clientid(client_id, KEYSTORE_MAX_CLIENT_ID_SIZE);
if (res) {
@@ -834,8 +823,8 @@ int dal_keystore_encrypt(const uint8_t *client_ticket, int slot_id,
if (key_spec != KEYSPEC_DAL_WRAPPED_KEY ||
wrapped_key_size > DAL_KEYSTORE_MAX_WRAP_KEY_LEN) {
- ks_err(KBUILD_MODNAME ": %s: Invalid key retrived from wrapped key cache.\n",
- __func__, res);
+ ks_err(KBUILD_MODNAME ": %s: Invalid key %d retrived from wrapped key cache.\n",
+ __func__, key_spec);
goto exit;
}
@@ -986,8 +975,8 @@ int dal_keystore_decrypt(const uint8_t *client_ticket, int slot_id,
if (key_spec != KEYSPEC_DAL_WRAPPED_KEY ||
wrapped_key_size > DAL_KEYSTORE_MAX_WRAP_KEY_LEN) {
- ks_err(KBUILD_MODNAME ": %s: Invalid key retrived from wrapped key cache.\n",
- __func__, res);
+ ks_err(KBUILD_MODNAME ": %s: Invalid key %d retrived from wrapped key cache.\n",
+ __func__, key_spec);
goto exit;
}
--
2.17.1

View File

@ -0,0 +1,171 @@
From baa43756ed1711865512d89cb1c3d83a08f0715d Mon Sep 17 00:00:00 2001
From: Jon Moeller <jon.moeller@intel.com>
Date: Tue, 8 Jan 2019 20:29:09 -0600
Subject: [PATCH 02/11] platform/x86: Change struct fields to 16-bit in sep,
socwatchhv drivers
Changing some fields in structs used by sep and socwatch drivers to match
16-bit fields in hypervisor to avoid casting.
Change-Id: If3f21f75b559fb19104cbe9137ac54dffc9e4762
Tracked-On: PKT-1655
Signed-off-by: Jon Moeller <jon.moeller@intel.com>
---
drivers/platform/x86/sepdk/inc/control.h | 2 +-
drivers/platform/x86/sepdk/inc/lwpmudrv.h | 15 ++++++-----
.../x86/sepdk/include/lwpmudrv_struct.h | 6 ++---
drivers/platform/x86/sepdk/sep/apic.c | 4 +--
.../x86/socwatchhv/inc/swhv_structs.h | 25 ++++++++++---------
5 files changed, 26 insertions(+), 26 deletions(-)
diff --git a/drivers/platform/x86/sepdk/inc/control.h b/drivers/platform/x86/sepdk/inc/control.h
index 73ecc2efeaa5..5a94c3ae0fed 100644
--- a/drivers/platform/x86/sepdk/inc/control.h
+++ b/drivers/platform/x86/sepdk/inc/control.h
@@ -102,7 +102,7 @@ struct GLOBAL_STATE_NODE_S {
typedef struct CPU_STATE_NODE_S CPU_STATE_NODE;
typedef CPU_STATE_NODE * CPU_STATE;
struct CPU_STATE_NODE_S {
- S32 apic_id; // Processor ID on the system bus
+ U32 apic_id; // Processor ID on the system bus
PVOID apic_linear_addr; // linear address of local apic
PVOID apic_physical_addr; // physical address of local apic
diff --git a/drivers/platform/x86/sepdk/inc/lwpmudrv.h b/drivers/platform/x86/sepdk/inc/lwpmudrv.h
index 37c8109a0e8b..994121d28ef2 100644
--- a/drivers/platform/x86/sepdk/inc/lwpmudrv.h
+++ b/drivers/platform/x86/sepdk/inc/lwpmudrv.h
@@ -454,9 +454,8 @@ int sbuf_share_setup(uint32_t pcpu_id, uint32_t sbuf_id, shared_buf_t *sbuf);
extern shared_buf_t **samp_buf_per_cpu;
-#define MAX_NR_PCPUS 8
#define MAX_NR_VCPUS 8
-#define MAX_NR_VMS 6
+#define MAX_NR_VMS 4
#define MAX_MSR_LIST_NUM 15
#define MAX_GROUP_NUM 1
@@ -490,21 +489,21 @@ struct profiling_msr_ops_list {
};
struct profiling_vcpu_pcpu_map {
- int32_t vcpu_id;
- int32_t pcpu_id;
- int32_t apic_id;
+ int16_t vcpu_id;
+ int16_t pcpu_id;
+ uint32_t apic_id;
};
struct profiling_vm_info {
- int32_t vm_id;
+ uint16_t vm_id;
u_char guid[16];
char vm_name[16];
- int32_t num_vcpus;
+ uint16_t num_vcpus;
struct profiling_vcpu_pcpu_map cpu_map[MAX_NR_VCPUS];
};
struct profiling_vm_info_list {
- int32_t num_vms;
+ uint16_t num_vms;
struct profiling_vm_info vm_list[MAX_NR_VMS];
};
diff --git a/drivers/platform/x86/sepdk/include/lwpmudrv_struct.h b/drivers/platform/x86/sepdk/include/lwpmudrv_struct.h
index 82819e5e11b7..3af04d4ed829 100644
--- a/drivers/platform/x86/sepdk/include/lwpmudrv_struct.h
+++ b/drivers/platform/x86/sepdk/include/lwpmudrv_struct.h
@@ -1646,14 +1646,14 @@ typedef CPU_MAP_TRACE_NODE * CPU_MAP_TRACE;
struct CPU_MAP_TRACE_NODE_S {
U64 tsc;
U32 os_id;
- U32 vcpu_id;
- U32 pcpu_id;
+ U16 vcpu_id;
+ U16 pcpu_id;
U8 is_static : 1;
U8 initial : 1;
U8 reserved1 : 6;
U8 reserved2;
U16 reserved3;
- U64 reserved4;
+ U32 reserved4;
};
#define CPU_MAP_TRACE_tsc(x) ((x)->tsc)
diff --git a/drivers/platform/x86/sepdk/sep/apic.c b/drivers/platform/x86/sepdk/sep/apic.c
index 693c526d63de..8f8bc5635ced 100755
--- a/drivers/platform/x86/sepdk/sep/apic.c
+++ b/drivers/platform/x86/sepdk/sep/apic.c
@@ -65,7 +65,7 @@ static VOID apic_Get_APIC_ID(S32 cpu)
U32 apic_id = 0;
CPU_STATE pcpu;
#if defined(DRV_SEP_ACRN_ON)
- U32 i;
+ U16 i;
#endif
SEP_DRV_LOG_TRACE_IN("CPU: %d.", cpu);
@@ -108,7 +108,7 @@ static VOID apic_Get_APIC_ID(S32 cpu)
"apic_Get_APIC_ID: Error in reading APIC ID on ACRN\n");
} else {
for (i = 0; i < vm_info_list->num_vms; i++) {
- if (vm_info_list->vm_list[i].vm_id == 0xFFFFFFFF) {
+ if (vm_info_list->vm_list[i].vm_id == 0xFFFF) {
CPU_STATE_apic_id(pcpu) =
vm_info_list->vm_list[i]
.cpu_map[cpu]
diff --git a/drivers/platform/x86/socwatchhv/inc/swhv_structs.h b/drivers/platform/x86/socwatchhv/inc/swhv_structs.h
index d5fd717511ba..0393a95e4875 100644
--- a/drivers/platform/x86/socwatchhv/inc/swhv_structs.h
+++ b/drivers/platform/x86/socwatchhv/inc/swhv_structs.h
@@ -199,30 +199,31 @@ struct vm_switch_trace {
uint64_t vm_enter_tsc;
uint64_t vm_exit_tsc;
uint64_t vm_exit_reason;
- int32_t os_id;
+ uint16_t os_id;
+ uint16_t reserved;
} __attribute__((aligned(32)));
#define VM_SWITCH_TRACE_SIZE ((uint64_t)sizeof(struct vm_switch_trace))
-#define MAX_NR_VCPUS 8
-#define MAX_NR_VMS 6
+#define CONFIG_MAX_VCPUS_PER_VM 8
+#define CONFIG_MAX_VM_NUM 6
struct profiling_vcpu_pcpu_map {
- int32_t vcpu_id;
- int32_t pcpu_id;
- int32_t apic_id;
+ int16_t vcpu_id;
+ int16_t pcpu_id;
+ uint32_t apic_id;
} __attribute__((aligned(8)));
struct profiling_vm_info {
- int32_t vm_id_num;
- unsigned char guid[16];
+ uint16_t vm_id_num;
+ uint8_t guid[16];
char vm_name[16];
- int32_t num_vcpus;
- struct profiling_vcpu_pcpu_map cpu_map[MAX_NR_VCPUS];
+ uint16_t num_vcpus;
+ struct profiling_vcpu_pcpu_map cpu_map[CONFIG_MAX_VCPUS_PER_VM];
} __attribute__((aligned(8)));
struct profiling_vm_info_list {
- int32_t num_vms;
- struct profiling_vm_info vm_list[MAX_NR_VMS];
+ uint16_t num_vms;
+ struct profiling_vm_info vm_list[CONFIG_MAX_VM_NUM];
} __attribute__((aligned(8)));
/*
--
2.17.1

View File

@ -0,0 +1,37 @@
From a465b67941f4c0cf8b8bb2af87e8e1a946b2a43a Mon Sep 17 00:00:00 2001
From: Min He <min.he@intel.com>
Date: Thu, 10 Jan 2019 15:17:56 +0800
Subject: [PATCH 03/11] drm/i915/gvt: Get Port ID from the encoder object
instead of using enc_to_dig_port
Using enc_to_dig_port() to determine the port id may not be applicable to
some types of encoders like MIPI-DSI. Therefore, retrieve the port id from
the encoder object.
Change-Id: I55f323957afe1ecc487bbe732e4bd41ae3c09b98
Tracked-On: projectacrn/acrn-hypervisor/issues/2288
Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
Signed-off-by: Min He <min.he@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Tracked-On: PKT-1657
---
drivers/gpu/drm/i915/gvt/display.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/gvt/display.c b/drivers/gpu/drm/i915/gvt/display.c
index 700bf9f1f16d..afe9eafdbd1d 100644
--- a/drivers/gpu/drm/i915/gvt/display.c
+++ b/drivers/gpu/drm/i915/gvt/display.c
@@ -555,8 +555,7 @@ int setup_virtual_monitors(struct intel_vgpu *vgpu)
!bxt_check_planes(vgpu, pipe))
continue;
/* Get (Dom0) port associated with current pipe. */
- port = enc_to_dig_port(
- &(connector->encoder->base))->base.port;
+ port = connector->encoder->port;
ret = setup_virtual_monitor(vgpu, port,
type, 0, connector->detect_edid,
!gvt_emulate_hdmi);
--
2.17.1

View File

@ -0,0 +1,55 @@
From 3b5944968f5d45fae75c17d779201643f17aa61d Mon Sep 17 00:00:00 2001
From: Zhao Yakui <yakui.zhao@intel.com>
Date: Thu, 10 Jan 2019 15:17:59 +0800
Subject: [PATCH 04/11] drivers/hyper_dmabuf: Reuse the exported dma_buf to
avoid creating multiple dma_buf for one importer
After the imported hyper_dmabuf is added to the BE, the
IOCTL_HYPER_DMABUF_EXPORT_REMOTE iotcl will export one dma_buf based on
the imported ID info. When the ioctl is called twice for the same ID,
it will try to create two dma_buf structure and then sync with the FE
driver. In fact one dma_buf is enough for the same imported ID info. And
the different file_fd is returned for the same dma_buf when the ioctl
is called twice.
Change-Id: I15df88ed7c79ff2c96e877a95414f97899751a0d
Tracked-On: projectacrn/acrn-hypervisor#2237
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Reviewed-by: Liu, Shuo <shuo.a.liu@intel.com>
Acked-by: Dongwon Kim <dongwon.kim@intel.com>
Tracked-On: PKT-1657
---
.../dma-buf/hyper_dmabuf/hyper_dmabuf_ioctl.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_ioctl.c b/drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_ioctl.c
index 62f83cc45f36..8fc3a56ffee6 100644
--- a/drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_ioctl.c
+++ b/drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_ioctl.c
@@ -450,6 +450,23 @@ static int hyper_dmabuf_export_fd_ioctl(struct file *filp, void *data)
mutex_lock(&hy_drv_priv->lock);
+ if (imported->dma_buf) {
+ if (imported->valid == false) {
+ mutex_unlock(&hy_drv_priv->lock);
+ dev_err(hy_drv_priv->dev,
+ "Buffer is released {id:%d key:%d %d %d}, cannot import\n",
+ imported->hid.id, imported->hid.rng_key[0],
+ imported->hid.rng_key[1], imported->hid.rng_key[2]);
+ return -EINVAL;
+ }
+ get_dma_buf(imported->dma_buf);
+ export_fd_attr->fd = dma_buf_fd(imported->dma_buf,
+ export_fd_attr->flags);
+ mutex_unlock(&hy_drv_priv->lock);
+ dev_dbg(hy_drv_priv->dev, "%s exit\n", __func__);
+ return 0;
+ }
+
imported->importers++;
/* send notification for export_fd to exporter */
--
2.17.1

View File

@ -0,0 +1,80 @@
From b4906dff23dae875d8f1894527bef1bfb62b7d1a Mon Sep 17 00:00:00 2001
From: Zhao Yakui <yakui.zhao@intel.com>
Date: Thu, 10 Jan 2019 15:18:03 +0800
Subject: [PATCH 05/11] drivers/hyper_dmabuf: Remove the imported dma_buf with
closed domid
When one VM is closed, the BE driver should remove the corresponding
imported dma_buf that is based on the closed dmid. Otherwise it can't be
released when the guest OS exits without sending unexport notification.
Change-Id: If588089abdb8c6595404cb65abdaa1f0ddb22031
Tracked-On: projectacrn/acrn-hypervisor#2237
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Reviewed-by: Liu, Shuo <shuo.a.liu@intel.com>
Acked-by: Dongwon Kim <dongwon.kim@intel.com>
Tracked-On: PKT-1657
---
drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_list.c | 15 +++++++++++++++
drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_list.h | 1 +
.../virtio/hyper_dmabuf_virtio_be_drv.c | 2 ++
3 files changed, 18 insertions(+)
diff --git a/drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_list.c b/drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_list.c
index 84cfb065bddd..7b6ce1f067a2 100644
--- a/drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_list.c
+++ b/drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_list.c
@@ -290,3 +290,18 @@ void hyper_dmabuf_foreach_exported(
func(info_entry->exported, attr);
}
}
+
+void hyper_dmabuf_remove_imported_vmid(int vmid)
+{
+ struct list_entry_imported *info_entry;
+ struct hlist_node *tmp;
+ int bkt;
+
+ hash_for_each_safe(hyper_dmabuf_hash_imported, bkt, tmp,
+ info_entry, node) {
+ if (HYPER_DMABUF_DOM_ID(info_entry->imported->hid) == vmid) {
+ hash_del(&info_entry->node);
+ kfree(info_entry);
+ }
+ }
+}
diff --git a/drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_list.h b/drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_list.h
index f7102f5db75d..81250e5c5eab 100644
--- a/drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_list.h
+++ b/drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_list.h
@@ -61,6 +61,7 @@ struct imported_sgt_info *hyper_dmabuf_find_imported(hyper_dmabuf_id_t hid);
int hyper_dmabuf_remove_exported(hyper_dmabuf_id_t hid);
int hyper_dmabuf_remove_imported(hyper_dmabuf_id_t hid);
+void hyper_dmabuf_remove_imported_vmid(int vmid);
void hyper_dmabuf_foreach_exported(void (*func)(struct exported_sgt_info *,
void *attr), void *attr);
diff --git a/drivers/dma-buf/hyper_dmabuf/virtio/hyper_dmabuf_virtio_be_drv.c b/drivers/dma-buf/hyper_dmabuf/virtio/hyper_dmabuf_virtio_be_drv.c
index 1be021876e47..c29793997bbc 100644
--- a/drivers/dma-buf/hyper_dmabuf/virtio/hyper_dmabuf_virtio_be_drv.c
+++ b/drivers/dma-buf/hyper_dmabuf/virtio/hyper_dmabuf_virtio_be_drv.c
@@ -40,6 +40,7 @@
#include <linux/vhm/acrn_vhm_mm.h>
#include "../hyper_dmabuf_msg.h"
#include "../hyper_dmabuf_drv.h"
+#include "../hyper_dmabuf_list.h"
#include "hyper_dmabuf_virtio_common.h"
#include "hyper_dmabuf_virtio_fe_list.h"
#include "hyper_dmabuf_virtio_shm.h"
@@ -329,6 +330,7 @@ static void cleanup_fe(struct virtio_fe_info *fe_info, void *attr)
acrn_ioreq_destroy_client(fe_info->client_id);
virtio_fe_remove(fe_info->client_id);
+ hyper_dmabuf_remove_imported_vmid(fe_info->vmid);
kfree(fe_info);
}
}
--
2.17.1

View File

@ -0,0 +1,36 @@
From 151279cb5afe5a87c09e5c6ce355533930351fcb Mon Sep 17 00:00:00 2001
From: Zhao Yakui <yakui.zhao@intel.com>
Date: Thu, 10 Jan 2019 15:18:07 +0800
Subject: [PATCH 06/11] drivers/hyper_dmabuf: Remove from imported_list to
avoid exporting dma_buf later after receiving unexport notification
After the FE sends the UNEXPORT msg notification, it should not be
exported any more. So it needs to be removed from the imported_list.
In such case it can assure that it won't export the DMA_BUF again later
for imported ID info that is already released.
Change-Id: I2e18a2af7196682ad04046a11a28cdd75cae274a
Tracked-On: projectacrn/acrn-hypervisor#2237
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Reviewed-by: Liu, Shuo <shuo.a.liu@intel.com>
Acked-by: Dongwon Kim <dongwon.kim@intel.com>
Tracked-On: PKT-1657
---
drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_msg.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_msg.c b/drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_msg.c
index fe9e4e2339a1..48db3fd8bb0e 100644
--- a/drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_msg.c
+++ b/drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_msg.c
@@ -316,6 +316,7 @@ int hyper_dmabuf_msg_parse(int domid, struct hyper_dmabuf_req *req)
* anymore.
*/
imported->valid = false;
+ hyper_dmabuf_remove_imported(hid);
} else {
/* No one is using buffer, remove it from
* imported list
--
2.17.1

View File

@ -0,0 +1,33 @@
From a7c6f2993bcf787f13013995d02f951929677247 Mon Sep 17 00:00:00 2001
From: Zhou Furong <furong.zhou@intel.com>
Date: Fri, 4 Jan 2019 08:59:45 +0800
Subject: [PATCH 07/11] Security: Fix copy wrong size of keystore client id
Copy wrong size of keystore client id by mistake.
Tracked-On: PKT-1640
Signed-off-by: Zhou Furong <furong.zhou@intel.com>
Change-Id: Ibb90ad0fe1d87615170c4b1636ca7a68b08964a4
---
security/keystore/api_dal.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/security/keystore/api_dal.c b/security/keystore/api_dal.c
index 31c351e18456..d97dd469d404 100644
--- a/security/keystore/api_dal.c
+++ b/security/keystore/api_dal.c
@@ -112,8 +112,8 @@ static int dal_keystore_register_client(enum keystore_seed_type seed_type,
goto err;
}
- memcpy(input, client_id, sizeof(client_id));
- index += sizeof(client_id);
+ memcpy(input, client_id, KEYSTORE_MAX_CLIENT_ID_SIZE);
+ index += KEYSTORE_MAX_CLIENT_ID_SIZE;
memcpy(input + index, client_ticket, KEYSTORE_CLIENT_TICKET_SIZE);
index += KEYSTORE_CLIENT_TICKET_SIZE;
pack_int_to_buf(seed_type, input + index);
--
2.17.1

View File

@ -0,0 +1,28 @@
From 90696017c624624475d3b0dfc48f95817da4547b Mon Sep 17 00:00:00 2001
From: Manisha Chinthapally <manisha.chinthapally@intel.com>
Date: Thu, 10 Jan 2019 17:22:38 -0800
Subject: [PATCH 08/11] Bug Fix to fix incorrect osid value
Change-Id: I39d002b72dcd6b7405f35c97dd97f9d1585de999
Tracked-On: PKT-1662
Signed-off-by: Manisha Chinthapally <manisha.chinthapally@intel.com>
---
drivers/platform/x86/sepdk/include/lwpmudrv_defines.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/platform/x86/sepdk/include/lwpmudrv_defines.h b/drivers/platform/x86/sepdk/include/lwpmudrv_defines.h
index aeee9516bef2..8346ea72d587 100644
--- a/drivers/platform/x86/sepdk/include/lwpmudrv_defines.h
+++ b/drivers/platform/x86/sepdk/include/lwpmudrv_defines.h
@@ -511,7 +511,7 @@ extern "C" {
#define OS_ID_MODEM 1
#define OS_ID_ANDROID 2
#define OS_ID_SECVM 3
-#define OS_ID_ACORN (U32)(-1)
+#define OS_ID_ACORN 0xFFFF
#define PERF_HW_VER4 (5)
#if defined(__cplusplus)
--
2.17.1

View File

@ -0,0 +1,58 @@
From 2832c17cc3d4e63a68b7b14f6a32c00b87324b56 Mon Sep 17 00:00:00 2001
From: "Yew, Chang Ching" <chang.ching.yew@intel.com>
Date: Fri, 11 Jan 2019 14:46:30 +0800
Subject: [PATCH 09/11] media: intel-ipu4: [VIRT] Avoid double close of dmabuf
FD.
Message for Open Source:
This patch is to fix the ksys_close call for
camera streaming for SOS case where the dmabuf fd
is close by user space. Added check to only close
the dmabuf fd for virtualized case.
Change-Id: I3b03d72bd5ce4f22a08542be1f03b022b29f4fcc
Tracked-On: #JOLINUX-2973
Signed-off-by: Ong Hock Yu <ong.hock.yu@intel.com>
---
drivers/media/pci/intel/ipu-psys.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/media/pci/intel/ipu-psys.c b/drivers/media/pci/intel/ipu-psys.c
index f342951ee550..345285caaa99 100644
--- a/drivers/media/pci/intel/ipu-psys.c
+++ b/drivers/media/pci/intel/ipu-psys.c
@@ -516,6 +516,9 @@ static int ipu_psys_release(struct inode *inode, struct file *file)
struct ipu_psys *psys = inode_to_ipu_psys(inode);
struct ipu_psys_fh *fh = file->private_data;
struct ipu_psys_kbuffer *kbuf, *kbuf0;
+#if defined(CONFIG_VIDEO_INTEL_IPU_ACRN) && defined(CONFIG_VIDEO_INTEL_IPU_VIRTIO_BE)
+ struct ipu_dma_buf_attach *ipu_attach;
+#endif
mutex_lock(&fh->mutex);
/* clean up buffers */
@@ -526,6 +529,11 @@ static int ipu_psys_release(struct inode *inode, struct file *file)
if (kbuf->dbuf && kbuf->db_attach) {
struct dma_buf *dbuf;
kbuf->valid = false;
+#if defined(CONFIG_VIDEO_INTEL_IPU_ACRN) && defined(CONFIG_VIDEO_INTEL_IPU_VIRTIO_BE)
+ ipu_attach = kbuf->db_attach->priv;
+ if (ipu_attach->vma_is_io)
+ ksys_close(kbuf->fd);
+#endif
dma_buf_vunmap(kbuf->dbuf, kbuf->kaddr);
dma_buf_unmap_attachment(kbuf->db_attach,
kbuf->sgt,
@@ -535,9 +543,6 @@ static int ipu_psys_release(struct inode *inode, struct file *file)
kbuf->dbuf = NULL;
kbuf->db_attach = NULL;
dma_buf_put(dbuf);
-#if defined(CONFIG_VIDEO_INTEL_IPU_ACRN) && defined(CONFIG_VIDEO_INTEL_IPU_VIRTIO_BE)
- ksys_close(kbuf->fd);
-#endif
} else {
if (kbuf->db_attach)
ipu_psys_put_userpages(
--
2.17.1

View File

@ -0,0 +1,94 @@
From 370cb2d5ff28c014f1bd4ad7a779f623a675581b Mon Sep 17 00:00:00 2001
From: Ong Hock Yu <ong.hock.yu@intel.com>
Date: Wed, 9 Jan 2019 23:03:09 +0000
Subject: [PATCH 10/11] media: intel-ipu4: [VIRT] Increase the POLL_WAIT
timeout & REQ_TIMEOUT.
Few sensors like OV10635 require many I2C commands RW
for init & setup. This caused long stream ON time
under multiple camera use case.
Need to increase POLL_WAIT timeout from 500mS to
5 seconds for mediation BE and increase REQ_TIMEOUT
for FE's virtio req for 3s to 6s.
Change-Id: I08cbbd7b40ce95f9cb3e0a3da0402c81d0ac4d9c
Tracked-On: OAM-63913
Signed-off-by: Ong Hock Yu <ong.hock.yu@intel.com>
Signed-off-by: Bandi,Kushal <kushal.bandi@intel.com>
---
.../virtio/intel-ipu4-virtio-be-stream.c | 21 ++++++++++++-------
.../pci/intel/virtio/intel-ipu4-virtio-fe.c | 2 +-
2 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/drivers/media/pci/intel/virtio/intel-ipu4-virtio-be-stream.c b/drivers/media/pci/intel/virtio/intel-ipu4-virtio-be-stream.c
index 9025b9586d67..7958fd836a12 100644
--- a/drivers/media/pci/intel/virtio/intel-ipu4-virtio-be-stream.c
+++ b/drivers/media/pci/intel/virtio/intel-ipu4-virtio-be-stream.c
@@ -20,7 +20,7 @@
#include "intel-ipu4-virtio-be.h"
#define MAX_SIZE 6 // max 2^6
-#define POLL_WAIT 500 //500ms
+#define POLL_WAIT 5000 //5s
#define dev_to_stream(dev) \
container_of(dev, struct ici_isys_stream, strm_dev)
@@ -186,12 +186,16 @@ int process_poll(struct ipu4_virtio_req_info *req_info)
} else {
time_remain = wait_event_interruptible_timeout(
as->buf_list.wait,
- !list_empty(&as->buf_list.putbuf_list),
+ !list_empty(&as->buf_list.putbuf_list) ||
+ !as->ip.streaming,
POLL_WAIT);
if((time_remain == -ERESTARTSYS) ||
- time_remain == 0) {
- pr_err("%s poll timeout or unexpected wake up! code:%d port:%d",
- __func__, time_remain, req->op[0]);
+ time_remain == 0 ||
+ !as->ip.streaming) {
+ pr_err("%s poll timeout or unexpected wake up! code:%d streaming: %d port:%d",
+ __func__, time_remain,
+ as->ip.streaming,
+ req->op[0]);
req->func_ret = 0;
return IPU4_REQ_ERROR;
}
@@ -400,6 +404,7 @@ int process_stream_off(struct ipu4_virtio_req_info *req_info)
{
struct stream_node *sn = NULL;
struct ici_stream_device *strm_dev;
+ struct ici_isys_stream *as;
int err, found;
struct ipu4_virtio_req *req = req_info->request;
@@ -433,9 +438,11 @@ int process_stream_off(struct ipu4_virtio_req_info *req_info)
if (err) {
pr_err("%s: stream off failed\n", __func__);
return IPU4_REQ_ERROR;
- }
- else
+ } else {
+ as = dev_to_stream(strm_dev);
+ wake_up_interruptible(&as->buf_list.wait);
return IPU4_REQ_PROCESSED;
+ }
}
int process_set_format_thread(void *data)
diff --git a/drivers/media/pci/intel/virtio/intel-ipu4-virtio-fe.c b/drivers/media/pci/intel/virtio/intel-ipu4-virtio-fe.c
index 39e2e556a008..5a02b8275de4 100644
--- a/drivers/media/pci/intel/virtio/intel-ipu4-virtio-fe.c
+++ b/drivers/media/pci/intel/virtio/intel-ipu4-virtio-fe.c
@@ -15,7 +15,7 @@
static DEFINE_IDA(index_ida);
-#define REQ_TIMEOUT 3000 //3s
+#define REQ_TIMEOUT 6000 //6s
struct ipu4_virtio_uos {
struct virtqueue *vq[IPU_VIRTIO_QUEUE_MAX];
--
2.17.1

View File

@ -0,0 +1,94 @@
From 860b7009ed14bad9650f26d8d7ded82152b96368 Mon Sep 17 00:00:00 2001
From: "Gopal, Puunithaaraj" <puunithaaraj.gopal@intel.com>
Date: Sat, 12 Jan 2019 00:05:13 +0800
Subject: [PATCH 11/11] intel-ipu4: ici: Move empty list check into spinlock to
avoid list get out of sync.
Under race condition, the list content can be modified to
become empty. This will cause invalid object access.
Change-Id: Ica5351c7f1b3e34fec7d2cbe8789062a2f42ff7d
Tracked-On: OAM-72430
Tracked-On: OOLI2-2387
Signed-off-by: Gopal, Puunithaaraj <puunithaaraj.gopal@intel.com>
---
.../media/pci/intel/ici/ici-isys-frame-buf.c | 26 ++++++++++++++++---
1 file changed, 22 insertions(+), 4 deletions(-)
diff --git a/drivers/media/pci/intel/ici/ici-isys-frame-buf.c b/drivers/media/pci/intel/ici/ici-isys-frame-buf.c
index 5d3c87612a7d..ff497f8fdd5e 100644
--- a/drivers/media/pci/intel/ici/ici-isys-frame-buf.c
+++ b/drivers/media/pci/intel/ici/ici-isys-frame-buf.c
@@ -698,10 +698,12 @@ void ici_isys_frame_buf_ready(struct ici_isys_pipeline
static void unmap_buf(struct ici_frame_buf_wrapper *buf)
{
int i;
-
+ dev_dbg(&buf->buf_list->strm_dev->dev, "buf: %p\n", buf);
for (i = 0; i < buf->frame_info.num_planes; i++) {
struct ici_kframe_plane *kframe_plane =
&buf->kframe_info.planes[i];
+ dev_dbg(&buf->buf_list->strm_dev->dev, "kframe_plane: %p\n",
+ kframe_plane);
switch (kframe_plane->mem_type) {
case ICI_MEM_USERPTR:
ici_put_userpages(kframe_plane->dev,
@@ -747,36 +749,52 @@ void ici_isys_frame_buf_stream_cancel(struct
struct ici_frame_buf_wrapper *buf;
unsigned long flags = 0;
- while (!list_empty(&buf_list->getbuf_list)) {
+ while (1) {
spin_lock_irqsave(&buf_list->lock, flags);
+ if (list_empty(&buf_list->getbuf_list)) {
+ spin_unlock_irqrestore(&buf_list->lock, flags);
+ break;
+ }
buf = list_entry(buf_list->getbuf_list.next,
struct ici_frame_buf_wrapper, node);
list_del(&buf->node);
spin_unlock_irqrestore(&buf_list->lock, flags);
+ dev_dbg(&buf_list->strm_dev->dev, "buf: %p\n", buf);
if (as->strm_dev.virt_dev_id < 0)
unmap_buf(buf);
else
unmap_buf_virt(buf);
}
- while (!list_empty(&buf_list->putbuf_list)) {
+ while (1) {
spin_lock_irqsave(&buf_list->lock, flags);
+ if (list_empty(&buf_list->putbuf_list)) {
+ spin_unlock_irqrestore(&buf_list->lock, flags);
+ break;
+ }
buf = list_entry(buf_list->putbuf_list.next,
struct ici_frame_buf_wrapper, node);
list_del(&buf->node);
spin_unlock_irqrestore(&buf_list->lock, flags);
+ dev_dbg(&buf_list->strm_dev->dev, "buf: %p\n", buf);
if (as->strm_dev.virt_dev_id < 0)
unmap_buf(buf);
else
unmap_buf_virt(buf);
}
- while (!list_empty(&buf_list->interlacebuf_list)) {
+ while (1) {
spin_lock_irqsave(&buf_list->short_packet_queue_lock, flags);
+ if (list_empty(&buf_list->interlacebuf_list)) {
+ spin_unlock_irqrestore
+ (&buf_list->short_packet_queue_lock, flags);
+ break;
+ }
buf = list_entry(buf_list->interlacebuf_list.next,
struct ici_frame_buf_wrapper, node);
list_del(&buf->node);
spin_unlock_irqrestore(&buf_list->short_packet_queue_lock, flags);
+ dev_dbg(&buf_list->strm_dev->dev, "buf: %p\n", buf);
unmap_buf(buf);
}
}
--
2.17.1

View File

@ -17,7 +17,7 @@ Name: linux-iot-lts2018
Version: 4.19.8
# Release number is the number from PKT it consist in
# YYMMDDHHMM a 10 length number
Release: 1901090631
Release: 1901111952
License: GPL-2.0
Summary: The Linux kernel
Url: http://www.kernel.org/
@ -31,8 +31,8 @@ Source5: fragment-sos
# quilt.url: https://github.com/intel/linux-intel-quilt
# quilt.branch: 4.19/base
# quilt.tag: lts-v4.19.8-base-190109T063124Z
# config.tag: lts-v4.19.8-base-190109T063124Z
# quilt.tag: lts-v4.19.8-base-190111T195245Z
# config.tag: lts-v4.19.8-base-190111T195245Z
%define ktarget0 iot-lts2018
%define kversion0 %{version}-%{release}.%{ktarget0}
@ -912,6 +912,17 @@ Patch0860: 0860-media-intel-ipu4-VIRT-Close-dmabuf-fd-when-.patch
Patch0861: 0861-media-intel-ipu4-ICI-Workaround-to-force-co.patch
Patch0862: 0862-Revert-igb_avb-back-port-an-upstream-patch-.patch
Patch0863: 0863-drm-i915-gvt-allocate-memory-for-vreg-mmio-.patch
Patch0864: 0864-Security-improvement-for-depressing-compile.patch
Patch0865: 0865-platform-x86-Change-struct-fields-to-16-bit.patch
Patch0866: 0866-drm-i915-gvt-Get-Port-ID-from-the-encoder-o.patch
Patch0867: 0867-drivers-hyper_dmabuf-Reuse-the-exported-dma.patch
Patch0868: 0868-drivers-hyper_dmabuf-Remove-the-imported-dm.patch
Patch0869: 0869-drivers-hyper_dmabuf-Remove-from-imported_l.patch
Patch0870: 0870-Security-Fix-copy-wrong-size-of-keystore-cl.patch
Patch0871: 0871-Bug-Fix-to-fix-incorrect-osid-value.patch
Patch0872: 0872-media-intel-ipu4-VIRT-Avoid-double-close-of.patch
Patch0873: 0873-media-intel-ipu4-VIRT-Increase-the-POLL_WAI.patch
Patch0874: 0874-intel-ipu4-ici-Move-empty-list-check-into-s.patch
#END XXXX: PK Series
# Clear Linux Series
@ -1804,6 +1815,17 @@ Linux kernel extra files
%patch0861 -p1
%patch0862 -p1
%patch0863 -p1
%patch0864 -p1
%patch0865 -p1
%patch0866 -p1
%patch0867 -p1
%patch0868 -p1
%patch0869 -p1
%patch0870 -p1
%patch0871 -p1
%patch0872 -p1
%patch0873 -p1
%patch0874 -p1
# End XXXX PK Series
# Clear Linux Series

View File

@ -1 +1 @@
1901090631
1901111952