Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5973898pxj; Wed, 23 Jun 2021 13:16:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw8E1B/soUB9Bf/Yy9+BAAzTgilv2bj7CTWvkQXAKeuvdiNAZ2rVyD9WeyCE3f9ZEhgLLwN X-Received: by 2002:a05:6e02:20c3:: with SMTP id 3mr826802ilq.131.1624479404427; Wed, 23 Jun 2021 13:16:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624479404; cv=none; d=google.com; s=arc-20160816; b=wcHxIePtBAnXg7MxQuyx3WirbHxLB42mcpBm07ZKeemPdkfUMrb+yGbeBtALjW5xsD V/Jxls+IrrmaPmxq7CmeNVz8H2FIe1+d9rXoGBs6WeFBa4l1ZX2L8a7yH+fpOildkpiD 36ubAvhRUl2EG1MXLXnEYTbj7LzwYtEMa8qml+YLEEJnMMZ5nvIpUE9p2znm5XyKIAt+ CkVz3036GRKks2ZN/By++SOvA57o01XrKPrMtkoU3jCTp+3di+P/7vxl69WFB+qjCVd7 Z748fpyAZHHWIKfmkU1qjgE7u1VGZXR50Y/gxzB1THzd7m5oo85Zi/kMqLMYfGa9SAjc C/0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=zPS5S0IvDFy+C72CmNQKNdIO8Yy6w5eRS/q/XzOp9LU=; b=aDvMV6ZhRwheXeCU7x4RLfapOSIufF183r86Ps4xxSt7RynxSR9jSDmZnhgn0mJ/RG qKIH//c1PUT43OdHAum2ldmrRjS86ObJWHdhRLJXbxMOXrGgs6zmJ0jm2o6kvMltl6R4 dAm7NHrg6IGpIVwD3lb6hD0s1Bt/tW5lvul9A/hAWwut3Li2VXiTgoEmWk0qaZPUP0wS Vb3KHzLvc8YzIu2AjZJ+kQb5Vv2gfnOgSUDi0G28jyyDOweH3ZnOpcarYyjgzMPbJItr DSnABspHlyBEF4rTx8v4woWpXrxY0edxIOsvkOHdK9czbT19fEJ/XoG+EV5hsNkLZiwj xhxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Zo/nNL+A"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y7si1002382jae.125.2021.06.23.13.16.32; Wed, 23 Jun 2021 13:16:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@redhat.com header.s=mimecast20190719 header.b="Zo/nNL+A"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229916AbhFWUPm (ORCPT + 99 others); Wed, 23 Jun 2021 16:15:42 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:47551 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229726AbhFWUPl (ORCPT ); Wed, 23 Jun 2021 16:15:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1624479203; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zPS5S0IvDFy+C72CmNQKNdIO8Yy6w5eRS/q/XzOp9LU=; b=Zo/nNL+Al2J0ISx9ovIsyHBntXQiDxElRBbckF8fqrdSsEcNb1kQ3KHJS8u498nKlQQR/g ZhynuQMLa0Vycs1B1xKXsrwZ/W5o3dEY5QS8VnLeJAiNuXsbNtjTDtGd0ABVH+inhvstOd wi7mfjdEBjTLUAl9ivV3EitJQnufkq8= Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-591-URIfD-OGOZa2gyPlsiNaKQ-1; Wed, 23 Jun 2021 16:13:21 -0400 X-MC-Unique: URIfD-OGOZa2gyPlsiNaKQ-1 Received: by mail-ej1-f71.google.com with SMTP id lu1-20020a170906fac1b02904aa7372ec41so1242042ejb.23 for ; Wed, 23 Jun 2021 13:13:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=zPS5S0IvDFy+C72CmNQKNdIO8Yy6w5eRS/q/XzOp9LU=; b=OkjNRAEO1BntMf0HwhwYeeoZTF21DGr2IhU6ok/kXq10pyw6BUMgkw7c7v4OM+A60I U5uZHCVGDdFVVtwuU0vL76qOw+2Hk67tjThFWBeWk198y6HELxLUL+GJftVewUg51yan lwxeks205NWWkN+/Wj4PApsfHY3J5KrNgsbfOIPsppmYhC7gwMqe/cHrIT+itvf/ie9h QEwIYT9xqrOMwLVrbT3zxa8ROX02QIrx4lUHFhyiA83GREeuuGKEw3OisR2LzVmQYM6V exfDrtdL+o1Z4B7aRM1wxCS7E2uJITukE5LGyWStpgGcnM0NNngja/g4ZU1LMngzpVE9 MmWg== X-Gm-Message-State: AOAM530MeDS4RpBpChB+K9uDak8NImfP1/fuywqmqu8QZUD/XpyfpZYF vmqBMCPc1Uju+8eXbeHzSB6rbVu0oRQusIq4HRIhm3rY1T8Y8I7G4lGlLl3b3WwsXcn55D5Ey3x 0BrOGmQyYbVWvBlk6dAqbjBGd X-Received: by 2002:a17:907:6e9:: with SMTP id yh9mr1853172ejb.86.1624479200510; Wed, 23 Jun 2021 13:13:20 -0700 (PDT) X-Received: by 2002:a17:907:6e9:: with SMTP id yh9mr1853165ejb.86.1624479200333; Wed, 23 Jun 2021 13:13:20 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:c8dd:75d4:99ab:290a? ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id bx11sm292565ejc.122.2021.06.23.13.13.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 23 Jun 2021 13:13:19 -0700 (PDT) Subject: Re: [PATCH 47/54] KVM: x86/mmu: Add helpers to do full reserved SPTE checks w/ generic MMU To: Sean Christopherson Cc: Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Yu Zhang , Maxim Levitsky References: <20210622175739.3610207-1-seanjc@google.com> <20210622175739.3610207-48-seanjc@google.com> From: Paolo Bonzini Message-ID: Date: Wed, 23 Jun 2021 22:13:18 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20210622175739.3610207-48-seanjc@google.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 22/06/21 19:57, Sean Christopherson wrote: > + /* > + * Use a bitwise-OR instead of a logical-OR to aggregate the reserved > + * bits and EPT's invalid memtype/XWR checks to avoid an extra Jcc > + * (this is used in hot paths). Probably s/this is used in hot paths/this is extremely unlikely to be short-circuited as true/, since we are at it. Paolo > + */ > + return __is_bad_mt_xwr(rsvd_check, spte) | > + __is_rsvd_bits_set(rsvd_check, spte, level);