From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S939127AbZDJRUt (ORCPT ); Fri, 10 Apr 2009 13:20:49 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S938944AbZDJRUJ (ORCPT ); Fri, 10 Apr 2009 13:20:09 -0400 Received: from terminus.zytor.com ([198.137.202.10]:53229 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1765248AbZDJRUH (ORCPT ); Fri, 10 Apr 2009 13:20:07 -0400 Message-ID: <49DF7FA4.9070909@zytor.com> Date: Fri, 10 Apr 2009 10:19:32 -0700 From: "H. Peter Anvin" User-Agent: Thunderbird 2.0.0.19 (X11/20090105) MIME-Version: 1.0 To: Pavel Machek CC: mingo@redhat.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, hpa@linux.intel.com, rjw@sisk.pl, linux-tip-commits@vger.kernel.org Subject: Re: [tip:x86/setup] x86, setup: "glove box" BIOS calls -- infrastructure References: <49DE7F79.4030106@zytor.com> <20090410080444.GC16512@elf.ucw.cz> In-Reply-To: <20090410080444.GC16512@elf.ucw.cz> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Pavel Machek wrote: > >> + .code16 >> + .text >> + .globl intcall >> + .type intcall, @function >> +intcall: >> + /* Self-modify the INT instruction. Ugly, but works. */ >> + cmpb %al, 3f >> + je 1f >> + movb %al, 3f >> + jmp 1f /* Synchronize pipeline */ >> +1: > > There are various CPU bugs with self-modifying code, but I guess we > are not using it heavily enough. Also we are single-threaded so that > should be ok. > Pavel > This case is extremely straightforward, so I'm not worried about it. The final JMP is actually not required (there is a LOOP instruction between the modify and the invocation point) but is there for extra safety. FWIW, we already do SMC during the transfer to protected mode (pmjump.S), and hopefully got the issues worked out there. -hpa