From patchwork Tue Nov 14 14:38:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 743779 Delivered-To: patch@linaro.org Received: by 2002:a5d:67cf:0:b0:32d:baff:b0ca with SMTP id n15csp2206386wrw; Tue, 14 Nov 2023 06:39:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IHAhXBeoTq6tjnAPyCcCs28Ju9aBUJPeMOVtfuEhVDSrc6Sc0t0FxlYyA479QAGnC9KlXyL X-Received: by 2002:a05:622a:1aaa:b0:416:5dca:3c9d with SMTP id s42-20020a05622a1aaa00b004165dca3c9dmr2769279qtc.16.1699972765684; Tue, 14 Nov 2023 06:39:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699972765; cv=none; d=google.com; s=arc-20160816; b=aFjjO+qI8bCn1TVCOqQpdBJyBpb05z6k8jInahCOOk8z8UVHfU3oPXBziSBc9itK1Z 7qjVs6nEVlksfm9vFJoVsp9YR8A1YJeSCQf/56cZ6y4girZ/Q97V9aO5jn8qkSTxhvOs cVQyfnR/FmQFoM6uAnp6mc5F52K3t27aqy0okIO6/ULdDEtx9ASWRnT7vHXCsaV3iCnM WSOq9R98McNQtnt6E6keS2iXi4yNNOGoJf/PEgmeDRYzJjXvantIPGu7kIT1tO+UMIYP mb9nypNLI4v/UfBzjZZxkBjwuaJsUxIRF1LiPxFeoB/Q5FCs2a8ff+IzW3OWhX+PQRsA clhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=A2i2PCnBLcbag3MdE1ImS65uDPosS8yIjq0X323T5yY=; fh=x9Fi4ZIukdrtyL5TeYscoblPJScsjDRIG6KPVWTJ4xI=; b=D4H8xtzFoAr0IZA/Sks12NymYQ9cuXmfRGlQ9yVy1CLnRFLR6QleYeHWfbOFK4GoDb x9VJ8gUEqezXT177c8hPGhzqRP1ApyPM6y8lBF2M3xybkY4Flnwh52RPkMjeER60Uy3b UfIrR0270AN4f4X03XUDlMmGPcexJCVpLh8pQgHQ8BfdDNi7u8ygQh335MPn6NG1DwGx wB4EzEAsGg+bf3PS7YPViMyel1vvgjw3tL2kBCk9SRfxJm8qO6bVpLTOYH9X7TY9Pifp TsdbY6Pw6woe/FtkUTjTRKzivU1DPEvYAZWTztXfpBtV2HbUAUUWrnhKmV/N7325tlpP v4eA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=p2MLQoMp; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id z12-20020a05622a028c00b0041972df884fsi7062118qtw.578.2023.11.14.06.39.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 Nov 2023 06:39:25 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=p2MLQoMp; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r2uZF-0003DX-6W; Tue, 14 Nov 2023 09:39:05 -0500 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 1r2uZD-0003A6-GP for qemu-devel@nongnu.org; Tue, 14 Nov 2023 09:39:03 -0500 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r2uZB-0007pD-Q5 for qemu-devel@nongnu.org; Tue, 14 Nov 2023 09:39:03 -0500 Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-54366784377so8748935a12.3 for ; Tue, 14 Nov 2023 06:39:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699972740; x=1700577540; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=A2i2PCnBLcbag3MdE1ImS65uDPosS8yIjq0X323T5yY=; b=p2MLQoMpeE6hKJkd9H/q22lEr3r2r6rGb46b+8xSF7n6UYGAW7SsbSHFvFTJvQkQ9T 69iBCBEA9qfpYthNVcxWC9nEAIDXYbnSLsdVnYYHgz1MlQ5LX7AwyDfJXy/Pnhyr8fmu /kGJqimW90n8Wu7S4YOxPtzIyLH1TAvo8hI5Fx43PObOOzV1vIqqcVx4zOB8K0EmatzA 0G7lkPzwuYNsc2KGdqmZqmtNWOphQ18dU4gaRF+shYB9ij6FLEMocQoxl77kDq04Gdjs M4ftz9EJGh5Z7PzHCusxT3FbQDiMmPPzzUors+NTUUq62P/asF4pzUc0IXGbUTHYwtSL kiXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699972740; x=1700577540; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=A2i2PCnBLcbag3MdE1ImS65uDPosS8yIjq0X323T5yY=; b=ski0FYaaAng5NLDKNa7M5MlisynkHg5G7Y/Y0dZHPobrmtLP2sLUSzNVVsGgVIDaVY +r0vVkA3ygTmpDQDLAknksgxtppQU0xFj05cLnpE7F6kYk4QwiynG5+/ZW7B8/yJse3+ wQQUhD36yjQTPIjeDdxohc1t8l9pou9ZKSWDb7A/gwRBbjAYhi6yvBpLyTaJsuNGgQ6P 1F/JVtyQjTyBaOXuaLThDobhDvUv0AcCga4klVgJf2VfHLU/9nkZhcuFpxrPnC9voxZj R+uvWS6s34qJuFn5rVhCEfT/vaBK+Wimpac203/+bUakU/p04z4aSD7L4cZMH6PMxmaQ N2Fg== X-Gm-Message-State: AOJu0YwC17fYhPjBcVz+kRBLl3DjH4I/aU3AxmR9Q0g3rQ1Gji2eN5lC eprAHRMIbFDLwP2LE5lQhp/O0g== X-Received: by 2002:a50:fb14:0:b0:53d:eca8:8775 with SMTP id d20-20020a50fb14000000b0053deca88775mr7423669edq.26.1699972740609; Tue, 14 Nov 2023 06:39:00 -0800 (PST) Received: from m1x-phil.lan (cac94-h02-176-184-25-155.dsl.sta.abo.bbox.fr. [176.184.25.155]) by smtp.gmail.com with ESMTPSA id b21-20020aa7d495000000b0054353639161sm5133902edr.89.2023.11.14.06.38.58 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 14 Nov 2023 06:39:00 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: David Woodhouse , qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Paul Durrant , qemu-arm@nongnu.org, Paolo Bonzini , David Woodhouse , Stefano Stabellini , Richard Henderson , xen-devel@lists.xenproject.org, qemu-block@nongnu.org, Anthony Perard , kvm@vger.kernel.org, Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Marcel Apfelbaum Subject: [PATCH-for-9.0 v2 06/19] hw/pci/msi: Restrict xen_is_pirq_msi() call to Xen Date: Tue, 14 Nov 2023 15:38:02 +0100 Message-ID: <20231114143816.71079-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231114143816.71079-1-philmd@linaro.org> References: <20231114143816.71079-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52f; envelope-from=philmd@linaro.org; helo=mail-ed1-x52f.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Similarly to the restriction in hw/pci/msix.c (see commit e1e4bf2252 "msix: fix msix_vector_masked"), restrict the xen_is_pirq_msi() call in msi_is_masked() to Xen. Signed-off-by: Philippe Mathieu-Daudé --- hw/pci/msi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/pci/msi.c b/hw/pci/msi.c index 041b0bdbec..8104ac1d91 100644 --- a/hw/pci/msi.c +++ b/hw/pci/msi.c @@ -23,6 +23,7 @@ #include "hw/xen/xen.h" #include "qemu/range.h" #include "qapi/error.h" +#include "sysemu/xen.h" #include "hw/i386/kvm/xen_evtchn.h" @@ -308,7 +309,7 @@ bool msi_is_masked(const PCIDevice *dev, unsigned int vector) } data = pci_get_word(dev->config + msi_data_off(dev, msi64bit)); - if (xen_is_pirq_msi(data)) { + if (xen_enabled() && xen_is_pirq_msi(data)) { return false; }