5.4.63-rc1 review
Greg Kroah-Hartman
maintainerPATCH 4/16 drm/sched: Fix passing zero to PTR_ERR warning v2
In reply to Greg Kroah-HartmanFrom: Andrey Grodzovsky <[email protected]>
commit d7c5782acd354bdb5ed0fa10e1e397eaed558390 upstream.
Fix a static code checker warning.
v2: Drop PTR_ERR_OR_ZERO.
--- drivers/gpu/drm/scheduler/sched_main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/scheduler/sched_main.c +5 -2
@@ -496,8 +496,10 @@ void drm_sched_resubmit_jobs(struct drm_ fence = sched->ops->run_job (s_job);if (IS_ERR_OR_NULL (fence)) { +if (IS_ERR (fence)) +dma_fence_set_error (&s_fence->finished,PTR_ERR (fence)); + s_job->s_fence->parent =NULL ; -dma_fence_set_error (&s_fence->finished,PTR_ERR (fence)); }else { s_job->s_fence->parent = fence; }
@@ -748,8 +750,9 @@ static int drm_sched_main(void *param) r);dma_fence_put (fence); }else { +if (IS_ERR (fence)) +dma_fence_set_error (&s_fence->finished,PTR_ERR (fence)); -dma_fence_set_error (&s_fence->finished,PTR_ERR (fence));drm_sched_process_job (NULL , &sched_job->cb); }
Greg Kroah-Hartman
maintainerPATCH 2/16 HID: core: Sanitize event code and type when mapping input
In reply to Greg Kroah-HartmanFrom: Marc Zyngier <[email protected]>
commit 35556bed836f8dc07ac55f69c8d17dce3e7f0e25 upstream.
When calling into hid_map_usage(), the passed event code is blindly stored as is, even if it doesn't fit in the associated bitmap.
This event code can come from a variety of sources, including devices masquerading as input devices, only a bit more "programmable".
Instead of taking the event code at face value, check that it actually fits the corresponding bitmap, and if it doesn't:
- spit out a warning so that we know which device is acting up
- NULLify the bitmap pointer so that we catch unexpected uses
Code paths that can make use of untrusted inputs can now check that the mapping was indeed correct and bail out if not.
--- drivers/hid/hid-input.c | 4 ++++ drivers/hid/hid-multitouch.c | 2 ++ include/linux/hid.h | 42 +++++++++++++++++++++++++++++------------- 3 files changed, 35 insertions(+), 13 deletions(-)
drivers/hid/hid-input.c +4 -0
@@ -1132,6 +1132,10 @@ static void hidinput_configure_usage(str } mapped: +/* Mapping failed, bail out */ +if (!bit) +return ; +if (device->driver->input_mapped && device->driver->input_mapped (device, hidinput, field, usage, &bit, &max) <0 ) {
drivers/hid/hid-multitouch.c +2 -0
@@ -864,6 +864,8 @@ static int mt_touch_input_mapping(struct code =BTN_0 + ((usage->hid -1 ) &HID_USAGE );hid_map_usage (hi, usage, bit, max,EV_KEY , code); +if (!*bit) +return -1 ;input_set_capability (hi->input,EV_KEY , code);return 1 ;
include/linux/hid.h +29 -13
70 lines not on this page · raw message
Greg Kroah-Hartman
maintainerPATCH 3/16 perf record/stat: Explicitly call out event modifiers in the documentation
In reply to Greg Kroah-HartmanFrom: Kim Phillips <[email protected]>
commit e48a73a312ebf19cc3d72aa74985db25c30757c1 upstream.
Event modifiers are not mentioned in the perf record or perf stat manpages. Add them to orient new users more effectively by pointing them to the perf list manpage for details.
--- tools/perf/Documentation/perf-record.txt | 4 ++++ tools/perf/Documentation/perf-stat.txt | 4 ++++ 2 files changed, 8 insertions(+)
tools/perf/Documentation/perf-record.txt +4 -0
@@ -33,6 +33,10 @@ OPTIONS - a raw PMU event (eventsel+umask) in the form of rNNN where NNN is a hexadecimal event descriptor. + - a symbolic or raw PMU event followed by an optional colon + and a list of event modifiers, e.g., cpu-cycles:p. See the + linkperf:perf-list[1] man page for details on event modifiers. + - a symbolically formed PMU event like 'pmu/param1=0x3,param2/' where 'param1', 'param2', etc are defined as formats for the PMU in /sys/bus/event_source/devices/<pmu>/format/*.
tools/perf/Documentation/perf-stat.txt +4 -0
@@ -39,6 +39,10 @@ report:: - a raw PMU event (eventsel+umask) in the form of rNNN where NNN is a hexadecimal event descriptor. + - a symbolic or raw PMU event followed by an optional colon + and a list of event modifiers, e.g., cpu-cycles:p. See the + linkperf:perf-list[1] man page for details on event modifiers. + - a symbolically formed event like 'pmu/param1=0x3,param2/' where param1 and param2 are defined as formats for the PMU in /sys/bus/event_source/devices/<pmu>/format/*
Greg Kroah-Hartman
maintainerPATCH 5/16 drm/etnaviv: fix TS cache flushing on GPUs with BLT engine
In reply to Greg Kroah-HartmanFrom: Lucas Stach <[email protected]>
commit f232d9ec029ce3e2543b05213e2979e01e503408 upstream.
As seen in the Vivante kernel driver, most GPUs with the BLT engine have a broken TS cache flush. The workaround is to temporarily set the BLT command to CLEAR_IMAGE, without actually executing the clear. Apparently this state change is enough to trigger the required TS cache flush. As the BLT engine is completely asychronous, we also need a few more stall states to synchronize the flush with the frontend.
--- drivers/gpu/drm/etnaviv/etnaviv_buffer.c | 60 ++++++++++++++++++++++++++++--- drivers/gpu/drm/etnaviv/state_blt.xml.h | 2 + 2 files changed, 57 insertions(+), 5 deletions(-)
drivers/gpu/drm/etnaviv/etnaviv_buffer.c +55 -5
@@ -12,6 +12,7 @@#include "common.xml.h" #include "state.xml.h" +#include "state_blt.xml.h" #include "state_hi.xml.h" #include "state_3d.xml.h" #include "cmdstream.xml.h"
@@ -233,6 +234,8 @@ void etnaviv_buffer_end(struct etnaviv_gstruct etnaviv_cmdbuf *buffer = &gpu->buffer;unsigned int waitlink_offset = buffer->user_size -16 ;u32 link_target, flush =0 ; +bool has_blt = !!(gpu->identity.minor_features5 & + chipMinorFeatures5_BLT_ENGINE);lockdep_assert_held (&gpu->lock);
@@ -248,16 +251,38 @@ void etnaviv_buffer_end(struct etnaviv_gif (flush) {unsigned int dwords =7 ; +if (has_blt) + dwords +=10 ; + link_target =etnaviv_buffer_reserve (gpu, buffer, dwords);CMD_SEM (buffer,SYNC_RECIPIENT_FE ,SYNC_RECIPIENT_PE );CMD_STALL (buffer,SYNC_RECIPIENT_FE ,SYNC_RECIPIENT_PE ); +if (has_blt) { +CMD_LOAD_STATE (buffer,VIVS_BLT_ENABLE ,0x1 ); +CMD_SEM (buffer,SYNC_RECIPIENT_FE ,SYNC_RECIPIENT_BLT ); +CMD_STALL (buffer,SYNC_RECIPIENT_FE ,SYNC_RECIPIENT_BLT ); +CMD_LOAD_STATE (buffer,VIVS_BLT_ENABLE ,0x0 ); + }CMD_LOAD_STATE (buffer,VIVS_GL_FLUSH_CACHE , flush); -if (gpu->exec_state ==ETNA_PIPE_3D ) -CMD_LOAD_STATE (buffer,VIVS_TS_FLUSH_CACHE , -VIVS_TS_FLUSH_CACHE_FLUSH ); +if (gpu->exec_state ==ETNA_PIPE_3D ) { +if (has_blt) { +CMD_LOAD_STATE (buffer,VIVS_BLT_ENABLE ,0x1 ); +CMD_LOAD_STATE (buffer,VIVS_BLT_SET_COMMAND ,0x1 ); +CMD_LOAD_STATE (buffer,VIVS_BLT_ENABLE ,0x0 ); + }else { +CMD_LOAD_STATE (buffer,VIVS_TS_FLUSH_CACHE , +VIVS_TS_FLUSH_CACHE_FLUSH ); + } + }CMD_SEM (buffer,SYNC_RECIPIENT_FE ,SYNC_RECIPIENT_PE );CMD_STALL (buffer,SYNC_RECIPIENT_FE ,SYNC_RECIPIENT_PE ); +if (has_blt) { +CMD_LOAD_STATE (buffer,VIVS_BLT_ENABLE ,0x1 ); +CMD_SEM (buffer,SYNC_RECIPIENT_FE ,SYNC_RECIPIENT_BLT ); +CMD_STALL (buffer,SYNC_RECIPIENT_FE ,SYNC_RECIPIENT_BLT ); +CMD_LOAD_STATE (buffer,VIVS_BLT_ENABLE ,0x0 ); + }CMD_END (buffer); etnaviv_buffer_replace_wait(buffer, waitlink_offset,
@@ -323,6 +348,8 @@ void etnaviv_buffer_queue(struct etnavivbool switch_mmu_context = gpu->mmu_context != mmu_context;unsigned int new_flush_seq =READ_ONCE (gpu->mmu_context->flush_seq);bool need_flush = switch_mmu_context || gpu->flush_seq != new_flush_seq; +bool has_blt = !!(gpu->identity.minor_features5 & + chipMinorFeatures5_BLT_ENGINE);lockdep_assert_held (&gpu->lock);
@@ -433,6 +460,15 @@ void etnaviv_buffer_queue(struct etnaviv* 2 semaphore stall + 1 event + 1 wait + 1 link. */ return_dwords =7 ; + +/* +* When the BLT engine is present we need 6 more dwords in the return +* target: 3 enable/flush/disable + 4 enable/semaphore stall/disable, +* but we don't need the normal TS flush state. +*/ +if (has_blt) + return_dwords +=6 ; + return_target =etnaviv_buffer_reserve (gpu, buffer, return_dwords);CMD_LINK (cmdbuf, return_dwords, return_target);
@@ -447,11 +483,25 @@ void etnaviv_buffer_queue(struct etnavivCMD_LOAD_STATE (buffer,VIVS_GL_FLUSH_CACHE ,VIVS_GL_FLUSH_CACHE_DEPTH |VIVS_GL_FLUSH_CACHE_COLOR ); -CMD_LOAD_STATE (buffer,VIVS_TS_FLUSH_CACHE , -VIVS_TS_FLUSH_CACHE_FLUSH ); +if (has_blt) { +CMD_LOAD_STATE (buffer,VIVS_BLT_ENABLE ,0x1 ); +CMD_LOAD_STATE (buffer,VIVS_BLT_SET_COMMAND ,0x1 ); +CMD_LOAD_STATE (buffer,VIVS_BLT_ENABLE ,0x0 ); + }else { +CMD_LOAD_STATE (buffer,VIVS_TS_FLUSH_CACHE , +VIVS_TS_FLUSH_CACHE_FLUSH ); + } }CMD_SEM (buffer,SYNC_RECIPIENT_FE ,SYNC_RECIPIENT_PE );CMD_STALL (buffer,SYNC_RECIPIENT_FE ,SYNC_RECIPIENT_PE ); + +if (has_blt) { +CMD_LOAD_STATE (buffer,VIVS_BLT_ENABLE ,0x1 ); +CMD_SEM (buffer,SYNC_RECIPIENT_FE ,SYNC_RECIPIENT_BLT ); +CMD_STALL (buffer,SYNC_RECIPIENT_FE ,SYNC_RECIPIENT_BLT ); +CMD_LOAD_STATE (buffer,VIVS_BLT_ENABLE ,0x0 ); + } +CMD_LOAD_STATE (buffer,VIVS_GL_EVENT ,VIVS_GL_EVENT_EVENT_ID (event) |VIVS_GL_EVENT_FROM_PE );CMD_WAIT (buffer);
drivers/gpu/drm/etnaviv/state_blt.xml.h +2 -0
@@ -46,6 +46,8 @@ DEALINGS IN THE SOFTWARE./* This is a cut-down version of the state_blt.xml.h file */ +#define VIVS_BLT_SET_COMMAND 0x000140ac +#define VIVS_BLT_ENABLE 0x000140b8#define VIVS_BLT_ENABLE_ENABLE 0x00000001
Greg Kroah-Hartman
maintainerPATCH 16/16 scsi: target: tcmu: Optimize use of flush_dcache_page
In reply to Greg Kroah-HartmanFrom: Bodo Stroesser <[email protected]>
commit 3c58f737231e2c8cbf543a09d84d8c8e80e05e43 upstream.
(scatter|gather)_data_area() need to flush dcache after writing data to or before reading data from a page in uio data area. The two routines are able to handle data transfer to/from such a page in fragments and flush the cache after each fragment was copied by calling the wrapper tcmu_flush_dcache_range().
That means:
1) flush_dcache_page() can be called multiple times for the same page.
2) Calling flush_dcache_page() indirectly using the wrapper does not make sense, because each call of the wrapper is for one single page only and the calling routine already has the correct page pointer.
Change (scatter|gather)_data_area() such that, instead of calling tcmu_flush_dcache_range() before/after each memcpy, it now calls flush_dcache_page() before unmapping a page (when writing is complete for that page) or after mapping a page (when starting to read the page).
After this change only calls to tcmu_flush_dcache_range() for addresses in vmalloc'ed command ring are left over.
The patch was tested on ARM with kernel 4.19.118 and 5.7.2
--- drivers/target/target_core_user.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
drivers/target/target_core_user.c +7 -4
@@ -676,8 +676,10 @@ static void scatter_data_area(struct tcm from =kmap_atomic (sg_page (sg)) + sg->offset;while (sg_remaining >0 ) {if (block_remaining ==0 ) { -if (to) +if (to) { +flush_dcache_page (page);kunmap_atomic (to); + } block_remaining =DATA_BLOCK_SIZE ; dbi =tcmu_cmd_get_dbi (tcmu_cmd);
@@ -722,7 +724,6 @@ static void scatter_data_area(struct tcmmemcpy (to + offset, from + sg->length - sg_remaining, copy_bytes); -tcmu_flush_dcache_range (to, copy_bytes); } sg_remaining -= copy_bytes;
@@ -731,8 +732,10 @@ static void scatter_data_area(struct tcmkunmap_atomic (from - sg->offset); } -if (to) +if (to) { +flush_dcache_page (page);kunmap_atomic (to); + } } static void gather_data_area(struct tcmu_dev *udev, struct tcmu_cmd *cmd,
@@ -778,13 +781,13 @@ static void gather_data_area(struct tcmu dbi =tcmu_cmd_get_dbi (cmd); page =tcmu_get_block_page (udev, dbi); from =kmap_atomic (page); +flush_dcache_page (page); } copy_bytes =min_t (size_t, sg_remaining, block_remaining);if (read_len < copy_bytes) copy_bytes = read_len; offset =DATA_BLOCK_SIZE - block_remaining; -tcmu_flush_dcache_range (from, copy_bytes);memcpy (to + sg->length - sg_remaining, from + offset, copy_bytes);
Greg Kroah-Hartman
maintainercover 5.4.63-rc1 review
This is the start of the stable review cycle for the 5.4.63 release. There are 16 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun, 06 Sep 2020 12:02:48 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.4.63-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.4.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 5.4.63-rc1
Bodo Stroesser <[email protected]>
scsi: target: tcmu: Optimize use of flush_dcache_page
Bodo Stroesser <[email protected]>
scsi: target: tcmu: Fix size in calls to tcmu_flush_dcache_range
Sowjanya Komatineni <[email protected]>
sdhci: tegra: Remove SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK for Tegra186
Sowjanya Komatineni <[email protected]>
sdhci: tegra: Remove SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK for Tegra210
Sowjanya Komatineni <[email protected]>
arm64: tegra: Add missing timeout clock to Tegra210 SDMMC
Sowjanya Komatineni <[email protected]>
arm64: tegra: Add missing timeout clock to Tegra186 SDMMC nodes
Sowjanya Komatineni <[email protected]>
arm64: tegra: Add missing timeout clock to Tegra194 SDMMC nodes
Sowjanya Komatineni <[email protected]>
dt-bindings: mmc: tegra: Add tmclk for Tegra210 and later
James Morse <[email protected]>
KVM: arm64: Set HCR_EL2.PTW to prevent AT taking synchronous exception
James Morse <[email protected]>
KVM: arm64: Survive synchronous exceptions caused by AT instructions
James Morse <[email protected]>
KVM: arm64: Add kvm_extable for vaxorcism code
Lucas Stach <[email protected]>
drm/etnaviv: fix TS cache flushing on GPUs with BLT engine
Andrey Grodzovsky <[email protected]>
drm/sched: Fix passing zero to 'PTR_ERR' warning v2
Kim Phillips <[email protected]>
perf record/stat: Explicitly call out event modifiers in the documentation
Marc Zyngier <[email protected]>
HID: core: Sanitize event code and type when mapping input
Marc Zyngier <[email protected]>
HID: core: Correctly handle ReportSize being zero
-------------
Diffstat:
.../bindings/mmc/nvidia,tegra20-sdhci.txt | 32 ++++++++++- Makefile | 4 +- arch/arm64/boot/dts/nvidia/tegra186.dtsi | 20 ++++--- arch/arm64/boot/dts/nvidia/tegra194.dtsi | 15 +++-- arch/arm64/boot/dts/nvidia/tegra210.dtsi | 20 ++++--- arch/arm64/include/asm/kvm_arm.h | 3 +- arch/arm64/include/asm/kvm_asm.h | 43 ++++++++++++++ arch/arm64/kernel/vmlinux.lds.S | 8 +++ arch/arm64/kvm/hyp/entry.S | 15 +++-- arch/arm64/kvm/hyp/hyp-entry.S | 65 ++++++++++++++-------- arch/arm64/kvm/hyp/switch.c | 39 +++++++++++-- drivers/gpu/drm/etnaviv/etnaviv_buffer.c | 60 ++++++++++++++++++-- drivers/gpu/drm/etnaviv/state_blt.xml.h | 2 + drivers/gpu/drm/scheduler/sched_main.c | 7 ++- drivers/hid/hid-core.c | 15 ++++- drivers/hid/hid-input.c | 4 ++ drivers/hid/hid-multitouch.c | 2 + drivers/mmc/host/sdhci-tegra.c | 2 - drivers/target/target_core_user.c | 15 +++-- include/linux/hid.h | 42 +++++++++----- tools/perf/Documentation/perf-record.txt | 4 ++ tools/perf/Documentation/perf-stat.txt | 4 ++ 22 files changed, 329 insertions(+), 92 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 9/16 dt-bindings: mmc: tegra: Add tmclk for Tegra210 and later
From: Sowjanya Komatineni <[email protected]>
commit f7f86e8ac0ad7cd6792a80137f5a550924966916 upstream.
commit b5a84ecf025a ("mmc: tegra: Add Tegra210 support")
Tegra210 and later uses separate SDMMC_LEGACY_TM clock for data timeout.
So, this patch adds "tmclk" to Tegra sdhci clock property in the device tree binding.
--- Documentation/devicetree/bindings/mmc/nvidia,tegra20-sdhci.txt | 32 +++++++++- 1 file changed, 29 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/mmc/nvidia,tegra20-sdhci.txt +29 -3
@@ -15,8 +15,15 @@ Required properties: - "nvidia,tegra210-sdhci": for Tegra210 - "nvidia,tegra186-sdhci": for Tegra186 - "nvidia,tegra194-sdhci": for Tegra194 -- clocks : Must contain one entry, for the module clock. - See ../clocks/clock-bindings.txt for details. +- clocks: For Tegra210, Tegra186 and Tegra194 must contain two entries. + One for the module clock and one for the timeout clock. + For all other Tegra devices, must contain a single entry for + the module clock. See ../clocks/clock-bindings.txt for details. +- clock-names: For Tegra210, Tegra186 and Tegra194 must contain the + strings 'sdhci' and 'tmclk' to represent the module and + the timeout clocks, respectively. + For all other Tegra devices must contain the string 'sdhci' + to represent the module clock. - resets : Must contain an entry for each entry in reset-names. See ../reset/reset.txt for details. - reset-names : Must include the following entries:
@@ -99,7 +106,7 @@ Optional properties for Tegra210, Tegra1 Example: sdhci@700b0000 { - compatible = "nvidia,tegra210-sdhci", "nvidia,tegra124-sdhci"; + compatible = "nvidia,tegra124-sdhci"; reg = <0x0 0x700b0000 0x0 0x200>; interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>; clocks = <&tegra_car TEGRA210_CLK_SDMMC1>;
@@ -107,6 +114,25 @@ sdhci@700b0000 { resets = <&tegra_car 14>; reset-names = "sdhci"; pinctrl-names = "sdmmc-3v3", "sdmmc-1v8"; + pinctrl-0 = <&sdmmc1_3v3>; + pinctrl-1 = <&sdmmc1_1v8>; + nvidia,pad-autocal-pull-up-offset-3v3 = <0x00>; + nvidia,pad-autocal-pull-down-offset-3v3 = <0x7d>; + nvidia,pad-autocal-pull-up-offset-1v8 = <0x7b>; + nvidia,pad-autocal-pull-down-offset-1v8 = <0x7b>; + status = "disabled"; +}; + +sdhci@700b0000 { + compatible = "nvidia,tegra210-sdhci"; + reg = <0x0 0x700b0000 0x0 0x200>; + interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&tegra_car TEGRA210_CLK_SDMMC1>, + <&tegra_car TEGRA210_CLK_SDMMC_LEGACY>; + clock-names = "sdhci", "tmclk"; + resets = <&tegra_car 14>; + reset-names = "sdhci"; + pinctrl-names = "sdmmc-3v3", "sdmmc-1v8"; pinctrl-0 = <&sdmmc1_3v3>; pinctrl-1 = <&sdmmc1_1v8>; nvidia,pad-autocal-pull-up-offset-3v3 = <0x00>;
Greg Kroah-Hartman
maintainerPATCH 15/16 scsi: target: tcmu: Fix size in calls to tcmu_flush_dcache_range
In reply to Greg Kroah-HartmanFrom: Bodo Stroesser <[email protected]>
commit 8c4e0f212398cdd1eb4310a5981d06a723cdd24f upstream.
1) If remaining ring space before the end of the ring is smaller then the next cmd to write, tcmu writes a padding entry which fills the remaining space at the end of the ring.
Then tcmu calls tcmu_flush_dcache_range() with the size of struct tcmu_cmd_entry as data length to flush. If the space filled by the padding was smaller then tcmu_cmd_entry, tcmu_flush_dcache_range() is called for an address range reaching behind the end of the vmalloc'ed ring.
tcmu_flush_dcache_range() in a loop calls flush_dcache_page(virt_to_page(start)); for every page being part of the range. On x86 the line is optimized out by the compiler, as flush_dcache_page() is empty on x86.
But I assume the above can cause trouble on other architectures that really have a flush_dcache_page(). For paddings only the header part of an entry is relevant due to alignment rules the header always fits in the remaining space, if padding is needed. So tcmu_flush_dcache_range() can safely be called with sizeof(entry->hdr) as the length here.
2) After it has written a command to cmd ring, tcmu calls tcmu_flush_dcache_range() using the size of a struct tcmu_cmd_entry as data length to flush. But if a command needs many iovecs, the real size of the command may be bigger then tcmu_cmd_entry, so a part of the written command is not flushed then.
--- drivers/target/target_core_user.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/target/target_core_user.c +2 -2
@@ -1007,7 +1007,7 @@ static int queue_cmd_ring(struct tcmu_cm entry->hdr.cmd_id =0 ;/* not used for PAD */ entry->hdr.kflags =0 ; entry->hdr.uflags =0 ; -tcmu_flush_dcache_range (entry,sizeof (*entry)); +tcmu_flush_dcache_range (entry,sizeof (entry->hdr));UPDATE_HEAD (mb->cmd_head, pad_size, udev->cmdr_size);tcmu_flush_dcache_range (mb,sizeof (*mb));
@@ -1072,7 +1072,7 @@ static int queue_cmd_ring(struct tcmu_cm cdb_off =CMDR_OFF + cmd_head + base_command_size;memcpy ((void *) mb + cdb_off, se_cmd->t_task_cdb,scsi_command_size (se_cmd->t_task_cdb)); entry->req.cdb_off = cdb_off; -tcmu_flush_dcache_range (entry,sizeof (*entry)); +tcmu_flush_dcache_range (entry, command_size);UPDATE_HEAD (mb->cmd_head, command_size, udev->cmdr_size);tcmu_flush_dcache_range (mb,sizeof (*mb));
Greg Kroah-Hartman
maintainerPATCH 7/16 KVM: arm64: Survive synchronous exceptions caused by AT instructions
In reply to Greg Kroah-HartmanFrom: James Morse <[email protected]>
commit 88a84ccccb3966bcc3f309cdb76092a9892c0260 upstream.
KVM doesn't expect any synchronous exceptions when executing, any such exception leads to a panic(). AT instructions access the guest page tables, and can cause a synchronous external abort to be taken.
The arm-arm is unclear on what should happen if the guest has configured the hardware update of the access-flag, and a memory type in TCR_EL1 that does not support atomic operations. B2.2.6 "Possible implementation restrictions on using atomic instructions" from DDI0487F.a lists synchronous external abort as a possible behaviour of atomic instructions that target memory that isn't writeback cacheable, but the page table walker may behave differently.
Make KVM robust to synchronous exceptions caused by AT instructions. Add a get_user() style helper for AT instructions that returns -EFAULT if an exception was generated.
While KVM's version of the exception table mixes synchronous and asynchronous exceptions, only one of these can occur at each location.
Re-enter the guest when the AT instructions take an exception on the assumption the guest will take the same exception. This isn't guaranteed to make forward progress, as the AT instructions may always walk the page tables, but guest execution may use the translation cached in the TLB.
This isn't a problem, as since commit 5dcd0fdbb492 ("KVM: arm64: Defer guest entry when an asynchronous exception is pending"), KVM will return to the host to process IRQs allowing the rest of the system to keep running.
--- arch/arm64/include/asm/kvm_asm.h | 28 ++++++++++++++++++++++++++++ arch/arm64/kvm/hyp/hyp-entry.S | 14 ++++++++++---- arch/arm64/kvm/hyp/switch.c | 8 ++++---- 3 files changed, 42 insertions(+), 8 deletions(-)
arch/arm64/include/asm/kvm_asm.h +28 -0
@@ -88,6 +88,34 @@ extern u32 __kvm_get_mdcr_el2(void); *__hyp_this_cpu_ptr (sym); \ }) +#define __KVM_EXTABLE (from, to) \ + " .pushsection __kvm_ex_table, \"a\"\n" \ + " .align 3\n" \ + " .long (" #from " - .), (" #to " - .)\n" \ + " .popsection\n" + + +#define __kvm_at (at_op, addr) \ +( { \ + int __kvm_at_err = 0; \ + u64 spsr, elr; \ + asm volatile( \ + " mrs %1, spsr_el2\n" \ + " mrs %2, elr_el2\n" \ + "1: at "at_op", %3\n" \ + " isb\n" \ + " b 9f\n" \ + "2: msr spsr_el2, %1\n" \ + " msr elr_el2, %2\n" \ + " mov %w0, %4\n" \ + "9:\n" \ + __KVM_EXTABLE(1b, 2b) \ + : "+r" (__kvm_at_err), "=&r" (spsr), "=&r" (elr) \ + : "r" (addr), "i" (-EFAULT)); \ + __kvm_at_err; \ +} ) + +#else /* __ASSEMBLY__ */ .macro hyp_adr_this_cpu reg, sym, tmp
arch/arm64/kvm/hyp/hyp-entry.S +10 -4
@@ -166,13 +166,19 @@ el1_error: b __guest_exit el2_sync: - /* Check for illegal exception return, otherwise panic */ + /* Check for illegal exception return */ mrs x0, spsr_el2 + tbnz x0, #20, 1f - /* if this was something else, then panic! */ - tst x0, #PSR_IL_BIT - b.eq __hyp_panic + save_caller_saved_regs_vect + stp x29, x30, [sp, #-16]! + bl kvm_unexpected_el2_exception + ldp x29, x30, [sp], #16 + restore_caller_saved_regs_vect + eret + +1: /* Let's attempt a recovery from the illegal exception return */ get_vcpu_ptr x1, x0 mov x0, #ARM_EXCEPTION_IL
arch/arm64/kvm/hyp/switch.c +4 -4
@@ -261,10 +261,10 @@ static bool __hyp_text __translate_far_t* saved the guest context yet, and we may return early... */ par =read_sysreg (par_el1); - asmvolatile ("at s1e1r, %0" : :"r" (far)); -isb (); - - tmp =read_sysreg (par_el1); +if (!__kvm_at ("s1e1r" , far)) + tmp =read_sysreg (par_el1); +else + tmp =SYS_PAR_EL1_F ;/* back to the guest */ write_sysreg (par, par_el1);if (unlikely (tmp &SYS_PAR_EL1_F ))
Greg Kroah-Hartman
maintainerPATCH 8/16 KVM: arm64: Set HCR_EL2.PTW to prevent AT taking synchronous exception
In reply to Greg Kroah-HartmanFrom: James Morse <[email protected]>
commit 71a7f8cb1ca4ca7214a700b1243626759b6c11d4 upstream.
AT instructions do a translation table walk and return the result, or the fault in PAR_EL1. KVM uses these to find the IPA when the value is not provided by the CPU in HPFAR_EL1.
If a translation table walk causes an external abort it is taken as an exception, even if it was due to an AT instruction. (DDI0487F.a's D5.2.11 "Synchronous faults generated by address translation instructions")
While we previously made KVM resilient to exceptions taken due to AT instructions, the device access causes mismatched attributes, and may occur speculatively. Prevent this, by forbidding a walk through memory described as device at stage2. Now such AT instructions will report a stage2 fault.
Such a fault will cause KVM to restart the guest. If the AT instructions always walk the page tables, but guest execution uses the translation cached in the TLB, the guest can't make forward progress until the TLB entry is evicted. This isn't a problem, as since commit 5dcd0fdbb492 ("KVM: arm64:
Defer guest entry when an asynchronous exception is pending"), KVM will return to the host to process IRQs allowing the rest of the system to keep running.
--- arch/arm64/include/asm/kvm_arm.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm64/include/asm/kvm_arm.h +2 -1
@@ -72,11 +72,12 @@* IMO: Override CPSR.I and enable signaling with VI * FMO: Override CPSR.F and enable signaling with VF * SWIO: Turn set/way invalidates into set/way clean+invalidate +* PTW: Take a stage2 fault if a stage1 walk steps in device memory */ #define HCR_GUEST_FLAGS (HCR_TSC | HCR_TSW | HCR_TWE | HCR_TWI | HCR_VM | \ HCR_TVM | HCR_BSU_IS | HCR_FB | HCR_TAC | \ HCR_AMO | HCR_SWIO | HCR_TIDCP | HCR_RW | HCR_TLOR | \ - HCR_FMO | HCR_IMO) + HCR_FMO | HCR_IMO | HCR_PTW )#define HCR_VIRT_EXCP_MASK (HCR_VSE | HCR_VI | HCR_VF)#define HCR_HOST_NVHE_FLAGS (HCR_RW | HCR_API | HCR_APK)#define HCR_HOST_VHE_FLAGS (HCR_RW | HCR_TGE | HCR_E2H)
Greg Kroah-Hartman
maintainerPATCH 14/16 sdhci: tegra: Remove SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK for Tegra186
In reply to Greg Kroah-HartmanFrom: Sowjanya Komatineni <[email protected]>
commit 391d89dba8c290859a3e29430d0b9e32c358bb0d upstream.
commit 4346b7c7941d ("mmc: tegra: Add Tegra186 support")
SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK is set for Tegra186 from the beginning of its support in driver.
Tegra186 SDMMC hardware by default uses timeout clock (TMCLK) instead of SDCLK and this quirk should not be set.
So, this patch remove this quirk for Tegra186.
--- drivers/mmc/host/sdhci-tegra.c | 1 - 1 file changed, 1 deletion(-)
drivers/mmc/host/sdhci-tegra.c +0 -1
@@ -1406,7 +1406,6 @@ static const struct sdhci_ops tegra186_sstatic const struct sdhci_pltfm_data sdhci_tegra186_pdata = { .quirks =SDHCI_QUIRK_BROKEN_TIMEOUT_VAL | -SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK |SDHCI_QUIRK_SINGLE_POWER_WRITE |SDHCI_QUIRK_NO_HISPD_BIT | SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC |
Greg Kroah-Hartman
maintainerPATCH 1/16 HID: core: Correctly handle ReportSize being zero
In reply to Greg Kroah-HartmanFrom: Marc Zyngier <[email protected]>
commit bce1305c0ece3dc549663605e567655dd701752c upstream.
It appears that a ReportSize value of zero is legal, even if a bit non-sensical. Most of the HID code seems to handle that gracefully, except when computing the total size in bytes. When fed as input to memset, this leads to some funky outcomes.
Detect the corner case and correctly compute the size.
--- drivers/hid/hid-core.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-)
drivers/hid/hid-core.c +13 -2
@@ -1598,6 +1598,17 @@ static void hid_output_field(const struc }/* +* Compute the size of a report. +*/ +static size_t hid_compute_report_size (struct hid_report *report) +{ +if (report->size) +return ((report->size -1 ) >>3 ) +1 ; + +return 0 ; +} + +/* * Create a report. 'data' has to be allocated using * hid_alloc_report_buf() so that it has proper size. */
@@ -1609,7 +1620,7 @@ void hid_output_report(struct hid_reportif (report->id >0 ) *data++ = report->id; -memset (data,0 , ((report->size -1 ) >>3 ) +1 ); +memset (data,0 ,hid_compute_report_size (report));for (n =0 ; n < report->maxfield; n++)hid_output_field (report->device, report->field[n], data); }
@@ -1739,7 +1750,7 @@ int hid_report_raw_event(struct hid_devi csize--; } - rsize = ((report->size -1 ) >>3 ) +1 ; + rsize =hid_compute_report_size (report);if (report_enum->numbered && rsize >=HID_MAX_BUFFER_SIZE ) rsize =HID_MAX_BUFFER_SIZE -1 ;
Greg Kroah-Hartman
maintainerPATCH 13/16 sdhci: tegra: Remove SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK for Tegra210
In reply to Greg Kroah-HartmanFrom: Sowjanya Komatineni <[email protected]>
commit e33588adcaa925c18ee2ea253161fb0317fa2329 upstream.
commit b5a84ecf025a ("mmc: tegra: Add Tegra210 support")
SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK is set for Tegra210 from the beginning of Tegra210 support in the driver.
Tegra210 SDMMC hardware by default uses timeout clock (TMCLK) instead of SDCLK and this quirk should not be set.
So, this patch remove this quirk for Tegra210.
--- drivers/mmc/host/sdhci-tegra.c | 1 - 1 file changed, 1 deletion(-)
drivers/mmc/host/sdhci-tegra.c +0 -1
@@ -1370,7 +1370,6 @@ static const struct sdhci_ops tegra210_sstatic const struct sdhci_pltfm_data sdhci_tegra210_pdata = { .quirks =SDHCI_QUIRK_BROKEN_TIMEOUT_VAL | -SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK |SDHCI_QUIRK_SINGLE_POWER_WRITE |SDHCI_QUIRK_NO_HISPD_BIT | SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC |
Greg Kroah-Hartman
maintainerPATCH 11/16 arm64: tegra: Add missing timeout clock to Tegra186 SDMMC nodes
In reply to Greg Kroah-HartmanFrom: Sowjanya Komatineni <[email protected]>
commit baba217d2c4446b6eef309d81d8776cb5c68cb55 upstream.
commit 39cb62cb8973 ("arm64: tegra: Add Tegra186 support")
Tegra186 uses separate SDMMC_LEGACY_TM clock for data timeout and this clock is not enabled currently which is not recommended.
Tegra186 SDMMC advertises 12Mhz as timeout clock frequency in host capability register and uses it by default.
So, this clock should be kept enabled by the SDMMC driver.
--- arch/arm64/boot/dts/nvidia/tegra186.dtsi | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-)
arch/arm64/boot/dts/nvidia/tegra186.dtsi +12 -8
@@ -309,8 +309,9 @@ compatible = "nvidia,tegra186-sdhci"; reg = <0x0 0x03400000 0x0 0x10000>; interrupts = <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&bpmp TEGRA186_CLK_SDMMC1>; - clock-names = "sdhci"; + clocks = <&bpmp TEGRA186_CLK_SDMMC1>, + <&bpmp TEGRA186_CLK_SDMMC_LEGACY_TM>; + clock-names = "sdhci", "tmclk"; resets = <&bpmp TEGRA186_RESET_SDMMC1>; reset-names = "sdhci"; iommus = <&smmu TEGRA186_SID_SDMMC1>;
@@ -335,8 +336,9 @@ compatible = "nvidia,tegra186-sdhci"; reg = <0x0 0x03420000 0x0 0x10000>; interrupts = <GIC_SPI 63 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&bpmp TEGRA186_CLK_SDMMC2>; - clock-names = "sdhci"; + clocks = <&bpmp TEGRA186_CLK_SDMMC2>, + <&bpmp TEGRA186_CLK_SDMMC_LEGACY_TM>; + clock-names = "sdhci", "tmclk"; resets = <&bpmp TEGRA186_RESET_SDMMC2>; reset-names = "sdhci"; iommus = <&smmu TEGRA186_SID_SDMMC2>;
@@ -356,8 +358,9 @@ compatible = "nvidia,tegra186-sdhci"; reg = <0x0 0x03440000 0x0 0x10000>; interrupts = <GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&bpmp TEGRA186_CLK_SDMMC3>; - clock-names = "sdhci"; + clocks = <&bpmp TEGRA186_CLK_SDMMC3>, + <&bpmp TEGRA186_CLK_SDMMC_LEGACY_TM>; + clock-names = "sdhci", "tmclk"; resets = <&bpmp TEGRA186_RESET_SDMMC3>; reset-names = "sdhci"; iommus = <&smmu TEGRA186_SID_SDMMC3>;
@@ -379,8 +382,9 @@ compatible = "nvidia,tegra186-sdhci"; reg = <0x0 0x03460000 0x0 0x10000>; interrupts = <GIC_SPI 65 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&bpmp TEGRA186_CLK_SDMMC4>; - clock-names = "sdhci"; + clocks = <&bpmp TEGRA186_CLK_SDMMC4>, + <&bpmp TEGRA186_CLK_SDMMC_LEGACY_TM>; + clock-names = "sdhci", "tmclk"; assigned-clocks = <&bpmp TEGRA186_CLK_SDMMC4>, <&bpmp TEGRA186_CLK_PLLC4_VCO>; assigned-clock-parents = <&bpmp TEGRA186_CLK_PLLC4_VCO>;
Greg Kroah-Hartman
maintainerPATCH 12/16 arm64: tegra: Add missing timeout clock to Tegra210 SDMMC
In reply to Greg Kroah-HartmanFrom: Sowjanya Komatineni <[email protected]>
commit 679f71fa0db2d777f39c7a5af7f7c0689fc713fa upstream.
commit 742af7e7a0a1 ("arm64: tegra: Add Tegra210 support")
Tegra210 uses separate SDMMC_LEGACY_TM clock for data timeout and this clock is not enabled currently which is not recommended.
Tegra SDMMC advertises 12Mhz as timeout clock frequency in host capability register.
So, this clock should be kept enabled by SDMMC driver.
--- arch/arm64/boot/dts/nvidia/tegra210.dtsi | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-)
arch/arm64/boot/dts/nvidia/tegra210.dtsi +12 -8
@@ -1116,8 +1116,9 @@ compatible = "nvidia,tegra210-sdhci", "nvidia,tegra124-sdhci"; reg = <0x0 0x700b0000 0x0 0x200>; interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&tegra_car TEGRA210_CLK_SDMMC1>; - clock-names = "sdhci"; + clocks = <&tegra_car TEGRA210_CLK_SDMMC1>, + <&tegra_car TEGRA210_CLK_SDMMC_LEGACY>; + clock-names = "sdhci", "tmclk"; resets = <&tegra_car 14>; reset-names = "sdhci"; pinctrl-names = "sdmmc-3v3", "sdmmc-1v8",
@@ -1144,8 +1145,9 @@ compatible = "nvidia,tegra210-sdhci", "nvidia,tegra124-sdhci"; reg = <0x0 0x700b0200 0x0 0x200>; interrupts = <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&tegra_car TEGRA210_CLK_SDMMC2>; - clock-names = "sdhci"; + clocks = <&tegra_car TEGRA210_CLK_SDMMC2>, + <&tegra_car TEGRA210_CLK_SDMMC_LEGACY>; + clock-names = "sdhci", "tmclk"; resets = <&tegra_car 9>; reset-names = "sdhci"; pinctrl-names = "sdmmc-1v8-drv";
@@ -1161,8 +1163,9 @@ compatible = "nvidia,tegra210-sdhci", "nvidia,tegra124-sdhci"; reg = <0x0 0x700b0400 0x0 0x200>; interrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&tegra_car TEGRA210_CLK_SDMMC3>; - clock-names = "sdhci"; + clocks = <&tegra_car TEGRA210_CLK_SDMMC3>, + <&tegra_car TEGRA210_CLK_SDMMC_LEGACY>; + clock-names = "sdhci", "tmclk"; resets = <&tegra_car 69>; reset-names = "sdhci"; pinctrl-names = "sdmmc-3v3", "sdmmc-1v8",
@@ -1184,8 +1187,9 @@ compatible = "nvidia,tegra210-sdhci", "nvidia,tegra124-sdhci"; reg = <0x0 0x700b0600 0x0 0x200>; interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&tegra_car TEGRA210_CLK_SDMMC4>; - clock-names = "sdhci"; + clocks = <&tegra_car TEGRA210_CLK_SDMMC4>, + <&tegra_car TEGRA210_CLK_SDMMC_LEGACY>; + clock-names = "sdhci", "tmclk"; resets = <&tegra_car 15>; reset-names = "sdhci"; pinctrl-names = "sdmmc-3v3-drv", "sdmmc-1v8-drv";
Greg Kroah-Hartman
maintainerPATCH 6/16 KVM: arm64: Add kvm_extable for vaxorcism code
In reply to Greg Kroah-HartmanFrom: James Morse <[email protected]>
commit e9ee186bb735bfc17fa81dbc9aebf268aee5b41e upstream.
KVM has a one instruction window where it will allow an SError exception to be consumed by the hypervisor without treating it as a hypervisor bug. This is used to consume asynchronous external abort that were caused by the guest.
As we are about to add another location that survives unexpected exceptions, generalise this code to make it behave like the host's extable.
KVM's version has to be mapped to EL2 to be accessible on nVHE systems.
The SError vaxorcism code is a one instruction window, so has two entries in the extable. Because the KVM code is copied for VHE and nVHE, we end up with four entries, half of which correspond with code that isn't mapped.
--- arch/arm64/include/asm/kvm_asm.h | 15 +++++++++++ arch/arm64/kernel/vmlinux.lds.S | 8 ++++++ arch/arm64/kvm/hyp/entry.S | 15 ++++++----- arch/arm64/kvm/hyp/hyp-entry.S | 51 +++++++++++++++++++++++---------------- arch/arm64/kvm/hyp/switch.c | 31 +++++++++++++++++++++++ 5 files changed, 94 insertions(+), 26 deletions(-)
arch/arm64/include/asm/kvm_asm.h +15 -0
@@ -113,6 +113,21 @@ extern u32 __kvm_get_mdcr_el2(void); kern_hyp_va \vcpu .endm +/* + * KVM extable for unexpected exceptions. + * In the same format _asm_extable, but output to a different section so that + * it can be mapped to EL2. The KVM version is not sorted. The caller must + * ensure: + * x18 has the hypervisor value to allow any Shadow-Call-Stack instrumented + * code to write to it, and that SPSR_EL2 and ELR_EL2 are restored by the fixup. + */ +.macro _kvm_extable, from, to + .pushsection __kvm_ex_table, "a" + .align 3 + .long (\from - .), (\to - .) + .popsection +.endm + #endif #endif /* __ARM_KVM_ASM_H__ */
arch/arm64/kernel/vmlinux.lds.S +8 -0
@@ -24,6 +24,13 @@ ENTRY(_text) jiffies = jiffies_64; + +#define HYPERVISOR_EXTABLE \ + . = ALIGN(SZ_8); \ + __start___kvm_ex_table = .; \ + *(__kvm_ex_table) \ + __stop___kvm_ex_table = .; + #define HYPERVISOR_TEXT \ /* \ * Align to 4 KB so that \
@@ -39,6 +46,7 @@ jiffies = jiffies_64; __hyp_idmap_text_end = .; \ __hyp_text_start = .; \ *(.hyp.text) \ + HYPERVISOR_EXTABLE \ __hyp_text_end = .; #define IDMAP_TEXT \
arch/arm64/kvm/hyp/entry.S +9 -6
@@ -173,20 +173,23 @@ alternative_endif // This is our single instruction exception window. A pending // SError is guaranteed to occur at the earliest when we unmask // it, and at the latest just after the ISB. - .global abort_guest_exit_start abort_guest_exit_start: isb - .global abort_guest_exit_end abort_guest_exit_end: msr daifset, #4 // Mask aborts + ret - // If the exception took place, restore the EL1 exception - // context so that we can report some information. - // Merge the exception code with the SError pending bit. - tbz x0, #ARM_EXIT_WITH_SERROR_BIT, 1f + _kvm_extable abort_guest_exit_start, 9997f + _kvm_extable abort_guest_exit_end, 9997f +9997: + msr daifset, #4 // Mask aborts + mov x0, #(1 << ARM_EXIT_WITH_SERROR_BIT) + + // restore the EL1 exception context so that we can report some + // information. Merge the exception code with the SError pending bit. msr elr_el2, x2 msr esr_el2, x3 msr spsr_el2, x4
arch/arm64/kvm/hyp/hyp-entry.S +31 -20
64 lines not on this page · raw message
arch/arm64/kvm/hyp/switch.c +31 -0
@@ -14,6 +14,7 @@#include <asm/arch_gicv3.h> #include <asm/cpufeature.h> +#include <asm/extable.h> #include <asm/kprobes.h> #include <asm/kvm_asm.h> #include <asm/kvm_emulate.h>
@@ -25,6 +26,9 @@#include <asm/processor.h> #include <asm/thread_info.h> +extern struct exception_table_entry __start___kvm_ex_table; +extern struct exception_table_entry __stop___kvm_ex_table; +/* Check whether the FP regs were dirtied while in the host-side run loop: */ static bool __hyp_text update_fp_enabled(struct kvm_vcpu *vcpu) {
@@ -791,3 +795,30 @@ void __hyp_text __noreturn hyp_panic(strunreachable (); } + +asmlinkage void __hyp_text kvm_unexpected_el2_exception(void) +{ +unsigned long addr, fixup; +struct kvm_cpu_context *host_ctxt; +struct exception_table_entry *entry, *end; +unsigned long elr_el2 =read_sysreg (elr_el2); + + entry =hyp_symbol_addr (__start___kvm_ex_table); + end =hyp_symbol_addr (__stop___kvm_ex_table); + host_ctxt = &__hyp_this_cpu_ptr (kvm_host_data)->host_ctxt; + +while (entry < end) { + addr = (unsigned long )&entry->insn + entry->insn; + fixup = (unsigned long )&entry->fixup + entry->fixup; + +if (addr != elr_el2) { + entry++; +continue ; + } + +write_sysreg (fixup, elr_el2); +return ; + } + +hyp_panic (host_ctxt); +}
Greg Kroah-Hartman
maintainerPATCH 10/16 arm64: tegra: Add missing timeout clock to Tegra194 SDMMC nodes
In reply to Greg Kroah-HartmanFrom: Sowjanya Komatineni <[email protected]>
commit c956c0cd4f6f4aac4f095621b1c4e1c5ee1df877 upstream.
commit 5425fb15d8ee ("arm64: tegra: Add Tegra194 chip device tree")
Tegra194 uses separate SDMMC_LEGACY_TM clock for data timeout and this clock is not enabled currently which is not recommended.
Tegra194 SDMMC advertises 12Mhz as timeout clock frequency in host capability register.
So, this clock should be kept enabled by SDMMC driver.
--- arch/arm64/boot/dts/nvidia/tegra194.dtsi | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)
arch/arm64/boot/dts/nvidia/tegra194.dtsi +9 -6
@@ -403,8 +403,9 @@ compatible = "nvidia,tegra194-sdhci", "nvidia,tegra186-sdhci"; reg = <0x03400000 0x10000>; interrupts = <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&bpmp TEGRA194_CLK_SDMMC1>; - clock-names = "sdhci"; + clocks = <&bpmp TEGRA194_CLK_SDMMC1>, + <&bpmp TEGRA194_CLK_SDMMC_LEGACY_TM>; + clock-names = "sdhci", "tmclk"; resets = <&bpmp TEGRA194_RESET_SDMMC1>; reset-names = "sdhci"; nvidia,pad-autocal-pull-up-offset-3v3-timeout =
@@ -425,8 +426,9 @@ compatible = "nvidia,tegra194-sdhci", "nvidia,tegra186-sdhci"; reg = <0x03440000 0x10000>; interrupts = <GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&bpmp TEGRA194_CLK_SDMMC3>; - clock-names = "sdhci"; + clocks = <&bpmp TEGRA194_CLK_SDMMC3>, + <&bpmp TEGRA194_CLK_SDMMC_LEGACY_TM>; + clock-names = "sdhci", "tmclk"; resets = <&bpmp TEGRA194_RESET_SDMMC3>; reset-names = "sdhci"; nvidia,pad-autocal-pull-up-offset-1v8 = <0x00>;
@@ -448,8 +450,9 @@ compatible = "nvidia,tegra194-sdhci", "nvidia,tegra186-sdhci"; reg = <0x03460000 0x10000>; interrupts = <GIC_SPI 65 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&bpmp TEGRA194_CLK_SDMMC4>; - clock-names = "sdhci"; + clocks = <&bpmp TEGRA194_CLK_SDMMC4>, + <&bpmp TEGRA194_CLK_SDMMC_LEGACY_TM>; + clock-names = "sdhci", "tmclk"; assigned-clocks = <&bpmp TEGRA194_CLK_SDMMC4>, <&bpmp TEGRA194_CLK_PLLC4>; assigned-clock-parents =
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.4.63 release. There are 16 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun, 06 Sep 2020 12:02:48 +0000. Anything received after that time might be too late.
Build results:
total: 157 pass: 157 fail: 0 Qemu test results: total: 430 pass: 430 fail: 0
Guenter
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.4.63 release. There are 16 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun, 06 Sep 2020 12:02:48 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.4.63-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.4.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
thanks,
-- Shuah
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.4.63 release. There are 16 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun, 06 Sep 2020 12:02:48 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.4.63-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.4.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
thanks,
-- Shuah
Quoted 4 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.4.63 release. There are 16 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Sorry for the delay - we are short handed this weekend and I got confused looking at results yesterday and thought we had a systems problem. In fact, the problem was that tags/releases weren't pushed to stable-rc which split-brains our results and I just forgot about that possibility. Is it possible on your side to automate updating the stable-rc repo when you publish a stable release?
Results from Linaro’s test farm.
No regressions on arm64, arm, x86_64, and i386.
Summary
------------------------------------------------------------------------
kernel: 5.4.63-rc1
git repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
git branch: linux-5.4.y
git commit: ef2051e79e05700a5c8814fe4d5b7a8a93503251
git describe: v5.4.61-231-gef2051e79e05
Test details: https://qa-reports.linaro.org/lkft/linux-stable-rc-5.4-oe/build/v5.4.61-231-gef2051e79e05
No regressions (compared to build v5.4.61)
No fixes (compared to build v5.4.61)
Ran 34712 total tests in the following environments and test suites.
Environments
--------------
- dragonboard-410c
- hi6220-hikey
- i386
- juno-r2
- juno-r2-compat
- juno-r2-kasan
- nxp-ls2088
- qemu_arm
- qemu_arm64
- qemu_i386
- qemu_x86_64
- x15
- x86
- x86-kasan
Test Suites
-----------
* libhugetlbfs
* linux-log-parser
* ltp-commands-tests
* ltp-containers-tests
* ltp-controllers-tests
* ltp-cve-tests
* ltp-dio-tests
* ltp-fs-tests
* ltp-hugetlb-tests
* ltp-io-tests
* ltp-math-tests
* ltp-nptl-tests
* ltp-pty-tests
* ltp-securebits-tests
* ltp-syscalls-tests
* v4l2-compliance
* ltp-fcntl-locktests-tests
* ltp-filecaps-tests
* ltp-fs_bind-tests
* ltp-fs_perms_simple-tests
* ltp-fsx-tests
* ltp-sched-tests
* ltp-cap_bounds-tests
* ltp-cpuhotplug-tests
* ltp-crypto-tests
* ltp-ipc-tests
* ltp-mm-tests
* ltp-open-posix-tests
* ltp-tracing-tests
* network-basic-tests
* igt-gpu-tools
--
Linaro LKFT
https://lkft.linaro.org
Greg Kroah-Hartman
maintainerQuoted 6 lines · Dan Rue
Quoted 4 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.4.63 release. There are 16 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Quoted 6 lines
Sorry for the delay - we are short handed this weekend and I got confused looking at results yesterday and thought we had a systems problem. In fact, the problem was that tags/releases weren't pushed to stable-rc which split-brains our results and I just forgot about that possibility. Is it possible on your side to automate updating the stable-rc repo when you publish a stable release?
Yes, I need to do that, sorry. Will work on that this week...
Quoted 4 lines
Results from Linaro’s test farm.
No regressions on arm64, arm,x86_64, and i386.
THanks for testing both of these, and sorry it crossed a weekend.
greg k-h