Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2144413pxb; Thu, 11 Feb 2021 05:39:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJz8etWIYNyC6w9TvOHIGGKmKtfh5xwWsP1qKwHtGv7cJx+d2WyhdWDeUBE6fx/neW+yrlqa X-Received: by 2002:a17:906:2e4f:: with SMTP id r15mr8572182eji.407.1613050749718; Thu, 11 Feb 2021 05:39:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613050749; cv=none; d=google.com; s=arc-20160816; b=m4/PPMwT6PJBm/rZYtrUI652R4hkonpe++7xXyEcLiDJeGSn6/ds88si/4QpHElLkH sBhpIA6ohHUnUpCTp5NE29gUeug+0T75+6xRak8qLqFSxC4FQMopOvY73eCwZUNVEFD5 eFirDBBicpzSC0sysXSneWydhkS3JNE1XjFKAPMeh61YPSkrLjPdwQNd0bclMLHf+ihj /En7sWw0MSaUBXS3/mtMV33EfuDpwBw6ivtkp+u0CsNzb8sAsKE8BVhYxFHg/6Ddnif8 yWaa+cEWV7ML5FrvhPjbukOd8OG1fZBv+6h49u/snPawjmg8t2VeCuT8FHiQFTHcrrVZ 68gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=0/ylQ7keEMZM2vB0HyhfCbqRdrDWn9fjEd0p4iPMH+0=; b=ArQz/N1TADz17wnKvI3e/VNrOS2LQ74kylClhfWwP6r1YWyiiCdlgZCXqw0mbP9u78 i22UiPeeYILyHjXtnlGWuTui51BLSwPip+XZNjmAXLOfTLy9xgaW748ykkCF5kqU8BBs Kuvb8HMBvy6VDkiNaP13JOPOvsxFUQasag0reGt6pHRZyUfbKAoCjD713uSU6oMS6Koq rrW80KpN0B3rqe1NHHCiZ5g9aKFdlTBIMUZuh39KD3/nxBxVgfi7JyXVAVcyTEDQWF2T bsBRfH9gBAeuQdsFfgXv9T/MplXc3U3D5P+EJR8sWQmsaMXG7v31L/tik7nAMCgjwzWa ZQrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZrN1Hp6u; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id kl24si3910970ejc.100.2021.02.11.05.38.44; Thu, 11 Feb 2021 05:39:09 -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=@redhat.com header.s=mimecast20190719 header.b=ZrN1Hp6u; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231253AbhBKNhZ (ORCPT + 99 others); Thu, 11 Feb 2021 08:37:25 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:53887 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231734AbhBKNO1 (ORCPT ); Thu, 11 Feb 2021 08:14:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613049179; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0/ylQ7keEMZM2vB0HyhfCbqRdrDWn9fjEd0p4iPMH+0=; b=ZrN1Hp6uR5vLudFdPw2lMEXsT0qmHm9wGJMwypm55O1WhwhlcYbt/Msq3heDho8wSyewFJ qPO0a3sayxLu/g1SDKonLcFSHCziAg+hha4JsMmR6ltfA1M/QsnwqTolbtmIKRNeNAaUou L/Amd0v2LGtnlzE+bUyZTeHMF0GvhZ0= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-79-h3S7f7aZM5OJsa89OFrPIw-1; Thu, 11 Feb 2021 08:12:55 -0500 X-MC-Unique: h3S7f7aZM5OJsa89OFrPIw-1 Received: by mail-wr1-f69.google.com with SMTP id o16so2475344wrn.1 for ; Thu, 11 Feb 2021 05:12:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=0/ylQ7keEMZM2vB0HyhfCbqRdrDWn9fjEd0p4iPMH+0=; b=MXTMcIsMYcfzwqsxQDUIGzSe/QuJfonujAPhpLm9iqRoguEiKdiZUUIJzyCkH9Wv3M I67CwfzVZwRXd+rHnIhLfjZfeP8XFSsUzJwOz3la0NWYsvjgeTWrzTAROQmsCYKrDyKQ iZWe+HeBnM1xQ/XWp4SLNGZYTuJHXgkyrn4RYoJ7aeNrziigcxUl5ATIrs6duSXHSyww gMBUGAivaC2je+A0IcmWaCKprCT5PzetzkcElzJFNSl2wmo6G87oNQuru77qznyNexTA eEpJPpXil1NDM//biU5rXw+u5u8fMg85Mxn9uqA0/dzxd+TivPMzhO+63VbpcyI35jIj yvRw== X-Gm-Message-State: AOAM532QaX/15ldgsD8vixq9r2/6xUu69d4mYXuxyUdW/WB61MwrJDQf b7lSlXvyS/1UqZB7EBgnT/qGXg1jia05VHeZR30KQPaQMgt5J2t2G0sYqzV/5RaAOysa0XeG4fy D2/o8/MpqsUZLrScvEJ0uOgpM X-Received: by 2002:a7b:ce17:: with SMTP id m23mr4931796wmc.80.1613049174454; Thu, 11 Feb 2021 05:12:54 -0800 (PST) X-Received: by 2002:a7b:ce17:: with SMTP id m23mr4931784wmc.80.1613049174338; Thu, 11 Feb 2021 05:12:54 -0800 (PST) Received: from ?IPv6:2001:b07:6468:f312:c8dd:75d4:99ab:290a? ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id d15sm739684wru.80.2021.02.11.05.12.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 11 Feb 2021 05:12:53 -0800 (PST) Subject: Re: [PATCH 09/15] KVM: selftests: Move per-VM GPA into perf_test_args To: Sean Christopherson , Ben Gardon Cc: kvm , LKML , Yanan Wang , Andrew Jones , Peter Xu , Aaron Lewis References: <20210210230625.550939-1-seanjc@google.com> <20210210230625.550939-10-seanjc@google.com> From: Paolo Bonzini Message-ID: <756fed52-8151-97ee-11f2-91f150afab42@redhat.com> Date: Thu, 11 Feb 2021 14:12:52 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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...). Paolo