# git rev-parse -q --verify 1ccd25030612c37a86f574e71c4f5b0ac246c183^{commit} 1ccd25030612c37a86f574e71c4f5b0ac246c183 already have revision, skipping fetch # git checkout -q -f -B kisskb 1ccd25030612c37a86f574e71c4f5b0ac246c183 # git clean -qxdf # < git log -1 # commit 1ccd25030612c37a86f574e71c4f5b0ac246c183 # Author: Nicholas Piggin # Date: Wed Aug 15 00:10:22 2018 +1000 # # powerpc/64s/hash: convert SLB miss handlers to C # # This patch moves SLB miss handlers completely to C, using the standard # exception handler macros to set up the stack and branch to C. # # This can be done because the segment containing the kernel stack is # always bolted, so accessing it with relocation on will not cause an # SLB exception. # # Arbitrary kernel memory may not be accessed when handling kernel space # SLB misses, so care should be taken there. However user SLB misses can # access any kernel memory, which can be used to move some fields out of # the paca (in later patches). # # User SLB misses could quite easily reconcile IRQs and set up a first # class kernel environment and exit via ret_from_except, however that # doesn't seem to be necessary at the moment, so we only do that if a # bad fault is encountered. # # [ Credit to Aneesh for bug fixes, error checks, and improvements to bad # address handling, etc ] # # Signed-off-by: Nicholas Piggin # # Since RFC: # - Added MSR[RI] handling # - Fixed up a register loss bug exposed by irq tracing (Aneesh) # - Reject misses outside the defined kernel regions (Aneesh) # - Added several more sanity checks and error handling (Aneesh), we may # look at consolidating these tests and tightenig up the code but for # a first pass we decided it's better to check carefully. # # Since v1: # - Fixed SLB cache corruption (Aneesh) # - Fixed untidy SLBE allocation "leak" in get_vsid error case # - Now survives some stress testing on real hardware # < /opt/cross/kisskb/korg/gcc-8.1.0-nolibc/aarch64-linux/bin/aarch64-linux-gcc --version # < git log --format=%s --max-count=1 1ccd25030612c37a86f574e71c4f5b0ac246c183 # < make -s -j 10 ARCH=arm64 O=/kisskb/build/npiggin_arm64-defconfig_arm64-gcc8 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.1.0-nolibc/aarch64-linux/bin/aarch64-linux- defconfig # make -s -j 10 ARCH=arm64 O=/kisskb/build/npiggin_arm64-defconfig_arm64-gcc8 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.1.0-nolibc/aarch64-linux/bin/aarch64-linux- /kisskb/src/fs/ext4/super.c: In function '__save_error_info.isra.8': /kisskb/src/fs/ext4/super.c:344:2: warning: 'strncpy' specified bound 32 equals destination size [-Wstringop-truncation] strncpy(es->s_last_error_func, func, sizeof(es->s_last_error_func)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /kisskb/src/fs/ext4/super.c:349:3: warning: 'strncpy' specified bound 32 equals destination size [-Wstringop-truncation] strncpy(es->s_first_error_func, func, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sizeof(es->s_first_error_func)); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In function 'devfreq_add_device.part.7', inlined from 'devfreq_add_device': /kisskb/src/drivers/devfreq/devfreq.c:593:2: warning: 'strncpy' specified bound 16 equals destination size [-Wstringop-truncation] strncpy(devfreq->governor_name, governor_name, DEVFREQ_NAME_LEN); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /kisskb/src/drivers/gpu/drm/nouveau/nvif/client.c: In function 'nvif_client_init': /kisskb/src/drivers/gpu/drm/nouveau/nvif/client.c:72:2: warning: 'strncpy' specified bound 32 equals destination size [-Wstringop-truncation] strncpy(args.name, name, sizeof(args.name)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /kisskb/src/drivers/gpu/drm/msm/msm_fence.c: In function 'msm_fence_context_alloc': /kisskb/src/drivers/gpu/drm/msm/msm_fence.c:34:2: warning: 'strncpy' specified bound 32 equals destination size [-Wstringop-truncation] strncpy(fctx->name, name, sizeof(fctx->name)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In function 'nvme_init_subnqn.isra.19', inlined from 'nvme_init_subsystem' at /kisskb/src/drivers/nvme/host/core.c:2225:2, inlined from 'nvme_init_identify' at /kisskb/src/drivers/nvme/host/core.c:2372:9: /kisskb/src/drivers/nvme/host/core.c:2079:3: warning: 'strncpy' output may be truncated copying 223 bytes from a string of length 255 [-Wstringop-truncation] strncpy(subsys->subnqn, id->subnqn, NVMF_NQN_SIZE); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In function 'brcmf_vndr_ie', inlined from 'brcmf_vif_set_mgmt_ie' at /kisskb/src/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c:4278:25: /kisskb/src/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c:4167:2: warning: 'strncpy' output truncated before terminating nul copying 3 bytes from a string of the same length [-Wstringop-truncation] strncpy(iebuf, add_del_cmd, VNDR_IE_CMD_LEN - 1); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In function 'brcmf_vndr_ie', inlined from 'brcmf_vif_set_mgmt_ie' at /kisskb/src/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c:4315:25: /kisskb/src/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c:4167:2: warning: 'strncpy' output truncated before terminating nul copying 3 bytes from a string of the same length [-Wstringop-truncation] strncpy(iebuf, add_del_cmd, VNDR_IE_CMD_LEN - 1); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In function 'qcom_glink_rx_close', inlined from 'qcom_glink_work' at /kisskb/src/drivers/rpmsg/qcom_glink_native.c:1533:4: /kisskb/src/drivers/rpmsg/qcom_glink_native.c:1459:3: warning: 'strncpy' specified bound 32 equals destination size [-Wstringop-truncation] strncpy(chinfo.name, channel->name, sizeof(chinfo.name)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In function 'qcom_glink_rx_open', inlined from 'qcom_glink_work' at /kisskb/src/drivers/rpmsg/qcom_glink_native.c:1530:4: /kisskb/src/drivers/rpmsg/qcom_glink_native.c:1409:3: warning: 'strncpy' specified bound 32 equals destination size [-Wstringop-truncation] strncpy(rpdev->id.name, name, RPMSG_NAME_SIZE); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In function 'qcom_smd_create_device.isra.2', inlined from 'qcom_channel_state_worker' at /kisskb/src/drivers/rpmsg/qcom_smd.c:1281:3: /kisskb/src/drivers/rpmsg/qcom_smd.c:1076:2: warning: 'strncpy' specified bound 32 equals destination size [-Wstringop-truncation] strncpy(rpdev->id.name, channel->name, RPMSG_NAME_SIZE); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /kisskb/src/drivers/rpmsg/qcom_smd.c: In function 'qcom_channel_state_worker': /kisskb/src/drivers/rpmsg/qcom_smd.c:1304:3: warning: 'strncpy' specified bound 32 equals destination size [-Wstringop-truncation] strncpy(chinfo.name, channel->name, sizeof(chinfo.name)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In function 'nvkm_udevice_info', inlined from 'nvkm_udevice_mthd' at /kisskb/src/drivers/gpu/drm/nouveau/nvkm/engine/device/user.c:223:10: /kisskb/src/drivers/gpu/drm/nouveau/nvkm/engine/device/user.c:192:2: warning: 'strncpy' specified bound 16 equals destination size [-Wstringop-truncation] strncpy(args->v0.chip, device->chip->name, sizeof(args->v0.chip)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /kisskb/src/drivers/video/hdmi.c: In function 'hdmi_spd_infoframe_init': /kisskb/src/drivers/video/hdmi.c:174:2: warning: 'strncpy' specified bound 8 equals destination size [-Wstringop-truncation] strncpy(frame->vendor, vendor, sizeof(frame->vendor)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /kisskb/src/drivers/video/hdmi.c:175:2: warning: 'strncpy' specified bound 16 equals destination size [-Wstringop-truncation] strncpy(frame->product, product, sizeof(frame->product)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Completed OK # rm -rf /kisskb/build/npiggin_arm64-defconfig_arm64-gcc8 # Build took: 0:05:24.344563