From patchwork Fri Dec 6 10:14:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 11275937 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CDCF8138D for ; Fri, 6 Dec 2019 10:15:17 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B42BD2245C for ; Fri, 6 Dec 2019 10:15:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B42BD2245C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1idAd0-0002hk-Ij; Fri, 06 Dec 2019 10:14:26 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1idAcz-0002hd-BD for xen-devel@lists.xenproject.org; Fri, 06 Dec 2019 10:14:25 +0000 X-Inumbo-ID: 2d557e30-1811-11ea-b4e9-bc764e2007e4 Received: from mx1.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 2d557e30-1811-11ea-b4e9-bc764e2007e4; Fri, 06 Dec 2019 10:14:24 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 02799B217; Fri, 6 Dec 2019 10:14:24 +0000 (UTC) From: Jan Beulich To: "xen-devel@lists.xenproject.org" References: <57491ade-fa47-5e66-47ac-a5f79de84070@suse.com> Message-ID: Date: Fri, 6 Dec 2019 11:14:39 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 MIME-Version: 1.0 In-Reply-To: <57491ade-fa47-5e66-47ac-a5f79de84070@suse.com> Content-Language: en-US Subject: [Xen-devel] [PATCH 2/3] x86: relax LDT check in arch_set_info_guest() X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Andrew Cooper , Wei Liu , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" It is wrong for us to check the base address when there's no LDT in the first place. Signed-off-by: Jan Beulich --- TBD: I also wonder whether we wouldn't better set v->arch.pv.ldt_base to zero for an empty LDT, just like do_mmuext_op() does. --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -989,8 +989,9 @@ int arch_set_info_guest( for ( i = 0; !fail && i < nr_gdt_frames; ++i ) fail |= v->arch.pv.gdt_frames[i] != c(gdt_frames[i]); - fail |= v->arch.pv.ldt_base != c(ldt_base); fail |= v->arch.pv.ldt_ents != c(ldt_ents); + if ( v->arch.pv.ldt_ents ) + fail |= v->arch.pv.ldt_base != c(ldt_base); if ( fail ) return -EOPNOTSUPP;