x86: make arch_set_info_guest() match comments in load_segments()

For both fs_base and gs_base_user, there are comments saying "This can
only be non-zero if selector is NULL." While save_segments() ensures
this, so far arch_set_info_guest() didn't. Make behavior consistent
(attaching comments identical to those in save_segments()).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
This commit is contained in:
Jan Beulich committed 2018-08-17 13:51:27 +02:00
1 parent 3e4ec07e14
commit 520116f7b1
1 file changed
+6 -2
+6 -2
View File
@@ -931,9 +931,13 @@ int arch_set_info_guest(
if ( !compat )
{
v->arch.pv_vcpu.syscall_callback_eip = c.nat->syscall_callback_eip;
v->arch.pv_vcpu.fs_base = c.nat->fs_base;
/* non-nul selector kills fs_base */
v->arch.pv_vcpu.fs_base =
!(v->arch.user_regs.fs & ~3) ? c.nat->fs_base : 0;
v->arch.pv_vcpu.gs_base_kernel = c.nat->gs_base_kernel;
v->arch.pv_vcpu.gs_base_user = c.nat->gs_base_user;
/* non-nul selector kills gs_base_user */
v->arch.pv_vcpu.gs_base_user =
!(v->arch.user_regs.gs & ~3) ? c.nat->gs_base_user : 0;
}
else
{
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.