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 0C477CDB47E for ; Wed, 18 Oct 2023 15:46:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232185AbjJRPq0 (ORCPT ); Wed, 18 Oct 2023 11:46:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235263AbjJRPMl (ORCPT ); Wed, 18 Oct 2023 11:12:41 -0400 Received: from mail-pl1-x64a.google.com (mail-pl1-x64a.google.com [IPv6:2607:f8b0:4864:20::64a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C2DE113 for ; Wed, 18 Oct 2023 08:12:39 -0700 (PDT) Received: by mail-pl1-x64a.google.com with SMTP id d9443c01a7336-1caaaa873efso4985155ad.3 for ; Wed, 18 Oct 2023 08:12:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1697641959; x=1698246759; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=evf98vIg4TK2MPQBLVBmj385x0hMw4FlsTtUwU11DSI=; b=d51R1t+jYNyCrVgXhpOOE+dXe6Aovx8stHBG7TKoKEwls9axz0dTXnX4CDatWJDU+1 hvtIf/d1v+DG36x6GiTkAdnYOBkOYqMfm/EadTzUqYKRsi8pnLrN0nfkC77DrztuY5U1 hfG2E4dyIqMDIWCGEXjTNFNh+SDeDBP/WyfIhbHiXSSddfk6j2RRUpwCwA758UjJ6qMl ITjlHy3V+vtSFCZKF+dVtD/BEB291uf+sJ3+kZTBUnn7twKO2FvI3Q7Sq+EkNjFs+kv8 q2YNnBUURURdeIED67nXUqWRObxPzaMLCo0z4jWPdKO4xYGwNR8BUj7wME172RUJQF9Q m9Ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697641959; x=1698246759; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=evf98vIg4TK2MPQBLVBmj385x0hMw4FlsTtUwU11DSI=; b=tizg0D9vg8v1TvKQeofQx38nRQ1wPpYncrleYZLMuX4+eLmiFw7sTs3FSHq3HFAKME 7t/U/JgBVmWZCQJMbshi91l2/aA3QWbPezYAtjZXTME7pSX5WQ8NtkOwsyAXAO9WJc5t 3o76HDJAAPb6Cu0QSejZ7JOhMEcQH81kef9O9zrCGQdF081U1LSB341920EYIWXIV79a efC0eJPYLpHsxq1yRUt+DBVBaUHdjf2Ul6QKbkUsr+8eoYzodM/j+sAFanzXJHPaMk6S MtqtP3qnFkrnOY0jbnJac+eGCPb84aG2991fPhCIbLAD6jKIzEBz5DYXUNG2t6IiXVey a1Tg== X-Gm-Message-State: AOJu0YyPbQsGCpLB03tSP2LevQMx3x4K7Wyq8hdzkB96J5tDozn8mSTZ WhoOBHbOUiqd0adYJnAVwm36S3yErpc= X-Google-Smtp-Source: AGHT+IGGj6YD1tNGtkylhZ2TMrFEwNGuXiRirTZJm64uFeGyC2oRhC4jwU5nYGby5n/F7k9IPGht2AGbZO4= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a17:903:328a:b0:1b8:8c7:31e6 with SMTP id jh10-20020a170903328a00b001b808c731e6mr130834plb.1.1697641958822; Wed, 18 Oct 2023 08:12:38 -0700 (PDT) Date: Wed, 18 Oct 2023 08:12:37 -0700 In-Reply-To: <020adf4b-5fd9-4216-9dac-7dabe53617d5@intel.com> Mime-Version: 1.0 References: <20231013070037.512051-1-xiaoyao.li@intel.com> <020adf4b-5fd9-4216-9dac-7dabe53617d5@intel.com> Message-ID: Subject: Re: [PATCH] KVM: x86: Use the correct size of struct kvm_vcpu_pv_apf_data and fix the documentation From: Sean Christopherson To: Xiaoyao Li Cc: Paolo Bonzini , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 18, 2023, Xiaoyao Li wrote: > On 10/18/2023 1:28 AM, Sean Christopherson wrote: > > On Fri, Oct 13, 2023, Xiaoyao Li wrote: > > > Fix the kvm_gfn_to_hva_cache_init() to use the correct size though KVM > > > only touches fist 8 bytes. > > > > This isn't a fix. There's actually meaningful value in precisely initializing the > > cache as it guards against KVM writing into the padding, e.g. this WARN would fire: > > > > if (WARN_ON_ONCE(len + offset > ghc->len)) > > return -EINVAL; > > > > So it's a bit odd, but I would prefer to keep the current behavior of mapping only > > the first 8 bytes. > > > > Here's what I'm thinking to clean up the enabled field (compile tested only, > > haven't touched the docs other than the obvious removal): > > It looks better. > > Will you send out a formal patch yourself? or leave it to me? Your call, I don't have a preference. Just let me know which option you choose.