Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 5 product line. The current stable release is 5.10. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 678571

Summary: hap_gva_to_gfn_* do not preserve domain context
Product: Red Hat Enterprise Linux 5 Reporter: Radim Krčmář <rkrcmar>
Component: kernel-xenAssignee: Radim Krčmář <rkrcmar>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: low Docs Contact:
Priority: low    
Version: 5.6CC: drjones, jzheng, phan, qcai, xen-maint, yuzhang
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-07-21 09:48:21 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 678618    
Attachments:
Description Flags
backport of gdbsx, suffering from this bug
none
fix, using different function to get mfn from gfn
none
fix, using different function to get mfn from gfn none

Description Radim Krčmář 2011-02-18 13:29:51 UTC
Created attachment 479501 [details]
backport of gdbsx, suffering from this bug

Description of problem:
hap_gva_to_gfn_* functions do not preserve domain context when requesting mfn from gfn, returning the current domain's mfn regardless of wanted domain.

Ecountered while backporting gdbsx, where dom0 was current domain, yet information about paused guest was wanted.

How reproducible:
Always.

Steps to reproduce:
1. Backport gdbsx (patch attached)
2. Run the modified hypervisor with enabled hap. (hardware support required)
3. Start debugging a hvm machine (howto in tools/gdbsx/README)
4. See it fail on a breakpoint.
  
Actual results:
(gdbsx output)
ERROR:xg_write_mem:ERROR: failed to write 0 bytes. errno:14 rc:-1

Expected results:
(No error and the breakpoint works)

Comment 1 Radim Krčmář 2011-02-18 13:39:39 UTC
Created attachment 479503 [details]
fix, using different function to get mfn from gfn

get_mfn_from_gpfn(gfn) calls gfn_to_mfn_current(pfn),
proposed patch uses gfn_to_mfn(domain, gfn) instead, which calls either gfn_to_mfn_current(pfn), or gfn_to_mfn_foreign(domain, gfn), depending on context, thus fixing the bug with little overhead.

Comment 2 Radim Krčmář 2011-02-18 15:18:53 UTC
Created attachment 479539 [details]
fix, using different function to get mfn from gfn

The last patch was not using mfn_x, hence failing typecheck.
Replaced gfn_to_mfn by gmfn_to_mfn. (macro for mfn_x(gfn_to_mfn))

Comment 3 RHEL Program Management 2011-02-25 15:39:55 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 9 Jarod Wilson 2011-03-16 18:02:27 UTC
Patch(es) available in kernel-2.6.18-248.el5
Detailed testing feedback is always welcomed.

Comment 11 Jinxin Zheng 2011-04-28 10:09:25 UTC
We checked the -257 code, confirming that the patches are inside.
Due to comment 5, debug tools won't be packaged with any release, thus this shouldn't need any specific testing. Setting this 'Verified:SanityOnly'.

Comment 12 errata-xmlrpc 2011-07-21 09:48:21 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2011-1065.html