From patchwork Fri Oct 27 18:22:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Christopherson X-Patchwork-Id: 13438948 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id F3F23C25B70 for ; Fri, 27 Oct 2023 18:23:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A40518001D; Fri, 27 Oct 2023 14:23:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9C74F80018; Fri, 27 Oct 2023 14:23:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7CA4D8001D; Fri, 27 Oct 2023 14:23:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 63EB480018 for ; Fri, 27 Oct 2023 14:23:10 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 3EC0040779 for ; Fri, 27 Oct 2023 18:23:10 +0000 (UTC) X-FDA: 81392063340.08.7397D48 Received: from mail-pl1-f201.google.com (mail-pl1-f201.google.com [209.85.214.201]) by imf22.hostedemail.com (Postfix) with ESMTP id 74DA6C0016 for ; Fri, 27 Oct 2023 18:23:08 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=n48X3M1J; spf=pass (imf22.hostedemail.com: domain of 3CwA8ZQYKCCwaMIVRKOWWOTM.KWUTQVcf-UUSdIKS.WZO@flex--seanjc.bounces.google.com designates 209.85.214.201 as permitted sender) smtp.mailfrom=3CwA8ZQYKCCwaMIVRKOWWOTM.KWUTQVcf-UUSdIKS.WZO@flex--seanjc.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1698430988; a=rsa-sha256; cv=none; b=Ib1wat25RZHo6XbFdhNmISIjc4HSVWoRfPhcRPy2ETESgSjk7y3krQJVD9E3w0uvJPehc8 qqCBpNGeqCbSr521FFb9zjc3REx8orGAzevqV/R/g0UIcQt+Qx+tJ1nkjH4wGkNdOGO02z sq4ft+B5HnjCbrQijuECKXqn+O9fgro= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=n48X3M1J; spf=pass (imf22.hostedemail.com: domain of 3CwA8ZQYKCCwaMIVRKOWWOTM.KWUTQVcf-UUSdIKS.WZO@flex--seanjc.bounces.google.com designates 209.85.214.201 as permitted sender) smtp.mailfrom=3CwA8ZQYKCCwaMIVRKOWWOTM.KWUTQVcf-UUSdIKS.WZO@flex--seanjc.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1698430988; h=from:from:sender:reply-to: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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=o8gdvYQ3/1yqqCN7M6+cUJLwJKILjEFSh0R8bjlKI1I=; b=RDijblpQgxHuXfznSmEdcmAlLykAeb7GwRRQz2OUaCT29twv3q+VyZoA2tvUI6DGZor98z m7+sGfsFguqPwgW2fIsQO1VQvmdirag4OPAPEX7K49fnCaRt+o/kVnrJ+FDNxSMVgqoLQr U9z2bAU4CgPl4IVkqJajNz1wQm3FLA0= Received: by mail-pl1-f201.google.com with SMTP id d9443c01a7336-1c9da175faaso20619725ad.1 for ; Fri, 27 Oct 2023 11:23:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1698430987; x=1699035787; darn=kvack.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:from:to:cc:subject:date:message-id:reply-to; bh=o8gdvYQ3/1yqqCN7M6+cUJLwJKILjEFSh0R8bjlKI1I=; b=n48X3M1JNrWhfG58vEMEzAQr+6pnUd/6VMWQCIeshgyCNR2qTr3/JIs11zWxObsBYA 9Bg55i/iOUtn71Dpwg/AVgzMWJpDHdPrlUOmMPzPPXStdq3jI0+fjzOPU709USIOe5vX ukURhSph8l0Gb5KXvoqqmR1vfsCttycOPcCTCRPRMvEpgfrhK++wNxsOp2QGfk1+Jr2Z hbs70wF+Bb6g4HIJLXsa1U4wgqyKj0rpj0PTmF3WLggVoeZOq9+WWcX0MWu8Ncb9jW2V 2eR8HZ28gdDXd98yc15OjhmMYVjPVg+U9PdKri01kLkSP0k+GXXloLPR6+PGKJTICAzH M0+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698430987; x=1699035787; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=o8gdvYQ3/1yqqCN7M6+cUJLwJKILjEFSh0R8bjlKI1I=; b=vpO5lBhPtfmNGOzYy6xGxxWPQ0iWTU80ume61avV042qac9N6pSP8e+cRINwtspzVc TZIU55b3NvWxYVI20xyPE4aIPZ+xU+QI8pcqq/UIDGk0oOn68jfznZAv4gAH5YTM6jsY dGCBVvq/lRapayydNO2chWxu6gLlB/KoXwi/FdXYRhoGgm6/s47IE/Kge1stz1VGweFl 8DucVdRkS0+v7+KZopf9ruYYWSaWb9sK8QOgHnyx/K9A0iehf7c6/Ip4bnIcwODECjqF 7Y96foPZYSBrJPILHK1ZMSJLAzjydsj0n06idEcxki0GNMBWsbixQU0Ttrmg/6/HHQ41 GGnA== X-Gm-Message-State: AOJu0YxSJvtLzIcV69sAVman3i/cHkPLZtR6quak/6vKO/2TnaVc5CI+ ItmZlcFjk57Tk9s6npb9GiraSiwFZsM= X-Google-Smtp-Source: AGHT+IGxPKYh61YDaE4Ab16I5616FjNw5G/WLIOxqZ93NjDEP07jn0icTkqJBzjVXPbdr7XzvwkO91qMX/M= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a17:902:c144:b0:1cc:281a:8463 with SMTP id 4-20020a170902c14400b001cc281a8463mr32544plj.7.1698430987435; Fri, 27 Oct 2023 11:23:07 -0700 (PDT) Reply-To: Sean Christopherson Date: Fri, 27 Oct 2023 11:22:03 -0700 In-Reply-To: <20231027182217.3615211-1-seanjc@google.com> Mime-Version: 1.0 References: <20231027182217.3615211-1-seanjc@google.com> X-Mailer: git-send-email 2.42.0.820.g83a721a137-goog Message-ID: <20231027182217.3615211-22-seanjc@google.com> Subject: [PATCH v13 21/35] KVM: Drop superfluous __KVM_VCPU_MULTIPLE_ADDRESS_SPACE macro From: Sean Christopherson To: Paolo Bonzini , Marc Zyngier , Oliver Upton , Huacai Chen , Michael Ellerman , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Sean Christopherson , Alexander Viro , Christian Brauner , "Matthew Wilcox (Oracle)" , Andrew Morton Cc: kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Xiaoyao Li , Xu Yilun , Chao Peng , Fuad Tabba , Jarkko Sakkinen , Anish Moorthy , David Matlack , Yu Zhang , Isaku Yamahata , " =?utf-8?q?Micka=C3=ABl_Sala?= =?utf-8?q?=C3=BCn?= " , Vlastimil Babka , Vishal Annapurve , Ackerley Tng , Maciej Szmigiero , David Hildenbrand , Quentin Perret , Michael Roth , Wang , Liam Merwick , Isaku Yamahata , "Kirill A . Shutemov" X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 74DA6C0016 X-Stat-Signature: mjfckgynftoh6qbdfkqr6zg7seoid8mj X-Rspam-User: X-HE-Tag: 1698430988-502375 X-HE-Meta: U2FsdGVkX1/BHCsxpspBkFlY8c0yfzXHDG9y9Q6iJfmBhF9GXDIgiShjUCre27arOSoCNgqVzvhm0jGNFugcKZT1aKkESWqS2XTUeqq2Zkl30E6gE7HQZCBQsgR7Ance7h3aG7a3qu1y5PpDTZ4Ourm4GMnCnO29C5DgnxtOFfiwRRa/36u5Ns+J9VoihHpuwoAC/d8J0abdIrwEb3XsSwzbZHkSgC9tedXQt49Ljfmkv0R0Gqp3ZI2QNgfCCSiheBurVi0sqsiNMKmaZvTUcr0Fr3i83J/GdYy4RQNYmhggPaVhUkRFNfv/MUQF+RuZr0LPh5DEoQQMdFofpo2Bl4wAyNlwzJHac4lZ3+lHC68VebMUAfVL0IqDO0zVnV4q1be22u+s40ZFKtCu8oAQ/jTabM/373VcBbnfgYh3BfuoHfm8bpVyGIUjzRyn1CuEkgHMdr8IUG9cD66PijN8+GNLZLePwILaGRp+rJUeSDxMjTKEf8jeGpEsA6o5osVp2fbSzUhuIk0YTzviOi9VzUR9w8YfQs+6JJC38hkvnKKflNV1t+bKGSNclrIxDt/o6Q6KFINDlWw43iyteinqDM1RCGjNmURwmi+l3N7JF/Je5YcGD2Rl6fCQu/ibjxrqznQrOIqCmkZSjmc9I1gAjze1tWbP6oun7kZhD5/w7hCQ7YY293txT++P4WAC7BgFPuCxHHpn+c7MYT4oxFq6pzmKJyd+MzIAmH8nOJqaaZUR7odCgMDFrFgN0kwwtNBASC849F0nhDucSlJpjK+NvvRC/bn9TlOCFD/7tloGa9iWwRybGj7aHvCFVrxQPn/ZzgYHjkw5XASfQ31MhqiyRHXOgUpTja7S0nGfXFPAkzKT0j3IJkU6VcpHVWzSc0ujW3D1AS6dqGRS19VP5Zys3trrmyHBy+m83V0AX6I3SRJmQvHU5XlbWLdhhITL2jozR9IS+3vGhAHYZVEudZi z5QUBmbk BPgl9ZxmbUBqVFY441ZuDIn68q9nPXQDKT6ur4Qoh0OE+ZKPpeG8nSGjqJxge82Zj9Vgp1lyu8HYT4OUR2cG4AQCniF9566dc2DFjS9MJXfiBN/eeqNuPW34aoxlzw6BXVuN1qKgfq2irGITwnCN+ytBw9QYixxF7KbFTcawMTj0lJ1s5HFGE9j4/uu4kjSUS6vYs4LWIO2oRLgyvpabp3IwC1FU21LqdGejTLIssPdqjipXmADX593s63VcZI/QVZnfOr1STxEKko1soiGGHsXuU6bxytPhPdjRaVR3A9XjNQFB4IsvyFvnxFVIgi5Sn64xL5b4KNXMZqldzN9ygS9lqzBXIXueVOORuFcnNtLwlUJfdF2NadM2QxZ6p6d4aeCgrHMEv8XagKFKEaU+n+tvN47ogLe+3/thXhgxOFrWAwjU5Bg1sWzGr4r0bN8S04MKuUGnIQCnPzFrrL0ldRFjfjmKc2N2Bk+ZnkJqZaiUxFfasSDneQPC9yt6n/oF79vAyjx9FNIXoyQr7CXoFK80/EKkgD4v2mvbxep1MV6FefPG7zsYLsikW5tTZ1LnqBzwv3EE9HTLkyFzIJMmDQ1HbLjWcc119P21B43RHHDaV/kLd26evsbTJY1oJUkaMmFQJ5jJyirWSv4BqMS8bCBGf+gRZFrdKF7JukbwgXbom5vf9AJglqDWq9PNllFLmMLET7xNixiRIhBrURd+GabjxKq0I1i1ZCH1oT5nqo5yrse+XnNGkC9FzykaKxoTWcnUhkS0klL8TJpyv+86JsvmBwVfndVKZY9MlTP6ZKtTiYCR2ezSvdkJWW6b/1I/fSg9JR5CCYVeMJLQ= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Drop __KVM_VCPU_MULTIPLE_ADDRESS_SPACE and instead check the value of KVM_ADDRESS_SPACE_NUM. No functional change intended. Reviewed-by: Paolo Bonzini Signed-off-by: Sean Christopherson Reviewed-by: Fuad Tabba Tested-by: Fuad Tabba --- arch/x86/include/asm/kvm_host.h | 1 - include/linux/kvm_host.h | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index 8d60e4745e8b..6702f795c862 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h @@ -2124,7 +2124,6 @@ enum { #define HF_SMM_MASK (1 << 1) #define HF_SMM_INSIDE_NMI_MASK (1 << 2) -# define __KVM_VCPU_MULTIPLE_ADDRESS_SPACE # define KVM_ADDRESS_SPACE_NUM 2 # define kvm_arch_vcpu_memslots_id(vcpu) ((vcpu)->arch.hflags & HF_SMM_MASK ? 1 : 0) # define kvm_memslots_for_spte_role(kvm, role) __kvm_memslots(kvm, (role).smm) diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index e3223cafd7db..c3cfe08b1300 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -692,7 +692,7 @@ bool kvm_arch_irqchip_in_kernel(struct kvm *kvm); #define KVM_MEM_SLOTS_NUM SHRT_MAX #define KVM_USER_MEM_SLOTS (KVM_MEM_SLOTS_NUM - KVM_INTERNAL_MEM_SLOTS) -#ifndef __KVM_VCPU_MULTIPLE_ADDRESS_SPACE +#if KVM_ADDRESS_SPACE_NUM == 1 static inline int kvm_arch_vcpu_memslots_id(struct kvm_vcpu *vcpu) { return 0;