Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp663745imm; Wed, 18 Jul 2018 08:36:33 -0700 (PDT) X-Google-Smtp-Source: AAOMgpddiHHLDliusNLMl7OZfiE/eVGuufish1W4QIdZq8/lLWJW7N/dt5fXK7LFsifuy+MQYBTd X-Received: by 2002:a17:902:6e09:: with SMTP id u9-v6mr6259587plk.13.1531928193512; Wed, 18 Jul 2018 08:36:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531928193; cv=none; d=google.com; s=arc-20160816; b=gamYX8mJsU0MWms80TU9fGXRPG2vP4fK8WjGPyadoE5nSvqt2VxKW9BFZkMftHTF9p NXzvMlG7Co28ox9bgnI4Bsft3YWv+5EAWni+FXA2WhahqK8g19nC1uqKc9wbSq1wM7aD IUdRLIY/RAc8ge2OnL6HIBpwPrCpWuRxj1aq7gD4ac9h81k3dUKl1sS4lrakpfzvmmTn 1/UhzKq0QUYGC/1LZ6i8X6OTL/WLsE4J4uTgBqVdAa3qd0APdWuDDJFPv6pm6PrsFaYX u9xs3CDX634ykUo5CUcxj78bE9Hr3Zy7mxI4lFETUi410WgL8BRtexex4ySJ/4FGzx8m 1Esw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=425b9yKFxH9T/sA9BZES6WEPhoy5sATcvK0zi0v6Lt0=; b=S8MNr7OSE0eXT6ixSpdFk1mjpN49KY9iAsuUcxfEExkvXe9jUAgO2ilpAz7Ux5OiVH 0bXzCfRK33dztOCulMGv9LtoPR1TNhjPYwF/8EGeW0i/e6lPsvA8/hJ+5mkbe+l1Qk2i Ys3Ea/DrcQvDsVCvAf0kLl0UQyxae8TTvp8faK59ReDAzd9Bt5qyJaSQ7pgTiX/2Pjni DPd1rCq8FDxjDMWv4a+E46IPbut/zTwcE1kgn7DZHUzB17ofM7Y7mCFMcFeN06MXMMhS e9lQ8F5f1wGud0IbGhO0T1rljb8Bg/pnRYVNHGyXPKbdY0+WV5yhUHBbt0iX3aG35kTB s5nQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g10-v6si3278998pgv.315.2018.07.18.08.36.18; Wed, 18 Jul 2018 08:36:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731646AbeGRQM7 (ORCPT + 99 others); Wed, 18 Jul 2018 12:12:59 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:56638 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730987AbeGRQM7 (ORCPT ); Wed, 18 Jul 2018 12:12:59 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 45CFC7DAC2; Wed, 18 Jul 2018 15:34:32 +0000 (UTC) Received: from flask (unknown [10.43.2.80]) by smtp.corp.redhat.com (Postfix) with SMTP id 7B41F2026D69; Wed, 18 Jul 2018 15:34:30 +0000 (UTC) Received: by flask (sSMTP sendmail emulation); Wed, 18 Jul 2018 17:34:29 +0200 Date: Wed, 18 Jul 2018 17:34:29 +0200 From: Radim =?utf-8?B?S3LEjW3DocWZ?= To: KarimAllah Ahmed Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Paolo Bonzini Subject: Re: [PATCH v5 1/2] KVM: Switch 'requests' to be 64-bit (explicitly) Message-ID: <20180718153429.GC6348@flask> References: <1531214840-24686-1-git-send-email-karahmed@amazon.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1531214840-24686-1-git-send-email-karahmed@amazon.de> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Wed, 18 Jul 2018 15:34:32 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Wed, 18 Jul 2018 15:34:32 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'rkrcmar@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2018-07-10 11:27+0200, KarimAllah Ahmed: > Switch 'requests' to be explicitly 64-bit and update BUILD_BUG_ON check to > use the size of "requests" instead of the hard-coded '32'. > > That gives us a bit more room again for arch-specific requests as we > already ran out of space for x86 due to the hard-coded check. > > The only exception here is ARM32 as it is still 32-bits. What do you mean? I think we're just going to slow down kvm_request_pending() on 32 bit architectures. > Cc: Paolo Bonzini > Cc: Radim Krčmář > Cc: kvm@vger.kernel.org > Cc: linux-kernel@vger.kernel.org > Reviewed-by: Jim Mattson > Signed-off-by: KarimAllah Ahmed > --- > v1 -> v2: > - Use FIELD_SIZEOF > --- > diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h > @@ -130,7 +130,7 @@ static inline bool is_error_page(struct page *page) > #define KVM_REQUEST_ARCH_BASE 8 Now that the base is easily moveable, we could also lower it to 4 and get few more arch flags. Bumping requests to 64 bits is probably inevitable and this patch looks good. In v4, you have proposed the bitmap-array solution that would easily allow more than 64 requests -- was the problem that possible implementations of kvm_request_pending were not as efficient for current amount of requests? Thanks. > #define KVM_ARCH_REQ_FLAGS(nr, flags) ({ \ > - BUILD_BUG_ON((unsigned)(nr) >= 32 - KVM_REQUEST_ARCH_BASE); \ > + BUILD_BUG_ON((unsigned)(nr) >= (FIELD_SIZEOF(struct kvm_vcpu, requests) * 8) - KVM_REQUEST_ARCH_BASE); \ > (unsigned)(((nr) + KVM_REQUEST_ARCH_BASE) | (flags)); \ > }) > #define KVM_ARCH_REQ(nr) KVM_ARCH_REQ_FLAGS(nr, 0)