From nobody Tue Feb 10 20:14:13 2026 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1508246811040719.6432612117363; Tue, 17 Oct 2017 06:26:51 -0700 (PDT) Received: from localhost ([::1]:39242 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4RtD-0000Ed-50 for importer@patchew.org; Tue, 17 Oct 2017 09:26:35 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34432) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4Rew-0004vw-5C for qemu-devel@nongnu.org; Tue, 17 Oct 2017 09:11:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e4Rev-0006aL-7K for qemu-devel@nongnu.org; Tue, 17 Oct 2017 09:11:50 -0400 Received: from mail.ispras.ru ([83.149.199.45]:57108) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4Reu-0006Zo-Vw for qemu-devel@nongnu.org; Tue, 17 Oct 2017 09:11:49 -0400 Received: from Misha-PC.lan02.inno (unknown [85.142.117.226]) by mail.ispras.ru (Postfix) with ESMTPSA id 51B8754006B; Tue, 17 Oct 2017 16:11:43 +0300 (MSK) From: Mihail Abakumov To: qemu-devel@nongnu.org Date: Tue, 17 Oct 2017 16:11:40 +0300 Message-ID: <150824590066.6816.17516686057228279307.stgit@Misha-PC.lan02.inno> In-Reply-To: <150824572545.6816.5099701189660002212.stgit@Misha-PC.lan02.inno> References: <150824572545.6816.5099701189660002212.stgit@Misha-PC.lan02.inno> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 83.149.199.45 Subject: [Qemu-devel] [PATCH v2 30/43] windbg: implemented windbg_set_sr X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: sw@weilnetz.de, lprosek@redhat.com, dovgaluk@ispras.ru, rkagan@virtuozzo.com, pbonzini@redhat.com, den@openvz.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_6 Z_629925259 SPT_0 Signed-off-by: Mihail Abakumov Signed-off-by: Pavel Dovgalyuk Signed-off-by: Dmitriy Koltunov --- target/i386/windbgstub.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/target/i386/windbgstub.c b/target/i386/windbgstub.c index fbb42d05bd..d67ad8cf0c 100755 --- a/target/i386/windbgstub.c +++ b/target/i386/windbgstub.c @@ -275,7 +275,22 @@ static void windbg_set_dr(CPUState *cpu, int index, ta= rget_ulong value) {} =20 static void windbg_set_sr(CPUState *cpu, int sr, uint16_t selector) -{} +{ + CPUArchState *env =3D cpu->env_ptr; + + if (selector !=3D env->segs[sr].selector && + (!(env->cr[0] & CR0_PE_MASK) || (env->eflags & VM_MASK))) { + unsigned int limit, flags; + target_ulong base; + + int dpl =3D (env->eflags & VM_MASK) ? 3 : 0; + base =3D selector << 4; + limit =3D 0xffff; + flags =3D DESC_P_MASK | DESC_S_MASK | DESC_W_MASK | + DESC_A_MASK | (dpl << DESC_DPL_SHIFT); + cpu_x86_load_seg_cache(env, sr, selector, base, limit, flags); + } +} =20 static int windbg_read_context(CPUState *cpu, uint8_t *buf, int buf_size, int offset, int len)