Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp1655624rdb; Wed, 20 Sep 2023 16:01:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEhsKLiYPgv9M391q4s4czJI+M6GEr9hkHXr/Q+ENVsdc0xQcKmTTSW5c73ukWzbJill84G X-Received: by 2002:a17:902:e88e:b0:1c5:d063:b70e with SMTP id w14-20020a170902e88e00b001c5d063b70emr590319plg.53.1695250880132; Wed, 20 Sep 2023 16:01:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695250880; cv=none; d=google.com; s=arc-20160816; b=HiGeHW/YDlS4tJ3QBStdeneAVNGquY7azWlkgqeVgX/FZSlshbTEpTA5WVug+8nw6S qpq3VciUq0VEaObpTyeBc0FMH2PXSxFU6WDbm4fkgaxmCUmwAHakTE9x0I+Pn8BDDgqk G2R3Qm/r7yspL9GDqwOtCWy9471IfwrlIlj+QLIOjxpr7rsQNqctyn2tqL7nAMFlF7bZ vqSM5CjNstEEmPBOQ/hF1jeuV8xqbov3aQnFhN/6I6IO4uP8VMtPAgbX7aPjP2Ff/TpD xxHdCdML7Xx1T/uDE8zSPWjm0BC8C4MaalS/mbrq96XIQhNfgtm5yRUe2V6j6JBWztaS HLig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=h5xYFinNZipHsHGmHUqZFR1epFlz8wPv/8ryGu1Ybe8=; fh=E9hTE6OAcCscVUxqzvM4R3IVrsSe3HooEIYtjbefn7I=; b=a/vNsxZiQIaDsF+0jyfZudjvoyeQberm2xJC77NHo/edBlMu2qVijAmRdQyX/xpvS0 gXEFRhdCiJI8k+mp/SmWvnIBdChEi6MPrHdxUAIUGK2AJ2Z5slH2fYYZVe0R5Qm3B6+2 iq93yR+ySCHwYl+RiOrUO9wPLMi4KyXmqRbOwRggF5tjngfAfOdz5mCRYIiLoYJQBgeu hnnmgTKKeKGd7MncofjRp0i4cij6ITtWPGWr3BFCas3fNULn+tSre7goIV2GnPK/LEKC 3F6VzCcueOubBijlmqmqPZC1t/h+vz0U2Nk7R4FEtl7N4vUfRfZoXGEea6c5SLxkA3J+ gsmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="TkI/3/86"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id o7-20020a170902d4c700b001c3411c9b83si79419plg.454.2023.09.20.16.01.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 16:01:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="TkI/3/86"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 8D5B8836D93B; Wed, 20 Sep 2023 10:55:52 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229579AbjITRzw (ORCPT + 99 others); Wed, 20 Sep 2023 13:55:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229520AbjITRzv (ORCPT ); Wed, 20 Sep 2023 13:55:51 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94490DC for ; Wed, 20 Sep 2023 10:55:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695232500; 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=h5xYFinNZipHsHGmHUqZFR1epFlz8wPv/8ryGu1Ybe8=; b=TkI/3/86NJCEXVvamz1vLwb8rTym/0BNZ4FtOe9aeTUstWOXdALWFchDfJ4H0VakgC8CHk oRB3T1dU0cI5LUDBn31m85q5GOsbSjDqo4f6HAjVHjuRTRkxxD+e2lexI3qCEPrha/o0V8 ncb2RnUPI7mtI6QhPNj2oG2CetFwBjQ= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-94-u-cN4DzaM1SPE-Bgrqn_Sw-1; Wed, 20 Sep 2023 13:54:59 -0400 X-MC-Unique: u-cN4DzaM1SPE-Bgrqn_Sw-1 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-40525249280so642295e9.1 for ; Wed, 20 Sep 2023 10:54:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695232498; x=1695837298; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=h5xYFinNZipHsHGmHUqZFR1epFlz8wPv/8ryGu1Ybe8=; b=Z6A+C+/riHR6FS2s5/mo1tYD2iY1kuLGZ9aGF6hRfEZtItoClRWoMznjDVcLPbwmxE wPog5tpkFyHrAGziftwneI8Qyp/wvR/k1mND9GTrzrzBnEUaorwSUgAGdkCsisfUfVJg wpGnZihSIabJUmbibK2Yapc2dw3MInEIDMcwmS42Aqzwf6HQgz8bzEO7hzRkEMLoAtdk 8Ew6NZm4uyxfb2wnVZ+sdySzbDRE8SxWpgH1Tb7EHkUBh7deZbTznP5qk4nqkZ5lh5BQ 0H+LDZSU4SC7Mnk9KUa85j4VGkWgAEe8YDytZAV07euuR0/ecPR4pJZiBo29OTskGC+k aqEQ== X-Gm-Message-State: AOJu0YxcmMXVLRx8wPKCvtaqJ34oqqTzqNIDMOD3wg/Heo2I/AA/oRje jkvVeZSoY8mK9ue0PPXJ8mJsnp2xvbRoPU1N9IOdkbVU/s8n0yKuOVyFrYJ81bfjyUn1+3jeOne z6/ZXXyFg52Znih2Yet4oRP+w X-Received: by 2002:a7b:ce88:0:b0:400:57d1:4910 with SMTP id q8-20020a7bce88000000b0040057d14910mr3302437wmj.17.1695232497848; Wed, 20 Sep 2023 10:54:57 -0700 (PDT) X-Received: by 2002:a7b:ce88:0:b0:400:57d1:4910 with SMTP id q8-20020a7bce88000000b0040057d14910mr3302418wmj.17.1695232497523; Wed, 20 Sep 2023 10:54:57 -0700 (PDT) Received: from ?IPV6:2001:b07:6468:f312:9af8:e5f5:7516:fa89? ([2001:b07:6468:f312:9af8:e5f5:7516:fa89]) by smtp.googlemail.com with ESMTPSA id g7-20020a05600c310700b003fe15ac0934sm1501378wmo.1.2023.09.20.10.54.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 20 Sep 2023 10:54:54 -0700 (PDT) Message-ID: Date: Wed, 20 Sep 2023 19:54:48 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v10 33/38] x86/entry: Add fred_entry_from_kvm() for VMX to handle IRQ/NMI To: Xin Li , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-edac@vger.kernel.org, linux-hyperv@vger.kernel.org, kvm@vger.kernel.org, xen-devel@lists.xenproject.org Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, luto@kernel.org, seanjc@google.com, peterz@infradead.org, jgross@suse.com, ravi.v.shankar@intel.com, mhiramat@kernel.org, andrew.cooper3@citrix.com, jiangshanlai@gmail.com References: <20230914044805.301390-1-xin3.li@intel.com> <20230914044805.301390-34-xin3.li@intel.com> Content-Language: en-US From: Paolo Bonzini In-Reply-To: <20230914044805.301390-34-xin3.li@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Wed, 20 Sep 2023 10:55:52 -0700 (PDT) On 9/14/23 06:48, Xin Li wrote: > + /* > + * Don't check the FRED stack level, the call stack leading to this > + * helper is effectively constant and shallow (relatively speaking). It's more that we don't need to protect from reentrancy. The external interrupt uses stack level 0 so no adjustment would be needed anyway, and NMI does not use an IST even in the non-FRED case. > + * Emulate the FRED-defined redzone and stack alignment. > + */ > + sub $(FRED_CONFIG_REDZONE_AMOUNT << 6), %rsp > + and $FRED_STACK_FRAME_RSP_MASK, %rsp