From nobody Sat Dec 21 14:52:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=treblig.org ARC-Seal: i=1; a=rsa-sha256; t=1726669023; cv=none; d=zohomail.com; s=zohoarc; b=g9j5mqSKBpZlFlcp9wu2RyNzkYuzkZ/im7UY7HvohYRtknfASvRSE5JCJ90Dz3qAR0+0iGiYD07vXaUgzAYJusUSDWvKMqxnew4HKpmEY90HTQzuFkVc8LvfXLE8FSL3qXrf4Bx0yp/vj18chtYZYHXrWGKK9/zU5384Hcb4HTk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1726669023; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=vKqpOD15e1VclfTK3L5CXdjgHocRd3YUXBcZAVPIbgQ=; b=ZjEeqNBS2BFC7Kva/fCjYSqWdsQw1FwoP8Ogh3vWXSHYlSTB9zkgUW9ojCnml0q262voXP6UrHAAnZQR7EW+c5+f/DJnijpp3MVjlgCVkElqmhgnjgjXAATv7L6iEnENz6cSsQWsoePWChWu4CXjd28gchXVNgYmj9syv45aFfs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1726669023745563.0899607643652; Wed, 18 Sep 2024 07:17:03 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sqvTQ-0001BE-Is; Wed, 18 Sep 2024 10:16:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sqvTM-000191-NH for qemu-devel@nongnu.org; Wed, 18 Sep 2024 10:16:02 -0400 Received: from mx.treblig.org ([2a00:1098:5b::1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sqvTK-0004TI-Og for qemu-devel@nongnu.org; Wed, 18 Sep 2024 10:16:00 -0400 Received: from localhost ([127.0.0.1] helo=dalek.home.treblig.org) by mx.treblig.org with esmtp (Exim 4.96) (envelope-from ) id 1sqvTG-006Itt-1x; Wed, 18 Sep 2024 14:15:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=treblig.org ; s=bytemarkmx; h=MIME-Version:Message-ID:Date:Subject:From:Content-Type:From :Subject; bh=vKqpOD15e1VclfTK3L5CXdjgHocRd3YUXBcZAVPIbgQ=; b=A8tttI3UgYTmNTnC 7FBZXDhrytouCgiv42cVm25aHR6gwxm/8CxE9zeK5hZ2mU82sfD5DAHTDfQGTMTz4AMDaOHisHtlh 3zehWCim2BUqfSKG6b+lqvgbhum8bboG99OU8Ix26MYztDjHDhxZ82EHgYkuLhxV5kxKFEfUsJTjU yDMiyjYowTucAxEb+vvPwTD3JbSmKXBdw8c5JT6B5+Pld6MHWVHZGmK30O3xTYE+mor3SlyDCu5WG LQpj6lebZ24yaFIvQ7ZpUolC4JPOij21p0lMgHueAnT1/Xru1OW5+qU1aywwHDg+P+XyHzbStOSuP t58cfmgowu1kRojFZQ==; From: dave@treblig.org To: richard.henderson@linaro.org, laurent@vivier.eu Cc: qemu-devel@nongnu.org, "Dr. David Alan Gilbert" Subject: [PATCH] linux-user: Remove unused handle_vm86_fault Date: Wed, 18 Sep 2024 15:15:53 +0100 Message-ID: <20240918141553.149521-1-dave@treblig.org> X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1098:5b::1; envelope-from=dave@treblig.org; helo=mx.treblig.org X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @treblig.org) X-ZM-MESSAGEID: 1726669025737116600 Content-Type: text/plain; charset="utf-8" From: "Dr. David Alan Gilbert" handle_vm86_fault has been unused since: 1ade5b2fed ("linux-user/i386: Split out maybe_handle_vm86_trap") Remove it, and it's local macros. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Thomas Huth --- linux-user/user-internals.h | 1 - linux-user/vm86.c | 136 ------------------------------------ 2 files changed, 137 deletions(-) diff --git a/linux-user/user-internals.h b/linux-user/user-internals.h index 5c7f173ceb..46ffc093f4 100644 --- a/linux-user/user-internals.h +++ b/linux-user/user-internals.h @@ -102,7 +102,6 @@ int host_to_target_waitstatus(int status); /* vm86.c */ void save_v86_state(CPUX86State *env); void handle_vm86_trap(CPUX86State *env, int trapno); -void handle_vm86_fault(CPUX86State *env); int do_vm86(CPUX86State *env, long subfunction, abi_ulong v86_addr); #elif defined(TARGET_SPARC64) void sparc64_set_context(CPUSPARCState *env); diff --git a/linux-user/vm86.c b/linux-user/vm86.c index 9f512a2242..31a2d707cf 100644 --- a/linux-user/vm86.c +++ b/linux-user/vm86.c @@ -255,142 +255,6 @@ void handle_vm86_trap(CPUX86State *env, int trapno) } } =20 -#define CHECK_IF_IN_TRAP() \ - if ((ts->vm86plus.vm86plus.flags & TARGET_vm86dbg_active) && \ - (ts->vm86plus.vm86plus.flags & TARGET_vm86dbg_TFpendig)) \ - newflags |=3D TF_MASK - -#define VM86_FAULT_RETURN \ - if ((ts->vm86plus.vm86plus.flags & TARGET_force_return_for_pic) &&= \ - (ts->v86flags & (IF_MASK | VIF_MASK))) \ - return_to_32bit(env, TARGET_VM86_PICRETURN); \ - return - -void handle_vm86_fault(CPUX86State *env) -{ - CPUState *cs =3D env_cpu(env); - TaskState *ts =3D get_task_state(cs); - uint32_t csp, ssp; - unsigned int ip, sp, newflags, newip, newcs, opcode, intno; - int data32, pref_done; - - csp =3D env->segs[R_CS].selector << 4; - ip =3D env->eip & 0xffff; - - ssp =3D env->segs[R_SS].selector << 4; - sp =3D env->regs[R_ESP] & 0xffff; - - LOG_VM86("VM86 exception %04x:%08x\n", - env->segs[R_CS].selector, env->eip); - - data32 =3D 0; - pref_done =3D 0; - do { - opcode =3D vm_getb(env, csp, ip); - ADD16(ip, 1); - switch (opcode) { - case 0x66: /* 32-bit data */ data32=3D1; break; - case 0x67: /* 32-bit address */ break; - case 0x2e: /* CS */ break; - case 0x3e: /* DS */ break; - case 0x26: /* ES */ break; - case 0x36: /* SS */ break; - case 0x65: /* GS */ break; - case 0x64: /* FS */ break; - case 0xf2: /* repnz */ break; - case 0xf3: /* rep */ break; - default: pref_done =3D 1; - } - } while (!pref_done); - - /* VM86 mode */ - switch(opcode) { - case 0x9c: /* pushf */ - if (data32) { - vm_putl(env, ssp, sp - 4, get_vflags(env)); - ADD16(env->regs[R_ESP], -4); - } else { - vm_putw(env, ssp, sp - 2, get_vflags(env)); - ADD16(env->regs[R_ESP], -2); - } - env->eip =3D ip; - VM86_FAULT_RETURN; - - case 0x9d: /* popf */ - if (data32) { - newflags =3D vm_getl(env, ssp, sp); - ADD16(env->regs[R_ESP], 4); - } else { - newflags =3D vm_getw(env, ssp, sp); - ADD16(env->regs[R_ESP], 2); - } - env->eip =3D ip; - CHECK_IF_IN_TRAP(); - if (data32) { - if (set_vflags_long(newflags, env)) - return; - } else { - if (set_vflags_short(newflags, env)) - return; - } - VM86_FAULT_RETURN; - - case 0xcd: /* int */ - intno =3D vm_getb(env, csp, ip); - ADD16(ip, 1); - env->eip =3D ip; - if (ts->vm86plus.vm86plus.flags & TARGET_vm86dbg_active) { - if ( (ts->vm86plus.vm86plus.vm86dbg_intxxtab[intno >> 3] >> - (intno &7)) & 1) { - return_to_32bit(env, TARGET_VM86_INTx + (intno << 8)); - return; - } - } - do_int(env, intno); - break; - - case 0xcf: /* iret */ - if (data32) { - newip =3D vm_getl(env, ssp, sp) & 0xffff; - newcs =3D vm_getl(env, ssp, sp + 4) & 0xffff; - newflags =3D vm_getl(env, ssp, sp + 8); - ADD16(env->regs[R_ESP], 12); - } else { - newip =3D vm_getw(env, ssp, sp); - newcs =3D vm_getw(env, ssp, sp + 2); - newflags =3D vm_getw(env, ssp, sp + 4); - ADD16(env->regs[R_ESP], 6); - } - env->eip =3D newip; - cpu_x86_load_seg(env, R_CS, newcs); - CHECK_IF_IN_TRAP(); - if (data32) { - if (set_vflags_long(newflags, env)) - return; - } else { - if (set_vflags_short(newflags, env)) - return; - } - VM86_FAULT_RETURN; - - case 0xfa: /* cli */ - env->eip =3D ip; - clear_IF(env); - VM86_FAULT_RETURN; - - case 0xfb: /* sti */ - env->eip =3D ip; - if (set_IF(env)) - return; - VM86_FAULT_RETURN; - - default: - /* real VM86 GPF exception */ - return_to_32bit(env, TARGET_VM86_UNKNOWN); - break; - } -} - int do_vm86(CPUX86State *env, long subfunction, abi_ulong vm86_addr) { CPUState *cs =3D env_cpu(env); --=20 2.46.0