Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp441753ybl; Fri, 10 Jan 2020 01:10:01 -0800 (PST) X-Google-Smtp-Source: APXvYqzyhC//AFKwV/HKi24A3Ao2i54C5l1pANbjiY8kD9We2Ln8gSSbeP/+oVAO+AZdxrUq7jTr X-Received: by 2002:a05:6808:150:: with SMTP id h16mr1361974oie.130.1578647401274; Fri, 10 Jan 2020 01:10:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578647401; cv=none; d=google.com; s=arc-20160816; b=Fc5rh/QqBAUaOYEedMiuAoqimuTb97+6H/hbWUvgGyLPGBEQJVEyhmyMYngorn6ESk XgGJAlJnYDcDd81gOu8CEnGhcpHfG1mCDA287ygdP9vDXzwlVWvBcAVtzpAG+SfSggUe N6LNhtEtsJsZ/x3zpQgAINRs+krRCszvqAHXEiEldJ6DkR5yM7mkGSGrVfJ3tZCvwuDa rEtykZe0W3s7EEeTHalzzjxbtgGduhUV8dWIE3/SuvnUpj/I6/hMPNIdb9g/dSzFOJxk x0MH3etZfAeSEvimKBrGuTFWnRniowKeNW50H5pia15+xfQvC9JMx2JjrpeWm9wrchJn jYvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=Lzgn8YXStng2R+80T9W8I4Psk1SlFLw8jgvvhGGhYgs=; b=WHF7yUccvGMZjSv2MrwHBfuJ1XXxySHo9Xbg8AqgRICT1VfUDaneK26AJoJN7xhgv0 DlrXhsjpOqSl1VgOR98Si+dIDFoJUotZrdfK7HhJqjwlDKuclRmmHq8EdfFl4NPiOnTm bHIV/tquYugNaDdzkrG0LvJt65OxnLJH8WXnIsUIGzAWLUrNXzRy0RgSzCnp5uWa6S3/ v3PxHL95bLhqnXfxbn667A/fQZG0DgkHS3kJ3gw3QqJOENIZ41HpJVjZc1rm43qJUOeV 2BOGQ2+tzJHPp2ljVKSHoyCc+/nKVb3FCh05gImy50zc0oqySNbe9KP7JRF3HFKg/6R4 6PVA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e6si827479otq.217.2020.01.10.01.09.49; Fri, 10 Jan 2020 01:10:01 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727188AbgAJJIr (ORCPT + 99 others); Fri, 10 Jan 2020 04:08:47 -0500 Received: from mail.loongson.cn ([114.242.206.163]:53768 "EHLO loongson.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726734AbgAJJIr (ORCPT ); Fri, 10 Jan 2020 04:08:47 -0500 Received: from localhost.localdomain.localdomain (unknown [182.149.160.139]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9DxL2oYPxheAPICAA--.2S3; Fri, 10 Jan 2020 17:08:41 +0800 (CST) From: Xing Li To: Ralf Baechle , Paul Burton Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] KVM: MIPS: Fixup VPN2_MASK definition over 32bits virtual address Date: Fri, 10 Jan 2020 17:08:39 +0800 Message-Id: <1578647320-14391-2-git-send-email-lixing@loongson.cn> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1578647320-14391-1-git-send-email-lixing@loongson.cn> References: <1578647320-14391-1-git-send-email-lixing@loongson.cn> X-CM-TRANSID: AQAAf9DxL2oYPxheAPICAA--.2S3 X-Coremail-Ant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UUUU X-CM-SenderInfo: pol0x03j6o00pqjv00gofq/ Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If the cpu support more than 32bits vmbits, VPN2_MASK set to fixed 0xffffe000 will lead to wrong entryhi for _kvm_mips_host_tlb_inv Signed-off-by: Xing Li --- arch/mips/include/asm/kvm_host.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/mips/include/asm/kvm_host.h b/arch/mips/include/asm/kvm_host.h index 6be70d5..ce9546c 100644 --- a/arch/mips/include/asm/kvm_host.h +++ b/arch/mips/include/asm/kvm_host.h @@ -274,7 +274,12 @@ enum emulation_result { #define MIPS3_PG_SHIFT 6 #define MIPS3_PG_FRAME 0x3fffffc0 +#if defined(CONFIG_64BIT) +#define VPN2_MASK (((1UL << cpu_vmbits) - 1) & \ + 0x3fffffffffffe000UL) +#else #define VPN2_MASK 0xffffe000 +#endif #define KVM_ENTRYHI_ASID cpu_asid_mask(¤t_cpu_data) #define TLB_IS_GLOBAL(x) ((x).tlb_lo[0] & (x).tlb_lo[1] & ENTRYLO_G) #define TLB_VPN2(x) ((x).tlb_hi & VPN2_MASK) -- 2.1.0