Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2007671pxb; Thu, 16 Sep 2021 23:13:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxYJZ5rfTiD2qCyBUu6HZvTUvqNpCrA6As/cCf7UwdZ+8P/hD25btbPd3lbEIeVJujqFK6Y X-Received: by 2002:a05:6e02:dce:: with SMTP id l14mr6993512ilj.272.1631859180396; Thu, 16 Sep 2021 23:13:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631859180; cv=none; d=google.com; s=arc-20160816; b=cLfHDDCq4CRCaCcBuT0dy8wnc8EBO61FPVyEU7prjU/T81NewOBjeObWi998zJxoRl ECKy6GWhP5CdbfURsbGlvQE64T9QFKeyskJzhVTfyfBSUbNIRwMX2V4cG2NLbSQdwSJY cmPZJW324uAd0b6JhK7NSs8WvyCLAevuRzs2qxDQdNwzogLRHE3tQnttgI95kvNsR+TS curtclAnk5U/14Buh6jmPS+VHeowg67wH+6nHnTotUopFbvses0UNt7ZOZOXZwUQgi0U OIUQuY/5xqbX2QFg5NXAQJrQg8P6b9EwcpZ8ZMr0K3qglYofhlPk4syekdrnpTcwOJhY UBgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=4r4VCDRNhn5NuXXhrpjE/K0L0acR/ljmw/oylxT1VSA=; b=vvCbvVUFZgDCtjH0CpGF5MylvYSv6D4wHmD/YR4U3AWvQwx6fPouXGA5UCGDgazFvD vsG1woG7VHPUlkIyYPTfff/YRnpdMejpEeWvUXhZ7H5CNNDCIrZszGloiqw+MDUEoyVU p7DJorczST5OCNZOYpe0R5aPpTTv5diRz3hjEP5OpPm2ozJLJmx/hAv1MjIPKoyvxZlD vMHjkHl3IsS3yND8uDO52AFglRvaZ5mKjwydU8bCA5l6pZEdeBBKXzwGECOh7UfZC8rk Vsb+LNBZLxjf+v34v67A4AVDT8td7pmUXSGrl4qTtpUoS40I62EUbgIlAp1M3DbdZb9f optw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=YC419Uh4; dkim=neutral (no key) header.i=@linutronix.de header.b="i/khbvyN"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g2si4971443ilb.132.2021.09.16.23.12.48; Thu, 16 Sep 2021 23:13:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=YC419Uh4; dkim=neutral (no key) header.i=@linutronix.de header.b="i/khbvyN"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348298AbhIPSmo (ORCPT + 99 others); Thu, 16 Sep 2021 14:42:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348247AbhIPSml (ORCPT ); Thu, 16 Sep 2021 14:42:41 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3153AC0ECD01 for ; Thu, 16 Sep 2021 10:09:34 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1631812171; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=4r4VCDRNhn5NuXXhrpjE/K0L0acR/ljmw/oylxT1VSA=; b=YC419Uh4QoFwbWT8W+nR8DV2hyIK337Yf3wjf259qhd5/sBeQYj7Ts/p+j9H6+qYihiJ3f MusMYcl008Hchd9zfu7SGC9cMGvjyeF3vr8BwmnuSruwGsGEe1KUZWoJAWMqCeDhcV3S35 Y+ZO5fWOg0SExlXDTOX9cSiJFGT2CMYJdJFrVqxtL4ks63IL+a/Up4ce5Fl27rjWHHHHfC SgQdJ55T8gQkBlm4eq3ecn2SZQaBwe1YH1znAJbHn69CzAo0IqGmftjKaEF51Qe+iUnWou JFdKc0T8PZw+gA1VQKet8sIqS4QxKMrr/gd4LRBkMHIv0VvcblJQkLWMtjdZWA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1631812171; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=4r4VCDRNhn5NuXXhrpjE/K0L0acR/ljmw/oylxT1VSA=; b=i/khbvyNGFWaUevd8PtOS2y8Ftus8lJ0VVR22w6uQU9Crcyq9d7HAnA6FZRpEV8PSXbdKu tdUGbusA49hHP5Cg== To: Ondrej Zary Cc: x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: IOPL emulation breaks hpasmd (hp-health) needed by HP DL380 G4 servers In-Reply-To: <202109151423.43604.linux@zary.sk> References: <202109151423.43604.linux@zary.sk> Date: Thu, 16 Sep 2021 19:09:31 +0200 Message-ID: <87pmt8a1mc.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Ondrej, On Wed, Sep 15 2021 at 14:23, Ondrej Zary wrote: > after upgrading Debian from 10 (kernel 4.19.194) to 11 (kernel 5.10.46) on HP > DL380 G4 servers, hpasmd segfaults. Booting the 4.19.194 kernel allows hpasmd > to work. > > Noticed the iopl(3) call. Checked out a kernel before "x86/iopl: Remove legacy IOPL option" > (a24ca9976843156eabbc5f2d798954b5674d1b61) and built with CONFIG_X86_IOPL_LEGACY. > It works!. > > I even disassembled /opt/hp/hp-health/bin/IrqRouteTbl (it's only 5952 bytes > and does not use any hp libs). There's no CLI, only a couple of INs and OUTs: > ... > 8048f75: 66 ba 84 00 mov dx,0x84 > 8048f79: 66 b8 00 00 mov ax,0x0 > 8048f7d: ee out dx,al > 8048f7e: 66 ba 85 00 mov dx,0x85 > 8048f82: ee out dx,al > > But I still don't know what's going on. That's weird. Let me think about a way to debug that. I just ran a trivial test program which issues iopl(3) and reads all ports from 0-65535. That works like a charm. #include #include int main(void) { unsigned int i; int ret; ret = iopl(3); if (ret) return ret; for (i = 0; i < 65536; i++) printf("%5u: %02x\n", i, inb(i)); return 0; } Which CPU is in that machine? Can you please run that failing program with GDB and figure out which instruction causes #GP and what the register content is. Thanks, tglx