Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp6250498ybv; Wed, 12 Feb 2020 08:41:17 -0800 (PST) X-Google-Smtp-Source: APXvYqygAqwzjhO3Q1gdIvJt+6j514U/euNzxzzz9d7raYHF3xILRZLnzjukBbsyh82jSaPw4JYV X-Received: by 2002:aca:4c9:: with SMTP id 192mr7104114oie.105.1581525677293; Wed, 12 Feb 2020 08:41:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581525677; cv=none; d=google.com; s=arc-20160816; b=ioe58gfvvUXG11Nwpw8KDQVvb+lWE1WwautBaWh4xtc2Rd3st/5AkbXBhGpPmqIYov i+p3bHI38m1KTT56qojgOUPfCnT5IST1CcMX4YUUZlFIeIj33nlsMWinZBcNXuda7YER nK6uo3NFW9PbNWoySiJseiy45wR9GqrNjnSiC1nITbcmGKZPt5QmcgOPlrKK1Wu5eji9 UmEnWFgbQTmA5SME/DR3a7A9Zs12I9b4u1kpsVwMW9fbDOS3uxy+A3+rjUkKMEsIFLRj 8aK4dyTxPUoD6/e8o19FWUWtE64odEpLAGhbR7+/Y4fUTdPxJAtrAHDAmZ/c7PWJxDpm DeqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=NrzhUur53Q4Y2ZEl1kiuBFTu/KwLXcTXVoqRdvHJiBI=; b=Tfnqu+ccJdUb34lOvKp8AlnmEdEJEFgTJSCMxshvdS62KwPXdidEq5j8k5sGibnp8e k2XhxycjRYh3Ml69tRIGVWnMnhCyc8qFvPBwmY6EGq4vCjemeOlQqDxrE/jLE5hpA/ff fDO6YLqbAZOPbiQu+WOtqay28wKoZ+fJFA/iCE00WmtAp5rNKXlXbgYJP2TVN7rcmt8X DW+e8WDiqM54qeiiRKUeo/KZ257aragWHpQpkmOFIpoQCCoTokam28ZnkpZVIlMut3pB MFnJKPCbuTOk768LEG3taXJcHBDXcGLbL1df4PLtU4X3wSHYgczBxTg68LPgcy9mjnEn shjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MmT6dKzI; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k1si3693325oic.245.2020.02.12.08.40.56; Wed, 12 Feb 2020 08:41:17 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MmT6dKzI; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728460AbgBLQko (ORCPT + 99 others); Wed, 12 Feb 2020 11:40:44 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:47206 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727548AbgBLQko (ORCPT ); Wed, 12 Feb 2020 11:40:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581525642; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NrzhUur53Q4Y2ZEl1kiuBFTu/KwLXcTXVoqRdvHJiBI=; b=MmT6dKzIFED2xhfqhOBjly+jhYXiP1wFlnVwK+4da6z35cIqLUZEyrDvnfQqFh8nH2rw9O 8hHQPz48rA3YiLWxNpia0pGSfrRJ1K/z+eps2lM4jCNEDHIQiyWJxwo0/xeJ7rxkM5w1CF YNFbI1rPmbILrpTIJfmyhLz5ENm1eGQ= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-291-Mdftop4CNUWSWA7jm5_pNw-1; Wed, 12 Feb 2020 11:40:40 -0500 X-MC-Unique: Mdftop4CNUWSWA7jm5_pNw-1 Received: by mail-wr1-f69.google.com with SMTP id c6so1026144wrm.18 for ; Wed, 12 Feb 2020 08:40:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=NrzhUur53Q4Y2ZEl1kiuBFTu/KwLXcTXVoqRdvHJiBI=; b=uSlkbqLo0g8QU7Nmd54+o2OHGzYeHdmE+ZWgEHXFaRrzqJYiGrrEWKitGKc89lyn6M iiF3taOKjJrx6QdqE72T6FRLuUciILHnKoMZs9zM4wX3dYAiruS1WRYX/1FzTCWCQYs5 2CtlN3dDTgz4tU1wsS8SDP/1tUT/5TDEgdcj61taUotFAJKm270zWLiQVq7/dITsjFcr 6CWwowPyxe/LNg+5VXUsXw5JxhbiuiVwvZdxAsA3B3ESEwWwY4joGTbJcdcRyRfey3wh Zh/cm+8ITapfTUP6h3eSjkaYBUvgLbfIpGAZMOiAOyg0oN2N2JIVC4zac/OF51VsglYT Fyvw== X-Gm-Message-State: APjAAAUA5m+zLM42EM1VEqjynqbLk/gnm+gw1e5pI2f5i1LuWD840v1n l+XZ5WPy3UBr8WLQC9qbsfoEsJIdwAvNFOmmTD5gPsuWG/v8g7sJUpYSvIND+/hHviWZgdsjVw/ exn7YMUDGYZy4+Aw1KXhKCJi6 X-Received: by 2002:adf:f288:: with SMTP id k8mr17060151wro.301.1581525639840; Wed, 12 Feb 2020 08:40:39 -0800 (PST) X-Received: by 2002:adf:f288:: with SMTP id k8mr17060137wro.301.1581525639611; Wed, 12 Feb 2020 08:40:39 -0800 (PST) Received: from [192.168.178.40] ([151.30.86.140]) by smtp.gmail.com with ESMTPSA id n8sm1179999wrx.42.2020.02.12.08.40.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 12 Feb 2020 08:40:39 -0800 (PST) Subject: Re: [PATCH RFC 0/4] KVM: MIPS: Provide arch-specific kvm_flush_remote_tlbs() To: Paul Burton , Mike Rapoport Cc: Peter Xu , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Sean Christopherson , linux-mips@vger.kernel.org, Vitaly Kuznetsov References: <20200207223520.735523-1-peterx@redhat.com> <44ba59d6-39a5-4221-1ae6-41e5a305d316@redhat.com> <20200212163004.cpd33ux4zslfc3es@lantea.localdomain> From: Paolo Bonzini Message-ID: <66e0a38c-a7f5-dcd1-d06b-b317588fad7a@redhat.com> Date: Wed, 12 Feb 2020 17:40:37 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1 MIME-Version: 1.0 In-Reply-To: <20200212163004.cpd33ux4zslfc3es@lantea.localdomain> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/02/20 17:30, Paul Burton wrote: > Hi Paolo, > > On Wed, Feb 12, 2020 at 01:25:30PM +0100, Paolo Bonzini wrote: >> MIPS folks, I see that arch/mips/kvm/mmu.c uses pud_index, so it's not >> clear to me if it's meant to only work if CONFIG_PGTABLE_LEVELS=4 or >> it's just bit rot. Should I add a "depends on PGTABLE_LEVEL=4" to >> arch/mips/Kconfig? > > I'm no expert on this bit of code, but I'm pretty sure the systems > KVM/VZ has been used on the most internally had PGTABLE_LEVEL=3. > > I suspect this is actually a regression from commit 31168f033e37 ("mips: > drop __pXd_offset() macros that duplicate pXd_index() ones"). Whilst > that commit is correct that pud_index() & __pud_offset() are the same > when pud_index() is actually provided, it doesn't take into account the > __PAGETABLE_PUD_FOLDED case. There __pud_offset() was available but > would always evaluate to zero, whereas pud_index() isn't defined... Ok, I'll try to whip out a patch that handles __PAGETABLE_PUD_FOLDED. On the other hand this makes me worry about how much KVM is being tested by people that care about MIPS (even just compile-tested). Paolo