Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp1658935ybf; Sun, 1 Mar 2020 15:05:28 -0800 (PST) X-Google-Smtp-Source: APXvYqwJyAHWxWbOgmHB0OiwcnyLs1ZCM50kVMFqmfFFmPTFtItwYtd4MEWuPIMDaDO5VjFI6rfe X-Received: by 2002:a9d:a16:: with SMTP id 22mr9702133otg.31.1583103928167; Sun, 01 Mar 2020 15:05:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583103928; cv=none; d=google.com; s=arc-20160816; b=fOSbeh93EFdjJ2ofvKDwVVhuaa1ByAEIhOmZNCNDrc5cLmsk3nayAALGpA5EY3IkM9 1sMNIIRCK6jiGCZ4ox+Ws+O6T5GLgZFnB7OYHW1ai9JN8yMnkDhZXNwfmT5lZnzoBRry KmlkjxeyKpSGTFb00/YbnL3uEN5GqNzmfA3uY+/tqOUllby2T/v+tGExKrDyBHBAYd8m A5hHFQl7ogwv5Khlhoqg3QkHFvL8i8u1ZQ961hQFAry28QoLICqF0s7aRTeRFdATLviw a6shweTBTN1r9Omuz5BMJKih/vUfSwo9y5X8whwPsCGilsIZTUxD8slUPFaj9zKdwN9s KWVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=IZ0AjbtgZYbQmgeycgx4fTf3TsbCTcfSdl6G4jmsqCg=; b=BPV5WYwwuGgc1y+GP2z/SoNhTC08EGznxddU3gDtJ0AaR529E4U50BRb1BtOtofx1E b2ljyiacvn0WMf8YTkih2mcKJ4k0UQNQwhZCeLs06rogtyTDds1SHRNUEzfeu73gSsiI UJjKTx77G0SLzwwSmwAhuMNKNyCyL50RFKSxNDvE3XH8rh18CVLtBk/wkUa9p2ZtBwEA Y6ejqP53wnY7C+rRciwiuHl/sXAwtjzutYmgsXMZvqyY62kvh1k3SqQjiXMAuxNmKEVg cRBsBiRxZMhhKbofC/kNNPXxNBEecPjEpIVUUa9H3Shwps7f7EVSbg+Ku0KrKwZkWEjJ yWtg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v2si4978273oix.176.2020.03.01.15.05.09; Sun, 01 Mar 2020 15:05:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726905AbgCAXEx (ORCPT + 99 others); Sun, 1 Mar 2020 18:04:53 -0500 Received: from mail-qk1-f175.google.com ([209.85.222.175]:44795 "EHLO mail-qk1-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726700AbgCAXEk (ORCPT ); Sun, 1 Mar 2020 18:04:40 -0500 Received: by mail-qk1-f175.google.com with SMTP id f198so707490qke.11; Sun, 01 Mar 2020 15:04:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IZ0AjbtgZYbQmgeycgx4fTf3TsbCTcfSdl6G4jmsqCg=; b=B5WwEWH9pXCrhOj4AH2H8P6LUKUBP8cC69hez9R9FvKpowmP2REUd8S8RnWoQLK9lf MNQuKxUhi5VBvFGNHFu/jWo8EAyVetr8fs/hbzaGacabLsoCdoXhzaugJLhKB4kNEyE2 vXAhxm49Qjj0/ky1d2TaZEK6b3YeoqzFYRCdiWUGOLFcxi9TS8Jx/5bpSmtMNXcofIhr fbN0j0HFTzQIKJJjrOw1mwyAO5bWxGbIEedgqa6QIhmWRJhv6fo1wgYwshfT1irpfrIw BVaBQjxvf+Xgr8iq5zgTRdxBDiYNOZ4AuMNcd+xmmXqxg5ziPjnrUoCLEpYi9xKlJRnC r9YA== X-Gm-Message-State: APjAAAXeaWIH5x0vngmNBfc3sKdeMwXxZA0L6kvYly0Y3nxpByvJ1GHE +j98nDdwmNTxwP3MJ5En/fnzsP3PljE= X-Received: by 2002:a37:5285:: with SMTP id g127mr13356577qkb.315.1583103879165; Sun, 01 Mar 2020 15:04:39 -0800 (PST) Received: from rani.riverdale.lan ([2001:470:1f07:5f3::b55f]) by smtp.gmail.com with ESMTPSA id n138sm9065082qkn.33.2020.03.01.15.04.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Mar 2020 15:04:38 -0800 (PST) From: Arvind Sankar To: Ard Biesheuvel Cc: linux-efi@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/5] efi/x86: Respect 32-bit ABI in efi32_pe_entry Date: Sun, 1 Mar 2020 18:04:33 -0500 Message-Id: <20200301230436.2246909-3-nivedita@alum.mit.edu> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200301230436.2246909-1-nivedita@alum.mit.edu> References: <20200301230436.2246909-1-nivedita@alum.mit.edu> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org verify_cpu clobbers BX and DI. In case we have to return error, we need to preserve them to respect 32-bit calling convention. Signed-off-by: Arvind Sankar --- arch/x86/boot/compressed/head_64.S | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S index 8105e8348607..920daf62dac2 100644 --- a/arch/x86/boot/compressed/head_64.S +++ b/arch/x86/boot/compressed/head_64.S @@ -660,7 +660,11 @@ SYM_DATA(efi_is64, .byte 1) SYM_FUNC_START(efi32_pe_entry) pushl %ebp + pushl %ebx + pushl %edi call verify_cpu // check for long mode support + popl %edi + popl %ebx testl %eax, %eax movl $0x80000003, %eax // EFI_UNSUPPORTED jnz 3f -- 2.24.1