From patchwork Thu Nov 16 12:02:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 119041 Delivered-To: patch@linaro.org Received: by 10.80.225.132 with SMTP id k4csp4645130edl; Thu, 16 Nov 2017 04:04:37 -0800 (PST) X-Google-Smtp-Source: AGs4zMar750NamnI4MBi8U2sj3U7V3rrAYIZ2QBlgH5J5gQgkd+CiOKIOfN9cTyB6waJhQjMCDtA X-Received: by 10.36.147.198 with SMTP id y189mr2031087itd.6.1510833877302; Thu, 16 Nov 2017 04:04:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510833877; cv=none; d=google.com; s=arc-20160816; b=RvWbg12wAiA5w7ubJLjW34xdM3VT845XZPNUZ2Nqgha8bhuHixWaK52/lfVBKc+NJD IWO/fcKpp90r6dtNa0i8sMhXQPlEBAzjHlA64q4nwB+dJ0BGmTmmOqFoZPzI2uHxcZhZ IEv/WihMHPsN2jQIzvvqxoTDQh2weaRJGNLR9Sc+K4ohZKMliniIwv9KQCgAjdVhdehV ZajhwIlrKYriFzbgg9hdj6WlMgZje09eYC1a7cJI/V1fA9H/hVNGQmemjvEB2ucF0D8J O6g1Lx0fpJQHNYaFT2X8/2jLV5XkWLX69hFH5O8DwD2MbXE7eVknxsS8569tuwUW++Xo 5uBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:cc:message-id:date:to:from:dkim-signature :arc-authentication-results; bh=NasHoQF+SXfoaXKqWX2YbR5M03Nll5GSBuOktSDX0bw=; b=b6+A8drIXa1iSPR8bNxleSqgLtOIMDmhHFVlXyo62oAR/woLeXJwAoQ8XZmB1rLrkz Ubpl9w5GsjTtueX7eldFtKt+euxD6zrabWGsqdckcqfCPgCk2CGLZSOIOSaOOb1IkfMR AIMomIo+nmIHCxDomKg0r8U5FoYVYQ9CGIGvl9EMKn+xErfZHK6YI54LzNAzUMGMz+Ro /9U9V6btYUHPlhuQOCv7pq0KjIl1GqqPYIr+jYplR5dwuaDpoMA8WMLVjLvc8kR345/h l+GNDHaPS4B3plRJg5r4dzjckjWhJ6guBhR6yRw+clnSUfGw6lDQ0Hlvja1f9aCrSKco 8UJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=khYto2BZ; spf=neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) smtp.mailfrom=xen-devel-bounces@lists.xen.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id j194si906259ite.79.2017.11.16.04.04.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Nov 2017 04:04:37 -0800 (PST) Received-SPF: neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) client-ip=192.237.175.120; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=khYto2BZ; spf=neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) smtp.mailfrom=xen-devel-bounces@lists.xen.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eFIsU-0000Z3-E0; Thu, 16 Nov 2017 12:02:42 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eFIsS-0000Yv-JW for xen-devel@lists.xenproject.org; Thu, 16 Nov 2017 12:02:40 +0000 Received: from [85.158.137.68] by server-17.bemta-3.messagelabs.com id E8/3E-07572-F5E7D0A5; Thu, 16 Nov 2017 12:02:39 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrAIsWRWlGSWpSXmKPExsXiVRvkpBtfxxt lsGqekMX3LZOZHBg9Dn+4whLAGMWamZeUX5HAmnFj4lrWglncFSc//2ZuYNzK2cXIySEkMI1R omNFchcjFweLQDuzxPw9HxlBHAmBdywSZ3YsYASpkhDIkujbvhTKTpPYfPQMG4RdKfHq6B0mi EkaEjcmzwBrFhJoYpLo+HuTGSTBJmAgMatrMpgtIhAhcfrxJbAGZgFviYY/p8GGCgtYSLzrPQ 0WZxFQlZhyajo7iM0rYCexadVrdohl8hLnHtxmnsDIv4CRYRWjRnFqUVlqka6xgV5SUWZ6Rkl uYmaOrqGBsV5uanFxYnpqTmJSsV5yfu4mRmAI1TMwMO5g7Dzhd4hRkoNJSZTX+Td3lBBfUn5K ZUZicUZ8UWlOavEhRhkODiUJXv9a3ighwaLU9NSKtMwcYDDDpCU4eJREeM1A0rzFBYm5xZnpE KlTjJYc+/bc+sPE8Wzm6wZmjmlXW5uYhVjy8vNSpcR5WUAaBEAaMkrz4MbBIu4So6yUMC8jAw ODEE9BalFuZgmq/CtGcQ5GJWFeIZApPJl5JXBbXwEdxAR0kM0NbpCDShIRUlINjBpNt678v3N C+w/f/Zh3CUsnFyQ3PVmRaqKaV3GvIDN466nuQ5q93tEGzG1emRy677oZzfvWbWvSU+u4fOWB 6QGXhw7lCwL3zRRSufZBvuyYdfNWR+OXu9b9NshlvD9Dbuu+HRZuspW57WkKwctnM8+7K3Vmy tdwo9gHa13abi8qFOtcWqT8XomlOCPRUIu5qDgRAKox6RKzAgAA X-Env-Sender: andre.przywara@linaro.org X-Msg-Ref: server-14.tower-31.messagelabs.com!1510833759!115073658!1 X-Originating-IP: [74.125.82.66] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 14405 invoked from network); 16 Nov 2017 12:02:39 -0000 Received: from mail-wm0-f66.google.com (HELO mail-wm0-f66.google.com) (74.125.82.66) by server-14.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 16 Nov 2017 12:02:39 -0000 Received: by mail-wm0-f66.google.com with SMTP id l8so8962842wmg.4 for ; Thu, 16 Nov 2017 04:02:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=bFo1unHFwN45IkkPzubnk8wmCZjQE6Gsyh+qOJbs01A=; b=khYto2BZWjl2sEOUtZrPUGXGuzcQYgK6Vaq3G3eoo88HbuI9BEgzXmXfRgkd6036+z creApP6AR8hvgpOtJMhosX6WNn16CokVscVLsWXByMW5GI+SeRkLZvtOtUO0yRzT3eHM QguR9xBZFYNylsUZiqkvW0jDTNSUBdFxKp1+E= 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; bh=bFo1unHFwN45IkkPzubnk8wmCZjQE6Gsyh+qOJbs01A=; b=uFjdN7djT3toP+5Uq/iJxuc6kO49QjsTxnaQLMwqCnRFcRyv6aW9tB2Ao7PDCfdAB4 l0ngTRlVwDscnBC7i85ypGULEJUmoU0+g/8qmhXWBh5Y6JkA7ZcWkSK3545O0Eu5JghP 7zpNn5b5XFQBNPcYwPltC7URaiCRDaKXRbVnJypgBXkErR5mQ1/t8cuAXdgR2n/xf7sH lmySqcXpAHf/Ha7PiTM1tV0AACnRNZE+ZiUQNbUReicZgGWFgqoh2BRwCGLptBc1wT9e iNIwfCbbWpb0twf9ma4jPt9yJ3uXyqARsJF1iXobIFYk7nZrVpzWKf4hv+YiVRl0OZik nkhg== X-Gm-Message-State: AJaThX6DEZqWVbUVQbZ9TKU2pIlEVl//WwDzIx9Qx8XA6sDaYMbYfosJ vAaOvaK33Z3pOFEr94nQg+VQ7w== X-Received: by 10.80.157.199 with SMTP id l7mr2398010edk.170.1510833758828; Thu, 16 Nov 2017 04:02:38 -0800 (PST) Received: from e104803-lin.lan (mail.andrep.de. [217.160.17.100]) by smtp.gmail.com with ESMTPSA id e46sm855697edb.93.2017.11.16.04.02.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 16 Nov 2017 04:02:38 -0800 (PST) From: Andre Przywara To: Julien Grall , Stefano Stabellini Date: Thu, 16 Nov 2017 12:02:35 +0000 Message-Id: <20171116120235.10041-1-andre.przywara@linaro.org> X-Mailer: git-send-email 2.14.1 Cc: Manish Jaggi , xen-devel@lists.xenproject.org Subject: [Xen-devel] [PATCH] arm64: ITS: fix cacheability adjustment X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" If the host GICv3 redistributor reports that the pending table cannot use shareable memory, we try to drop the cacheability attributes as well. However we fail horribly in doing computer science 101 bit masking, effectively clearing the whole register instead of just a few bits. Fix this by removing the one redundant masking operation and adding the magic negation for the actually needed other operation. Reported-by: Manish Jaggi Signed-off-by: Andre Przywara --- Julien, can we have this still for 4.10, please? Seems like an obvious bug to me. Cheers, Andre xen/arch/arm/gic-v3-lpi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/xen/arch/arm/gic-v3-lpi.c b/xen/arch/arm/gic-v3-lpi.c index c3474f5434..84582157b8 100644 --- a/xen/arch/arm/gic-v3-lpi.c +++ b/xen/arch/arm/gic-v3-lpi.c @@ -359,8 +359,7 @@ int gicv3_lpi_init_rdist(void __iomem * rdist_base) /* If the hardware reports non-shareable, drop cacheability as well. */ if ( !(table_reg & GICR_PENDBASER_SHAREABILITY_MASK) ) { - table_reg &= GICR_PENDBASER_SHAREABILITY_MASK; - table_reg &= GICR_PENDBASER_INNER_CACHEABILITY_MASK; + table_reg &= ~GICR_PENDBASER_INNER_CACHEABILITY_MASK; table_reg |= GIC_BASER_CACHE_nC << GICR_PENDBASER_INNER_CACHEABILITY_SHIFT; writeq_relaxed(table_reg, rdist_base + GICR_PENDBASER);