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=-20.4 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FSL_HELO_FAKE, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL 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 ADAC8C4338F for ; Tue, 3 Aug 2021 10:24:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6DC1C6103C for ; Tue, 3 Aug 2021 10:24:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235373AbhHCKYJ (ORCPT ); Tue, 3 Aug 2021 06:24:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235294AbhHCKYH (ORCPT ); Tue, 3 Aug 2021 06:24:07 -0400 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B298FC06175F for ; Tue, 3 Aug 2021 03:23:52 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id p5so24760806wro.7 for ; Tue, 03 Aug 2021 03:23:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=4nP9D6D93L6qc5wew7Nn46YCj/dOgm/CGIsmnHV7G9M=; b=Ho4RQEFtqmvBySDaWHiw1aTqR3SvwRCIavU7WYhFyFZhuNLD+JoxHFCrzhAGnlwv45 nGcmz5APzAtb38Smfo7PXQOSiH9KG+hvvvDyezbbCsXufg9MGoEC2R5Hdso09fGEMt6q SvkrB1zNZe8acO7dxYIUmRnRXfp6O3KpfKQrqXJdOX8R+4/+K1zFHXDlzjLJ/HOYxZtH FYAc+DfRi8FWVr0tTLlKp54se6JvxmOaP/V4ia6YKhaHu5fhhzBDNVmUGB2ktw/ZXwSx R1cpS1W9iOhYU6OAgDBOYDoRukjsvsNjbWcfyU9AmBb67uctkwKkttxb7JCAhkUatIxC Yv+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=4nP9D6D93L6qc5wew7Nn46YCj/dOgm/CGIsmnHV7G9M=; b=Zv+RDC/jobCACWTO21cUOuW6Jxc+jYI5pok9qriyfIV/awm427xt+ABMKeefMmpzPa Ps+3LLinCMq9HslJaPIz0CJrKzURJz0JO5YowyBGlwZ3nqcliv5kJhMAGqeES+eFyget pZVRqtiQQGks9PMPSc6NO2OXyHOkI+lYJ74bFFl5rBXXEbI9Vblu5LWonxvtr1NBIs1n 8pjxUGRht5vSSe6qPyeav6NAG8HUMv1UgK8Nh8B87V9TOeDV06ZKI0N6q7oWDN6Ye1Cc kcbFLCyrsu8JErEDiNHUiIO9ChpvetDYHzYpMhvsSJD6n4UBbyvPQGVUZB2AbDR5bvy+ /GnQ== X-Gm-Message-State: AOAM530aVz+lz1yPJqfNRApuFiB4du+yN3yTET7G7sTVbD+gxIrBXziF CiVaL65P+Ncls8Fz/rok2a+Xaw== X-Google-Smtp-Source: ABdhPJw6dFoHt9c3udAF7oPNiz9FzEP1I0FGJKO5RGfwj7M7cAIND+fyusk+0UJkJ+0JmosBwI1pOw== X-Received: by 2002:adf:fd90:: with SMTP id d16mr23463332wrr.105.1627986231087; Tue, 03 Aug 2021 03:23:51 -0700 (PDT) Received: from google.com ([2a00:79e0:d:210:754:7d1b:7303:129a]) by smtp.gmail.com with ESMTPSA id n5sm12842687wme.47.2021.08.03.03.23.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Aug 2021 03:23:50 -0700 (PDT) Date: Tue, 3 Aug 2021 11:23:47 +0100 From: Quentin Perret To: Fuad Tabba Cc: maz@kernel.org, james.morse@arm.com, alexandru.elisei@arm.com, suzuki.poulose@arm.com, catalin.marinas@arm.com, will@kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, ardb@kernel.org, qwandor@google.com, dbrazdil@google.com, kernel-team@android.com Subject: Re: [PATCH v3 15/21] KVM: arm64: Introduce addr_is_memory() Message-ID: References: <20210729132818.4091769-1-qperret@google.com> <20210729132818.4091769-16-qperret@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: linux-kernel@vger.kernel.org On Monday 02 Aug 2021 at 16:52:31 (+0200), Fuad Tabba wrote: > Hi Quentin. > > On Thu, Jul 29, 2021 at 3:28 PM Quentin Perret wrote: > > > > Introduce a helper usable in nVHE protected mode to check whether a > > physical address is in a RAM region or not. > > > > Signed-off-by: Quentin Perret > > --- > > arch/arm64/kvm/hyp/include/nvhe/mem_protect.h | 1 + > > arch/arm64/kvm/hyp/nvhe/mem_protect.c | 7 +++++++ > > 2 files changed, 8 insertions(+) > > > > diff --git a/arch/arm64/kvm/hyp/include/nvhe/mem_protect.h b/arch/arm64/kvm/hyp/include/nvhe/mem_protect.h > > index cc86598654b9..5968fbbb3514 100644 > > --- a/arch/arm64/kvm/hyp/include/nvhe/mem_protect.h > > +++ b/arch/arm64/kvm/hyp/include/nvhe/mem_protect.h > > @@ -51,6 +51,7 @@ extern const u8 pkvm_hyp_id; > > int __pkvm_prot_finalize(void); > > int __pkvm_mark_hyp(phys_addr_t start, phys_addr_t end); > > > > +bool addr_is_memory(phys_addr_t phys); > > I'm just wondering about the naming of the function. I understand what > you're trying to achieve with it, but an address without a unit that > conveys size or type seems to be missing something. Would Well it does have a type no? I was hopping this would make it clear what it actually does. > memregion_addr_is_memory or something like that be a better > description, since it is what find_mem_range finds? I think the callers shouldn't need to care about the implementation details though. This just replies to the question 'is this physical address in RAM range or not?'. And I could actually imagine that we would change the implementation some day to avoid the binary search, but the users probably don't need to care. Thanks, Quentin 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=-10.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,FSL_HELO_FAKE, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 C19D0C4338F for ; Tue, 3 Aug 2021 10:23:56 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id 36F6460F58 for ; Tue, 3 Aug 2021 10:23:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 36F6460F58 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id B3B39406AD; Tue, 3 Aug 2021 06:23:55 -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 zOzzgk08FtVA; Tue, 3 Aug 2021 06:23:54 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 91B70407F1; Tue, 3 Aug 2021 06:23:54 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 59359406AD for ; Tue, 3 Aug 2021 06:23:53 -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 JeX8DCizX-7w for ; Tue, 3 Aug 2021 06:23:52 -0400 (EDT) Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id 3A01E40629 for ; Tue, 3 Aug 2021 06:23:52 -0400 (EDT) Received: by mail-wr1-f51.google.com with SMTP id h13so11268451wrp.1 for ; Tue, 03 Aug 2021 03:23:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=4nP9D6D93L6qc5wew7Nn46YCj/dOgm/CGIsmnHV7G9M=; b=Ho4RQEFtqmvBySDaWHiw1aTqR3SvwRCIavU7WYhFyFZhuNLD+JoxHFCrzhAGnlwv45 nGcmz5APzAtb38Smfo7PXQOSiH9KG+hvvvDyezbbCsXufg9MGoEC2R5Hdso09fGEMt6q SvkrB1zNZe8acO7dxYIUmRnRXfp6O3KpfKQrqXJdOX8R+4/+K1zFHXDlzjLJ/HOYxZtH FYAc+DfRi8FWVr0tTLlKp54se6JvxmOaP/V4ia6YKhaHu5fhhzBDNVmUGB2ktw/ZXwSx R1cpS1W9iOhYU6OAgDBOYDoRukjsvsNjbWcfyU9AmBb67uctkwKkttxb7JCAhkUatIxC Yv+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=4nP9D6D93L6qc5wew7Nn46YCj/dOgm/CGIsmnHV7G9M=; b=aQZWeH3guN1nlGcop8tOPK7HDTx8RE4ps5SesBjL7DZbZ2ddRbVDSGkdMGOjYd86dv uFQxfnd9swbmR1VFjmLB2UsIuFT+NQVkVaqCJSUbtWY6QDtIJZgjzn7zX17ogfgX+Cuc po1gs2Ja0qbHG9jOvcDtmt4+D0ejq8nyZzdqC8eQQO8yGj5yPSSn0H4YZoyWifbtOzt4 jbogX32ad4GsM1fkXh22GrRznLTFaeqQ8BNe4eIx1CohmvsQqNtLEJOCKrQfxO63jpfc EDZE/GEpAsUO3OH8gGvNdHx/ZXuRQEDQSZDhQwhj/Z54AcZgKaLCtMiddqjas7LIlibK LHpw== X-Gm-Message-State: AOAM533kONonQ8WwqeOiTL+zvqRbtouchqfhEoUbCMGC88qqaoTF+UeL AggR9RJ/JFPLKAI93nrjBjWWug== X-Google-Smtp-Source: ABdhPJw6dFoHt9c3udAF7oPNiz9FzEP1I0FGJKO5RGfwj7M7cAIND+fyusk+0UJkJ+0JmosBwI1pOw== X-Received: by 2002:adf:fd90:: with SMTP id d16mr23463332wrr.105.1627986231087; Tue, 03 Aug 2021 03:23:51 -0700 (PDT) Received: from google.com ([2a00:79e0:d:210:754:7d1b:7303:129a]) by smtp.gmail.com with ESMTPSA id n5sm12842687wme.47.2021.08.03.03.23.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Aug 2021 03:23:50 -0700 (PDT) Date: Tue, 3 Aug 2021 11:23:47 +0100 From: Quentin Perret To: Fuad Tabba Subject: Re: [PATCH v3 15/21] KVM: arm64: Introduce addr_is_memory() Message-ID: References: <20210729132818.4091769-1-qperret@google.com> <20210729132818.4091769-16-qperret@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Cc: kernel-team@android.com, qwandor@google.com, maz@kernel.org, linux-kernel@vger.kernel.org, catalin.marinas@arm.com, will@kernel.org, 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 Monday 02 Aug 2021 at 16:52:31 (+0200), Fuad Tabba wrote: > Hi Quentin. > > On Thu, Jul 29, 2021 at 3:28 PM Quentin Perret wrote: > > > > Introduce a helper usable in nVHE protected mode to check whether a > > physical address is in a RAM region or not. > > > > Signed-off-by: Quentin Perret > > --- > > arch/arm64/kvm/hyp/include/nvhe/mem_protect.h | 1 + > > arch/arm64/kvm/hyp/nvhe/mem_protect.c | 7 +++++++ > > 2 files changed, 8 insertions(+) > > > > diff --git a/arch/arm64/kvm/hyp/include/nvhe/mem_protect.h b/arch/arm64/kvm/hyp/include/nvhe/mem_protect.h > > index cc86598654b9..5968fbbb3514 100644 > > --- a/arch/arm64/kvm/hyp/include/nvhe/mem_protect.h > > +++ b/arch/arm64/kvm/hyp/include/nvhe/mem_protect.h > > @@ -51,6 +51,7 @@ extern const u8 pkvm_hyp_id; > > int __pkvm_prot_finalize(void); > > int __pkvm_mark_hyp(phys_addr_t start, phys_addr_t end); > > > > +bool addr_is_memory(phys_addr_t phys); > > I'm just wondering about the naming of the function. I understand what > you're trying to achieve with it, but an address without a unit that > conveys size or type seems to be missing something. Would Well it does have a type no? I was hopping this would make it clear what it actually does. > memregion_addr_is_memory or something like that be a better > description, since it is what find_mem_range finds? I think the callers shouldn't need to care about the implementation details though. This just replies to the question 'is this physical address in RAM range or not?'. And I could actually imagine that we would change the implementation some day to avoid the binary search, but the users probably don't need to care. Thanks, Quentin _______________________________________________ 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=-11.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FSL_HELO_FAKE, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 D71B2C4338F for ; Tue, 3 Aug 2021 10:25:37 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id A2A9460ED6 for ; Tue, 3 Aug 2021 10:25:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A2A9460ED6 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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=Ljx/rQYHHM+nUNikdXoxuerP6AfdBXBeF7y73GX9f8k=; b=Txxint+6DYBpEy IGF6j1qlSrjI6gB7BNB3tLCmXyJ9PdHqUKLcW/wee+7Rsx1cJkzUFf2t2bUD7R6lRCM3dBqcdMmqk uTt1Vp+93VxrpOXWS5F1HpeMLWrIXuru1Ih6VaRKqwtAqnOyJbyMMkq+Lukow2oRNS73jd7pzYgM1 eVUiLllcApgr9vXJC/akqRPY2sEwyO+nfspgroSDjfK7OV87TzFshywSM+GpgYpEv11NNkECWug2D 6qAAp+w+ZAzPZHDZbOEkONt3DlC83RPcyc6jr7cok+cyXrTUwVERI/LCYZI024nRJ/u6E24Y0mvVW EsWLDHESALj6d142Lchg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mAraZ-001zcE-EY; Tue, 03 Aug 2021 10:23:59 +0000 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mAraV-001zb4-Cr for linux-arm-kernel@lists.infradead.org; Tue, 03 Aug 2021 10:23:56 +0000 Received: by mail-wr1-x436.google.com with SMTP id d8so24719694wrm.4 for ; Tue, 03 Aug 2021 03:23:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=4nP9D6D93L6qc5wew7Nn46YCj/dOgm/CGIsmnHV7G9M=; b=Ho4RQEFtqmvBySDaWHiw1aTqR3SvwRCIavU7WYhFyFZhuNLD+JoxHFCrzhAGnlwv45 nGcmz5APzAtb38Smfo7PXQOSiH9KG+hvvvDyezbbCsXufg9MGoEC2R5Hdso09fGEMt6q SvkrB1zNZe8acO7dxYIUmRnRXfp6O3KpfKQrqXJdOX8R+4/+K1zFHXDlzjLJ/HOYxZtH FYAc+DfRi8FWVr0tTLlKp54se6JvxmOaP/V4ia6YKhaHu5fhhzBDNVmUGB2ktw/ZXwSx R1cpS1W9iOhYU6OAgDBOYDoRukjsvsNjbWcfyU9AmBb67uctkwKkttxb7JCAhkUatIxC Yv+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=4nP9D6D93L6qc5wew7Nn46YCj/dOgm/CGIsmnHV7G9M=; b=SSne49XARIN8vol0wfAQKYE5uqvNVwyfN/Pzbs1NkyFMGQHY9h+LOu5CkdZn6xFTxG nLUPY4F4z8sh5w66BaeQE9r9+rm0u0J3VUOwKGiMxjDkddnbDaCWvmlVbBncfh8BzRcA V91BgS36voSS2KeW30bKqVVl5mcHItWoAxY/8lQGqD4gC/qAZ4LCx2SU3n6OR7CN9YpE O03wZPIZ2TJIL/rQso2s0Rkf9+SNBz3yj4ye7cdbwz/oQx93NZ69Fg8o/kdTllbtZc3H caHW2TVtmnvDL762quX3E78I+JtM5JQXdi+UyV6ibzL99mJoMMw/HuG1McXWiEU7af9E clhw== X-Gm-Message-State: AOAM532FVa6drgpRmZx0pY981nUCMhnV0nheqADX9Wk5heOKrUaCJ7aW xTiUXQxmcpqJnepu2xj7OenRWw== X-Google-Smtp-Source: ABdhPJw6dFoHt9c3udAF7oPNiz9FzEP1I0FGJKO5RGfwj7M7cAIND+fyusk+0UJkJ+0JmosBwI1pOw== X-Received: by 2002:adf:fd90:: with SMTP id d16mr23463332wrr.105.1627986231087; Tue, 03 Aug 2021 03:23:51 -0700 (PDT) Received: from google.com ([2a00:79e0:d:210:754:7d1b:7303:129a]) by smtp.gmail.com with ESMTPSA id n5sm12842687wme.47.2021.08.03.03.23.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Aug 2021 03:23:50 -0700 (PDT) Date: Tue, 3 Aug 2021 11:23:47 +0100 From: Quentin Perret To: Fuad Tabba Cc: maz@kernel.org, james.morse@arm.com, alexandru.elisei@arm.com, suzuki.poulose@arm.com, catalin.marinas@arm.com, will@kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, ardb@kernel.org, qwandor@google.com, dbrazdil@google.com, kernel-team@android.com Subject: Re: [PATCH v3 15/21] KVM: arm64: Introduce addr_is_memory() Message-ID: References: <20210729132818.4091769-1-qperret@google.com> <20210729132818.4091769-16-qperret@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-20210803_032355_519547_3A4F8B55 X-CRM114-Status: GOOD ( 24.22 ) 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 Monday 02 Aug 2021 at 16:52:31 (+0200), Fuad Tabba wrote: > Hi Quentin. > > On Thu, Jul 29, 2021 at 3:28 PM Quentin Perret wrote: > > > > Introduce a helper usable in nVHE protected mode to check whether a > > physical address is in a RAM region or not. > > > > Signed-off-by: Quentin Perret > > --- > > arch/arm64/kvm/hyp/include/nvhe/mem_protect.h | 1 + > > arch/arm64/kvm/hyp/nvhe/mem_protect.c | 7 +++++++ > > 2 files changed, 8 insertions(+) > > > > diff --git a/arch/arm64/kvm/hyp/include/nvhe/mem_protect.h b/arch/arm64/kvm/hyp/include/nvhe/mem_protect.h > > index cc86598654b9..5968fbbb3514 100644 > > --- a/arch/arm64/kvm/hyp/include/nvhe/mem_protect.h > > +++ b/arch/arm64/kvm/hyp/include/nvhe/mem_protect.h > > @@ -51,6 +51,7 @@ extern const u8 pkvm_hyp_id; > > int __pkvm_prot_finalize(void); > > int __pkvm_mark_hyp(phys_addr_t start, phys_addr_t end); > > > > +bool addr_is_memory(phys_addr_t phys); > > I'm just wondering about the naming of the function. I understand what > you're trying to achieve with it, but an address without a unit that > conveys size or type seems to be missing something. Would Well it does have a type no? I was hopping this would make it clear what it actually does. > memregion_addr_is_memory or something like that be a better > description, since it is what find_mem_range finds? I think the callers shouldn't need to care about the implementation details though. This just replies to the question 'is this physical address in RAM range or not?'. And I could actually imagine that we would change the implementation some day to avoid the binary search, but the users probably don't need to care. Thanks, Quentin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel