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=-23.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL autolearn=unavailable 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 861D4C47088 for ; Wed, 26 May 2021 21:25:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5C2A760FEB for ; Wed, 26 May 2021 21:25:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233032AbhEZV0x (ORCPT ); Wed, 26 May 2021 17:26:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232976AbhEZV0l (ORCPT ); Wed, 26 May 2021 17:26:41 -0400 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0EBC9C06175F for ; Wed, 26 May 2021 14:25:09 -0700 (PDT) Received: by mail-pj1-x1033.google.com with SMTP id g24so1527232pji.4 for ; Wed, 26 May 2021 14:25:09 -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=WVc6rrn4ix7kzoqkUAe/JbStIipNPKiFqHZ5BsMtVeo=; b=ZoRVc9oN4oNPKm6vjIAUPW0PzVTj4Nvxi4/+CjDSVOTPFV9F+9Nb8cusOtcjxx/UME yABMRA4bu2vX6q0/SBRHFLozQESmq6u8WhynmHwImFViPpw/4LrFLvuzNZIuC+Ov75bw sDxtW2JvlTwGtcraiLi408RVMttNHqf5tlVMG7S9zRRYQxNCWoh7KGsHZT2t+qSpgPv3 LpMv1bp1WrtJKPRasXxJ04gcA3bF0pp46KYjAlq+c8B8W3oNL36kIn0MUDDQBhqVLZ0q Q3GfEZgPCOtVrAPid5irXC13Y09I1ZxFD6xOavl5xzxx/SwAJpcez6P5bvBSLOv1QAZa WbOw== 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=WVc6rrn4ix7kzoqkUAe/JbStIipNPKiFqHZ5BsMtVeo=; b=SD7QPCjJWe7/EgRc0VTojDKYAX+J7EiN+tGcktc7DwI2fGY0P6bpGt1XapJrcEjN8n TpAinEhonBgmAg/iniEdCcRaoBGjWM8/vanN2c6iMKlF8rPs755iq6zdIYMT5sHrl879 a1tS9Y6GELapjNbegcm/rVTzGtLQcVn+bRwknd+r674WXT2Wiv6xq3bT1XvmrcjP4hwk Kiw619ZtSjsSLZhTPLVBuMBCSSBjLl17ELplCiRGB6F8G7ZcqaVdulSrbdNO1IiyRopw XQLmC07a4WrxOEqq3tCd9rkf/TOTj5WE+gnZwi39FJTYlPJDQR1PFwTYHnllLvDKJjrq k63w== X-Gm-Message-State: AOAM531tdcXlQczVcM6y+fGoFBf4Bl+bIu2k5Jy6l532vdLpzYtxEdfY SVQfZN/OipjGTw7mNXFAks/JYtWNSOC9+Q== X-Google-Smtp-Source: ABdhPJzE1Bi0PAdIhkNUKqEOZDKNbG0v5wgFpWssPQYy0i0Y03qVcKMKLtsZ9Q848HNHzI9YNwhX7Q== X-Received: by 2002:a17:90b:f95:: with SMTP id ft21mr147436pjb.215.1622064308427; Wed, 26 May 2021 14:25:08 -0700 (PDT) Received: from google.com (240.111.247.35.bc.googleusercontent.com. [35.247.111.240]) by smtp.gmail.com with ESMTPSA id m5sm16586pgl.75.2021.05.26.14.25.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 May 2021 14:25:07 -0700 (PDT) Date: Wed, 26 May 2021 21:25:04 +0000 From: Sean Christopherson To: Ben Gardon Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Paolo Bonzini , Peter Xu , Peter Shier , Peter Feiner , Junaid Shahid , Jim Mattson , Yulei Zhang , Wanpeng Li , Vitaly Kuznetsov , Xiao Guangrong Subject: Re: [PATCH v2 01/13] KVM: x86/mmu: Re-add const qualifier in kvm_tdp_mmu_zap_collapsible_sptes Message-ID: References: <20210401233736.638171-1-bgardon@google.com> <20210401233736.638171-2-bgardon@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210401233736.638171-2-bgardon@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 01, 2021, Ben Gardon wrote: > kvm_tdp_mmu_zap_collapsible_sptes unnecessarily removes the const > qualifier from its memlsot argument, leading to a compiler warning. Add > the const annotation and pass it to subsequent functions. > > Signed-off-by: Ben Gardon > --- > arch/x86/kvm/mmu/mmu.c | 10 +++++----- > arch/x86/kvm/mmu/mmu_internal.h | 5 +++-- > arch/x86/kvm/mmu/tdp_mmu.c | 5 +++-- > arch/x86/kvm/mmu/tdp_mmu.h | 3 ++- > include/linux/kvm_host.h | 2 +- > 5 files changed, 14 insertions(+), 11 deletions(-) > > diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c > index efb41f31e80a..617809529987 100644 > --- a/arch/x86/kvm/mmu/mmu.c > +++ b/arch/x86/kvm/mmu/mmu.c > @@ -715,8 +715,7 @@ static void kvm_mmu_page_set_gfn(struct kvm_mmu_page *sp, int index, gfn_t gfn) > * handling slots that are not large page aligned. > */ > static struct kvm_lpage_info *lpage_info_slot(gfn_t gfn, > - struct kvm_memory_slot *slot, > - int level) > + const struct kvm_memory_slot *slot, int level) I'd prefer to let this poke out (it's only 2 chars) instead of having an unaligned param list. And if we want to make it pretty, we could always do: static struct kvm_lpage_info *lpage_info_slot(const struct kvm_memory_slot *slot, gfn_t gfn, int level)