Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp7249634pxv; Fri, 30 Jul 2021 13:49:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwBOAC2E3eGC0YWDimqLwLPitSalWodkNURddbXm6PLkys9SdPG+DMXD4McF177H+450ZdA X-Received: by 2002:a02:a69a:: with SMTP id j26mr3563035jam.9.1627678141757; Fri, 30 Jul 2021 13:49:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627678141; cv=none; d=google.com; s=arc-20160816; b=ansrSkUvMfUm+RHyW/ITuOwF2vku1NDzus8SbQ2jhQHFqMx7xY7yi7/27eBjW2hmnA 1co0oP+WM0FCXlAdwnSBsherkvhHHyytxw/TCgLn04O6/ZkkUJXPjApnFKit7WsVke6E z1xkdQ50niKJr5YXdFcrR00pqAF1BgmxPGWTBeDReMeT7QDuIy5E9L7V34nLGrOYtncg csYi5t7lfC7zWRAT5HqM+0MFQzzw1CHkBxEiz5zh1PjP1TC1z3ZpK3gBzhfIgv2hmU6F TNtvvUAQlsjmzabzwyKCILadgQ0mwUAF0/wLTDsnHUGZpqu2Z8SuD+NTH+flGP4JaopQ J9NA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :cc:to:subject:from:date; bh=GuaHJWM/Ene6umHuMl8/nOE809BhJ9zTrmFuV1e3ERw=; b=efFvZHolOGxeu65Gg2VjV/lLpIw2hYmTQgTBeSfMCyRo0pZfvalQdx3+JH8S+WUAOo /amS95wogq1HIzjgNj+PsXzciHOIxzPhYAg70H1Q7Y16KwcbG+VpUF0WIgRtj4fpSvT8 XAkTDFtPT3/hSoPsmpyKx1BNUORnUIJ1XVNRUHDq/n18RYzA8IwyAsj1VldpBhWfWSZm NY+76JhFc20g9q4AysKP0DmVuEalfDDDMqRd2WelKOV1fPuuSDOd45kivTqC2k9rREux /4byDY6lhA4uDZgFVrNDejrIAfudIf7rR0ReSPYOSA8+YAlONEF3YM7QVu+jGdjgxBO4 rhLA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 187si3017164iow.86.2021.07.30.13.48.49; Fri, 30 Jul 2021 13:49:01 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231286AbhG3UsM (ORCPT + 99 others); Fri, 30 Jul 2021 16:48:12 -0400 Received: from mta-09-3.privateemail.com ([68.65.122.19]:16921 "EHLO MTA-09-3.privateemail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230455AbhG3UsM (ORCPT ); Fri, 30 Jul 2021 16:48:12 -0400 Received: from mta-09.privateemail.com (localhost [127.0.0.1]) by mta-09.privateemail.com (Postfix) with ESMTP id AF1DB180094A; Fri, 30 Jul 2021 16:48:06 -0400 (EDT) Received: from [192.168.0.46] (unknown [10.20.151.224]) by mta-09.privateemail.com (Postfix) with ESMTPA id 14DCF18000B7; Fri, 30 Jul 2021 16:48:03 -0400 (EDT) Date: Fri, 30 Jul 2021 16:47:57 -0400 From: Hamza Mahfooz Subject: Re: [PATCH] KVM: const-ify all relevant uses of struct kvm_memory_slot To: Peter Xu Cc: linux-kernel@vger.kernel.org, Paolo Bonzini , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , kvm@vger.kernel.org Message-Id: In-Reply-To: References: <20210713023338.57108-1-someguy@effective-light.com> X-Mailer: geary/40.0 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hey Peter, On Fri, Jul 30 2021 at 04:19:21 PM -0400, Peter Xu wrote: > This patch breaks kvm/queue with above issue. Constify of > kvm_memory_slot > pointer should have nothing to do with this so at least it should > need a > separate patch. At the meantime I also don't understand why memcpy() > here, > which seems to be even slower.. To const-ify the slot member of struct slot_rmap_walk_iterator, we need to initialize a new struct and then copy it over (otherwise we would need to relay on casting again or the compiler will complain about it).