From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by smtp.lore.kernel.org (Postfix) with ESMTP id 37996C433FE for ; Mon, 25 Apr 2022 18:17:01 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id A3D3F49E32; Mon, 25 Apr 2022 14:17:00 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Authentication-Results: mm01.cs.columbia.edu (amavisd-new); dkim=softfail (fail, message has been altered) header.i=@google.com Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VtoOY+eGITtl; Mon, 25 Apr 2022 14:16:59 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 804D249F3C; Mon, 25 Apr 2022 14:16:59 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id E7FF240CDE for ; Mon, 25 Apr 2022 14:16:58 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3NzSq+FDJXHi for ; Mon, 25 Apr 2022 14:16:57 -0400 (EDT) Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id D6C2640C58 for ; Mon, 25 Apr 2022 14:16:57 -0400 (EDT) Received: by mail-pj1-f46.google.com with SMTP id iq10so2610200pjb.0 for ; Mon, 25 Apr 2022 11:16:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=cJX4NOJxx8yt8bifaIIJHW1REW326f1qVXuNvHoJSGg=; b=F3Hg1J94deTs8D8c5x1mAeV7ldoQpgW1s6cQYtX1nmsV/vMU5VmvD2P9H4jtGsz0n6 HCRfrqmumUVIyK1j9wk+b+Hh7JxDlXVj5WXa39ZQqtlC8foiC7DcT9y4skTjKIFHv4vw 8YCxCAeVfEmEgrqwzi7pLiiRLvrQf922iJo52BUjCvD7FIZmvWyGa8FOzPJz/6EgGI6v XyYd8VT3Qx82VijPLex/NBTEXRxnpS1jZLs2wulPpuMipuqsAczB115q6JB87jO5kRRS dGB80hWg50jdhiHePj195LJTjAdj0elbPPMHjXkh5hzfETrtqojnaowF7veZzPtIy0DG gipQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=cJX4NOJxx8yt8bifaIIJHW1REW326f1qVXuNvHoJSGg=; b=Gx7P4kA6VUb2vjUUH7Vfepf7QPY3g/AHl4Yf18V3yOLxGM+OjK/gBZfiNgGVeOBBBo QVrWZeAZ15OFjeOHDEA9LUC8goCxaKviwNAsyOLFQ+W4dy6nlxMwzTmL0znAhT5sZmFm lwqUJ2We0pHnrovuB0JO6idBOdjDvdvSbCK08RNoVCXS4ouid0D7K+6iGCnXfw5lC2S6 Ze0eZ0JMpOnoOxaEor5MzuIy7M5Je6drb7p9XsZ/sVa7Bh07QfQDLKE5RyUveVHWoe3B rGZJw9Q6H1OSFMLbCyLf5A/M6xPr8pRxgORnRkLQjBADclCsSy4VBrXEmMAnxuXYfvis zUgg== X-Gm-Message-State: AOAM530632hB5kMoFqXsnXB6Gyd9exZei71sCp2Clux9qaIph730hGoN nCMi1BYoBr+dHh/MPJdt2VhtPA== X-Google-Smtp-Source: ABdhPJxV/XUGUnp8Y08gGA8YCbm1IrFT95czI8pjByDzfirwYlhZgziSfr3Rg2N60hRkRbJm5fHa3A== X-Received: by 2002:a17:902:b596:b0:158:f23a:c789 with SMTP id a22-20020a170902b59600b00158f23ac789mr19031923pls.57.1650910616632; Mon, 25 Apr 2022 11:16:56 -0700 (PDT) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id f16-20020aa78b10000000b0050a81508653sm12251481pfd.198.2022.04.25.11.16.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Apr 2022 11:16:56 -0700 (PDT) Date: Mon, 25 Apr 2022 18:16:52 +0000 From: Sean Christopherson To: Oliver Upton Subject: Re: [RFC PATCH 06/17] KVM: arm64: Implement break-before-make sequence for parallel walks Message-ID: References: <20220415215901.1737897-1-oupton@google.com> <20220415215901.1737897-7-oupton@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Cc: kvm@vger.kernel.org, Marc Zyngier , Peter Shier , Ben Gardon , David Matlack , Paolo Bonzini , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu On Mon, Apr 25, 2022, Oliver Upton wrote: > On Mon, Apr 25, 2022 at 8:13 AM Sean Christopherson wrote: > > > > On Fri, Apr 15, 2022, Oliver Upton wrote: > > > The ARM architecture requires that software use the 'break-before-make' > > > sequence whenever memory is being remapped. > > > > What does "remapped" mean here? Changing the pfn? Promoting/demoting to/from a > > huge page? > > Both, but in the case of this series it is mostly concerned with > promotion/demotion. I'll make this language a bit more precise next > time around. Please be very precise :-) It matters because it should be impossible for KVM to actually change a PFN in a valid PTE. Callers of mmu_notifier_change_pte() are required to bookend it with mmu_notifier_invalidate_range_start/end(), i.e. KVM should have zapped all PTEs and should not establish new PTEs. I'd actually like to drop mmu_notifier_change_pte() altogether, because for all intents and purposes, it's dead code. But convincing "everyone" that dropping it instead of trying to salvage it for KSM is too much work :-) _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 94BAAC433EF for ; Mon, 25 Apr 2022 18:18:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=onmDYiT9RwuDdvAvcfD4lYM3WHQu+TyoXBovfVMNOdc=; b=eU1PBXHV9N5NsK NT1p9GiH1kEfK2CIO+r0O2DvxtADGMzAXAzs6PSeFXPZUAIT9/0kluFxmJSozDM83RbjAgmp4jeeJ /0XTKhHs13rsoETRccGWwdcbPN0E26H2Jk/FjvxQMiD1fQO0A6gj3CEsANInSjhZ4jsb5CkqhQ68k 6yf7J9N6gi9zo+QvqwGe+0dthsEuCCIUXVGfLyQfjT/2wyR9b5GSX+4cjIj+zOKMuyOrM7IInky6j MGXeMDEK+YGFY2vfPsHQpEhrTCZFqrVpoAJA3ej249zYYuC+73Odjwmlx0zqacTBQyPnCg+VghRtj o4VLsSTADMC8yu/GfIXA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nj3Go-00Ap3z-KF; Mon, 25 Apr 2022 18:17:10 +0000 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nj3Gl-00Ap1h-64 for linux-arm-kernel@lists.infradead.org; Mon, 25 Apr 2022 18:17:08 +0000 Received: by mail-pj1-x1033.google.com with SMTP id gj17-20020a17090b109100b001d8b390f77bso104424pjb.1 for ; Mon, 25 Apr 2022 11:16:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=cJX4NOJxx8yt8bifaIIJHW1REW326f1qVXuNvHoJSGg=; b=F3Hg1J94deTs8D8c5x1mAeV7ldoQpgW1s6cQYtX1nmsV/vMU5VmvD2P9H4jtGsz0n6 HCRfrqmumUVIyK1j9wk+b+Hh7JxDlXVj5WXa39ZQqtlC8foiC7DcT9y4skTjKIFHv4vw 8YCxCAeVfEmEgrqwzi7pLiiRLvrQf922iJo52BUjCvD7FIZmvWyGa8FOzPJz/6EgGI6v XyYd8VT3Qx82VijPLex/NBTEXRxnpS1jZLs2wulPpuMipuqsAczB115q6JB87jO5kRRS dGB80hWg50jdhiHePj195LJTjAdj0elbPPMHjXkh5hzfETrtqojnaowF7veZzPtIy0DG gipQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=cJX4NOJxx8yt8bifaIIJHW1REW326f1qVXuNvHoJSGg=; b=OdMp1HL8oiBjnODnG2ALqKZz68Gmk00dYixeImK9jLbjKk6qAqyyft9V/UNvzI2DE/ PV4XSOVYxq1MgO74kF5H/5llPEqxvyl8/NLnZgKM2Edp6tU4SwfOVLjuJ0gjg8A7j+ZG 4uQRyS1wwOZXZhSVqAv673RuSRyxNiVBL1X7r6OD76VuB7L8pJld0vM202F46iEyf17A bD8tRKOGNqTgot1O0etu/+P0QrHZZI3PDqDqOrAKrZW1hFbqKkDnkLKQeX/FragMxlJ3 MTbjMxZVOrGTlnHjkPftPtWwTVVCOXvo9AAVUvYgZGDDBN7EHB1Tc1MQLtPvIDxwaT5J 5L/A== X-Gm-Message-State: AOAM531/MoRF5HQuq9+3A/jsvKoTYirJMkO9yMye6Vpwy7R4Xr8lzdFS J7VldqlewkCpPC3zjb5AEgC85Q== X-Google-Smtp-Source: ABdhPJxV/XUGUnp8Y08gGA8YCbm1IrFT95czI8pjByDzfirwYlhZgziSfr3Rg2N60hRkRbJm5fHa3A== X-Received: by 2002:a17:902:b596:b0:158:f23a:c789 with SMTP id a22-20020a170902b59600b00158f23ac789mr19031923pls.57.1650910616632; Mon, 25 Apr 2022 11:16:56 -0700 (PDT) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id f16-20020aa78b10000000b0050a81508653sm12251481pfd.198.2022.04.25.11.16.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Apr 2022 11:16:56 -0700 (PDT) Date: Mon, 25 Apr 2022 18:16:52 +0000 From: Sean Christopherson To: Oliver Upton Cc: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, Marc Zyngier , James Morse , Alexandru Elisei , Suzuki K Poulose , linux-arm-kernel@lists.infradead.org, Peter Shier , Ricardo Koller , Reiji Watanabe , Paolo Bonzini , Ben Gardon , David Matlack Subject: Re: [RFC PATCH 06/17] KVM: arm64: Implement break-before-make sequence for parallel walks Message-ID: References: <20220415215901.1737897-1-oupton@google.com> <20220415215901.1737897-7-oupton@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220425_111707_253878_3C9DAC01 X-CRM114-Status: GOOD ( 14.77 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Apr 25, 2022, Oliver Upton wrote: > On Mon, Apr 25, 2022 at 8:13 AM Sean Christopherson wrote: > > > > On Fri, Apr 15, 2022, Oliver Upton wrote: > > > The ARM architecture requires that software use the 'break-before-make' > > > sequence whenever memory is being remapped. > > > > What does "remapped" mean here? Changing the pfn? Promoting/demoting to/from a > > huge page? > > Both, but in the case of this series it is mostly concerned with > promotion/demotion. I'll make this language a bit more precise next > time around. Please be very precise :-) It matters because it should be impossible for KVM to actually change a PFN in a valid PTE. Callers of mmu_notifier_change_pte() are required to bookend it with mmu_notifier_invalidate_range_start/end(), i.e. KVM should have zapped all PTEs and should not establish new PTEs. I'd actually like to drop mmu_notifier_change_pte() altogether, because for all intents and purposes, it's dead code. But convincing "everyone" that dropping it instead of trying to salvage it for KSM is too much work :-) _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 06C19C433EF for ; Mon, 25 Apr 2022 18:17:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244275AbiDYSUD (ORCPT ); Mon, 25 Apr 2022 14:20:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230029AbiDYSUB (ORCPT ); Mon, 25 Apr 2022 14:20:01 -0400 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 490BA3B03B for ; Mon, 25 Apr 2022 11:16:57 -0700 (PDT) Received: by mail-pj1-x1031.google.com with SMTP id fv2so658614pjb.4 for ; Mon, 25 Apr 2022 11:16:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=cJX4NOJxx8yt8bifaIIJHW1REW326f1qVXuNvHoJSGg=; b=F3Hg1J94deTs8D8c5x1mAeV7ldoQpgW1s6cQYtX1nmsV/vMU5VmvD2P9H4jtGsz0n6 HCRfrqmumUVIyK1j9wk+b+Hh7JxDlXVj5WXa39ZQqtlC8foiC7DcT9y4skTjKIFHv4vw 8YCxCAeVfEmEgrqwzi7pLiiRLvrQf922iJo52BUjCvD7FIZmvWyGa8FOzPJz/6EgGI6v XyYd8VT3Qx82VijPLex/NBTEXRxnpS1jZLs2wulPpuMipuqsAczB115q6JB87jO5kRRS dGB80hWg50jdhiHePj195LJTjAdj0elbPPMHjXkh5hzfETrtqojnaowF7veZzPtIy0DG gipQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=cJX4NOJxx8yt8bifaIIJHW1REW326f1qVXuNvHoJSGg=; b=AwFm4UTehQTftDhUvMYlfiHe8vMyIDSv0JJ/8MNbcU7CG/I4PHr5U4zKMjpbanmrUV FyCyuZLj9AMlTaBzDHLOlzCiCJhF8EYELlE3lxPJecAgJIqtWIOodgPIYuUjxuFEPmtC Qi7SdeNKQdX9I/dFDCpQlzqnyBb13um6RHB+oNHNSmvFBaiDbkXzyFfI3rDPFAq8p9dp HCHXzDnMXicv/Hi/yVOrFK08jhU/5gMlOtjqoPfbwIdI12vBO+2abyqmkTWCVmBalHm5 du34Si64lA4pAkSPAT1/bdd5Q97ABJhjHCzBuC94zzTL4eyYLIKo+t9GB6o/g+GUuEr4 +rLA== X-Gm-Message-State: AOAM530oZYuHarbdEAFa5nHxC6jmi2d343HQEYhRQQ5hmLFog307uhBx +6kM0bzyy0bj7NwB09j1hWXyYg== X-Google-Smtp-Source: ABdhPJxV/XUGUnp8Y08gGA8YCbm1IrFT95czI8pjByDzfirwYlhZgziSfr3Rg2N60hRkRbJm5fHa3A== X-Received: by 2002:a17:902:b596:b0:158:f23a:c789 with SMTP id a22-20020a170902b59600b00158f23ac789mr19031923pls.57.1650910616632; Mon, 25 Apr 2022 11:16:56 -0700 (PDT) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id f16-20020aa78b10000000b0050a81508653sm12251481pfd.198.2022.04.25.11.16.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Apr 2022 11:16:56 -0700 (PDT) Date: Mon, 25 Apr 2022 18:16:52 +0000 From: Sean Christopherson To: Oliver Upton Cc: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, Marc Zyngier , James Morse , Alexandru Elisei , Suzuki K Poulose , linux-arm-kernel@lists.infradead.org, Peter Shier , Ricardo Koller , Reiji Watanabe , Paolo Bonzini , Ben Gardon , David Matlack Subject: Re: [RFC PATCH 06/17] KVM: arm64: Implement break-before-make sequence for parallel walks Message-ID: References: <20220415215901.1737897-1-oupton@google.com> <20220415215901.1737897-7-oupton@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Mon, Apr 25, 2022, Oliver Upton wrote: > On Mon, Apr 25, 2022 at 8:13 AM Sean Christopherson wrote: > > > > On Fri, Apr 15, 2022, Oliver Upton wrote: > > > The ARM architecture requires that software use the 'break-before-make' > > > sequence whenever memory is being remapped. > > > > What does "remapped" mean here? Changing the pfn? Promoting/demoting to/from a > > huge page? > > Both, but in the case of this series it is mostly concerned with > promotion/demotion. I'll make this language a bit more precise next > time around. Please be very precise :-) It matters because it should be impossible for KVM to actually change a PFN in a valid PTE. Callers of mmu_notifier_change_pte() are required to bookend it with mmu_notifier_invalidate_range_start/end(), i.e. KVM should have zapped all PTEs and should not establish new PTEs. I'd actually like to drop mmu_notifier_change_pte() altogether, because for all intents and purposes, it's dead code. But convincing "everyone" that dropping it instead of trying to salvage it for KSM is too much work :-)