target-i386: fix kernel accesses with SMAP and CPL = 3

With SMAP, implicit kernel accesses from user mode always behave as
if AC=0.  To do this, kernel mode is not anymore a separate MMU mode.
Instead, KERNEL_IDX is renamed to KSMAP_IDX and the kernel mode accessors
wrap KSMAP_IDX and KNOSMAP_IDX.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
target-i386: simplify SMAP handling in MMU_KSMAP_IDX

Do not use this MMU index at all if CR4.SMAP is false, and drop
the SMAP check from x86_cpu_handle_mmu_fault.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
target-i386: fix checks on U/S bit for SMAP

The SDM says that supervisor-mode accesses are okay if at least one entry
in the page tables has the U/S bit set to zero.  Instead, the code is
marking accesses bad if at least one entry in the page tables has the
U/S bit set to one.  Correct this.

Cc: qemu-stable@nongnu.org
Cc: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>