From patchwork Tue Nov 7 10:47:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 10046475 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 64A7A60247 for ; Tue, 7 Nov 2017 11:08:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3F0F729CEC for ; Tue, 7 Nov 2017 11:08:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3320C29D1B; Tue, 7 Nov 2017 11:08:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E754829CEC for ; Tue, 7 Nov 2017 11:08:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=xwnwdYZrM8lZXYLGA0rFj6agdYlvpZKd8rRbwWaMk84=; b=QqQSL1OomsUJimQ324KeZeGjN3 +g1dq0cnz4rMmUPMgC1CrYUu9iHMF6CKh+ce8cRYHLNVpqKEx91VQhwaHQ1S901qPDNDlfDfM7KDr ccvpq1Jf0OxZEUpXPHj8PUFEDgBtcbpVs5NZIBC/9RTR1VlVl6YIJDRFuD1Xb7o/PSElhMd24hJ7C yicbEUAWtYWjvYYFhWsiiGb2K+8podjuNHRBR9YN/wta+4CYFUZoAa3WKVYPI1EyigU4NS54R5X3i 0gVd/Lx76goHnxGyRm3de+jeKyng6nMXxG2dGxN9RIIEeYwWISAmUSovmzJ3GW/Uw2BcOw4O6vzh9 rjurGB8A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eC1jW-00049q-VL; Tue, 07 Nov 2017 11:07:54 +0000 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eC1RN-0001Cb-L3 for linux-arm-kernel@lists.infradead.org; Tue, 07 Nov 2017 10:49:28 +0000 Received: by mail-wm0-x244.google.com with SMTP id r196so2756171wmf.2 for ; Tue, 07 Nov 2017 02:48:49 -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:in-reply-to:references; bh=QRRvrArS+itLakJBqtesaZtWVAcVuswYEkhFHH9qceo=; b=OwhCJ3XazvOysmXYfOD8jZU5penTayjH5O0DBK2axsFho0jZzzPu8V+UcRbiHtqFeJ z6TwvJEz+fTXjPt47qOpe29cxI6G2kyey5snt4hReFbd3fqPCauKVZue0SjzioXddR1q V5AYmAUhYmixQm7SLwvlq3vWkd/MNagIVzdrM= 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; bh=QRRvrArS+itLakJBqtesaZtWVAcVuswYEkhFHH9qceo=; b=NRNw8/Utduq8AfeaL78MBwPl9LIsiB141wTnmO2glT7wWLro3A1CmpKDpfkQ6wWvlf HxGsXEE47dbhL/+RSG5M1d78YxdJmjipZRysxqmU+TCruR9Sc2KR9IC3+XYx5h77SVzi XsjRTQuOwSh5F3UfyikY2TsV5ITGQIbjLuXknllYdpaQuCj2I6A+VuytimMDunW+Vm6x 4M566lLCo5t/1jEwOtQoYg9LE47uoAbDkJY5E0WQf4NcN5dgIxq0d8/PIizAiggLGK6n jN4UVRMDnvOiHCciW6U1/wdcfgHGEg9sXThcPbRHC13uKSYZafg2bdi06mtCBp93KLAZ 6ANA== X-Gm-Message-State: AMCzsaWO2E/g/ZIJn7QorTN6siZ4GCLFxnib5Ihy93Q8MwBsl9b5u1Ft iP5lzDVH3FlX+DIQ6P+su44bLA== X-Google-Smtp-Source: ABhQp+TWyu9EJyxxTtbA23EfioryHUTydRLnfH36XzljPIY2TZHm+bGQHdqh7FHtPvhSfmv6N0A48A== X-Received: by 10.80.181.71 with SMTP id z7mr24130588edd.201.1510051727964; Tue, 07 Nov 2017 02:48:47 -0800 (PST) Received: from localhost.localdomain (xd93dd96b.cust.hiper.dk. [217.61.217.107]) by smtp.gmail.com with ESMTPSA id q12sm1044958edj.29.2017.11.07.02.48.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 07 Nov 2017 02:48:47 -0800 (PST) From: Christoffer Dall To: Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= Subject: [PULL 26/26] KVM: arm/arm64: fix the incompatible matching for external abort Date: Tue, 7 Nov 2017 11:47:59 +0100 Message-Id: <20171107104800.30021-27-christoffer.dall@linaro.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171107104800.30021-1-christoffer.dall@linaro.org> References: <20171107104800.30021-1-christoffer.dall@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171107_024910_831243_F2BA589A X-CRM114-Status: GOOD ( 11.38 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kvm@vger.kernel.org, Marc Zyngier , Dongjiu Geng , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, Christoffer Dall MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Dongjiu Geng kvm_vcpu_dabt_isextabt() tries to match a full fault syndrome, but calls kvm_vcpu_trap_get_fault_type() that only returns the fault class, thus reducing the scope of the check. This doesn't cause any observable bug yet as we end-up matching a closely related syndrome for which we return the same value. Using kvm_vcpu_trap_get_fault() instead fixes it for good. Signed-off-by: Dongjiu Geng Acked-by: Marc Zyngier Signed-off-by: Christoffer Dall --- arch/arm/include/asm/kvm_emulate.h | 2 +- arch/arm64/include/asm/kvm_emulate.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/include/asm/kvm_emulate.h b/arch/arm/include/asm/kvm_emulate.h index dcae3970148d..3d22eb87f919 100644 --- a/arch/arm/include/asm/kvm_emulate.h +++ b/arch/arm/include/asm/kvm_emulate.h @@ -233,7 +233,7 @@ static inline u8 kvm_vcpu_trap_get_fault_type(struct kvm_vcpu *vcpu) static inline bool kvm_vcpu_dabt_isextabt(struct kvm_vcpu *vcpu) { - switch (kvm_vcpu_trap_get_fault_type(vcpu)) { + switch (kvm_vcpu_trap_get_fault(vcpu)) { case FSC_SEA: case FSC_SEA_TTW0: case FSC_SEA_TTW1: diff --git a/arch/arm64/include/asm/kvm_emulate.h b/arch/arm64/include/asm/kvm_emulate.h index bf61da0ef82b..5f28dfa14cee 100644 --- a/arch/arm64/include/asm/kvm_emulate.h +++ b/arch/arm64/include/asm/kvm_emulate.h @@ -240,7 +240,7 @@ static inline u8 kvm_vcpu_trap_get_fault_type(const struct kvm_vcpu *vcpu) static inline bool kvm_vcpu_dabt_isextabt(const struct kvm_vcpu *vcpu) { - switch (kvm_vcpu_trap_get_fault_type(vcpu)) { + switch (kvm_vcpu_trap_get_fault(vcpu)) { case FSC_SEA: case FSC_SEA_TTW0: case FSC_SEA_TTW1: