Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1980434rdb; Wed, 31 Jan 2024 15:39:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IGb9BGXl+STeAiWuxmR9PICbo0+FG8dRo4fKJ51XHI7xqjqk/L9u3k6BsASRrgzozpNY0xS X-Received: by 2002:a05:620a:b85:b0:784:ba4:7042 with SMTP id k5-20020a05620a0b8500b007840ba47042mr967700qkh.69.1706744381569; Wed, 31 Jan 2024 15:39:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706744381; cv=pass; d=google.com; s=arc-20160816; b=R8fRweaTFfdOonty6zBgaGJsmE6YLxc5ZQ5ilaYmQS40HWiKahsS1IgxwvhP7ScN3i CgqAKJtS7YbpbZuvC/pD6ajnE1j9H3kOg7Z+cjAsPEOc+8BZkxmCUELijCC+1hsiyGkB czhP+QhdZ0vRgI9cs9umQgfHoaWpUfCGeWJeq6mZ5CA0DSYMFyrWE5NSoXkU+i92Mb8Z bwgscWnoQgv+D59HDlSCHE8cZt+VkH+ewX39ZvXviHjN2pg/XxCDmkd5nOYKMdLBIIUx 9j5bWeUD8MU9AvsaaCBXSnFY5vjrdgMSOXGaIuC0qihmE1AP85BX4fGs2rt0u/PtOcVU 1jyQ== 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=qJvE1SRsR/qR/by5RcNBKVAxpeGKj1Pas8p9l7Jbyao=; fh=BorKo2WHQI/KSaZJTjt9TnMzEBThyYzIW0EhGae/ajE=; b=AYMARb+B43n+cfD0YTIdWG8Km9NQeDM6HrZREzgqnOl1PT5RHDPzRcUvRZhWyYoomK 7NWrvit9wqDEEjiVZ0UdFgvbQekvM/gc+U509WAVhaNYTHpIIxfCPeAyoOd2yWutmVf5 JAUhcwDEI5XNfVouiwPRNQaUWIVv8rfnT1YSYuLNY5lwkhYFTx0pRP33lFkOxFnJPvay u5auxCmD3wGESqGOO/+Ge888a4ymSilNWbNmEFvmj6C1CifLNp2i1lsqVhdxELmYk6VD 3BzKAU8T6XLjSfpoPMcQnJ4XYYOOxrkcBjb+j9EofVrVdC+67ZvG3mSmcNiIQnh1Yalp 6iMg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=WfriaY9p; 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-47380-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47380-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Forwarded-Encrypted: i=1; AJvYcCUyjWZltfmuU744B61zqa8x4dzAQv8n/cVWgondHfbf+SHOnie9NQkyt7TnR5rPaTx3o3KhSXDobs2NwHmQCkejECWLCywzHRWb5MhCEQ== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id t22-20020a05620a0b1600b0078403334a55si6416806qkg.133.2024.01.31.15.39.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 15:39:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47380-linux.lists.archive=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=WfriaY9p; 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-47380-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47380-linux.lists.archive=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 547491C25035 for ; Wed, 31 Jan 2024 23:39:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8191447F6A; Wed, 31 Jan 2024 23:31:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="WfriaY9p" 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 5D71C3C497 for ; Wed, 31 Jan 2024 23:31:01 +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=1706743864; cv=none; b=OKWoJKoGBE/lYKwd2PXzc7lz2G7XRj4q/SfjUmZ02IMgpiraWgGumBItehj63qIwYwN6mPx4LQpw4GNDxhtV6JR+3eJtIjJqOZJCFsl3t8CveCyq7+lRzakG+LnkM44WYCm/2DJYs5/X4HS6kxLT5MnIhn2mDcy+IInoDd1hFyA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706743864; c=relaxed/simple; bh=NhyqOTC+iPTISMZZnFTimq/nANv46xw9EN49JJUfr2I=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=S16XWo+xYGF8v37wfl9SAwoIPKB7bXVJltbo+c/ZZ/KiBVubWlFyQ+K9c3b8Te5X6jo1fYsPC+BZ268bxYbyP5rihlomUPbqQO2IPaxWv2DxH6YIboDox2XAJP3Uf8gcSgjuTIN8GQkgP2UHgxeK7JEIwEzqJKgwSCxQEHlLTao= 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=WfriaY9p; 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=1706743861; 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=qJvE1SRsR/qR/by5RcNBKVAxpeGKj1Pas8p9l7Jbyao=; b=WfriaY9py5pSIHd0Lq0ixWi0ZfS57UvTjmtdgslfpVoVaukOLzy0QfMJyDTsniX6LYfN8S TpoQ3522goaGXSDl1Pym4Lo46IyX0VMEzoFDfiyBUm18UXW2dw3ynUceI9LP+qvzaOmcFF 39e78o/KwpFRMeqCDeH+MlwRaGQK4CE= 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-388-P_n42ALDO4CirAnq__DfYA-1; Wed, 31 Jan 2024 18:30:57 -0500 X-MC-Unique: P_n42ALDO4CirAnq__DfYA-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 1ECBF101A526; 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 071C6C2590D; Wed, 31 Jan 2024 23:30:57 +0000 (UTC) From: Paolo Bonzini To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org Subject: [PATCH 3/8] KVM: powerpc: move powerpc-specific structs to uapi/asm/kvm.h Date: Wed, 31 Jan 2024 18:30:51 -0500 Message-Id: <20240131233056.10845-4-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 Content-Type: text/plain Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 While this in principle breaks the appearance of KVM_PPC_* ioctls on architectures other than powerpc, this seems unlikely to be a problem considering that there are already many "struct kvm_ppc_*" definitions in arch/powerpc/include/uapi. Signed-off-by: Paolo Bonzini --- arch/powerpc/include/uapi/asm/kvm.h | 44 +++++++++++++++++++++++++++++ include/uapi/linux/kvm.h | 44 ----------------------------- 2 files changed, 44 insertions(+), 44 deletions(-) diff --git a/arch/powerpc/include/uapi/asm/kvm.h b/arch/powerpc/include/uapi/asm/kvm.h index 9f18fa090f1f..a96ef6b36bba 100644 --- a/arch/powerpc/include/uapi/asm/kvm.h +++ b/arch/powerpc/include/uapi/asm/kvm.h @@ -733,4 +733,48 @@ struct kvm_ppc_xive_eq { #define KVM_XIVE_TIMA_PAGE_OFFSET 0 #define KVM_XIVE_ESB_PAGE_OFFSET 4 +/* for KVM_PPC_GET_PVINFO */ + +#define KVM_PPC_PVINFO_FLAGS_EV_IDLE (1<<0) + +struct kvm_ppc_pvinfo { + /* out */ + __u32 flags; + __u32 hcall[4]; + __u8 pad[108]; +}; + +/* for KVM_PPC_GET_SMMU_INFO */ +#define KVM_PPC_PAGE_SIZES_MAX_SZ 8 + +struct kvm_ppc_one_page_size { + __u32 page_shift; /* Page shift (or 0) */ + __u32 pte_enc; /* Encoding in the HPTE (>>12) */ +}; + +struct kvm_ppc_one_seg_page_size { + __u32 page_shift; /* Base page shift of segment (or 0) */ + __u32 slb_enc; /* SLB encoding for BookS */ + struct kvm_ppc_one_page_size enc[KVM_PPC_PAGE_SIZES_MAX_SZ]; +}; + +#define KVM_PPC_PAGE_SIZES_REAL 0x00000001 +#define KVM_PPC_1T_SEGMENTS 0x00000002 +#define KVM_PPC_NO_HASH 0x00000004 + +struct kvm_ppc_smmu_info { + __u64 flags; + __u32 slb_size; + __u16 data_keys; /* # storage keys supported for data */ + __u16 instr_keys; /* # storage keys supported for instructions */ + struct kvm_ppc_one_seg_page_size sps[KVM_PPC_PAGE_SIZES_MAX_SZ]; +}; + +/* for KVM_PPC_RESIZE_HPT_{PREPARE,COMMIT} */ +struct kvm_ppc_resize_hpt { + __u64 flags; + __u32 shift; + __u32 pad; +}; + #endif /* __LINUX_KVM_POWERPC_H */ diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h index 9744e1891c16..a5458aeee018 100644 --- a/include/uapi/linux/kvm.h +++ b/include/uapi/linux/kvm.h @@ -810,50 +810,6 @@ struct kvm_enable_cap { __u8 pad[64]; }; -/* for KVM_PPC_GET_PVINFO */ - -#define KVM_PPC_PVINFO_FLAGS_EV_IDLE (1<<0) - -struct kvm_ppc_pvinfo { - /* out */ - __u32 flags; - __u32 hcall[4]; - __u8 pad[108]; -}; - -/* for KVM_PPC_GET_SMMU_INFO */ -#define KVM_PPC_PAGE_SIZES_MAX_SZ 8 - -struct kvm_ppc_one_page_size { - __u32 page_shift; /* Page shift (or 0) */ - __u32 pte_enc; /* Encoding in the HPTE (>>12) */ -}; - -struct kvm_ppc_one_seg_page_size { - __u32 page_shift; /* Base page shift of segment (or 0) */ - __u32 slb_enc; /* SLB encoding for BookS */ - struct kvm_ppc_one_page_size enc[KVM_PPC_PAGE_SIZES_MAX_SZ]; -}; - -#define KVM_PPC_PAGE_SIZES_REAL 0x00000001 -#define KVM_PPC_1T_SEGMENTS 0x00000002 -#define KVM_PPC_NO_HASH 0x00000004 - -struct kvm_ppc_smmu_info { - __u64 flags; - __u32 slb_size; - __u16 data_keys; /* # storage keys supported for data */ - __u16 instr_keys; /* # storage keys supported for instructions */ - struct kvm_ppc_one_seg_page_size sps[KVM_PPC_PAGE_SIZES_MAX_SZ]; -}; - -/* for KVM_PPC_RESIZE_HPT_{PREPARE,COMMIT} */ -struct kvm_ppc_resize_hpt { - __u64 flags; - __u32 shift; - __u32 pad; -}; - #define KVMIO 0xAE /* machine type bits, to be used as argument to KVM_CREATE_VM */ -- 2.39.0