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=-7.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 28206C433E0 for ; Thu, 11 Feb 2021 13:38:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C0CA464DA8 for ; Thu, 11 Feb 2021 13:38:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230299AbhBKNhi (ORCPT ); Thu, 11 Feb 2021 08:37:38 -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-Google-Smtp-Source: ABdhPJw86omcCww3Grv2u7cdAIF2HtKvKP9q6OhV7oOtjNAZkcp+eceV3hNZ0A7cl6cyg04lcA/l/Q== 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