From patchwork Wed Jan 31 23:30:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 195073 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:106:209c:c626 with SMTP id mn5csp94728dyc; Wed, 31 Jan 2024 15:41:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IEk6GBG5W2GKHMwk00WRDHAwsKcRy44BJwa5K0as+VBpI3Du6dTtVRZb5BwmOoHfBU7zZRQ X-Received: by 2002:a05:622a:138b:b0:42a:b67c:f38c with SMTP id o11-20020a05622a138b00b0042ab67cf38cmr4024770qtk.43.1706744495304; Wed, 31 Jan 2024 15:41:35 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706744495; cv=pass; d=google.com; s=arc-20160816; b=VhbD209p1MUmDE4lbKTsIWT50P/yO9ZWTRJDc4KW3qvYMt9NTcJw3/n05OLxkOwwGy onPLDcVTEhlC0J4zKTKN/3+EGkF0ykyfTwhp2QVTIOkYhSFEhe9amseXXJdwsO0Dk6B+ zrYOjkxYIuZgTty6daHAje11jlDqYYc1WMOUOzBxDfS6P/vb7nHOyNNaOeMXkQVHiWnX mI0aXSnzvqB2cKZith7moZC1Qd7GGPReSjJ6rrerFLFVwVD/DYThsxO8CMThvmg310HO 9yjjuYlQ0vZAOowLZse8o7RSdSvEfyfY5S+8YWqp+399oIYnF3EZTMSBnBVxabTg5VQA qRfA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:to:from:dkim-signature; bh=s+BWRqwRbbb0ZjiffCmlWuwED5KeVg2ZZ25OkfKH+sE=; fh=PgYdv0dh/4nVQMkTzD5KujN8GV24PlrRC5YUNkquLEI=; b=OYeYzsinOi8bgoi9HWfFun0MeGRw53gXrI02b46NAkaG9VM4/M3nfZ+8hXH7kyw1gK 3/LgGNyBt50s5cc+mfXpvpaNk6NQlvD5hdQ/YIutI4jzNGHoTAzuZp9S+xYqsHbjAocc 8wpr3nkwnDSfBPi8vz5h5EZDiFvflF+uYbENWpu2Rc0SBr6NVUQsMRDjR2nIKfmOZjag om6DVgAM/KsSnKe0C2qGCyPgAJgmfqinYHDrhJhR1COedJbaafRN5A2oYNdxgkWbERK/ 6cHtuH5HxX2PHkQrIfFhVVL8k3/wdW/MCP0JtltK2SLyA5fDusF3kZFEK1JwOYYaWPur lBKQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QmYzDbIu; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-47378-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47378-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Forwarded-Encrypted: i=1; AJvYcCUyJWEHANfmfL6rxjEgn3pXS8v7tFavPDQhOh/n7KcHIa37c/q2tY7UKz4EBWI78KrPzs/CcbSvFToh+6YQp4MjrgMJDw== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id j7-20020ac85c47000000b0042bf01cd87asi1024896qtj.579.2024.01.31.15.41.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 15:41:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47378-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QmYzDbIu; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-47378-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47378-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id B3F9A1C227B5 for ; Wed, 31 Jan 2024 23:40:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C08FD482DD; Wed, 31 Jan 2024 23:31:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="QmYzDbIu" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 707393C06B for ; Wed, 31 Jan 2024 23:31:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706743863; cv=none; b=Tcm7rp3rP2GT/+YXSKmT2qCqSvQH4X8oE6QY6gQf2f3rajonHB+PT57Ozolqf5REyG5OZBynDjVj5X9128d6h6unlFb+dH7rRRG8WpKNzmdGsk/8racIres5e2AllXQb5ZMOW7pyLtOvwUGRo79T/kQfOkNTSCnxyIN95H8Kupc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706743863; c=relaxed/simple; bh=Ux18IXW0DZHPKhYAMzyZDNK2COUwdRVoZU6iY0lsftQ=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=u4tK4Y1YyyyMwKSj86FjdKsLeeJn8p2ksKh3VHyz4zDyIwEWd+pHtlsgH3Qc9Wt8bl+sEsGv4jaoMol8zMcOHmu/7jSbEunldZVCjFMh0BcI+mEGyEeAbqEPXmNanoC4DLfmhoxUrzfNFVcncycdvtT5FHYD2uD528UD0RhzWgs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=QmYzDbIu; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706743859; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=s+BWRqwRbbb0ZjiffCmlWuwED5KeVg2ZZ25OkfKH+sE=; b=QmYzDbIu+OKChkYQbK5FdVUUhG+euspl7sMLhTEnFLYSX0JwiY97kwQtR7Ao5pzd41vjIn IDVX7n9vBJseTpQf5ycbER+K0d8RAgxZqkYA4j8eqYPa6AWu/rPGAyFBelDXrZLndViMFp kpR92fKBdw/TKfwStA45kpoH1EqPnZY= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-682-sW8m4aLfOom1O4KLKvp6RA-1; Wed, 31 Jan 2024 18:30:57 -0500 X-MC-Unique: sW8m4aLfOom1O4KLKvp6RA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5D9D212501E1; Wed, 31 Jan 2024 23:30:57 +0000 (UTC) Received: from virtlab511.virt.lab.eng.bos.redhat.com (virtlab511.virt.lab.eng.bos.redhat.com [10.19.152.198]) by smtp.corp.redhat.com (Postfix) with ESMTP id 466B5C2590D; Wed, 31 Jan 2024 23:30:57 +0000 (UTC) From: Paolo Bonzini To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org Subject: [PATCH 5/8] KVM: arm64: move ARM-specific defines to uapi/asm/kvm.h Date: Wed, 31 Jan 2024 18:30:53 -0500 Message-Id: <20240131233056.10845-6-pbonzini@redhat.com> In-Reply-To: <20240131233056.10845-1-pbonzini@redhat.com> References: <20240131233056.10845-1-pbonzini@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789651315745561424 X-GMAIL-MSGID: 1789651315745561424 While this in principle breaks userspace code that mentions KVM_ARM_DEV_* on architectures other than aarch64, this seems unlikely to be a problem considering that run->s.regs.device_irq_level is only defined on that architecture. Signed-off-by: Paolo Bonzini --- arch/arm64/include/uapi/asm/kvm.h | 5 +++++ include/uapi/linux/kvm.h | 7 ------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/arch/arm64/include/uapi/asm/kvm.h b/arch/arm64/include/uapi/asm/kvm.h index 6b8b57b97228..75809c8dc2f0 100644 --- a/arch/arm64/include/uapi/asm/kvm.h +++ b/arch/arm64/include/uapi/asm/kvm.h @@ -162,6 +162,11 @@ struct kvm_sync_regs { __u64 device_irq_level; }; +/* Bits for run->s.regs.device_irq_level */ +#define KVM_ARM_DEV_EL1_VTIMER (1 << 0) +#define KVM_ARM_DEV_EL1_PTIMER (1 << 1) +#define KVM_ARM_DEV_PMU (1 << 2) + /* * PMU filter structure. Describe a range of events with a particular * action. To be used with KVM_ARM_VCPU_PMU_V3_FILTER. diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h index b7c8054e9d14..00d5cecd057d 100644 --- a/include/uapi/linux/kvm.h +++ b/include/uapi/linux/kvm.h @@ -1384,13 +1384,6 @@ struct kvm_enc_region { #define KVM_GET_SREGS2 _IOR(KVMIO, 0xcc, struct kvm_sregs2) #define KVM_SET_SREGS2 _IOW(KVMIO, 0xcd, struct kvm_sregs2) -/* Available with KVM_CAP_ARM_USER_IRQ */ - -/* Bits for run->s.regs.device_irq_level */ -#define KVM_ARM_DEV_EL1_VTIMER (1 << 0) -#define KVM_ARM_DEV_EL1_PTIMER (1 << 1) -#define KVM_ARM_DEV_PMU (1 << 2) - #define KVM_DIRTY_LOG_MANUAL_PROTECT_ENABLE (1 << 0) #define KVM_DIRTY_LOG_INITIALLY_SET (1 << 1)