The effects of impurity, safety factor ( ${q}$ ), and magnetic shear ( $\hat {s}$ ) on kinetic ballooning mode (KBM) in tokamak plasmas, with positive impurity density gradient (for which ${L}_{ez}\equiv {L}_{ne} / {L}_{nz} < 0$ holds, with ${L}_{ne(z)}=-({{d\text {ln}}{n}_{e(z)}} / {dr})^{-1}$ , and here, the electron and ion density gradients being negative are assumed), are numerically studied by means of gyrokinetic simulation, where the concise and efficient gyrokinetic model for KBM, including impurity effect, is employed. The KBM instability with the representative parameter of $0 < \beta ({2}/{3}){\varepsilon }$ ( $\beta \equiv $ the ratio of plasma thermal to magnetic pressures and ${\varepsilon }= {a} / {R}$ with ${a}$ and ${R}$ the minor and major radii of the plasma torus, respectively) is focused on, for which the magnetic compression effect is unnecessary to be considered. The impurity effect on KBM that is always stabilizing for the case ${L}_{ez}>0$ is confirmed first, and then, it is revealed that for the case ${L}_{ez} < 0$ , the dependences of mode growth rate on ion temperature gradient (ITG) ( ${\eta }_{i}$ ) and on impurity charge concentration in high ${q}$ case are opposite to those in low ${q}$ case, owing to the different effects of impurities on KBMs in different regions of safety factor. The mode structure width is varied due to ${q}$ and $\hat {s}$ or the presence of impurities. The most unstable perturbation in ${\beta }$ space has a wider wavenumber spectrum with residual instability. The dependence of the mode growth rate on $\hat {s}$ and ${q}$ is not monotonic. The turning points of $\hat {s}$ and ${q}$ satisfy $\hat {s}_{c}\approx q/2$ and ${q}_{c}\approx 2\hat {s}$ , respectively, while ${\beta }_{e}$ value and impurity ion species, especially with ${L}_{ez} < 0$ , significantly modify the relationships. The reasonability of applying the simplified model to this work and the application prospects of this research are also discussed.