[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202007091628.UzzEfrjS%lkp@intel.com>
Date: Thu, 9 Jul 2020 16:56:31 +0800
From: kernel test robot <lkp@...el.com>
To: Huacai Chen <chenhc@...ote.com>
Cc: kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
Paolo Bonzini <pbonzini@...hat.com>,
Aleksandar Markovic <aleksandar.qemu.devel@...il.com>
Subject: arch/mips/kvm/emulate.c:1734:28: warning: right shift count >= width
of type
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 0bddd227f3dc55975e2b8dfa7fc6f959b062a2c7
commit: dc6d95b153e78ed70b1b2c04aadffb76bcd2b3ec KVM: MIPS: Add more MMIO load/store instructions emulation
date: 5 weeks ago
config: mips-randconfig-r031-20200709 (attached as .config)
compiler: mipsel-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout dc6d95b153e78ed70b1b2c04aadffb76bcd2b3ec
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=mips
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>
All warnings (new ones prefixed by >>):
arch/mips/kvm/emulate.c:946:23: warning: no previous prototype for 'kvm_mips_emul_eret' [-Wmissing-prototypes]
946 | enum emulation_result kvm_mips_emul_eret(struct kvm_vcpu *vcpu)
| ^~~~~~~~~~~~~~~~~~
arch/mips/kvm/emulate.c:1029:23: warning: no previous prototype for 'kvm_mips_emul_tlbr' [-Wmissing-prototypes]
1029 | enum emulation_result kvm_mips_emul_tlbr(struct kvm_vcpu *vcpu)
| ^~~~~~~~~~~~~~~~~~
arch/mips/kvm/emulate.c:1102:23: warning: no previous prototype for 'kvm_mips_emul_tlbwi' [-Wmissing-prototypes]
1102 | enum emulation_result kvm_mips_emul_tlbwi(struct kvm_vcpu *vcpu)
| ^~~~~~~~~~~~~~~~~~~
arch/mips/kvm/emulate.c:1138:23: warning: no previous prototype for 'kvm_mips_emul_tlbwr' [-Wmissing-prototypes]
1138 | enum emulation_result kvm_mips_emul_tlbwr(struct kvm_vcpu *vcpu)
| ^~~~~~~~~~~~~~~~~~~
arch/mips/kvm/emulate.c:1163:23: warning: no previous prototype for 'kvm_mips_emul_tlbp' [-Wmissing-prototypes]
1163 | enum emulation_result kvm_mips_emul_tlbp(struct kvm_vcpu *vcpu)
| ^~~~~~~~~~~~~~~~~~
arch/mips/kvm/emulate.c: In function 'kvm_mips_emulate_store':
>> arch/mips/kvm/emulate.c:1734:28: warning: right shift count >= width of type [-Wshift-count-overflow]
1734 | ((vcpu->arch.gprs[rt] >> 56) & 0xff);
| ^~
arch/mips/kvm/emulate.c:1738:28: warning: right shift count >= width of type [-Wshift-count-overflow]
1738 | ((vcpu->arch.gprs[rt] >> 48) & 0xffff);
| ^~
arch/mips/kvm/emulate.c:1742:28: warning: right shift count >= width of type [-Wshift-count-overflow]
1742 | ((vcpu->arch.gprs[rt] >> 40) & 0xffffff);
| ^~
arch/mips/kvm/emulate.c:1746:28: warning: right shift count >= width of type [-Wshift-count-overflow]
1746 | ((vcpu->arch.gprs[rt] >> 32) & 0xffffffff);
| ^~
>> arch/mips/kvm/emulate.c:1796:27: warning: left shift count >= width of type [-Wshift-count-overflow]
1796 | (vcpu->arch.gprs[rt] << 32);
| ^~
arch/mips/kvm/emulate.c:1800:27: warning: left shift count >= width of type [-Wshift-count-overflow]
1800 | (vcpu->arch.gprs[rt] << 40);
| ^~
arch/mips/kvm/emulate.c:1804:27: warning: left shift count >= width of type [-Wshift-count-overflow]
1804 | (vcpu->arch.gprs[rt] << 48);
| ^~
arch/mips/kvm/emulate.c:1808:27: warning: left shift count >= width of type [-Wshift-count-overflow]
1808 | (vcpu->arch.gprs[rt] << 56);
| ^~
vim +1734 arch/mips/kvm/emulate.c
1637
1638 case sw_op:
1639 run->mmio.len = 4;
1640 *(u32 *)data = vcpu->arch.gprs[rt];
1641
1642 kvm_debug("[%#lx] OP_SW: eaddr: %#lx, gpr: %#lx, data: %#x\n",
1643 vcpu->arch.pc, vcpu->arch.host_cp0_badvaddr,
1644 vcpu->arch.gprs[rt], *(u32 *)data);
1645 break;
1646
1647 case sh_op:
1648 run->mmio.len = 2;
1649 *(u16 *)data = vcpu->arch.gprs[rt];
1650
1651 kvm_debug("[%#lx] OP_SH: eaddr: %#lx, gpr: %#lx, data: %#x\n",
1652 vcpu->arch.pc, vcpu->arch.host_cp0_badvaddr,
1653 vcpu->arch.gprs[rt], *(u16 *)data);
1654 break;
1655
1656 case sb_op:
1657 run->mmio.len = 1;
1658 *(u8 *)data = vcpu->arch.gprs[rt];
1659
1660 kvm_debug("[%#lx] OP_SB: eaddr: %#lx, gpr: %#lx, data: %#x\n",
1661 vcpu->arch.pc, vcpu->arch.host_cp0_badvaddr,
1662 vcpu->arch.gprs[rt], *(u8 *)data);
1663 break;
1664
1665 case swl_op:
1666 run->mmio.phys_addr = kvm_mips_callbacks->gva_to_gpa(
1667 vcpu->arch.host_cp0_badvaddr) & (~0x3);
1668 run->mmio.len = 4;
1669 imme = vcpu->arch.host_cp0_badvaddr & 0x3;
1670 switch (imme) {
1671 case 0:
1672 *(u32 *)data = ((*(u32 *)data) & 0xffffff00) |
1673 (vcpu->arch.gprs[rt] >> 24);
1674 break;
1675 case 1:
1676 *(u32 *)data = ((*(u32 *)data) & 0xffff0000) |
1677 (vcpu->arch.gprs[rt] >> 16);
1678 break;
1679 case 2:
1680 *(u32 *)data = ((*(u32 *)data) & 0xff000000) |
1681 (vcpu->arch.gprs[rt] >> 8);
1682 break;
1683 case 3:
1684 *(u32 *)data = vcpu->arch.gprs[rt];
1685 break;
1686 default:
1687 break;
1688 }
1689
1690 kvm_debug("[%#lx] OP_SWL: eaddr: %#lx, gpr: %#lx, data: %#x\n",
1691 vcpu->arch.pc, vcpu->arch.host_cp0_badvaddr,
1692 vcpu->arch.gprs[rt], *(u32 *)data);
1693 break;
1694
1695 case swr_op:
1696 run->mmio.phys_addr = kvm_mips_callbacks->gva_to_gpa(
1697 vcpu->arch.host_cp0_badvaddr) & (~0x3);
1698 run->mmio.len = 4;
1699 imme = vcpu->arch.host_cp0_badvaddr & 0x3;
1700 switch (imme) {
1701 case 0:
1702 *(u32 *)data = vcpu->arch.gprs[rt];
1703 break;
1704 case 1:
1705 *(u32 *)data = ((*(u32 *)data) & 0xff) |
1706 (vcpu->arch.gprs[rt] << 8);
1707 break;
1708 case 2:
1709 *(u32 *)data = ((*(u32 *)data) & 0xffff) |
1710 (vcpu->arch.gprs[rt] << 16);
1711 break;
1712 case 3:
1713 *(u32 *)data = ((*(u32 *)data) & 0xffffff) |
1714 (vcpu->arch.gprs[rt] << 24);
1715 break;
1716 default:
1717 break;
1718 }
1719
1720 kvm_debug("[%#lx] OP_SWR: eaddr: %#lx, gpr: %#lx, data: %#x\n",
1721 vcpu->arch.pc, vcpu->arch.host_cp0_badvaddr,
1722 vcpu->arch.gprs[rt], *(u32 *)data);
1723 break;
1724
1725 case sdl_op:
1726 run->mmio.phys_addr = kvm_mips_callbacks->gva_to_gpa(
1727 vcpu->arch.host_cp0_badvaddr) & (~0x7);
1728
1729 run->mmio.len = 8;
1730 imme = vcpu->arch.host_cp0_badvaddr & 0x7;
1731 switch (imme) {
1732 case 0:
1733 *(u64 *)data = ((*(u64 *)data) & 0xffffffffffffff00) |
> 1734 ((vcpu->arch.gprs[rt] >> 56) & 0xff);
1735 break;
1736 case 1:
1737 *(u64 *)data = ((*(u64 *)data) & 0xffffffffffff0000) |
> 1738 ((vcpu->arch.gprs[rt] >> 48) & 0xffff);
1739 break;
1740 case 2:
1741 *(u64 *)data = ((*(u64 *)data) & 0xffffffffff000000) |
1742 ((vcpu->arch.gprs[rt] >> 40) & 0xffffff);
1743 break;
1744 case 3:
1745 *(u64 *)data = ((*(u64 *)data) & 0xffffffff00000000) |
1746 ((vcpu->arch.gprs[rt] >> 32) & 0xffffffff);
1747 break;
1748 case 4:
1749 *(u64 *)data = ((*(u64 *)data) & 0xffffff0000000000) |
1750 ((vcpu->arch.gprs[rt] >> 24) & 0xffffffffff);
1751 break;
1752 case 5:
1753 *(u64 *)data = ((*(u64 *)data) & 0xffff000000000000) |
1754 ((vcpu->arch.gprs[rt] >> 16) & 0xffffffffffff);
1755 break;
1756 case 6:
1757 *(u64 *)data = ((*(u64 *)data) & 0xff00000000000000) |
1758 ((vcpu->arch.gprs[rt] >> 8) & 0xffffffffffffff);
1759 break;
1760 case 7:
1761 *(u64 *)data = vcpu->arch.gprs[rt];
1762 break;
1763 default:
1764 break;
1765 }
1766
1767 kvm_debug("[%#lx] OP_SDL: eaddr: %#lx, gpr: %#lx, data: %llx\n",
1768 vcpu->arch.pc, vcpu->arch.host_cp0_badvaddr,
1769 vcpu->arch.gprs[rt], *(u64 *)data);
1770 break;
1771
1772 case sdr_op:
1773 run->mmio.phys_addr = kvm_mips_callbacks->gva_to_gpa(
1774 vcpu->arch.host_cp0_badvaddr) & (~0x7);
1775
1776 run->mmio.len = 8;
1777 imme = vcpu->arch.host_cp0_badvaddr & 0x7;
1778 switch (imme) {
1779 case 0:
1780 *(u64 *)data = vcpu->arch.gprs[rt];
1781 break;
1782 case 1:
1783 *(u64 *)data = ((*(u64 *)data) & 0xff) |
1784 (vcpu->arch.gprs[rt] << 8);
1785 break;
1786 case 2:
1787 *(u64 *)data = ((*(u64 *)data) & 0xffff) |
1788 (vcpu->arch.gprs[rt] << 16);
1789 break;
1790 case 3:
1791 *(u64 *)data = ((*(u64 *)data) & 0xffffff) |
1792 (vcpu->arch.gprs[rt] << 24);
1793 break;
1794 case 4:
1795 *(u64 *)data = ((*(u64 *)data) & 0xffffffff) |
> 1796 (vcpu->arch.gprs[rt] << 32);
1797 break;
1798 case 5:
1799 *(u64 *)data = ((*(u64 *)data) & 0xffffffffff) |
1800 (vcpu->arch.gprs[rt] << 40);
1801 break;
1802 case 6:
1803 *(u64 *)data = ((*(u64 *)data) & 0xffffffffffff) |
1804 (vcpu->arch.gprs[rt] << 48);
1805 break;
1806 case 7:
1807 *(u64 *)data = ((*(u64 *)data) & 0xffffffffffffff) |
1808 (vcpu->arch.gprs[rt] << 56);
1809 break;
1810 default:
1811 break;
1812 }
1813
1814 kvm_debug("[%#lx] OP_SDR: eaddr: %#lx, gpr: %#lx, data: %llx\n",
1815 vcpu->arch.pc, vcpu->arch.host_cp0_badvaddr,
1816 vcpu->arch.gprs[rt], *(u64 *)data);
1817 break;
1818
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Download attachment ".config.gz" of type "application/gzip" (24752 bytes)
Powered by blists - more mailing lists