Received: by 10.192.165.156 with SMTP id m28csp2155241imm; Sat, 14 Apr 2018 15:31:25 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+1RT0t0K7ptlivAEdF2gRbzlh9d2k43NnZ6ALAU/yhRH4jG6AC3vRzyyq6FGoYqMNemkKo X-Received: by 2002:a17:902:2702:: with SMTP id c2-v6mr10141688plb.110.1523745085123; Sat, 14 Apr 2018 15:31:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523745085; cv=none; d=google.com; s=arc-20160816; b=lIaMVRHFuP99FILWGnA2xXArr0puWKSkkSnIw0jDLsfYz6p8VyNDiyLrWBJ04ZGEMh IU3A3tTStIyu7z+NC3A25pEEZCQrk0n+nLfHHqmItZD2xFeJleK9Jgy3iGY5XeXJ4Vme GIcMEp4RhNznYVQBPcqthXl8pP1C7vX30bb5Jq0GVdrc52dFlYLXl1pLCqXtMNV7+bHJ DXG8f8Zgaas/ElefExWoG0JIpJVLW9AJsGHRqAu1AeXKDDtb92GgJJr4HAsFLL+mh0om Zvm1EqwN0RkZwVrGOZOVRNZEH7mZu+bbf6p0N4/ejSJ8beNnySfI1t7e6BvNde394DWy R3Ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=9iW1CdU84qJthlo+ns9l42sVP/7bkQmbGwCy7GN8D6w=; b=IFERlsBgiL0o++ER5711vRkgi/oJsITkwfKzBETv9USScMsPNPNj8CY+8rtDf9alUE 6n4B1MVCZz//woP+zP+4ldYEuMaNQwip17KOHTfbCq4TpnfGFcA6bz8cUsSPNOHU2mN0 h7DUEpsN+cVV9F+kRh46BiuVCYsWdABMyHWT9grpeDqCk4ttpTKYO5cx9rsJRaphxpE5 YL2rLNyv+UvDbSeIVzmZpNMqb1t8vY0K+X6MGt/w7x6Bf494HqemWlEvZlxUO/PO6tOb 0OXBC//qhFpGQfBtbY3p85McQfOaMvBBBCYyyT+ohVNq2C7jEj/a6LsRN+IMgWlE1wkb Fa0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.de header.s=amazon201209 header.b=IAjWMFUb; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i61-v6si8429139plb.560.2018.04.14.15.30.37; Sat, 14 Apr 2018 15:31:25 -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; dkim=pass header.i=@amazon.de header.s=amazon201209 header.b=IAjWMFUb; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752133AbeDNW1T (ORCPT + 99 others); Sat, 14 Apr 2018 18:27:19 -0400 Received: from smtp-fw-4101.amazon.com ([72.21.198.25]:34830 "EHLO smtp-fw-4101.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752053AbeDNW1S (ORCPT ); Sat, 14 Apr 2018 18:27:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.de; i=@amazon.de; q=dns/txt; s=amazon201209; t=1523744837; x=1555280837; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=9iW1CdU84qJthlo+ns9l42sVP/7bkQmbGwCy7GN8D6w=; b=IAjWMFUbGBVH/SNSy0dYqfZNvDWODkErcom9fWOMMbb1jciEu8v5ket0 RIr9/3j/pDLSwFcm1Jv3knz5XE/gc0JjRFCVCI8zwYHNzAPVLTVW3gV4v d5Q6qEDstX2vjclDd9k5SjscACzi3OufH1HRixXWRrjMaNE26AMp9z7PW M=; X-IronPort-AV: E=Sophos;i="5.48,451,1517875200"; d="scan'208";a="715956314" Received: from iad6-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-1e-428a6f71.us-east-1.amazon.com) ([10.124.125.6]) by smtp-border-fw-out-4101.iad4.amazon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 14 Apr 2018 22:27:16 +0000 Received: from u54e1ad5160425a4b64ea.ant.amazon.com (iad1-ws-svc-lb91-vlan2.amazon.com [10.0.103.146]) by email-inbound-relay-1e-428a6f71.us-east-1.amazon.com (8.14.7/8.14.7) with ESMTP id w3EMRB8T097789 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 14 Apr 2018 22:27:13 GMT Received: from u54e1ad5160425a4b64ea.ant.amazon.com (localhost [127.0.0.1]) by u54e1ad5160425a4b64ea.ant.amazon.com (8.15.2/8.15.2/Debian-3) with ESMTP id w3EMR9sJ008688; Sun, 15 Apr 2018 00:27:10 +0200 Received: (from karahmed@localhost) by u54e1ad5160425a4b64ea.ant.amazon.com (8.15.2/8.15.2/Submit) id w3EMR9NR008687; Sun, 15 Apr 2018 00:27:09 +0200 From: KarimAllah Ahmed To: kvm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: KarimAllah Ahmed , Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= Subject: [PATCH] KVM: Switch 'requests' to be 64-bit (explicitly) Date: Sun, 15 Apr 2018 00:26:44 +0200 Message-Id: <1523744804-8220-1-git-send-email-karahmed@amazon.de> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Cc: Paolo Bonzini Cc: Radim Krčmář Cc: kvm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: KarimAllah Ahmed --- include/linux/kvm_host.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index 6930c63..fe4f46b 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -129,7 +129,7 @@ static inline bool is_error_page(struct page *page) #define KVM_REQUEST_ARCH_BASE 8 #define KVM_ARCH_REQ_FLAGS(nr, flags) ({ \ - BUILD_BUG_ON((unsigned)(nr) >= 32 - KVM_REQUEST_ARCH_BASE); \ + BUILD_BUG_ON((unsigned)(nr) >= (sizeof(((struct kvm_vcpu *)0)->requests) * 8) - KVM_REQUEST_ARCH_BASE); \ (unsigned)(((nr) + KVM_REQUEST_ARCH_BASE) | (flags)); \ }) #define KVM_ARCH_REQ(nr) KVM_ARCH_REQ_FLAGS(nr, 0) @@ -223,7 +223,7 @@ struct kvm_vcpu { int vcpu_id; int srcu_idx; int mode; - unsigned long requests; + u64 requests; unsigned long guest_debug; int pre_pcpu; @@ -1122,7 +1122,7 @@ static inline void kvm_make_request(int req, struct kvm_vcpu *vcpu) * caller. Paired with the smp_mb__after_atomic in kvm_check_request. */ smp_wmb(); - set_bit(req & KVM_REQUEST_MASK, &vcpu->requests); + set_bit(req & KVM_REQUEST_MASK, (void *)&vcpu->requests); } static inline bool kvm_request_pending(struct kvm_vcpu *vcpu) @@ -1132,12 +1132,12 @@ static inline bool kvm_request_pending(struct kvm_vcpu *vcpu) static inline bool kvm_test_request(int req, struct kvm_vcpu *vcpu) { - return test_bit(req & KVM_REQUEST_MASK, &vcpu->requests); + return test_bit(req & KVM_REQUEST_MASK, (void *)&vcpu->requests); } static inline void kvm_clear_request(int req, struct kvm_vcpu *vcpu) { - clear_bit(req & KVM_REQUEST_MASK, &vcpu->requests); + clear_bit(req & KVM_REQUEST_MASK, (void *)&vcpu->requests); } static inline bool kvm_check_request(int req, struct kvm_vcpu *vcpu) -- 2.7.4