Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2739886pxj; Mon, 10 May 2021 09:39:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzK36SA+1Nb/+26Q0Blg7VACl7+osW9vdyfg4nK9E4oyBPl14/Fy4IRhRgrILdVTln1cd7y X-Received: by 2002:a92:b74a:: with SMTP id c10mr21780985ilm.72.1620664761699; Mon, 10 May 2021 09:39:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620664761; cv=none; d=google.com; s=arc-20160816; b=BhZ+DZaShYILGDhi8YyPd3ifhmDQL/cgDzd9fyfYADw81iDkOvmU5oPd1PnPXtNqW9 pcUeXLEiNoEfQco8C8xBAPDRJ0FFPQsjcQ8FCzwde0zhCeHzkMvXeA9VJBHcmSKU0iQ3 lb7mL/jRukl2FfxX5adHCm5LBcB5LMisDRazC91Ye4ALJWOpPc1DMfymOZTyomXqTYRs v82t6c7hA3GjxjTWWYlKy1MVCGaVAs14Bs5q/Xvf4euTEM15ap6pVRoqoAuT+7+gmgpk uGU78uCm689z4Iag9cz0MAGKlzqmCtP9Fw1xZ+bb7fvzTB3zqaUaZk/Cs5bEcZrDPDMQ yASQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=gZ7cDY5D7ED7oV3zufRsM/2xrQZyC5C3tmx4hUtNL90=; b=ZiB/v+3iJQND3CwiAu7c4wpTmEp2Se0b3irjK652Qny2VU2zqzSjjA06jWmKYB0Bjx 3hE3pafRf44fTTQLb5abFtkVK6Z/k/yAXOavCJJlVH5+nFaR6pk0Mz8fALmZxsrLqy1/ fNzbXyX5GlESripnIqjLJoKNXbn2ROaHI275G5TeqSSogwx3gCasBRZ6vzibG5yxPrjE WJtW6zo3MsibeIgF67o+v6Mv8OO8O0TuIP30eM6ONSBfgDwS0OL5jgTngXfmwmECC9Nd frseULONKC8fLQxq8oUjRL7YtOLTJElkQs8frK5lYfctqD556QCApvhSRJ8wpEF38vz7 h5pQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=RjMaIpp5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r5si18343935ilg.18.2021.05.10.09.39.07; Mon, 10 May 2021 09:39:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=RjMaIpp5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231877AbhEJQj0 (ORCPT + 99 others); Mon, 10 May 2021 12:39:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231659AbhEJQjH (ORCPT ); Mon, 10 May 2021 12:39:07 -0400 Received: from mail-io1-xd29.google.com (mail-io1-xd29.google.com [IPv6:2607:f8b0:4864:20::d29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 283BDC06175F for ; Mon, 10 May 2021 09:38:02 -0700 (PDT) Received: by mail-io1-xd29.google.com with SMTP id a11so15384465ioo.0 for ; Mon, 10 May 2021 09:38:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=gZ7cDY5D7ED7oV3zufRsM/2xrQZyC5C3tmx4hUtNL90=; b=RjMaIpp5YIRqTnldyLdlV3fxRBx2tRhXYAgDzcbGJOa7RFPgiR4+I34uS2mWSTyhF3 NRZg3TGeLwGW3bJZeucXGxLobGWJpKprli+RnTvfD1GxIij0PUNB0S8EP6dIvL9pwXZ3 u1P4cBawO5UY/BdlfLpeECy0p7chC49SZcXfrwP4iIjJZpkPpRsDtAgSVmiPaP+b6Z7c eiBk6guFB+u2avFI9OkGHmy3daxI28f2LZTxJs4y1y3O4QBVGD7b5Xrd8usCfPoo4du5 RCIAGcZRg9FKvkGv0q6Jz1DNC8KWcLTMHFaDQItWQ0yRwt3caqgR9SlRBBmJxo9YWEt2 pjGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=gZ7cDY5D7ED7oV3zufRsM/2xrQZyC5C3tmx4hUtNL90=; b=Xppn15I9Hsz/DkxtAgOi+rE2mDUfXRn219Ua9rM2R64ijhhOxnG5QneKhbxlLCdKx5 1MqloyFrO1CoNvCTFs5d0LtNW5xmVmZFsxh0NzoQ5bk1vMdqvJaWnnSxblDdokhnGhKi dG1Eb2kzgxUHDAMcsertXHii6EfHHglHsrM6zXEUHdA0Bl2RNkhoj98dfk0fVVRbB/Y0 Zgwac6AbfsKIFa53thohma4c/th8B34mU98VgjZWyDCdGeIOSXlg0KxlL1dHvByLE5ah HOhm+V6LrgJ4zhvmLKerr1EmVfa1vfphLnqp1lI0SgYNJQN+WOHPREx4zCWdlboGfNz0 dQAg== X-Gm-Message-State: AOAM530T81LhCy7Ort6IwQJTaAij0J7g7//RxGLbih0oknmRaaIz5WO2 vtFKEnp6x2g+wrSRZ/xVWOaxAnrhNnuKnvdTkeU34A== X-Received: by 2002:a6b:b2c8:: with SMTP id b191mr2257093iof.19.1620664681447; Mon, 10 May 2021 09:38:01 -0700 (PDT) MIME-Version: 1.0 References: <20210506184241.618958-1-bgardon@google.com> <20210506184241.618958-6-bgardon@google.com> <03e66630-b967-b91c-b74e-6944bdcaf2d7@redhat.com> In-Reply-To: <03e66630-b967-b91c-b74e-6944bdcaf2d7@redhat.com> From: Ben Gardon Date: Mon, 10 May 2021 09:37:51 -0700 Message-ID: Subject: Re: [PATCH v3 5/8] KVM: x86/mmu: Add a field to control memslot rmap allocation To: Paolo Bonzini Cc: LKML , kvm , Peter Xu , Sean Christopherson , Peter Shier , Yulei Zhang , Wanpeng Li , Xiao Guangrong , Kai Huang , Keqian Zhu Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 10, 2021 at 9:33 AM Paolo Bonzini wrote: > > On 10/05/21 18:14, Ben Gardon wrote: > >> Possibly stupid (or at least lazy) question: why can't it be a "normal" > >> static inline function? > > That was my initial approach (hence the leftover inline) but I got > > some warnings about a forward declaration of struct kvm because > > arch/x86/include/asm/kvm_host.h doesn't include virt/kvm/kvm_host.h. > > Maybe there's a way to fix that, but I didn't want to mess with it. > > > > Let's just use the field directly. That works for me too. I moved to the wrapper because adding the smp_load_acquire and a comment explaining why we were doing that looked bloated and I thought it would be easier to document in one place, but it's not that much bloat, and having the subtleties documented directly in the function is probably clearer for readers anyway. > > Paolo >