Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp848551pxb; Wed, 29 Sep 2021 10:56:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw92fvRKOuqPEQwt8Hr+0YHBWy3QjdAovNQzA8EY8ZrG66c/8mB8j3MAd2cURjXzn1zAAfF X-Received: by 2002:aa7:c401:: with SMTP id j1mr1476226edq.354.1632938176420; Wed, 29 Sep 2021 10:56:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632938176; cv=none; d=google.com; s=arc-20160816; b=oGbkmQBjXNE0nPet0bYX+gYGzmdWnrOm9sxRLx8P3IVnnOS5+XyWBuT2wuqVg19OQY HWFOikfP/O+Qj+jd1isSXrhIS+9GHOZBKsKDkmZb+sSBmOWvr5a4HtgXXbx8/FMLiOkb YcUuWbut3h7YYBIrYjYGnmw/sXQCO4pMMKoSiLI2sudE4ulDPIatSksGfqBakqz3BT45 zA2QhHlG24R2tBrzY6FWwViPSFzPtsKd2AcEhYPD7O5U5KYJ/zwvWTEe0uF/JHSR9T6w /JMk+v+SOaQOxa284vEBjCvL9JYqOBQP//4CdQrFlL2natSxOuYLt1LYmhMy1ArdL+bk E8FQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=y/YSVKPz9O6La4nqgfOZhSPntZc7BllBHBJbPD+DgVw=; b=LPK3e4cQ8qfp/NERDcx0RqkHch/0tz7uwqVrj7qgWeEAy/3GM2h/1OX7/2F49BtVp0 +BBFf+kn2CDlqMtq9m1067aUHv5HXforM+9l+DU/4ykYCf1zp2TQ0/Wz6c/KeB72L0mL Jm+BY3FhwA4+5q/tL486me6CuxskSXYRbTMc23CCO3sCEqLhwWY89LHmPn98snwR0Eb5 tjOVD3B0DXkwRTR/MEF7i6WHh2ldpW8G67cEHTpxY5vPcyrqAENVxzee29ag6K5xoREQ 8/B4/Gv9Hs+xFn6iavip8g94bf5Eo97IDuEmRyiXOJMcLzXGAw3gpVj2T5sFffyu5lUT VexA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=LxeHHdcN; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a26si611708ejv.66.2021.09.29.10.55.43; Wed, 29 Sep 2021 10:56:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=LxeHHdcN; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344630AbhI2R1I (ORCPT + 99 others); Wed, 29 Sep 2021 13:27:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244721AbhI2R1G (ORCPT ); Wed, 29 Sep 2021 13:27:06 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8AC1C061760; Wed, 29 Sep 2021 10:25:25 -0700 (PDT) Received: from zn.tnic (p200300ec2f0bd10085b5178de8b08a0e.dip0.t-ipconnect.de [IPv6:2003:ec:2f0b:d100:85b5:178d:e8b0:8a0e]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id EFE231EC085D; Wed, 29 Sep 2021 19:25:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1632936324; h=from:from: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; bh=y/YSVKPz9O6La4nqgfOZhSPntZc7BllBHBJbPD+DgVw=; b=LxeHHdcNffy35LFdD96qNzM49vE6teo3umfP4ix8VPJapVr0lpiTVaY+CxmAC3nk8Gj3Tc MKiExWcSc3wL9YjiOMT3ty//UnaFWs/4uNI5zspIUZjUhkmh1xtLs7uDygniu+JpaWPoTs XNxJ/6bbGghvOxtnHXpgwgRFPZRAnek= Date: Wed, 29 Sep 2021 19:25:13 +0200 From: Borislav Petkov To: Brijesh Singh Cc: x86@kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-coco@lists.linux.dev, linux-mm@kvack.org, linux-crypto@vger.kernel.org, Thomas Gleixner , Ingo Molnar , Joerg Roedel , Tom Lendacky , "H. Peter Anvin" , Ard Biesheuvel , Paolo Bonzini , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Andy Lutomirski , Dave Hansen , Sergio Lopez , Peter Gonda , Peter Zijlstra , Srinivas Pandruvada , David Rientjes , Dov Murik , Tobin Feldman-Fitzthum , Michael Roth , Vlastimil Babka , "Kirill A . Shutemov" , Andi Kleen , tony.luck@intel.com, marcorr@google.com, sathyanarayanan.kuppuswamy@linux.intel.com Subject: Re: [PATCH Part2 v5 07/45] x86/traps: Define RMP violation #PF error code Message-ID: References: <20210820155918.7518-1-brijesh.singh@amd.com> <20210820155918.7518-8-brijesh.singh@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210820155918.7518-8-brijesh.singh@amd.com> Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Fri, Aug 20, 2021 at 10:58:40AM -0500, Brijesh Singh wrote: > enum x86_pf_error_code { > - X86_PF_PROT = 1 << 0, > - X86_PF_WRITE = 1 << 1, > - X86_PF_USER = 1 << 2, > - X86_PF_RSVD = 1 << 3, > - X86_PF_INSTR = 1 << 4, > - X86_PF_PK = 1 << 5, > - X86_PF_SGX = 1 << 15, > + X86_PF_PROT = BIT_ULL(0), > + X86_PF_WRITE = BIT_ULL(1), > + X86_PF_USER = BIT_ULL(2), > + X86_PF_RSVD = BIT_ULL(3), > + X86_PF_INSTR = BIT_ULL(4), > + X86_PF_PK = BIT_ULL(5), > + X86_PF_SGX = BIT_ULL(15), > + X86_PF_RMP = BIT_ULL(31), Those are tested against error_code mostly, which is unsigned long so it looks like you wanna use _BITUL() here. Not that it matters on x86-64 but if we want to be precise... -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette