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 X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8753BC433E2 for ; Wed, 9 Sep 2020 15:28:28 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id C7714218AC for ; Wed, 9 Sep 2020 15:28:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C7714218AC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvmarm-bounces@lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 236534B5FE; Wed, 9 Sep 2020 11:28:27 -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 nK-Xwdel1s3y; Wed, 9 Sep 2020 11:28:26 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 1DBB94B2F3; Wed, 9 Sep 2020 11:28:26 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 549C34B5EC for ; Wed, 9 Sep 2020 11:28:25 -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 kvoyrvbyihXe for ; Wed, 9 Sep 2020 11:28:24 -0400 (EDT) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 152AD4B2F3 for ; Wed, 9 Sep 2020 11:28:24 -0400 (EDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A68B7101E; Wed, 9 Sep 2020 08:28:23 -0700 (PDT) Received: from [192.168.0.110] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6757A3F66E; Wed, 9 Sep 2020 08:28:22 -0700 (PDT) Subject: Re: [PATCH v4 02/21] KVM: arm64: Add stand-alone page-table walker infrastructure To: Will Deacon , kvmarm@lists.cs.columbia.edu References: <20200907152344.12978-1-will@kernel.org> <20200907152344.12978-3-will@kernel.org> From: Alexandru Elisei Message-ID: <4ef01cff-71ac-7f3c-2404-af184f5a5cb4@arm.com> Date: Wed, 9 Sep 2020 16:29:26 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20200907152344.12978-3-will@kernel.org> Content-Language: en-US Cc: Marc Zyngier , Catalin Marinas , kernel-team@android.com, 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 Hi Will, On 9/7/20 4:23 PM, Will Deacon wrote: > [..] > + > +int kvm_pgtable_walk(struct kvm_pgtable *pgt, u64 addr, u64 size, > + struct kvm_pgtable_walker *walker) > +{ > + struct kvm_pgtable_walk_data walk_data = { > + .pgt = pgt, > + .addr = ALIGN_DOWN(addr, PAGE_SIZE), > + .end = PAGE_ALIGN(walk_data.addr + size), > + .walker = walker, > + }; If the caller wants to walk [0x500, 0x1500), for PAGE_SIZE = 0x1000 (4K), the function walks the range [0x0, 0x1000). Is that intentional? Thanks, Alex _______________________________________________ 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 X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BC285C43461 for ; Wed, 9 Sep 2020 15:29:43 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4D09322284 for ; Wed, 9 Sep 2020 15:29:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="fD3tJKwI" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4D09322284 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=syWimqZWavFR3rw6/YUFuTdfln757vYhCYYs+sbAeOI=; b=fD3tJKwIc9VByJws/DtpAawjh LHkvWdAUwno4UrK4VbitUqjA7xbIEE7FSzEJnG1i3geTt02My5R/sG2V+kOBMK6PDT+UNzT8uOUvg TPJg+KSpTJE47k1lQU080mPWRliGqSnwgs0JKBIW5ENVSMxktOdiHYgB18bSmBkvJAEIig5KRtWuM PyI58rt6d1C+ypiC1RP0eFYpgCoSCo+Cgfou2X7Qd89WUWqnZTCivC+I1WyaqUo8LrYw/wcqoNOxG 0Fe2E6QppJI0RutTBMCC3EMW9EJ+E5El6VOFD5XAHwNHhRmn0JHYiyWyoRg/XStopa4aipbxAr4LY 4VFvsQW6w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kG21L-0004zj-9H; Wed, 09 Sep 2020 15:28:27 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kG21J-0004z4-3o for linux-arm-kernel@lists.infradead.org; Wed, 09 Sep 2020 15:28:25 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A68B7101E; Wed, 9 Sep 2020 08:28:23 -0700 (PDT) Received: from [192.168.0.110] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6757A3F66E; Wed, 9 Sep 2020 08:28:22 -0700 (PDT) Subject: Re: [PATCH v4 02/21] KVM: arm64: Add stand-alone page-table walker infrastructure To: Will Deacon , kvmarm@lists.cs.columbia.edu References: <20200907152344.12978-1-will@kernel.org> <20200907152344.12978-3-will@kernel.org> From: Alexandru Elisei Message-ID: <4ef01cff-71ac-7f3c-2404-af184f5a5cb4@arm.com> Date: Wed, 9 Sep 2020 16:29:26 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20200907152344.12978-3-will@kernel.org> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200909_112825_217261_0BC905EE X-CRM114-Status: GOOD ( 11.73 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gavin Shan , Suzuki Poulose , Marc Zyngier , Quentin Perret , James Morse , Catalin Marinas , kernel-team@android.com, linux-arm-kernel@lists.infradead.org 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 Hi Will, On 9/7/20 4:23 PM, Will Deacon wrote: > [..] > + > +int kvm_pgtable_walk(struct kvm_pgtable *pgt, u64 addr, u64 size, > + struct kvm_pgtable_walker *walker) > +{ > + struct kvm_pgtable_walk_data walk_data = { > + .pgt = pgt, > + .addr = ALIGN_DOWN(addr, PAGE_SIZE), > + .end = PAGE_ALIGN(walk_data.addr + size), > + .walker = walker, > + }; If the caller wants to walk [0x500, 0x1500), for PAGE_SIZE = 0x1000 (4K), the function walks the range [0x0, 0x1000). Is that intentional? Thanks, Alex _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel