Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2308962pxb; Thu, 11 Feb 2021 09:10:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJx8CDv10bw23NlLogTiCKVpau/UzTvg+BEzxMhlw43ZzDEZzlxA8BFgUEDDKGkniZX2NIYk X-Received: by 2002:a17:906:3f89:: with SMTP id b9mr9256608ejj.204.1613063414524; Thu, 11 Feb 2021 09:10:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613063414; cv=none; d=google.com; s=arc-20160816; b=spJ2R05F21s2vSMabl5RssD1M+uoFDvd1RyTDYb01maIBCJPBzdwHJo63z5ShX8D/a w9uJPl230nyrIStyWisP0QBBLWzFrsynkw2wUPRwIXNFWz0OXtCJ7x40HLQvhZlCzoSs r/bo9+8fu+tzdei0a2e7/+JDBJsgE/tCFDoqj5HvOz3cB8Y/nSGertyegaMs/heoJ+2g iT462da2Nh+o1NNG0EjE2GXqPdhkITDXL0TjLpIB+S7W/XFZsn5p5PNynw6n3ojP6GBr imzlel81TVfRw5VGQWAJ9DU/sgjz8N4pt3Za3ZBC4ymF8q/oExSDS6gL/WLsilXBpFnD wVkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=HeDDVNwJvE2yrKMWyL0hMeAKpq/juTb4nf0aTQ3YIII=; b=jfghN/kIDbl/1hT8NfrIOn6oMfbnzniTpai4fRqeyxHxxCuAlyYMdadlEwtOCzN9uD MVDUD+P613v2aqGgfYKPlk4PQeFPSb8tCo72UUrNmitHxivnXWjTuE6fuydPJfScg9fo 9MVEJgfxFP+ES9KhSktB1HltG+PKICBYdqI5mMn1ZZzwQw4BXShXfU0qfi77yKk5yaun lfgBMlSuz5tc0tbCiJ3vVks1dhcP4E1qZQ9EJU+PNPC7LJiGdizCSemFm4qhex237A63 4j0x9fa3oWfxCTavOzsri7GwnTsu5GzX2Q9Hh9QUSF19Apq8SVgSjSA4ctCIfcpF2QOH dxBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=fH0h91CR; 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 a3si4211294ejv.427.2021.02.11.09.09.47; Thu, 11 Feb 2021 09:10:14 -0800 (PST) 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=fH0h91CR; 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 S231196AbhBKRGE (ORCPT + 99 others); Thu, 11 Feb 2021 12:06:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230347AbhBKP6l (ORCPT ); Thu, 11 Feb 2021 10:58:41 -0500 Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F7E8C061756 for ; Thu, 11 Feb 2021 07:58:01 -0800 (PST) Received: by mail-pf1-x434.google.com with SMTP id t29so3925332pfg.11 for ; Thu, 11 Feb 2021 07:58:01 -0800 (PST) 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=HeDDVNwJvE2yrKMWyL0hMeAKpq/juTb4nf0aTQ3YIII=; b=fH0h91CR7DhcS+JEg8iSiuH+N9x4F/WdXKyPq5PAwBKI7LgvuJUkYbHy7G0NKYvcb8 icBiIuA7sZJ21p0T6EESdBWVxtplnyjpJLaMzvY2e7LpJLbF/fGxE7Gv4P+fz216xcaQ IV5P4qNNp3yCGZA93RPxQTwKrGNn6+3F8frCvuOMyFEmo+hkVhlwWNDR6GO5TP/gDaG9 VK6Y0jx1edOGRq3et9wCvW+9RUzEtYy5DGo+1JFJVAAaE2wu7k9R+sz9y7mAyuH0QCRe Kwvvw1Gdy202iKkkvHP26NJJJeNMfUQwXZmj5H8n88cJ5LFSCidwarEUauZjAfAXyllr k1eA== 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=HeDDVNwJvE2yrKMWyL0hMeAKpq/juTb4nf0aTQ3YIII=; b=e8vpNSyKjM07w6WMJ1aGy0wMIHfdmxlsuBpWOEVMQ0kN6ZOh6yBsaWIOanj3scRGO2 EQkNalCxJqEgi88CFQEcyo/aDKKdMe9NXnMzfM1Dc/ck5sc7uOgXxoKnsiCBly//f9l8 L43+2MtJbw5o6RO6nt48Tlu1lZOGvMLT62tVIdr2XefJHT8vW1rtLwvJm3NxgpqCoMsL OvFQE5fiiis4ddmaLHTY+MgXjq+Y1u0w6LTk2CuKoBkxyE3+NtywDUksJdh6poLtR378 RvGe2ZZS61GgM34tjaISjRR3a9GmZqaF+3yQb3FJHUR3Hmzy6cDXGSf8IiEEe5TY5ebL /6Gg== X-Gm-Message-State: AOAM533lJdLuhlWg9jMaJN6yOkRGeLVYGWvWwsojRzMNzCJPqE4tJVQE 8ick3tvKWnTKDHqhgZyE6BhFjQ== X-Received: by 2002:a63:e108:: with SMTP id z8mr8565022pgh.363.1613059080521; Thu, 11 Feb 2021 07:58:00 -0800 (PST) Received: from google.com ([2620:15c:f:10:11fc:33d:bf1:4cb8]) by smtp.gmail.com with ESMTPSA id c18sm6061906pfi.167.2021.02.11.07.57.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Feb 2021 07:58:00 -0800 (PST) Date: Thu, 11 Feb 2021 07:57:53 -0800 From: Sean Christopherson To: Paolo Bonzini Cc: Ben Gardon , kvm , LKML , Yanan Wang , Andrew Jones , Peter Xu , Aaron Lewis Subject: Re: [PATCH 09/15] KVM: selftests: Move per-VM GPA into perf_test_args Message-ID: References: <20210210230625.550939-1-seanjc@google.com> <20210210230625.550939-10-seanjc@google.com> <756fed52-8151-97ee-11f2-91f150afab42@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <756fed52-8151-97ee-11f2-91f150afab42@redhat.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 11, 2021, Paolo Bonzini wrote: > On 11/02/21 02:56, Sean Christopherson wrote: > > > > + pta->gpa = (vm_get_max_gfn(vm) - guest_num_pages) * pta->guest_page_size; > > > > + pta->gpa &= ~(pta->host_page_size - 1); > > > Also not related to this patch, but another case for align. > > > > > > > if (backing_src == VM_MEM_SRC_ANONYMOUS_THP || > > > > backing_src == VM_MEM_SRC_ANONYMOUS_HUGETLB) > > > > - guest_test_phys_mem &= ~(KVM_UTIL_HUGEPAGE_ALIGNMENT - 1); > > > > - > > > > + pta->gpa &= ~(KVM_UTIL_HUGEPAGE_ALIGNMENT - 1); > > > also align > > > > > > > #ifdef __s390x__ > > > > /* Align to 1M (segment size) */ > > > > - guest_test_phys_mem &= ~((1 << 20) - 1); > > > > + pta->gpa &= ~((1 << 20) - 1); > > > And here again (oof) > > > > Yep, I'll fix all these and the align() comment in v2. > > This is not exactly align in fact; it is x & ~y rather than (x + y) & ~y. > Are you going to introduce a round-down macro or is it a bug? (I am > lazy...). Good question. I, too, was lazy. I didn't look at the guts of align() when I moved it, and I didn't look closely at Ben's suggestion. I'll take a closer look today and make sure everything is doing what it's supposed to do.