From nobody Wed Nov 19 21:05:24 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1618318688; cv=none; d=zohomail.com; s=zohoarc; b=lf3MAcYCPR+S+ni0040bNdUtkRMivUSYLQY107initoFazUTR2X0LJvNjJO+PJjy0N9l7LTCTPesbaPXExVKeosB5NNpGCUUTv5nz8z/skuVeG/QHP1pIXapEVKpgnVnxwXZy1PjMBXuUe9IB1oYpYZC+jgo5vSsB2JlAOUyQt4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618318688; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ZY/g1DDp//F/F5LFsGZagO1HYB3lEEm5TGBFu+93DlY=; b=Ik+0I4Dql2LPyJiGWW9j14UPIqNOnEChu98PGTH3gJQtaFhU7ClNIVPrCzZH7A/vL/Nl8D1HSL4SBSXM6IVFQwBTjt+CLZuMJmKWgKF+c0/5jIYcYjOphpZRE9ihgrGaHMR2wKmKE5NGLMF8wlwgnEjvXm/l5bHd1oFpUBvU87c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1618318688890649.8558224413966; Tue, 13 Apr 2021 05:58:08 -0700 (PDT) Received: from localhost ([::1]:33946 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lWIcJ-0000bv-PB for importer@patchew.org; Tue, 13 Apr 2021 08:58:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36326) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lWIZT-0006X4-Eb; Tue, 13 Apr 2021 08:55:11 -0400 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]:36358) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lWIZQ-0005Oy-PM; Tue, 13 Apr 2021 08:55:11 -0400 Received: by mail-pl1-x62d.google.com with SMTP id z22so3033375plo.3; Tue, 13 Apr 2021 05:55:07 -0700 (PDT) Received: from bobo.ozlabs.ibm.com (193-116-90-211.tpgi.com.au. [193.116.90.211]) by smtp.gmail.com with ESMTPSA id s40sm9627352pfw.133.2021.04.13.05.55.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Apr 2021 05:55:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ZY/g1DDp//F/F5LFsGZagO1HYB3lEEm5TGBFu+93DlY=; b=CSm3zibNli/5wDq9tkVE5rAHeDLx0bCpNheiif+MGFBDkdS3LYfPyMMd6zPaqzeSt1 G3TzsdlYBSaCSiV29Dm64o9slMT16CzhkF7eKFOwuE+vXZ3TdHtKt0T/JJWLYOzP8dLY UUBLlUZfHvd2bveeQYP6lPg66TGYtGRE+gKRJkbK+yevY/sHWtDPT1bLdaUMGVAg2dMu HKu/QKfbKX4iKuWV283JnJBwl1ndTyWwRRXpPXu/ILRLNE4o8wlw5B3fkg6N2AdmHT+q axQkvQ9dByGqcTeweIEHfkQgS9VsmhntgTEUVwC9cRFTq8+lfhvWTXP5UVYBb0nI6VXX TT6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ZY/g1DDp//F/F5LFsGZagO1HYB3lEEm5TGBFu+93DlY=; b=mhIF4wEPK2xhZx2jxWr8UTVFi+uEY0rzrxNq77AULeJyblFPPaeTe6Fycs5BcgG3+g OPQal4TzG9qt9i7aiPa8XzEtw/QB7TYeWaosrwLYSM9+tKBZFjsdg27mJSF7gSP36BDW WxnJreZ0APq9znGgpjr2n9TTVGZ3kP/FMI9DqmsTH4FY2rlSvf0p1DLIUztT7N87XQVl h4C5TMPB2vIQfrR4BgOWlltzdmrARp6wnr7AiUBnz4zv75QMvyhoerr6cx/m3GajinQ6 Z044czy14wRoo2CucAMJiyAsD6Bn1MeMHq6wYkzFMiGJ4xUJeLhYtNm8jpBIGCPhSocc 35mw== X-Gm-Message-State: AOAM531y2/oIyVt1CavHjDcVOSrjf7/CVs+gZLA1Bbl0JecAxQm5w1KA FjUkuxUVEVkdH4p8mWXrWzflk23PL7A= X-Google-Smtp-Source: ABdhPJxo7Momz6MM7/LHKPe81Zw3k2++L9Wg7JulItsJK//HmyRi7aShIgYG/8cc6mSzJDB5geGDwQ== X-Received: by 2002:a17:902:fe91:b029:eb:ad8:c5f with SMTP id x17-20020a170902fe91b02900eb0ad80c5fmr8029266plm.63.1618318506690; Tue, 13 Apr 2021 05:55:06 -0700 (PDT) From: Nicholas Piggin To: qemu-ppc@nongnu.org Subject: [PATCH v1 1/3] target/ppc: Fix POWER9 radix guest HV interrupt AIL behaviour Date: Tue, 13 Apr 2021 22:54:46 +1000 Message-Id: <20210413125448.1689545-2-npiggin@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20210413125448.1689545-1-npiggin@gmail.com> References: <20210413125448.1689545-1-npiggin@gmail.com> 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=2607:f8b0:4864:20::62d; envelope-from=npiggin@gmail.com; helo=mail-pl1-x62d.google.com 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , qemu-devel@nongnu.org, Nicholas Piggin , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" ISA v3.0 radix guest execution has a quirk in AIL behaviour such that the LPCR[AIL] value can apply to hypervisor interrupts. This affects machines that emulate HV=3D1 mode (i.e., powernv9). Signed-off-by: Nicholas Piggin Reviewed-by: Fabiano Rosas --- target/ppc/excp_helper.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c index 85de7e6c90..b8881c0f85 100644 --- a/target/ppc/excp_helper.c +++ b/target/ppc/excp_helper.c @@ -791,14 +791,23 @@ static inline void powerpc_excp(PowerPCCPU *cpu, int = excp_model, int excp) #endif =20 /* - * AIL only works if there is no HV transition and we are running - * with translations enabled + * AIL only works if MSR[IR] and MSR[DR] are both enabled. */ - if (!((msr >> MSR_IR) & 1) || !((msr >> MSR_DR) & 1) || - ((new_msr & MSR_HVB) && !(msr & MSR_HVB))) { + if (!((msr >> MSR_IR) & 1) || !((msr >> MSR_DR) & 1)) { ail =3D 0; } =20 + /* + * AIL does not work if there is a MSR[HV] 0->1 transition and the + * partition is in HPT mode. For radix guests, such interrupts are + * allowed to be delivered to the hypervisor in ail mode. + */ + if ((new_msr & MSR_HVB) && !(msr & MSR_HVB)) { + if (!(env->spr[SPR_LPCR] & LPCR_HR)) { + ail =3D 0; + } + } + vector =3D env->excp_vectors[excp]; if (vector =3D=3D (target_ulong)-1ULL) { cpu_abort(cs, "Raised an exception without defined vector %d\n", --=20 2.23.0