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=-5.3 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=no 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 8333BC2D0E4 for ; Fri, 20 Nov 2020 15:55:37 +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 2527022264 for ; Fri, 20 Nov 2020 15:55:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="v3Lc/o2S"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="EwJL05mP" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2527022264 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.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-Type: Content-Transfer-Encoding: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=rXVOW22sgBd4YK8LpWUBTdxx3FPc0zq3a9MNriJd5us=; b=v3Lc/o2SRbXFr7ApxUfOQjYC1 xt3QscZgijNqLuCU34ZCN/2VTclWA0BI8CLwQKncWzXTf1dHA3KaAS0KpA1TouUarS1d74/auiJV0 3kQ9ehvQ0QtNS7F3qyJ//OwwI80kTJaBwQGUK3oxC3bgtipmXy3+XkbOlsfCiWjIfEthAjojx5F3y t/Gc3Cb+OOfT468H0i8P/fe52mfYoAj84ffSk7aDqXAzavtskuoHJvhFYXt375tYxVG9rMzstm8TH UqiNYQhix0QrNCLKh+pUVZhJtKnrDjBXEE7yHadj4vQxr5lipg2yX8b1lCWqx0d+8TKyZ3ISt8Ktw G/X7L8n4Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kg8kf-0003z1-Li; Fri, 20 Nov 2020 15:55:09 +0000 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kg8kd-0003xl-0y for linux-arm-kernel@lists.infradead.org; Fri, 20 Nov 2020 15:55:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605887706; 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=rY2Rec5SHAHV9d9Nn2wvBLT2el7uEj1Kc43gm3aG5HM=; b=EwJL05mPUm3n6YyKzsaGuY67v9GJ8cNLBhFVIx/CcaiaaWUXdHEcdBNGlaqLM4RSOcZ8Fx WP6/UfoMsecJ7luustqtS/zKled1lLYt0cjcuzWJ7AJ4iEYAIFA26++qCiVYGL+pRX7H+P AkwVWIc3qENm7P6ttAlq/d1px6yItL4= Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-408-QMkhEUdiPsabVgRqYVk6yg-1; Fri, 20 Nov 2020 10:55:04 -0500 X-MC-Unique: QMkhEUdiPsabVgRqYVk6yg-1 Received: by mail-ej1-f71.google.com with SMTP id z18so3650378eji.1 for ; Fri, 20 Nov 2020 07:55:03 -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=rY2Rec5SHAHV9d9Nn2wvBLT2el7uEj1Kc43gm3aG5HM=; b=G68odSqqkbFijf9GV+ge7Rs7mrVB/37FtZ1XPGtF5rOS7Y8gqD0a6LaONQ4/hJpPqh PCwCJHgiTVD9ukR/MYyMiV+seIo3e1OsD4xEsT4yyDS6fuHd/Om097+9LSF/Xv06uj6C MJbr2vuR8uDXfRxj8KsY8cS1M1mpBOG/WiRSaPFTNST9mLsXn4MsYN4MG6fzai4fENa/ ALH3gdEZvPXamSzzjoVNa54uV5oV/Fopksb5Vkn2ihJIx12C3u1SAu+RoEVbvVTEpOj3 Kw+bISeuiqjdLHrhEIRc4FDOQC2H3+R1yv74dXzpgjeveS/UPN1y6TCiilRZ4OGLChKB GFAw== X-Gm-Message-State: AOAM533ZfWx2ra/UJwetC0PFWx04MdEy5cOuNwwtuvg/5To1dZhBge+o JCUAqASJFhfJztRcOqwocSyI/iqti0RUWpC6BkSzI2Mkn++RJavotT65A+RYfDpaciZjxcuoh0A lXdDoNDo5zY0sckAMQRNbEmem0Y+C9q1xF/Y= X-Received: by 2002:aa7:d2d9:: with SMTP id k25mr34928691edr.310.1605887702586; Fri, 20 Nov 2020 07:55:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJw3gVlgwW/bmEajthpJVdpMUNtgPUbi/HFUtFVuvcpkMu9pSTRR3a9KC3tEdlGleoOWxNajPA== X-Received: by 2002:aa7:d2d9:: with SMTP id k25mr34928681edr.310.1605887702427; Fri, 20 Nov 2020 07:55:02 -0800 (PST) Received: from ?IPv6:2001:b07:6468:f312:c8dd:75d4:99ab:290a? ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id r25sm1300693eji.8.2020.11.20.07.55.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 20 Nov 2020 07:55:01 -0800 (PST) Subject: Re: [PATCH v6 16/17] RFC: kvm: pass kvm argument to follow_pfn callsites To: Daniel Vetter References: <20201119144146.1045202-1-daniel.vetter@ffwll.ch> <20201119144146.1045202-17-daniel.vetter@ffwll.ch> From: Paolo Bonzini Message-ID: <3eca2dde-c78b-3eb4-8f61-7fdf16573419@redhat.com> Date: Fri, 20 Nov 2020 16:55:00 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201120_105507_171576_DA3AE46F X-CRM114-Status: GOOD ( 16.24 ) 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: linux-samsung-soc , Jan Kara , Kees Cook , KVM list , Jason Gunthorpe , John Hubbard , LKML , DRI Development , Christoph Hellwig , Linux MM , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Daniel Vetter , Dan Williams , Andrew Morton , Linux ARM , "open list:DMA BUFFER SHARING FRAMEWORK" Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 20/11/20 16:44, Daniel Vetter wrote: >> It's a bit of a pity, it's making an API more complex (the point of >> gfn_to_pfn_memslot vs gfn_to_pfn is exactly that you don't need a >> "struct kvm*" and it's clear that you've already done the lookup into >> that struct kvm. > > Yeah I noticed that, I think pushing the lookups down should work, but > that's a fairly large-scale change. I didn't want to do that for the > RFC since it would distract from the actual change/goal. > -Daniel Pushing the lookups down would be worse code and possibly introduce TOC/TOU races, so better avoid that. Your patch is fine. :) Paolo _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel