From: Keir Fraser <keir@xen.org>
To: Jan Beulich <JBeulich@suse.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH] x86: retrieve keyboard shift status flags from BIOS
Date: Tue, 11 Sep 2012 14:33:38 +0100 [thread overview]
Message-ID: <CC74FC42.4B715%keir@xen.org> (raw)
In-Reply-To: <504F3F8A020000780009A8F9@nat28.tlf.novell.com>
On 11/09/2012 12:41, "Jan Beulich" <JBeulich@suse.com> wrote:
> Recent Linux tries to make use of this, and has no way of getting at
> these bits without Xen assisting it.
>
> There doesn't appear to be a way to obtain the same information from
> UEFI.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
> --- a/xen/arch/x86/boot/trampoline.S
> +++ b/xen/arch/x86/boot/trampoline.S
> @@ -184,11 +184,16 @@ trampoline_boot_cpu_entry:
> * 1. Get memory map.
> * 2. Get Enhanced Disk Drive (EDD) information.
> * 3. Set video mode.
> + * 4. Get keyboard shift flags.
> */
> call get_memory_map
> call get_edd
> call video
>
> + mov $0x0200,%ax
> + int $0x16
> + mov %al,bootsym(kbd_shift_flags)
> +
> /* Disable irqs before returning to protected mode. */
> cli
>
> @@ -221,6 +226,10 @@ trampoline_boot_cpu_entry:
> skip_realmode:
> .byte 0
>
> + .globl kbd_shift_flags
> +kbd_shift_flags:
> + .byte 0
> +
> rm_idt: .word 256*4-1, 0, 0
>
> #include "mem.S"
> --- a/xen/arch/x86/platform_hypercall.c
> +++ b/xen/arch/x86/platform_hypercall.c
> @@ -29,6 +29,7 @@
> #include <asm/edd.h>
> #include <asm/mtrr.h>
> #include <asm/io_apic.h>
> +#include <asm/setup.h>
> #include "cpu/mtrr/mtrr.h"
> #include <xsm/xsm.h>
>
> @@ -319,6 +320,18 @@ ret_t do_platform_op(XEN_GUEST_HANDLE(xe
> u.firmware_info.u.efi_info) )
> ret = -EFAULT;
> break;
> + case XEN_FW_KBD_SHIFT_FLAGS:
> + ret = -ESRCH;
> + if ( op->u.firmware_info.index != 0 )
> + break;
> +
> + op->u.firmware_info.u.kbd_shift_flags = bootsym(kbd_shift_flags);
> +
> + ret = 0;
> + if ( copy_field_to_guest(u_xenpf_op, op,
> + u.firmware_info.u.kbd_shift_flags) )
> + ret = -EFAULT;
> + break;
> default:
> ret = -EINVAL;
> break;
> --- a/xen/include/asm-x86/setup.h
> +++ b/xen/include/asm-x86/setup.h
> @@ -41,4 +41,6 @@ int xen_in_range(unsigned long mfn);
> void microcode_grab_module(
> unsigned long *, const multiboot_info_t *, void *(*)(const module_t *));
>
> +extern uint8_t kbd_shift_flags;
> +
> #endif
> --- a/xen/include/public/platform.h
> +++ b/xen/include/public/platform.h
> @@ -218,6 +218,7 @@ DEFINE_XEN_GUEST_HANDLE(xenpf_efi_runtim
> #define XEN_FW_EFI_VENDOR 2
> #define XEN_FW_EFI_MEM_INFO 3
> #define XEN_FW_EFI_RT_VERSION 4
> +#define XEN_FW_KBD_SHIFT_FLAGS 5
> struct xenpf_firmware_info {
> /* IN variables. */
> uint32_t type;
> @@ -266,6 +267,9 @@ struct xenpf_firmware_info {
> uint32_t type;
> } mem;
> } efi_info; /* XEN_FW_EFI_INFO */
> +
> + /* Int16, Fn02: Get keyboard shift flags. */
> + uint8_t kbd_shift_flags; /* XEN_FW_KBD_SHIFT_FLAGS */
> } u;
> };
> typedef struct xenpf_firmware_info xenpf_firmware_info_t;
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2012-09-11 13:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-11 11:41 [PATCH] x86: retrieve keyboard shift status flags from BIOS Jan Beulich
2012-09-11 13:33 ` Keir Fraser [this message]
2012-09-21 16:34 ` Konrad Rzeszutek Wilk
2012-09-24 10:48 ` Jan Beulich
2012-09-24 13:25 ` Konrad Rzeszutek Wilk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CC74FC42.4B715%keir@xen.org \
--to=keir@xen.org \
--cc=JBeulich@suse.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).